:root {
  --portal-navy: #08264d;
  --portal-navy-deep: #051a36;
  --portal-blue: #1f5e9f;
  --portal-gold: #f3a900;
  --portal-teal: #1aaa96;
  --portal-ink: #163456;
  --portal-muted: #5d718b;
  --portal-surface: #ffffff;
  --portal-bg: #eef3f9;
  --portal-line: rgba(8, 38, 77, 0.12);
  --portal-shadow: 0 18px 48px rgba(5, 26, 54, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.portal-page {
  margin: 0;
  overflow-x: hidden;
  background: var(--portal-bg);
  color: var(--portal-ink);
  font-family: 'Barlow', Arial, sans-serif;
}

.portal-page img {
  display: block;
  max-width: 100%;
}

.portal-page a {
  color: inherit;
}

.portal-nav {
  position: sticky;
  z-index: 1000;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.7rem clamp(1rem, 4vw, 3.5rem);
  border-bottom: 3px solid var(--portal-gold);
  background: rgba(5, 26, 54, 0.98);
  box-shadow: 0 8px 24px rgba(2, 17, 35, 0.2);
}

.portal-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.portal-brand img {
  width: auto;
  height: 39px;
  border-radius: 2px;
}

.portal-brand-separator {
  width: 1px;
  height: 34px;
  background: rgba(255, 255, 255, 0.28);
}

.portal-nav-title {
  color: rgba(255, 255, 255, 0.78);
  font-family: 'Barlow Condensed', Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.portal-nav .nav-links {
  display: flex;
  margin: 0;
  padding: 0;
  align-items: center;
  gap: 1rem;
  list-style: none;
}

.portal-nav .nav-links a {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.portal-nav .nav-links a:hover,
.portal-nav .nav-links a:focus-visible,
.portal-nav .nav-links a[aria-current='page'] {
  color: var(--portal-gold);
}

.portal-nav .nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.portal-nav .nav-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: #fff;
}

.portal-hero {
  position: relative;
  display: grid;
  min-height: 445px;
  overflow: hidden;
  place-items: center;
  isolation: isolate;
  background-position: center;
  background-size: cover;
}

.portal-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(105deg, rgba(5, 26, 54, 0.94) 0%, rgba(8, 38, 77, 0.75) 52%, rgba(5, 26, 54, 0.48) 100%);
  content: '';
}

.portal-hero::after {
  position: absolute;
  z-index: -1;
  right: -10%;
  bottom: -86px;
  width: 52%;
  height: 150px;
  border-top: 2px solid rgba(243, 169, 0, 0.8);
  background: rgba(8, 38, 77, 0.62);
  content: '';
  transform: skewY(-4deg);
}

.portal-hero-home {
  min-height: 510px;
  background-image: url('../img/tirana_hero.jpg.jpeg');
  background-position: center 38%;
}

.portal-hero-electric {
  background-image: url('../img/Consistorial.jpeg');
  background-position: center 52%;
}

.portal-hero-secretaria {
  background-image: url('../img/results/concejo-prensa.webp');
  background-position: center 42%;
}

.portal-hero-content {
  width: min(1120px, calc(100% - 2rem));
  padding: 4.6rem 0;
  color: #fff;
}

.portal-eyebrow {
  display: flex;
  margin-bottom: 1rem;
  align-items: center;
  gap: 0.75rem;
  color: var(--portal-gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.portal-eyebrow::before {
  width: 30px;
  height: 3px;
  border-radius: 99px;
  background: var(--portal-gold);
  content: '';
}

.portal-hero h1 {
  max-width: 900px;
  margin: 0;
  color: #fff;
  font-family: 'Barlow Condensed', Arial, sans-serif;
  font-size: clamp(2.55rem, 5.3vw, 4.65rem);
  font-weight: 900;
  letter-spacing: 0.015em;
  line-height: 0.95;
  text-transform: uppercase;
  text-wrap: balance;
}

.portal-hero-detail h1 {
  max-width: 780px;
  font-size: clamp(2.4rem, 4.6vw, 4rem);
}

.portal-hero h1 span {
  color: var(--portal-gold);
}

.portal-hero-lead {
  max-width: 730px;
  margin: 1.35rem 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  line-height: 1.7;
}

.portal-hero-actions {
  display: flex;
  margin-top: 1.7rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.portal-button {
  display: inline-flex;
  min-height: 44px;
  padding: 0.75rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.portal-button-primary {
  border-color: var(--portal-gold);
  background: var(--portal-gold);
  color: var(--portal-navy-deep);
}

.portal-button:hover,
.portal-button:focus-visible {
  background: #fff;
  color: var(--portal-navy-deep);
  transform: translateY(-2px);
}

.portal-section {
  padding: clamp(4rem, 8vw, 6.4rem) 1.25rem;
  background: var(--portal-surface);
}

.portal-section-alt {
  background: var(--portal-bg);
}

.portal-container {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.portal-section-heading {
  max-width: 820px;
  margin-bottom: 2.4rem;
}

.portal-section-label {
  display: flex;
  margin-bottom: 0.75rem;
  align-items: center;
  gap: 0.65rem;
  color: var(--portal-gold);
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.portal-section-label::before {
  width: 24px;
  height: 2px;
  background: var(--portal-gold);
  content: '';
}

.portal-section h2 {
  margin: 0;
  color: var(--portal-navy);
  font-family: 'Barlow Condensed', Arial, sans-serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  text-wrap: balance;
}

.portal-section h2 span {
  color: var(--portal-gold);
}

.portal-section-intro {
  max-width: 820px;
  margin: 1rem 0 0;
  color: var(--portal-muted);
  font-size: 1rem;
  line-height: 1.75;
}

.portal-access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
}

.portal-card {
  position: relative;
  display: flex;
  min-height: 450px;
  overflow: hidden;
  border: 1px solid var(--portal-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(5, 26, 54, 0.08);
  flex-direction: column;
  text-decoration: none;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.portal-card:hover,
.portal-card:focus-visible {
  border-color: rgba(243, 169, 0, 0.75);
  box-shadow: var(--portal-shadow);
  transform: translateY(-7px);
}

.portal-card-media {
  position: relative;
  display: flex;
  min-height: 225px;
  padding: 1.45rem;
  align-items: flex-end;
  background-position: center;
  background-size: cover;
  isolation: isolate;
}

.portal-card-media::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 26, 54, 0.18), rgba(5, 26, 54, 0.88));
  content: '';
}

.portal-card-programas .portal-card-media {
  background-image: url('../img/tirana_hero.jpg.jpeg');
  background-position: center 40%;
}

.portal-card-intervenciones .portal-card-media {
  background-image: url('../img/Consistorial.jpeg');
  background-position: center 52%;
}

.portal-card-secretaria .portal-card-media {
  background-image: url('../img/results/concejo-prensa.webp');
  background-position: center 42%;
}

.portal-card-index {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Barlow Condensed', Arial, sans-serif;
  font-size: 1.7rem;
  font-weight: 900;
}

.portal-card-media h3 {
  margin: 0;
  color: #fff;
  font-family: 'Barlow Condensed', Arial, sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.portal-card-body {
  display: flex;
  padding: 1.5rem;
  flex: 1;
  flex-direction: column;
}

.portal-card-body p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.portal-card-link {
  display: flex;
  margin-top: auto;
  padding-top: 1.3rem;
  align-items: center;
  gap: 0.5rem;
  color: var(--portal-navy);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.portal-card-link::after {
  color: var(--portal-gold);
  content: '→';
  font-size: 1rem;
}

.portal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.portal-kpi {
  min-height: 154px;
  padding: 1.4rem;
  border: 1px solid var(--portal-line);
  border-top: 4px solid var(--portal-gold);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(5, 26, 54, 0.07);
}

.portal-kpi-value {
  color: var(--portal-navy);
  font-family: 'Barlow Condensed', Arial, sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 900;
  line-height: 1;
}

.portal-kpi-label {
  margin-top: 0.65rem;
  color: var(--portal-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.portal-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.portal-info-card {
  padding: 1.55rem;
  border: 1px solid var(--portal-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(5, 26, 54, 0.06);
}

.portal-info-card h3 {
  margin: 0 0 0.7rem;
  color: var(--portal-navy);
  font-family: 'Barlow Condensed', Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-info-card p,
.portal-info-card li {
  color: var(--portal-muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.portal-info-card p {
  margin: 0;
}

.portal-info-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.portal-info-card li + li {
  margin-top: 0.45rem;
}

.portal-callout {
  margin-top: 1.5rem;
  padding: 1.65rem 1.8rem;
  border-left: 5px solid var(--portal-gold);
  border-radius: 14px;
  background: var(--portal-navy);
  box-shadow: var(--portal-shadow);
  color: #fff;
}

.portal-callout h3 {
  margin: 0 0 0.55rem;
  color: var(--portal-gold);
  font-family: 'Barlow Condensed', Arial, sans-serif;
  font-size: 1.35rem;
  text-transform: uppercase;
}

.portal-callout p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.7;
}

.portal-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--portal-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(5, 26, 54, 0.08);
}

.portal-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.portal-table th,
.portal-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--portal-line);
  text-align: left;
  vertical-align: top;
}

.portal-table th {
  background: var(--portal-navy);
  color: #fff;
  font-family: 'Barlow Condensed', Arial, sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-table td {
  color: #425a75;
  font-size: 0.9rem;
  line-height: 1.5;
}

.portal-table tbody tr:last-child td,
.portal-table tfoot tr:last-child td {
  border-bottom: 0;
}

.portal-table tbody tr:nth-child(even) td {
  background: #f7f9fc;
}

.portal-table tfoot td {
  background: #fff6df;
  color: var(--portal-navy);
  font-weight: 800;
}

.portal-number {
  white-space: nowrap;
  text-align: right !important;
}

.portal-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.portal-photo {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--portal-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(5, 26, 54, 0.07);
}

.portal-photo img {
  width: 100%;
  height: 225px;
  object-fit: cover;
}

.portal-photo-logo img {
  object-fit: contain;
  padding: 1.15rem;
  background: #fff;
}

.portal-photo figcaption {
  padding: 0.9rem 1rem 1rem;
  color: var(--portal-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.portal-footer {
  padding: 2.3rem 1.25rem;
  border-top: 3px solid var(--portal-gold);
  background: var(--portal-navy-deep);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.portal-footer-logos {
  display: flex;
  margin-bottom: 1rem;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.portal-footer-logos img {
  width: auto;
  height: 34px;
}

.portal-footer p {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
}

.programs-index .nav-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.programs-home-link {
  display: inline-flex;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  color: #fff;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.programs-home-link:hover,
.programs-home-link:focus-visible {
  border-color: var(--portal-gold);
  color: var(--portal-gold);
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  .portal-access-grid,
  .portal-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-access-grid .portal-card:last-child {
    grid-column: 1 / -1;
    width: min(520px, 100%);
    justify-self: center;
  }
}

@media (max-width: 760px) {
  .portal-nav {
    min-height: 68px;
  }

  .portal-nav-title {
    display: none;
  }

  .portal-brand img {
    height: 32px;
  }

  .portal-nav .nav-toggle {
    display: block;
  }

  .portal-nav .nav-links {
    position: fixed;
    top: 68px;
    right: 0;
    left: 0;
    display: none;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    padding: 1.25rem;
    background: var(--portal-navy-deep);
    align-items: stretch;
    flex-direction: column;
  }

  .portal-nav .nav-links.open {
    display: flex;
  }

  .portal-nav .nav-links a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .portal-hero,
  .portal-hero-home {
    min-height: 420px;
  }

  .portal-hero-content {
    padding: 3.4rem 0;
  }

  .portal-access-grid,
  .portal-gallery,
  .portal-info-grid {
    grid-template-columns: 1fr;
  }

  .portal-access-grid .portal-card:last-child {
    grid-column: auto;
    width: 100%;
  }

  .portal-card {
    min-height: 400px;
  }

  .portal-card-media {
    min-height: 205px;
  }

  .portal-photo img {
    height: 235px;
  }

  .programs-index .nav-title {
    display: flex;
  }

  .programs-index .nav-title span {
    display: none;
  }
}

@media (max-width: 520px) {
  .portal-kpi-grid {
    grid-template-columns: 1fr;
  }

  .portal-section {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .portal-hero h1,
  .portal-hero-detail h1 {
    font-size: clamp(2.15rem, 12vw, 3rem);
  }

  .portal-footer-logos img {
    height: 28px;
  }
}
