/* ============================================================
   Centro Etnoeducativo Integral Rural Nulapuin Clemente Gutierrez Pana
   ============================================================ */

:root {
  --color-white: #ffffff;
  --color-ink: #2a2420;
  --color-ink-soft: #5c5049;
  --color-vinotinto: #6e2430;
  --color-vinotinto-dark: #4a1620;
  --color-vinotinto-tint: #f5e9ea;
  --color-sand: #f3ead9;
  --color-sand-deep: #ddcba3;
  --color-verde: #4b5c43;
  --color-line: rgba(42, 36, 32, 0.13);

  --font-display: Georgia, "Iowan Old Style", "Noto Serif", "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-sm: 0 1px 2px rgba(35, 26, 20, 0.09);
  --shadow-md: 0 14px 32px -18px rgba(35, 26, 20, 0.45);

  --container-w: min(1240px, 92vw);
  --section-pad-y: clamp(3.25rem, 6vw, 6rem);

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
ul, ol { list-style: none; margin: 0; padding: 0; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; }

body.no-scroll { overflow: hidden; }

:focus-visible {
  outline: 2.5px solid var(--color-vinotinto);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--color-vinotinto);
  color: var(--color-white);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: var(--container-w);
  margin-inline: auto;
}

.icon { width: 1.1em; height: 1.1em; fill: currentColor; flex-shrink: 0; }

/* ---------- Type scale ---------- */
h1, .h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.05rem, 1.5rem + 2.4vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
h2, .h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.65rem, 1.35rem + 1.3vw, 2.4rem);
  line-height: 1.18;
}
h3, .h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.4rem);
  line-height: 1.3;
}
.section-lede {
  max-width: 62ch;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  color: var(--color-ink-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn--primary {
  background: var(--color-vinotinto);
  color: var(--color-white);
}
.btn--primary:hover { background: var(--color-vinotinto-dark); }
.btn--outline {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.65);
}
.btn--outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-white);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--color-white);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--color-line);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.7rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--color-ink);
  min-width: 0;
}
.brand__mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.brand__eyebrow {
  font-size: 0.68rem;
  color: var(--color-ink-soft);
  letter-spacing: 0.02em;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.86rem, 0.7rem + 0.5vw, 1.05rem);
  color: var(--color-vinotinto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--color-ink);
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle__bar::before { content: ""; position: absolute; top: -7px; }
.nav-toggle__bar::after { content: ""; position: absolute; top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); background: var(--color-ink); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); background: var(--color-ink); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 1vw + 0.5rem, 2.1rem);
}
.nav-menu a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-ink);
  padding-block: 0.35rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.nav-menu a:hover { color: var(--color-vinotinto); border-color: var(--color-vinotinto); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-menu {
    position: fixed;
    inset: 0 0 0 auto;
    top: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--color-white);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.25rem;
    padding: 5.5rem 1.75rem 2rem;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    box-shadow: -12px 0 32px -18px rgba(0, 0, 0, 0.35);
  }
  .nav-menu.is-open { transform: translateX(0); }
  .nav-menu a { width: 100%; padding-block: 0.9rem; border-bottom: 1px solid var(--color-line); }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; background: var(--color-ink); }

.hero-carousel {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 82vh;
}
.hero-carousel__track {
  display: flex;
  width: 100%;
  height: 100%;
  transform: translateX(0);
}
@media (prefers-reduced-motion: no-preference) {
  .hero-carousel__track { transition: transform 0.65s cubic-bezier(0.6, 0.04, 0.32, 1); }
}
.hero-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30, 18, 16, 0.25) 0%, rgba(28, 16, 15, 0.55) 62%, rgba(24, 13, 12, 0.78) 100%);
}

.hero-content {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  color: var(--color-white);
  pointer-events: none;
}
.hero-content > * { pointer-events: auto; }
.hero-content__inner { max-width: 46rem; }
.hero-title { color: var(--color-white); text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28); }
.hero-subtitle {
  margin-top: 0.9rem;
  font-size: clamp(1rem, 0.92rem + 0.3vw, 1.2rem);
  color: rgba(255, 255, 255, 0.92);
  max-width: 40ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.75rem; }

.hero-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(24, 15, 14, 0.35);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.hero-carousel__arrow:hover { background: rgba(24, 15, 14, 0.6); border-color: var(--color-white); }
.hero-carousel__arrow--prev { left: clamp(0.75rem, 2vw, 2rem); }
.hero-carousel__arrow--next { right: clamp(0.75rem, 2vw, 2rem); }

.hero-carousel__dots {
  position: absolute;
  z-index: 6;
  right: clamp(1.25rem, 3vw, 3rem);
  bottom: clamp(1.25rem, 3vw, 2.25rem);
  display: flex;
  gap: 0.5rem;
}
.hero-carousel__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.18s ease, width 0.18s ease;
}
.hero-carousel__dot.is-active { background: var(--color-white); width: 22px; border-radius: 5px; }

/* ---------- Indicators strip ---------- */
.hero-indicators {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--color-sand);
  border-bottom: 1px solid var(--color-line);
}
.hero-indicators li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem clamp(0.75rem, 2vw, 1.75rem);
  font-weight: 600;
  font-size: clamp(0.8rem, 0.7rem + 0.4vw, 0.95rem);
  color: var(--color-vinotinto-dark);
  border-right: 1px solid var(--color-sand-deep);
}
.hero-indicators li:last-child { border-right: none; }
.hero-indicators .icon { width: 1.35em; height: 1.35em; color: var(--color-vinotinto); }

@media (max-width: 700px) {
  .hero-carousel { aspect-ratio: 4 / 5; max-height: none; }
  .hero-indicators { grid-template-columns: repeat(2, 1fr); }
  .hero-indicators li:nth-child(2) { border-right: none; }
  .hero-indicators li { border-bottom: 1px solid var(--color-sand-deep); }
}

/* ============================================================
   Section scaffolding
   ============================================================ */
.section { padding-block: var(--section-pad-y); }
.section--sand { background: var(--color-sand); }
.section-head { max-width: 44rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { color: var(--color-vinotinto-dark); }
.section-head .section-lede { margin-top: 0.85rem; }

/* ---------- Placeholder media pattern ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  background: var(--color-sand);
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}
.media-frame.ph-pattern {
  background-color: var(--color-sand);
  background-image:
    linear-gradient(135deg, var(--color-sand-deep) 25%, transparent 25.5%),
    linear-gradient(225deg, var(--color-sand-deep) 25%, transparent 25.5%),
    linear-gradient(45deg, var(--color-sand-deep) 25%, transparent 25.5%),
    linear-gradient(315deg, var(--color-sand-deep) 25%, transparent 25.5%);
  background-position: 22px 0, 22px 0, 0 0, 0 0;
  background-size: 44px 44px;
}
.media-frame.is-placeholder img { opacity: 0; }
.media-frame--sede { aspect-ratio: 7 / 3; }
.media-frame--gallery { aspect-ratio: 1 / 1; }
.media-frame--hero { aspect-ratio: 16 / 9; }

/* ============================================================
   Sedes
   ============================================================ */
.sedes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
@media (max-width: 1199px) { .sedes-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 899px) { .sedes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .sedes-grid { grid-template-columns: 1fr; } }

.sede-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.sede-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-vinotinto);
  box-shadow: var(--shadow-md);
}
.sede-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.1rem 1.5rem 1.3rem;
  min-height: 9.75rem;
}
.sede-card__index {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-sand-deep);
  margin: 0 0 0.45rem;
}
.sede-card__name {
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
  flex: 1;
  margin: 0 0 0.65rem;
}
.sede-card__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--color-ink-soft);
}
.sede-card__meta .icon { color: var(--color-vinotinto); width: 1em; height: 1em; }

.sede-card__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--color-line);
}
.sede-card__visual-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 1.85rem + 1.8vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-vinotinto);
  opacity: 0.16;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.sede-card:hover .sede-card__visual-number {
  opacity: 0.32;
  transform: scale(1.06);
}

/* ============================================================
   Gallery
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 899px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 599px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

.gallery-tile { border-radius: var(--radius-md); overflow: hidden; }
.gallery-tile .media-frame { height: 100%; }
.gallery-tile__label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 0.75rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-white);
  background: linear-gradient(0deg, rgba(20, 12, 11, 0.72), transparent);
  transform: translateY(100%);
  transition: transform 0.22s ease;
}
.gallery-tile .media-frame:hover .gallery-tile__label,
.gallery-tile .media-frame:focus-within .gallery-tile__label { transform: translateY(0); }

/* ============================================================
   Institutional info blocks
   ============================================================ */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0;
  border-top: 1px solid var(--color-line);
  border-left: 1px solid var(--color-line);
}
.info-block {
  padding: 2rem clamp(1.25rem, 3vw, 2rem);
  border-right: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  border-top: 3px solid var(--color-vinotinto);
}
.info-block h3 { color: var(--color-vinotinto-dark); }
.info-block p { margin-top: 0.75rem; color: var(--color-ink-soft); font-size: 0.96rem; }

/* ============================================================
   Contact
   ============================================================ */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 860px) { .contact-layout { grid-template-columns: 1fr; } }

.contact-list { display: flex; flex-direction: column; gap: 1.5rem; }
.contact-item { display: flex; gap: 1rem; }
.contact-item .icon {
  width: 2.4rem; height: 2.4rem;
  flex-shrink: 0;
  padding: 0.55rem;
  border-radius: 50%;
  background: var(--color-vinotinto-tint);
  color: var(--color-vinotinto);
}
.contact-item h3 { font-size: 1rem; }
.contact-item p { margin-top: 0.25rem; color: var(--color-ink-soft); font-size: 0.95rem; }

.map-frame {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.6rem;
  color: var(--color-ink-soft);
  text-align: center;
  padding: 1.5rem;
}
.map-frame .icon { width: 2rem; height: 2rem; color: var(--color-vinotinto); }
.map-frame strong { color: var(--color-ink); font-family: var(--font-display); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--color-vinotinto-dark);
  color: rgba(255, 255, 255, 0.88);
  padding-block: clamp(2.75rem, 5vw, 4rem) 1.75rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 2.25rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand { display: flex; flex-direction: column; gap: 0.9rem; }
.footer-brand__mark { display: flex; align-items: center; gap: 0.75rem; }
.footer-brand__mark img { width: 42px; height: 42px; border-radius: 50%; }
.footer-brand__mark span { font-family: var(--font-display); font-weight: 700; color: var(--color-white); }
.footer-tagline { font-size: 0.9rem; color: rgba(255, 255, 255, 0.72); max-width: 32ch; }

.footer-col h3 {
  color: var(--color-white);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--color-white); }

.footer-social { display: flex; gap: 0.6rem; margin-top: 0.25rem; }
.footer-social a {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-white);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.footer-social a:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.6); }

.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}
