@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --bg: #f7f7f3;
  --surface: #ffffff;
  --surface-soft: #f0efe8;
  --text: #1f2c33;
  --muted: #5c6b73;
  --brand: #0f766e;
  --brand-strong: #0b4f4a;
  --accent: #f59e0b;
  --line: #d7ddd8;
  --shadow: 0 18px 48px rgba(20, 36, 44, 0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --max-width: 1140px;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 88% 8%, #efe5ca 0%, #f7f7f3 40%), var(--bg);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
}

body.home-page {
  background:
    radial-gradient(circle at 12% 0%, rgba(15, 118, 110, 0.14), transparent 28%),
    radial-gradient(circle at 90% 8%, rgba(245, 158, 11, 0.16), transparent 24%),
    linear-gradient(180deg, #f8f7f2 0%, #f5f2ea 48%, #eef4ef 100%);
}

body.home-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 118, 110, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 82%);
  opacity: 0.55;
  z-index: 0;
}

body.home-page > * {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #111;
  color: #fff;
  padding: 0.85rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 1500;
}

.skip-link:focus {
  left: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(15, 118, 110, 0.16);
}

.header-inner {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 78px;
}

.header-inner .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
}

.brand-text small,
.brand-text span {
  color: var(--muted); /* mateix to que el menú */
  font-weight: 600;
}


.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
}

.brand img {
  width: 100px; /* augmenta lleugerament la mida */
  height: auto;
  border: none; /* elimina el contorn */
  box-shadow: none; /* elimina l’ombra */
  background: transparent; /* sense fons blanc */
  padding: 0; /* elimina el marge intern */
  object-fit: contain;
  object-position: center;
  vertical-align: middle;
}


.brand-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem;
  line-height: 1.15;
}

.brand-text small {
  color: var(--brand-strong);
  font-size: 0.98rem;
  font-weight: 700;
}

.brand-text span {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--brand-strong);
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.site-nav a {
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active {
  color: var(--brand-strong);
  background: rgba(15, 118, 110, 0.14);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(15, 118, 110, 0.2);
  background: #fff;
  color: var(--brand-strong);
  font-size: 1rem;
  cursor: pointer;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  background: rgba(15, 118, 110, 0.12);
}

.menu-toggle {
  display: none;
}

main {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
}

.section {
  padding: 1.2rem 0 2.2rem;
}

.section-title {
  font-family: "Fraunces", serif;
  font-size: clamp(1.45rem, 2vw + 0.9rem, 2.4rem);
  margin: 0;
}

.section-lead {
  margin: 0.55rem 0 0;
  max-width: 68ch;
  color: var(--muted);
}

.hero {
  padding: 2.1rem 0 2.2rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.4rem;
  align-items: stretch;
}

.hero-intro {
  background: linear-gradient(135deg, #0f766e, #0d9488);
  color: #f9fcfb;
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 3.5vw, 2rem);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero-intro::before {
  content: "";
  position: absolute;
  inset: auto -20% -45% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 255, 252, 0.82);
}

.hero-intro h1,
.page-hero h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.9rem, 4vw, 3.35rem);
  line-height: 1.1;
}

.hero-intro p {
  margin: 0.95rem 0 0;
  max-width: 54ch;
}

.btn-row {
  margin-top: 1.35rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 0.7rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.btn-primary {
  background: var(--accent);
  color: #2e2102;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.hero-metrics {
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.hero-metrics li {
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  padding: 0.7rem;
}

.hero-metrics strong {
  display: block;
  font-size: 1.03rem;
}

.hero-metrics span {
  font-size: 0.8rem;
  color: rgba(248, 255, 252, 0.85);
}

body.home-page .site-header {
  background: rgba(248, 247, 242, 0.84);
  border-bottom: 1px solid rgba(15, 118, 110, 0.12);
}

body.home-page main {
  width: min(calc(var(--max-width) + 100px), calc(100% - 2rem));
  display: grid;
  gap: 1.35rem;
}

body.home-page .hero {
  padding: 1.55rem 0 0.95rem;
}

body.home-page .hero-layout {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
}

body.home-page .hero-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  box-shadow: 0 26px 64px rgba(15, 118, 110, 0.24);
}

body.home-page .hero-intro h1 {
  max-width: 11ch;
}

body.home-page .hero-intro p {
  max-width: 44ch;
}

body.home-page .hero-metrics {
  margin-top: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.home-page .hero-metrics li {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
}

body.home-page .hero-slider {
  padding: 1rem;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.42));
  border-color: rgba(15, 118, 110, 0.18);
  box-shadow: 0 18px 40px rgba(20, 36, 44, 0.08);
}

body.home-page .hero-slide {
  position: relative;
  grid-template-columns: 1fr;
  min-height: 470px;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 6px);
}

body.home-page .hero-slide img {
  height: 100%;
  min-height: 470px;
  border-radius: calc(var(--radius-lg) - 6px);
  filter: saturate(1.04) contrast(1.02);
}

body.home-page .hero-slide .slide-copy {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  max-width: 360px;
  padding: 1rem 1rem 0.95rem;
  background: rgba(9, 20, 21, 0.74);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 36px rgba(7, 16, 18, 0.22);
}

body.home-page .hero-slide h2 {
  color: #fff;
}

body.home-page .hero-slide p {
  color: rgba(244, 248, 247, 0.84);
}

body.home-page .hero-slide .badge {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

body.home-page .hero-slide .btn-primary {
  background: #f8c74a;
  color: #2e2102;
}

body.home-page .slider-controls {
  margin-top: 0.15rem;
  padding: 0.1rem 0.1rem 0;
}

body.home-page .slider-controls .btn-secondary {
  background: #fff;
  color: var(--brand-strong);
  border-color: rgba(15, 118, 110, 0.18);
  box-shadow: 0 8px 18px rgba(20, 36, 44, 0.06);
}

body.home-page .slider-dot {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(15, 118, 110, 0.35);
}

body.home-page .slider-dot.is-active {
  background: var(--brand);
}

body.home-page .home-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.62));
  border: 1px solid rgba(15, 118, 110, 0.12);
  box-shadow: 0 18px 42px rgba(20, 36, 44, 0.08);
  padding: clamp(1rem, 2vw, 1.35rem);
  border-radius: var(--radius-lg);
}

body.home-page .home-panel .section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

body.home-page .home-panel .section-title::before {
  content: "";
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

body.home-page .home-news-panel,
body.home-page .home-events-panel {
  position: relative;
  overflow: hidden;
}

body.home-page .home-news-panel::after,
body.home-page .home-events-panel::after {
  content: "";
  position: absolute;
  inset: auto -4rem -5rem auto;
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.16), transparent 68%);
  pointer-events: none;
}

body.home-page #home-news-list,
body.home-page #home-events-list {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

body.home-page #home-news-list > :first-child,
body.home-page #home-events-list > :first-child {
  grid-column: 1 / -1;
}

body.home-page #home-news-list .news-card,
body.home-page #home-events-list .feature-card {
  overflow: hidden;
  padding: 0;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

body.home-page #home-news-list .news-card img,
body.home-page #home-events-list .feature-card img {
  grid-row: 1 / span 4;
  width: 100%;
  height: 100%;
  min-height: 180px;
  border-radius: 0;
  border: 0;
  aspect-ratio: auto;
  margin: 0;
  object-fit: cover;
}

body.home-page #home-news-list .news-card .meta,
body.home-page #home-news-list .news-card h3,
body.home-page #home-news-list .news-card p,
body.home-page #home-events-list .feature-card .meta,
body.home-page #home-events-list .feature-card h3,
body.home-page #home-events-list .feature-card p {
  padding-left: 1rem;
  padding-right: 1rem;
}

body.home-page #home-news-list .news-card .meta,
body.home-page #home-events-list .feature-card .meta {
  padding-top: 1rem;
}

body.home-page #home-news-list .news-card p:last-child,
body.home-page #home-events-list .feature-card p:last-child {
  padding-bottom: 1rem;
}

body.home-page #home-news-list .news-card {
  background: linear-gradient(180deg, #ffffff, #fbfcfb);
}

body.home-page #home-events-list .feature-card {
  background: linear-gradient(180deg, #fefefe, #f6fbf8);
}

body.home-page #home-news-list .news-card:first-child,
body.home-page #home-events-list .feature-card:first-child {
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.05fr);
}

body.home-page #home-news-list .news-card:first-child img,
body.home-page #home-events-list .feature-card:first-child img {
  min-height: 220px;
}

.card,
.hero-slider,
.timeline,
.contact-panel,
.page-hero,
.news-toolbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 22px rgba(20, 36, 44, 0.08);
}

.hero-slider {
  padding: 0.7rem;
  display: grid;
  gap: 0.75rem;
}

.hero-slide {
  display: none;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 0.8rem;
  align-items: stretch;
  min-height: 360px;
}

.hero-slide.is-active {
  display: grid;
}

.hero-slide .slide-copy {
  padding: 1rem;
}

.hero-slide h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.hero-slide p {
  margin: 0.8rem 0 0;
  color: var(--muted);
}

.hero-slide img {
  width: 100%;
  height: clamp(240px, 32vw, 420px);
  min-height: 240px;
  object-position: center;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.slider-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.slider-dots {
  display: flex;
  gap: 0.4rem;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(15, 118, 110, 0.4);
  background: transparent;
  cursor: pointer;
}

.slider-dot.is-active {
  background: var(--brand);
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card,
.news-card,
.program-card,
.group-card,
.stat,
.timeline-item,
.contact-card,
.note {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.feature-card h3,
.news-card h3,
.program-card h3,
.group-card h3,
.timeline-item h3,
.contact-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.feature-card p,
.news-card p,
.program-card p,
.group-card p,
.timeline-item p,
.contact-card p,
.note p {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.14);
  color: var(--brand-strong);
  margin-bottom: 0.5rem;
}
/*
.institutional-logo {
  width: 100%;
  max-width: 190px;
  height: 78px;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto 0.55rem;
}
*/
.institutional-logo {
  width: 100%;
  max-width: 190px;
  height: 78px;
  object-fit: contain;
}

.feature-card .institutional-logo {
  aspect-ratio: auto !important;
  width: auto !important;
  height: auto !important;
  max-width: 180px;
  max-height: 90px;
  object-fit: contain !important;
  border: none !important;
  border-radius: 0 !important;
  margin-bottom: 0.55rem;
}


.subsidies-grid .feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Igualar altura de les targetes segons la més llarga */
.grid.subsidies-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.grid.subsidies-grid .feature-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* evita que s'estire massa */
  min-width: 0;
  height: auto; /* altura natural */
  min-height: 260px; /* ajusta la mida mínima perquè totes siguen iguals */
}

.grid.subsidies-grid .feature-card p {
  flex-grow: 1; /* fa que el text ocupe l'espai necessari */
}


.grid.subsidies-grid .feature-card p {
  max-width: 34ch;
}

.meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.page-hero {
  margin-top: 1.3rem;
  padding: clamp(1rem, 2vw, 1.7rem);
  display: grid;
  gap: 0.85rem;
}

.page-hero p {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.split img {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  min-height: 260px;
  width: 100%;
  object-fit: cover;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.stat {
  text-align: center;
  padding: 1rem 0.65rem;
}

.stat strong {
  display: block;
  font-size: 1.4rem;
  color: var(--brand-strong);
}

.timeline {
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}

.timeline-item {
  border-left: 4px solid rgba(15, 118, 110, 0.45);
}

.timeline-item .year {
  display: inline-block;
  font-weight: 700;
  color: var(--brand-strong);
  margin-bottom: 0.35rem;
}

.group-card img,
.news-card img,
.feature-card img,
.gallery-grid img,
.program-card img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  margin-bottom: 0.7rem;
}

.program-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.8rem;
}

.program-card h3 {
  margin-top: 0.1rem;
}

.program-card p {
  margin-top: 0.5rem;
  line-height: 1.6;
}

.section[aria-labelledby="programs-title"] .grid.cols-3 {
  align-items: stretch;
}

/* Separació vertical entre files de targetes */
.section[aria-labelledby="programs-title"] .grid.cols-3 {
  gap: 1.6rem; /* separació horitzontal i vertical */
  row-gap: 2.8rem; /* separació vertical entre files */
}


.section[aria-labelledby="programs-title"] .program-card img {
  aspect-ratio: 16 / 6;
}

/* Fine focal-point tuning per training stage card */
.section[aria-labelledby="programs-title"] .program-card:nth-child(1) img {
  object-position: center 38%;
}

.section[aria-labelledby="programs-title"] .program-card:nth-child(2) img {
  object-position: center 30%;
}

.section[aria-labelledby="programs-title"] .program-card:nth-child(3) img {
  object-position: center 26%;
}

.section[aria-labelledby="programs-title"] .program-card:nth-child(4) img {
  object-position: center 44%;
}

.section[aria-labelledby="programs-title"] .program-card:nth-child(5) img {
  object-position: center 35%;
}

.section[aria-labelledby="programs-title"] .program-card:nth-child(6) img {
  object-position: center 32%;
}

.split img {
  object-position: center top;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge {
  color: #0f4f48;
  background: rgba(15, 118, 110, 0.15);
  padding: 0.25rem 0.55rem;
}

.news-toolbar {
  padding: 0.75rem;
  margin-bottom: 0.8rem;
}

.chip {
  border: 1px solid rgba(15, 118, 110, 0.35);
  color: var(--brand-strong);
  background: #fff;
  padding: 0.42rem 0.82rem;
  cursor: pointer;
}

.chip.is-active,
.chip:hover,
.chip:focus-visible {
  color: #fff;
  background: var(--brand);
}

.chip-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.news-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-card {
  display: grid;
  gap: 0.6rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.news-card:hover,
.news-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(15, 118, 110, 0.16);
  border-color: rgba(15, 118, 110, 0.4);
  outline: none;
}

.feature-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover,
.feature-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(15, 118, 110, 0.16);
  border-color: rgba(15, 118, 110, 0.4);
  outline: none;
}

.group-card,
.program-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.group-card:hover,
.group-card:focus-visible,
.program-card:hover,
.program-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(15, 118, 110, 0.16);
  border-color: rgba(15, 118, 110, 0.4);
  outline: none;
}

/* Group detail modal */
.group-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(20, 36, 44, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.group-modal-backdrop.is-open {
  display: flex;
}

.group-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(20, 36, 44, 0.24);
  width: min(760px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.25s ease;
  position: relative;
}

.group-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 1;
}

.group-modal-close:hover {
  background: var(--surface-soft);
  color: var(--text);
}

/* Carousel */
.group-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: #111;
  aspect-ratio: 16 / 7;
}

.group-carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.group-carousel-track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  border: none;
  background: #111;
}

.group-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  color: var(--brand-strong);
  font-size: 0.95rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.group-carousel-btn:hover { background: #fff; }
.group-carousel-btn.prev { left: 0.75rem; }
.group-carousel-btn.next { right: 0.75rem; }

.group-carousel-dots {
  position: absolute;
  bottom: 0.65rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.35rem;
}

.group-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 0;
}

.group-carousel-dot.is-active { background: #fff; }

.group-modal-body {
  padding: clamp(1.2rem, 4vw, 2rem);
}

.group-modal-body h2 {
  font-family: "Fraunces", serif;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  margin: 0 0 0.4rem;
}

.group-modal-director {
  color: var(--brand);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 0.9rem;
}

.group-modal-desc {
  color: var(--muted);
  line-height: 1.75;
  margin: 0 0 0.75rem;
}

.group-modal-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--brand-strong);
  background: rgba(15,118,110,0.1);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

/* Schedule table inside modal */
.group-modal-schedule {
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.group-modal-schedule h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-strong);
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.group-modal-schedule table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.group-modal-schedule th {
  text-align: left;
  padding: 0.4rem 0.6rem;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.group-modal-schedule td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(215,221,216,0.5);
  color: var(--text);
  vertical-align: top;
}

.group-modal-schedule tr:last-child td {
  border-bottom: none;
}

/* PDF download cards */
.pdf-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pdf-card:hover,
.pdf-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(15, 118, 110, 0.16);
  border-color: rgba(15, 118, 110, 0.4);
  outline: none;
}

.pdf-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(15, 118, 110, 0.1);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  transition: background 0.2s ease;
}

.pdf-card:hover .pdf-card-icon {
  background: rgba(15, 118, 110, 0.18);
}

.pdf-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pdf-card-body h3 {
  margin: 0;
  font-size: 1.05rem;
}

.pdf-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.pdf-card-hint {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--brand);
  font-style: italic;
  letter-spacing: 0.01em;
}

/* News detail modal */
.news-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(20, 36, 44, 0.55);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.news-modal-backdrop.is-open {
  display: flex;
}

.news-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(20, 36, 44, 0.24);
  width: min(720px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  animation: modal-in 0.25s ease;
  position: relative;
}

.news-modal-media {
  position: relative;
  background: #eaf0eb;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.news-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 1;
}

.news-modal-close:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.news-modal-img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: contain;
  background: linear-gradient(180deg, #f7faf7, #e9f0eb);
  display: block;
}

.news-modal-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: linear-gradient(180deg, #f7faf7, #e9f0eb);
}

.news-modal-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}

.news-modal-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-modal-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: linear-gradient(180deg, #f7faf7, #e9f0eb);
}

.news-modal-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-strong);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 10px 24px rgba(20, 36, 44, 0.12);
}

.news-modal-carousel-btn.prev {
  left: 0.85rem;
}

.news-modal-carousel-btn.next {
  right: 0.85rem;
}

.news-modal-dots {
  position: absolute;
  left: 50%;
  bottom: 0.9rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
  z-index: 2;
}

.news-modal-dot {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(15, 118, 110, 0.32);
  cursor: pointer;
}

.news-modal-dot.is-active {
  width: 1.8rem;
  background: var(--brand);
}

.news-modal-body {
  padding: clamp(1.2rem, 4vw, 2rem);
}

.news-modal-body .meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.news-modal-body h2 {
  font-family: "Fraunces", serif;
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
  margin: 0 0 1rem;
  line-height: 1.2;
}

.news-modal-body .news-modal-content {
  color: var(--muted);
  line-height: 1.7;
}

.news-modal-body .news-modal-content p {
  margin: 0 0 0.85rem;
}

.news-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

label {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: #fff;
  color: var(--text);
  box-sizing: border-box;
  min-width: 0;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.33);
  outline-offset: 1px;
}

.contact-panel {
  padding: 1rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.contact-card {
  background: var(--surface-soft);
}

.map-frame {
  width: 100%;
  min-height: 310px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.form-status {
  font-size: 0.9rem;
  margin-top: 0.75rem;
  color: var(--muted);
}

.form-status.success {
  color: #0f766e;
}

.form-status.error {
  color: #b42318;
}

.admin-dashboard {
  display: grid;
  gap: 1rem;
}

.admin-stats-summary {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-page-chart {
  display: grid;
  gap: 0.85rem;
}

.admin-page-row {
  display: grid;
  gap: 0.45rem;
}

.admin-page-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  font-size: 0.95rem;
}

.admin-page-row-head strong {
  font-weight: 700;
}

.admin-page-row-head span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.admin-page-bar {
  position: relative;
  height: 12px;
  overflow: hidden;
  background: rgba(15, 118, 110, 0.12);
  border: 1px solid rgba(15, 118, 110, 0.15);
  border-radius: 999px;
}

.admin-page-bar-fill {
  display: block;
  height: 100%;
  min-width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-strong));
  border-radius: inherit;
}

.admin-stat-label {
  display: inline-block;
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 22px rgba(20, 36, 44, 0.08);
  padding: 1rem;
}

.admin-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.admin-panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-selected {
  color: var(--brand-strong);
  font-weight: 700;
}

.admin-panel-body {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 1rem;
}

.admin-list-shell {
  background: linear-gradient(180deg, #fbfcfa, #f4f8f5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  min-height: 320px;
}

.admin-list {
  display: grid;
  gap: 0.65rem;
}

.admin-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #fff;
  padding: 0.85rem 0.9rem;
  cursor: pointer;
  display: grid;
  gap: 0.15rem;
  box-shadow: 0 4px 14px rgba(20, 36, 44, 0.05);
.admin-dashboard #admin-stats-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-dashboard #admin-stats-summary .admin-stat-card {
  min-height: 118px;
}
}

.admin-item:hover,
.admin-item:focus-visible,
.admin-item.is-active {
  border-color: rgba(15, 118, 110, 0.28);
  background: linear-gradient(180deg, #ffffff, #f3faf8);
  box-shadow: 0 10px 22px rgba(20, 36, 44, 0.08);
}

.admin-item-title {
  font-size: 1rem;
  color: var(--text);
}

.admin-item-meta,
.admin-item-id {
  font-size: 0.84rem;
  color: var(--muted);
}

.admin-item-id {
  opacity: 0.8;
}

.admin-form {
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.admin-dropzone {
  display: grid;
  gap: 0.85rem;
  padding: 0.95rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(247, 248, 244, 0.92), rgba(255, 255, 255, 0.96));
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.admin-dropzone:hover,
.admin-dropzone:focus-within,
.admin-dropzone.is-dragover {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 14px 32px rgba(20, 36, 44, 0.08);
  background: linear-gradient(180deg, rgba(242, 250, 247, 0.98), rgba(255, 255, 255, 0.98));
  transform: translateY(-1px);
}

.admin-dropzone-preview {
  min-height: 210px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at top, rgba(15, 118, 110, 0.08), transparent 55%), #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
}

.admin-dropzone-preview::before {
  content: "Sin imagen";
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-dropzone.has-image .admin-dropzone-preview::before {
  display: none;
}

.admin-dropzone-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.admin-dropzone.has-image .admin-dropzone-preview img {
  display: block;
}

.admin-dropzone-copy {
  display: grid;
  gap: 0.2rem;
}

.admin-dropzone-copy strong {
  color: var(--brand-strong);
  font-size: 0.96rem;
}

.admin-dropzone-copy span {
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-dropzone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.admin-dropzone-actions .btn {
  min-width: 8.5rem;
}

.admin-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-field-full {
  grid-column: 1 / -1;
}

.admin-advanced {
  margin-top: 0.95rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.admin-advanced summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brand-strong);
}

.admin-advanced-body {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.75rem;
}

.admin-file-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

.admin-empty {
  margin: 0;
  padding: 1rem;
  border-radius: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}

.admin-form-actions {
  margin-top: 0.2rem;
}

.admin-form .btn-secondary {
  background: var(--surface-soft);
  color: var(--brand-strong);
  border: 1px solid var(--line);
}

.admin-form .btn-secondary:hover,
.admin-form .btn-secondary:focus-visible {
  background: #fff;
}

.admin-form .btn-primary {
  background: linear-gradient(135deg, #245e58, #0f766e);
  color: #fff;
}

.admin-page .btn-primary {
  background: linear-gradient(135deg, #245e58, #0f766e);
  color: #fff;
}

.admin-page .btn-secondary {
  background: #f1f5f2;
  color: var(--brand-strong);
  border: 1px solid var(--line);
}

.admin-page .btn-secondary:hover,
.admin-page .btn-secondary:focus-visible {
  background: #fff;
}

@media (max-width: 980px) {
  .admin-panel-body {
    grid-template-columns: 1fr;
  }

  .admin-field-grid {
    grid-template-columns: 1fr;
  }
}

.form-optional {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  font-style: italic;
}

/* Contact submit button */
.btn-submit-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  margin-top: 1rem;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.28);
}

.btn-submit-contact:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.35);
}

.btn-submit-contact:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
}

.json-editor {
  min-height: 360px;
  font-family: Consolas, Menlo, Monaco, monospace;
}

.status-line {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.accordion details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.95rem;
}

.accordion details + details {
  margin-top: 0.55rem;
}

.accordion summary {
  cursor: pointer;
  font-weight: 700;
}

.schedule {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.schedule th,
.schedule td {
  text-align: left;
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid #e8ece9;
}

.schedule th {
  background: #f0f7f6;
  color: var(--brand-strong);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.site-footer {
  margin-top: 1rem;
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 24%),
    radial-gradient(circle at 92% 12%, rgba(15, 118, 110, 0.18), transparent 26%),
    linear-gradient(180deg, #14343c 0%, #102a31 100%);
  color: #e4ede7;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;

}

.site-footer .institutional-logo {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 1000px; /* ajusta fins que quede perfecte */
  height: auto;
  object-fit: contain;
}

.footer-inner {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.8rem 0 1.4rem;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 0.95fr 1fr;
  gap: 0.9rem;
}

.footer-inner > section:first-child {
  padding: 0rem;
}


.footer-inner > section {
  padding: 1rem 1rem 1.05rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 30px rgba(6, 18, 21, 0.14);
}

.site-footer h3 {
  margin: 0 0 0.45rem;
  font-size: 1.03rem;
  color: #fff;
}

.footer-social h3 {
  margin-bottom: 0.65rem;
}

.footer-social {
  text-align: center;
}

.footer-social .social-links {
  justify-content: center;
}

.site-footer p,
.site-footer li {
  margin: 0;
  color: #dce3df;
  font-size: 0.92rem;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.social-links {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: #f3f7f5;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.social-link svg {
  width: 1.55rem;
  height: 1.55rem;
  display: block;
  flex: none;
}

.social-link .social-icon-fill {
  fill: currentColor;
}

.social-link .social-icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-link:hover,
.social-link:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #fcd34d;
}

.footer-bottom {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  padding: 1rem 0 1.15rem;
  font-size: 0.84rem;
  color: rgba(228, 237, 231, 0.78);
  letter-spacing: 0.02em;
}

[hidden] {
  display: none !important;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero-layout,
  .split,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  body.home-page .hero-layout {
    grid-template-columns: 1fr;
  }

  body.home-page .hero-slide {
    min-height: 420px;
  }

  body.home-page #home-news-list,
  body.home-page #home-events-list {
    grid-template-columns: 1fr;
  }

  .hero-slide {
    grid-template-columns: 1fr;
  }

  .stats-row,
  .grid.cols-3,
  .news-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 1rem;
    width: min(320px, calc(100% - 2rem));
    max-height: calc(100vh - 95px);
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    background: #fff;
    display: none;
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    border-radius: var(--radius-sm);
  }

  .form-grid,
  .grid.cols-2,
  .stats-row,
  .news-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .program-card {
    padding: 0.75rem;
  }

  .program-card img {
    aspect-ratio: 4 / 3;
  }

  .section[aria-labelledby="programs-title"] .program-card img {
    aspect-ratio: 16 / 6;
  }

  .section[aria-labelledby="programs-title"] .program-card:nth-child(1) img {
    object-position: center 34%;
  }

  .section[aria-labelledby="programs-title"] .program-card:nth-child(2) img {
    object-position: center 27%;
  }

  .section[aria-labelledby="programs-title"] .program-card:nth-child(3) img {
    object-position: center 22%;
  }

  .section[aria-labelledby="programs-title"] .program-card:nth-child(4) img {
    object-position: center 42%;
  }

  .section[aria-labelledby="programs-title"] .program-card:nth-child(5) img {
    object-position: center 33%;
  }

  .section[aria-labelledby="programs-title"] .program-card:nth-child(6) img {
    object-position: center 30%;
  }

  body.home-page .hero-intro {
    min-height: auto;
  }

  body.home-page .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.home-page .hero-slide {
    min-height: 390px;
  }

  body.home-page .hero-slide .slide-copy {
    max-width: 320px;
  }

  body.home-page #home-news-list .news-card,
  body.home-page #home-events-list .feature-card {
    grid-template-columns: 160px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .header-inner {
    width: calc(100% - 1rem);
    min-height: 72px;
    gap: 0.6rem;
  }

  .brand {
    gap: 0.55rem;
  }

  .brand img {
    width: 48px;
    height: 48px;
  }
  .section[aria-labelledby="programs-title"] .program-card img {
    aspect-ratio: 16 / 7;
  }

  .brand-text {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .brand-text small,
  .brand-text span {
    font-size: 0.82rem;
    line-height: 1.1;
  }

  body.home-page main {
    width: calc(100% - 1rem);
  }

  body.home-page .hero {
    padding-top: 1.2rem;
  }

  body.home-page .hero-intro {
    padding: 1rem;
  }

  body.home-page .hero-intro h1 {
    max-width: none;
  }

  body.home-page .hero-metrics {
    grid-template-columns: 1fr;
  }

  body.home-page .hero-slider {
    padding: 0.75rem;
  }

  body.home-page .hero-slide {
    min-height: 0;
  }

  body.home-page .hero-slide .slide-copy {
    position: static;
    max-width: none;
    margin-bottom: 0.75rem;
  }

  body.home-page .hero-slide img {
    min-height: 230px;
  }

  body.home-page #home-news-list,
  body.home-page #home-events-list {
    grid-template-columns: 1fr;
  }

  body.home-page #home-news-list .news-card,
  body.home-page #home-events-list .feature-card {
    grid-template-columns: 1fr;
  }

  body.home-page #home-news-list .news-card img,
  body.home-page #home-events-list .feature-card img {
    min-height: 210px;
  }

  .site-nav {
    right: 0.5rem;
    width: calc(100% - 1rem);
  }

  .hero {
    padding-top: 1.2rem;
  }

  .btn-row .btn {
    flex: 1 1 100%;
  }

  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-frame {
    min-height: 240px;
  }
}

@media (max-width: 560px) {
  .schedule thead {
    display: none;
  }

  .schedule,
  .schedule tbody,
  .schedule tr,
  .schedule td {
    display: block;
    width: 100%;
  }

  .schedule tr {
    padding: 0.7rem;
    border-bottom: 1px solid #e8ece9;
  }

  .schedule tr:last-child {
    border-bottom: 0;
  }

  .schedule td {
    border: 0;
    padding: 0.42rem 0;
    display: grid;
    grid-template-columns: minmax(105px, 38%) 1fr;
    gap: 0.55rem;
  }

  .schedule td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--brand-strong);
  }
}

@media (max-width: 360px) {
  .header-inner,
  main,
  .footer-inner {
    width: calc(100% - 0.75rem);
  }

  .header-inner {
    min-height: 68px;
  }

  .brand img {
    width: 44px;
    height: 44px;
  }

  .brand-text small,
  .brand-text span {
    font-size: 0.76rem;
  }

  body.home-page .hero-intro,
  body.home-page .home-panel {
    padding: 0.85rem;
  }

  body.home-page .hero-slide .slide-copy {
    padding: 0.85rem;
  }

  .section {
    padding: 0.9rem 0 1.6rem;
  }

  .hero-intro,
  .page-hero,
  .card,
  .news-toolbar,
  .contact-panel {
    border-radius: 16px;
    padding: 0.85rem;
  }

  .hero-slide {
    min-height: 0;
  }

  .hero-slide .slide-copy {
    padding: 0.75rem;
  }

  .hero-slide img,
  .split img {
    min-height: 180px;
  }

  .feature-card,
  .news-card,
  .program-card,
  .group-card,
  .stat,
  .timeline-item,
  .contact-card,
  .note {
    padding: 0.85rem;
  }

  .btn {
    width: 100%;
    padding: 0.62rem 0.9rem;
    font-size: 0.9rem;
  }

  .chip {
    font-size: 0.74rem;
    padding: 0.35rem 0.62rem;
  }

  .schedule td {
    grid-template-columns: minmax(92px, 42%) 1fr;
    gap: 0.45rem;
    font-size: 0.9rem;
  }

  .site-footer p,
  .site-footer li,
  .site-footer a {
    font-size: 0.88rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1100px) {
  .admin-stats-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.subsidies-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .header-inner {
    width: calc(100% - 1rem);
    min-height: 72px;
    gap: 0.6rem;
  }

  .header-inner .brand {
    min-width: 0;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0.5rem;
    width: min(320px, calc(100% - 1rem));
    max-height: calc(100vh - 95px);
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    background: #fff;
    display: none;
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    border-radius: var(--radius-sm);
  }

  .brand {
    gap: 0.5rem;
  }

  .brand img {
    width: 56px;
    height: 56px;
  }

  .brand-text span {
    font-size: 0.78rem;
    line-height: 1.02;
    max-width: 165px;
  }
}

@media (max-width: 900px) {
  .header-inner {
    width: calc(100% - 1rem);
    min-height: 72px;
    gap: 0.6rem;
  }

}

@media (max-width: 720px) {
  .admin-stats-summary {
    grid-template-columns: 1fr;
  }

  .grid.subsidies-grid {
    grid-template-columns: 1fr;
  }

  .admin-page-row-head {
    font-size: 0.9rem;
  }
}
