/* ─────────────────────────────────────────────────────────────
   Educación Alimentaria — styles.css
   Catalina Miranda · catalinamiranda.pe/educacion/
   Tokens alineados a la web principal
   ───────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Hardbob";
  src: url("../assets/fonts/Hardbop-Black.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Agenda One";
  src: url("../assets/fonts/agenda-one-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ── */
:root {
  --red:        #ed1c24;
  --yellow:     #ffac0b;
  --black:      #000000;
  --white:      #ffffff;
  --bg:         #ffffff;
  --muted:      #faf8f5;
  --muted-2:    #f2ede6;
  --text:       #111;
  --text-soft:  #555;
  --border:     rgba(0,0,0,.10);
  --shadow-sm:  0 2px 12px rgba(0,0,0,.06);
  --shadow-md:  0 8px 32px rgba(0,0,0,.09);

  --font-title: "Hardbob", system-ui, -apple-system, sans-serif;
  --font-body:  "Agenda One", system-ui, -apple-system, sans-serif;

  --radius:     18px;
  --radius-sm:  10px;
  --radius-pill:999px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.micro { font-size: 12px; opacity: .7; }

/* ── Contenedor ── */
.container { max-width: 860px; margin: 0 auto; padding: 0 18px; }

/* ════════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════════ */
.header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  height: 70px;
}
.brand { display: inline-flex; align-items: center; }
.brand__logo { height: 38px; width: auto; display: block; }
.header-back {
  font-size: 13px;
  opacity: .6;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: opacity .15s;
}
.header-back:hover { opacity: 1; }

/* ════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════ */
.edu-hero {
  background: var(--black);
  color: var(--white);
  padding: 4rem 0 3.5rem;
  border-bottom: 3px solid var(--red);
  position: relative;
  overflow: hidden;
}
/* Patrón de puntos sutil */
.edu-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.edu-hero__inner {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}
.edu-hero__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}
.edu-hero__title {
  font-family: var(--font-title);
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  line-height: 1;
  letter-spacing: .5px;
  margin-bottom: 1rem;
}
.edu-hero__title em {
  font-style: normal;
  color: var(--yellow);
}
.edu-hero__sub {
  font-size: 15px;
  opacity: .8;
  max-width: 480px;
  line-height: 1.65;
}
.edu-hero__stat-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-end;
  flex-shrink: 0;
}
.edu-stat {
  text-align: right;
}
.edu-stat__num {
  display: block;
  font-family: var(--font-title);
  font-size: 2.8rem;
  line-height: 1;
  color: var(--yellow);
}
.edu-stat__label {
  display: block;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: .55;
  margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════
   FILTROS
   ════════════════════════════════════════════════════════════ */
.edu-filters {
  background: var(--muted);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 70px;
  z-index: 9;
}
.edu-filters__inner {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.edu-filters__inner::-webkit-scrollbar { display: none; }

.filter-btn {
  flex-shrink: 0;
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: all .15s ease;
  white-space: nowrap;
}
.filter-btn:hover {
  border-color: rgba(0,0,0,.25);
}
.filter-btn.is-active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ════════════════════════════════════════════════════════════
   LISTADO PRINCIPAL
   ════════════════════════════════════════════════════════════ */
.edu-main {
  padding: 2rem 18px 5rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ════════════════════════════════════════════════════════════
   TARJETA DE ARTÍCULO (ACORDEÓN)
   ════════════════════════════════════════════════════════════ */
.edu-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, border-color .2s ease;
  /* Número de artículo como watermark */
  position: relative;
}
.edu-card::before {
  content: attr(data-num);
  font-family: var(--font-title);
  font-size: 7rem;
  line-height: 1;
  color: var(--text);
  opacity: .03;
  position: absolute;
  top: 10px;
  right: 18px;
  pointer-events: none;
  user-select: none;
}
.edu-card:hover {
  box-shadow: var(--shadow-md);
}
.edu-card.is-open {
  border-color: var(--red);
  box-shadow: var(--shadow-md);
}
.edu-card.is-filtered-out {
  display: none;
}

/* ── Trigger (cabecera clickeable) ── */
.edu-card__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  color: var(--text);
  transition: background .15s;
}
.edu-card__trigger:hover {
  background: var(--muted);
}
.edu-card.is-open .edu-card__trigger {
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.edu-card__trigger-left { flex: 1; min-width: 0; }

.edu-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.edu-card__time {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: .5px;
}

.edu-card__title {
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  line-height: 1.15;
  letter-spacing: .3px;
  margin-bottom: 8px;
}
.edu-card__teaser {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.55;
  margin: 0;
}

/* ── Flecha ── */
.edu-card__arrow {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: transform .25s ease, background .15s, border-color .15s;
  background: var(--white);
}
.edu-card.is-open .edu-card__arrow {
  transform: rotate(180deg);
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* ── Cuerpo del artículo (acordeón) ── */
.edu-card__body {
  overflow: hidden;
  /* La animación de altura se maneja con max-height en JS */
  max-height: 0;
  transition: max-height .4s cubic-bezier(.4,0,.2,1);
}
.edu-card__body[hidden] {
  display: block !important; /* override hidden para que la transición funcione */
  visibility: hidden;
}
.edu-card__body.is-expanding,
.edu-card__body.is-open {
  visibility: visible;
}

.edu-card__content {
  padding: 28px 28px 24px;
  border-top: 1px solid var(--border);
}

/* ── Tipografía del contenido ── */
.edu-card__content p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 1.1rem;
}
.edu-card__content p:last-child { margin-bottom: 0; }

.edu-card__content h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: .3px;
  margin: 1.75rem 0 .75rem;
  color: var(--black);
  position: relative;
  padding-left: 14px;
}
.edu-card__content h3::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 1.1em;
  background: var(--red);
  border-radius: 2px;
}

.edu-card__content ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.edu-card__content ul li {
  font-size: 15px;
  line-height: 1.65;
  padding-left: 18px;
  position: relative;
  color: var(--text);
}
.edu-card__content ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--red);
  font-size: 13px;
  top: 2px;
}

.edu-card__content em { font-style: italic; }
.edu-card__content strong { font-weight: 700; }

/* ── CTA al final de cada artículo ── */
.edu-card__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding: 16px 20px;
  background: var(--muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.edu-card__cta-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

/* ════════════════════════════════════════════════════════════
   TAGS DE CATEGORÍA
   ════════════════════════════════════════════════════════════ */
.edu-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.edu-tag--red    { background: var(--red);    color: var(--white); }
.edu-tag--yellow { background: var(--yellow); color: #3a2000; }
.edu-tag--black  { background: var(--black);  color: var(--white); }

/* ════════════════════════════════════════════════════════════
   BOTONES (reutiliza los de la web principal)
   ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--red); color: var(--white); }
.btn--primary:hover { opacity: .88; }
.btn--sm { padding: 7px 16px; font-size: 12px; }

/* ════════════════════════════════════════════════════════════
   ESTADO VACÍO
   ════════════════════════════════════════════════════════════ */
.edu-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
}

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
.edu-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  background: var(--muted);
}
.edu-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}
.edu-footer__inner a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   ANIMACIÓN DE ENTRADA DE TARJETAS
   ════════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.edu-card {
  animation: fadeUp .35s ease both;
}
.edu-card:nth-child(1) { animation-delay: .05s; }
.edu-card:nth-child(2) { animation-delay: .12s; }
.edu-card:nth-child(3) { animation-delay: .19s; }
.edu-card:nth-child(4) { animation-delay: .26s; }
.edu-card:nth-child(5) { animation-delay: .33s; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .edu-hero__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .edu-hero__stat-col {
    flex-direction: row;
    align-items: flex-end;
    gap: 2rem;
  }
  .edu-stat { text-align: left; }
  .edu-card__trigger { padding: 18px 16px; gap: 10px; }
  .edu-card__content { padding: 20px 16px; }
  .edu-card__cta { flex-direction: column; align-items: flex-start; gap: 10px; }
  .brand__logo { height: 34px; }
}

/* ── Print: ocultar lo que no es contenido ── */
@media print {
  .header, .edu-filters, .edu-hero, .edu-card__cta,
  .edu-card__arrow, .filter-btn, .edu-footer { display: none !important; }
  .edu-card__body { max-height: none !important; visibility: visible !important; }
  .edu-card__body[hidden] { visibility: visible !important; }
  .edu-card { border: none; box-shadow: none; page-break-inside: avoid; }
}
