/* ==========================================================================
   Filosofía Cotidiana – estilos del sitio (un solo archivo, sin dependencias)
   Colores y tamaños principales están en :root para cambiarlos en un solo lugar.
   ========================================================================== */

@font-face {
  font-family: "Noto Sans";
  src: url("../fonts/noto-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --verde: #086357;        /* cabecera */
  --verde-osc: #00453d;    /* bandas oscuras, títulos sobre blanco */
  --verde-vivo: #00635d;
  --azul: #084a63;
  --azul-med: #11597b;     /* bandas de videos / países */
  --azul-claro: #1f6984;
  --oro: #ffca00;          /* títulos sobre fondo oscuro */
  --naranja: #faaa31;      /* menú */
  --gris: #f4f6f4;
  --texto: #1d2b2a;
  --ancho: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font: 400 1rem/1.65 "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto); background: #fff;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--azul-claro); }
a:hover { color: var(--verde-vivo); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
p { margin: 0 0 1em; }
.wrap { width: min(100% - 2rem, var(--ancho)); margin-inline: auto; }
.sr-only, .solo-lectores {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.saltar { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 99; }
.saltar:focus { left: 0; }

/* ---------- Cabecera y menú (sin JavaScript) ---------- */
.cabecera { background: var(--verde); position: sticky; top: 0; z-index: 50; }
.cabecera .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 1rem; }
.logo img { width: 134px; height: auto; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu > ul { display: flex; gap: .25rem; }
.menu li { position: relative; }
.menu a { display: block; padding: .7rem .8rem; color: var(--naranja); text-decoration: none; font-weight: 600; font-size: .95rem; }
.menu a:hover, .menu a:focus-visible, .menu li.actual > a { color: #fff; }
.submenu {
  display: none; position: absolute; left: 0; top: 100%; min-width: 14rem;
  background: rgba(0, 69, 61, .97); border-radius: 0 0 6px 6px; padding: .4rem 0 !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}
.submenu a { color: #f4f6f4; font-weight: 400; padding: .5rem 1rem; }
.submenu a[aria-current] { color: var(--oro); }
.menu li:hover > .submenu, .menu li:focus-within > .submenu { display: block; }
.menu-chk, .menu-btn { display: none; }

@media (max-width: 860px) {
  .menu-btn {
    display: grid; place-items: center; width: 44px; height: 44px; background: var(--verde-osc);
    border-radius: 4px; cursor: pointer;
  }
  .barras, .barras::before, .barras::after { display: block; width: 20px; height: 2px; background: #fff; content: ""; position: relative; }
  .barras::before { top: -6px; position: absolute; }
  .barras::after { top: 6px; position: absolute; }
  .menu {
    display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .2); max-height: calc(100vh - 72px); overflow: auto;
  }
  .menu-chk:checked ~ .menu { display: block; }
  .menu > ul { display: block; }
  .menu a { color: var(--verde-osc); border-bottom: 1px solid #dfe5e3; padding: .8rem 1rem; }
  .menu li.actual > a { color: var(--verde-vivo); }
  .submenu { display: block; position: static; box-shadow: none; background: var(--gris); border-radius: 0; padding: 0 !important; }
  .submenu a { color: var(--verde-osc); padding-left: 2rem; }
  .submenu a[aria-current] { color: var(--verde-vivo); font-weight: 600; }
}

/* ---------- Secciones ---------- */
section { padding: 2.5rem 0; }
.plana { padding: 1.5rem 0; }
.plana h2, .plana h3 { color: var(--verde-osc); }

/* Portadas (hero) */
.hero, .hero-oscuro, .hero-azul { text-align: center; color: #fff; }
.hero h1, .hero-oscuro h1, .hero-azul h1 { color: var(--oro); font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 600; margin: 0; }
.hero p, .hero-oscuro p { color: #fff; font-size: 1.15rem; margin: .6rem 0 0; }
/* con ola blanca abajo (ediciones de Madre Tierra, Filosofía 2024, Artes) */
.hero { background: #386e68; padding: 5.5rem 0 7rem; position: relative; }
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 54px; background: #fff;
  clip-path: ellipse(60% 100% at 50% 100%);
}
.hero-oscuro { background: linear-gradient(var(--verde-osc) 20%, #002b26 100%); padding: 5rem 0 4rem; }
.hero-azul { background: linear-gradient(var(--verde-vivo), var(--azul)); padding: 1.8rem 0; }
.hero-azul .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.hero-azul figure { margin: 0; width: min(100%, 420px); }

/* Bandas de color */
.banda-video { background: linear-gradient(var(--azul-med), var(--azul)); color: #fff; padding: 3rem 0; }
.banda-paises { background: var(--azul-med); color: #fff; }
.banda-clara { background: var(--gris); color: var(--verde-osc); }
.banda-oscura { background: var(--verde-osc); color: #fafafa; padding: 4rem 0; }
.banda-video h2, .banda-video h3, .banda-paises h2, .banda-paises h3, .banda-oscura h2, .banda-oscura h3 { color: var(--oro); }
.banda-video a, .banda-oscura a { color: var(--oro); }
.banda-paises .texto, .banda-paises .texto p { color: #e8f1f4; font-size: .95rem; }
.banda-video > .wrap > figure { margin: 0 auto 2rem; width: min(100%, 300px); }
.banda-clara h2, .banda-clara h3 { color: var(--verde-osc); }

/* Rejillas y textos */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem 2rem; align-items: start; }
.col > figure { margin-bottom: 1rem; }
.col figure img { border-radius: 6px; width: 100%; }
.col h2 { font-size: 1.2rem; }
.texto { max-width: 70ch; }
.cols .texto, .banda-video .texto { max-width: none; }
.banda-video .texto p { margin-bottom: .4rem; }
.texto h3 { margin-top: 1.4em; }
figure { margin: 0 0 1.2rem; }
.principio { background: rgba(255, 255, 255, .6); border-left: 4px solid var(--verde); padding: .6rem 1rem; margin-bottom: .8rem; border-radius: 0 6px 6px 0; }
.principio h3 { margin: 0; font-size: 1.05rem; }
hr { border: 0; border-top: 1px solid rgba(0, 0, 0, .15); margin: 1.5rem 0; }
.boton { display: inline-block; background: var(--naranja); color: #1d2b2a; padding: .7rem 1.4rem; border-radius: 4px; text-decoration: none; font-weight: 600; }
.centro { text-align: center; }

/* Video responsive */
.video { position: relative; aspect-ratio: 16 / 9; max-width: 900px; margin: 0 auto 1rem; background: #000; border-radius: 6px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Acordeón (HTML <details>, sin JavaScript) */
.acordeon { margin: 0 0 6px; border-radius: 3px; overflow: hidden; background: #fff; color: var(--verde-vivo); }
.acordeon > summary {
  list-style: none; cursor: pointer; padding: .7rem 2.8rem .7rem 2.6rem; position: relative; font-weight: 600; color: #fff;
  background: linear-gradient(var(--azul) 85%, var(--azul-claro) 100%);
}
.acordeon > summary::-webkit-details-marker { display: none; }
.acordeon > summary::before { content: "+"; position: absolute; left: 1rem; font-size: 1.25rem; line-height: 1.4; }
.acordeon[open] > summary::before { content: "\2212"; }
.acordeon > summary::after {
  content: ""; position: absolute; right: 1.1rem; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s;
}
.acordeon[open] > summary::after { transform: rotate(45deg); }
.acordeon > summary:hover, .acordeon > summary:focus-visible { background: var(--azul-claro); }
.acordeon-cuerpo { padding: 1rem; }
.acordeon-cuerpo .texto { max-width: none; }

/* Galerías de fotos */
.galeria { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.galeria li { margin: 0; }
.galeria a { display: block; overflow: hidden; border-radius: 4px; background: #dfe8e6; aspect-ratio: 3 / 4; }
.galeria img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.galeria a:hover img { transform: scale(1.04); }

/* Pie */
.pie { background: var(--gris); text-align: center; padding: 1.6rem 1rem; font-size: .9rem; }
.pie p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Visor de fotos (assets/js/visor.js) */
.visor { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; overflow: hidden; }
.visor::backdrop { background: rgba(0, 20, 18, .88); }
.visor[open] { display: grid; place-items: center; }
.visor img { max-width: min(92vw, 1400px); max-height: 86vh; width: auto; height: auto; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.visor button { position: absolute; border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .15); border-radius: 50%; width: 56px; height: 56px; font-size: 38px; line-height: 1; }
.visor button:hover, .visor button:focus-visible { background: rgba(255, 255, 255, .3); }
.visor-x { top: 16px; right: 16px; background: rgba(0, 0, 0, .55); }
.visor-p { left: 12px; top: 50%; margin-top: -28px; background: rgba(0, 0, 0, .55); }
.visor-n { right: 12px; top: 50%; margin-top: -28px; background: rgba(0, 0, 0, .55); }
.visor.solo .visor-p, .visor.solo .visor-n { display: none; }
.visor-t { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: #fff; margin: 0; font-size: .9rem; }

@media (max-width: 600px) { .visor button { width: 52px; height: 52px; } .visor-p { left: 6px; } .visor-n { right: 6px; } .visor img { max-width: 100vw; max-height: 80vh; border-radius: 0; } }

/* ==========================================================================
   Páginas de edición: charlas en vivo y países (assets/js/edicion.js)
   ========================================================================== */
.boton--claro { background: transparent; color: #fff; border: 2px solid #fff; padding: calc(.7rem - 2px) calc(1.4rem - 2px); }
.boton--claro:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.hero-azul .cta { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .8rem; margin: .4rem 0 0; }
.hero-azul .cta .boton { margin: 0; }
[hidden] { display: none !important; }
#charlas, #paises { scroll-margin-top: 80px; }

/* Charlas en vivo */
.en-vivo { background: linear-gradient(var(--azul-med), var(--azul)); color: #fff; padding: 2.5rem 0 3rem; }
.en-vivo h2 { color: var(--oro); font-size: clamp(1.4rem, 3.5vw, 2rem); }
.sup { margin: 0 0 .3rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.charlas { display: grid; gap: 1.2rem; }
.charla + .charla { margin-top: 1.5rem; }
.charlas.js .charla + .charla { margin-top: 0; }
.charla-info { padding-top: .8rem; }
.charla-info .fecha { margin: 0; color: var(--oro); font-weight: 600; }
.charla-info h3 { color: #fff; font-size: 1.3rem; margin: .2rem 0 .3rem; }
.charla-info .presenta { margin: 0 0 .9rem; opacity: .92; }
.charla-info .presenta a { color: #fff; text-decoration-thickness: 2px; }
.en-vivo .video { max-width: none; margin: 0; }
.charlas-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; align-content: start; }
.charla-item {
  width: 100%; display: flex; gap: .75rem; align-items: center; text-align: left; position: relative; cursor: pointer;
  background: rgba(255, 255, 255, .08); border: 2px solid transparent; color: #fff; border-radius: 8px; padding: .5rem .6rem; font: inherit;
}
.charla-item:hover { background: rgba(255, 255, 255, .15); }
.charla-item[aria-current="true"] { border-color: var(--oro); background: rgba(255, 255, 255, .16); }
.charla-item img { width: 96px; height: 60px; flex: none; object-fit: cover; border-radius: 4px; }
.charla-txt { display: grid; gap: .1rem; min-width: 0; }
.charla-dia { color: var(--oro); font-weight: 600; font-size: .85rem; }
.charla-txt strong { font-size: .95rem; line-height: 1.3; }
.charla-txt em { font-style: normal; font-size: .85rem; opacity: .85; }
.estado { position: absolute; top: .45rem; right: .5rem; font-size: .7rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: rgba(255, 255, 255, .2); }
.estado-envivo { background: #d92d20; color: #fff; }
.estado-envivo::before { content: "\25CF  "; animation: parpadeo 1.2s infinite; }
.estado-proxima { background: var(--oro); color: #1d2b2a; }
@keyframes parpadeo { 50% { opacity: .3; } }
@media (min-width: 900px) {
  .charlas.js { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
  .charlas.js .charla { grid-column: 1; grid-row: 1; }
  .charlas.js .charlas-lista { grid-column: 2; grid-row: 1; }
}
@media (max-width: 899px) { .charla-txt strong { padding-right: 4.5rem; } }

/* Países */
.paises { padding: 2.5rem 0 3rem; }
.paises h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
.paises .nota { margin: 0 0 1.2rem; color: #e8f1f4; }
.pais { margin-bottom: 2rem; }
.pais h3 { color: var(--oro); font-size: 1.4rem; }
.paises-vacio { padding: 1.2rem; border: 2px dashed rgba(255, 255, 255, .4); border-radius: 8px; text-align: center; margin: 1rem 0 0; }
.paises-ui { margin-bottom: 1.2rem; }
.paises-ui.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { min-height: 44px; padding: .5rem 1.1rem; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .55); background: transparent; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.chip:hover { background: rgba(255, 255, 255, .15); }
.chip[aria-pressed="true"] { background: var(--oro); border-color: var(--oro); color: #1d2b2a; }
.selector-lab { display: block; font-weight: 600; margin-bottom: .4rem; }
.paises-ui select { width: min(100%, 420px); font: inherit; font-size: 1.1rem; padding: .8rem 1rem; border-radius: 8px; border: 0; color: #1d2b2a; background: #fff; min-height: 52px; }
.paises-ui.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.pais-card { display: grid; gap: .1rem; text-align: left; cursor: pointer; padding: 0 0 .7rem; border: 0; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .1); color: #fff; font: inherit; transition: transform .15s, background .15s; }
.pais-card:hover, .pais-card:focus-visible { transform: translateY(-3px); background: rgba(255, 255, 255, .2); }
.pais-card img, .pais-inicial { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--azul); display: grid; place-items: center; font-size: 2.2rem; color: var(--oro); margin-bottom: .5rem; }
.pais-card strong, .pais-n { padding: 0 .8rem; }
.pais-n { font-size: .85rem; opacity: .85; }
.hoja { border: 0; padding: 0; width: min(96vw, 1000px); max-height: 92vh; border-radius: 12px; background: var(--azul-med); color: #fff; overflow: auto; }
.hoja::backdrop { background: rgba(0, 20, 18, .8); }
.hoja-cab { position: sticky; top: 0; display: flex; justify-content: flex-end; padding: .6rem; background: var(--azul-med); z-index: 2; }
.hoja-x { width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .35); color: #fff; font-size: 34px; line-height: 1; cursor: pointer; }
.hoja-cuerpo { padding: 0 1.2rem 1.5rem; }
.hoja .pais { margin: 0; }
.pais .galeria { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.charla-info .presenta a { display: inline-block; padding: .6rem 0; }

/* Apertura directa de los archivos: enlace accesible en lugar del iframe. */
.youtube-local { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem; padding: 1rem; background: #102b3e; color: #fff; text-align: center; text-decoration: none; }
.youtube-local img { width: min(35%, 240px); max-height: 40%; object-fit: contain; border-radius: 6px; }
.youtube-local strong { background: #fff; color: #102b3e; border-radius: 2rem; padding: .65rem 1.2rem; }
.youtube-local span { max-width: 45ch; }
.youtube-local small { color: #e0edf5; }
.youtube-local:hover strong { background: #deb759; }
.youtube-local:focus-visible { outline: 4px solid #deb759; outline-offset: -4px; }
@media (max-width: 480px) { .youtube-local { gap: .35rem; font-size: .85rem; } .youtube-local img { max-height: 28%; } .youtube-local small { display: none; } }
