/* ==========================================================================
   Jóvenes Fieide Canarias — Sistema de diseño
   Basado en el Manual de Diseño JFC
   Tipografías: Montserrat (títulos/subtítulos) · Inter (texto/detalles)
   ========================================================================== */

:root {
  /* Colores principales */
  --ice-blue:   #b3c4de;   /* Pantone 543 C */
  --ocean-blue: #2575aa;   /* Pantone 7689 C */
  --white:      #ffffff;

  /* Colores de fondo */
  --bg-dark:    #1a1a1a;   /* Pantone Black 7C */
  --black:      #000000;   /* Pantone Black 6C */

  /* Derivados */
  --ocean-blue-dark: #1d5e8a;
  --ink: #1a1a1a;
  --muted: #5a6b80;
  --line: rgba(26, 26, 26, 0.10);

  --header-h: 76px;
  --maxw: 1200px;

  --font-title: 'Montserrat', system-ui, sans-serif;
  --font-body:  'Inter', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* seguridad anti-scroll horizontal */
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Tipografía -------------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-title); line-height: 1.08; }
h1 { font-weight: 800; font-size: clamp(2.4rem, 6vw, 4.2rem); text-transform: uppercase; letter-spacing: -0.01em; }
h2 { font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.8rem); text-transform: uppercase; }
h3 { font-weight: 700; font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
.eyebrow { font-family: var(--font-body); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.78rem; color: var(--ocean-blue); }
.quote { font-style: italic; color: var(--muted); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

/* Botones ----------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-title);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 0.85rem 1.7rem;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
/* Botón de sección aún no publicada: se ve, pero no lleva a ningún sitio */
.btn--soon { opacity: 0.55; cursor: default; }
.btn--soon:hover { transform: none; }
.btn--light { background: var(--white); color: var(--ink); }
.btn--ocean { background: var(--ocean-blue); color: var(--white); }
.btn--outline { background: transparent; border-color: var(--white); color: var(--white); }
.btn--outline-dark { background: transparent; border-color: var(--ocean-blue); color: var(--ocean-blue); }

/* ==========================================================================
   HEADER / NAV  (inyectado por layout.js)
   ========================================================================== */
/* Reserva el espacio del header (se inyecta por JS) para evitar parpadeo al navegar */
#site-header { min-height: var(--header-h); background: var(--bg-dark); }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-dark);
  height: var(--header-h);
  display: flex; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
/* La cabecera usa todo el ancho de la barra (el menú completo no cabe en 1200px) */
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; width: 100%; max-width: none; }

/* Panel que agrupa navegación + acciones (se vuelve overlay en móvil) */
.nav-panel { display: flex; align-items: center; gap: 1.2rem; margin-left: auto; }

/* Logo */
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--white); flex: 0 0 auto; }
/* max-width:none anula el img{max-width:100%} global: sin él, el flex puede
   comprimir el ancho manteniendo la altura fija y el logo sale deformado */
.brand__logo { height: 44px; width: auto; max-width: none; display: block; object-fit: contain; }
.site-footer .brand__logo { height: 52px; }
.nav__link .ext, .dropdown .ext { font-size: 0.7em; opacity: 0.7; }
.brand__mark { width: 38px; height: 38px; flex: 0 0 auto; }
.brand__text { font-family: var(--font-title); line-height: 1; }
.brand__text b { display: block; font-weight: 800; font-size: 1.25rem; }
.brand__text span { display: block; font-weight: 600; font-size: 0.62rem; letter-spacing: 0.16em; color: var(--ice-blue); }
.brand__text span i { font-style: normal; font-weight: 400; opacity: .8; }

/* Navegación */
.nav { display: flex; align-items: center; gap: 0.1rem; }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: var(--white); font-family: var(--font-title); font-weight: 600;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.02em;
  padding: 0.55rem 0.55rem; border-radius: 6px; white-space: nowrap;
}
.nav__link:hover { background: rgba(255,255,255,0.08); color: var(--ice-blue); }
.nav__link .caret { font-size: 0.55rem; opacity: 0.7; transition: transform .2s; }
.nav__item:hover .caret { transform: rotate(180deg); }

/* Dropdown */
.dropdown {
  position: absolute; top: 100%; left: 0; min-width: 230px;
  background: var(--white); border-radius: 10px; padding: 0.5rem;
  margin-top: 0.4rem;
  box-shadow: 0 18px 40px rgba(0,0,0,0.25);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all .18s ease;
}
/* puente invisible para que no se cierre al bajar el ratón */
.dropdown::before { content: ""; position: absolute; top: -0.6rem; left: 0; right: 0; height: 0.6rem; }
.nav__item:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
/* los dos últimos desplegables se anclan a la derecha para no salir de pantalla */
.nav__item:nth-last-child(-n+2) .dropdown { left: auto; right: 0; }
.dropdown a {
  display: block; padding: 0.6rem 0.8rem; border-radius: 6px;
  font-size: 0.9rem; font-weight: 500; color: var(--ink);
}
.dropdown a:hover { background: var(--ice-blue); color: var(--ocean-blue-dark); }

/* Acciones (login / registro) */
.nav-actions { display: flex; align-items: center; gap: 0.5rem; flex: 0 0 auto; }
.nav-actions .btn { padding: 0.6rem 1.15rem; font-size: 0.72rem; border-radius: 999px; }
.nav-actions .btn--ghost { background: rgba(255,255,255,0.10); color: var(--white); border-color: rgba(255,255,255,0.18); }
.nav-actions .btn--ghost:hover { background: rgba(255,255,255,0.20); }

/* Blindaje del header: los temas de evento (evt-*) definen `a { color: inherit }`
   y pisaban el color de los enlaces/botones de la cabecera (sobre todo el botón
   blanco "Regístrate", que quedaba con texto claro e ilegible). Lo forzamos aquí. */
.site-header .nav__link { color: var(--white); }
.site-header .nav__link:hover { color: var(--ice-blue); }
.site-header .nav-actions .btn--light { color: var(--ink); }
.site-header .nav-actions .btn--ghost { color: var(--white); }
.site-header .dropdown a { color: var(--ink); }
.site-header .dropdown a:hover { color: var(--ocean-blue-dark); }

/* Prisma Fest destacado como entidad propia en el menú */
.nav__link--highlight {
  background: linear-gradient(90deg, #ff2e9a, #7b2ff7 55%, #20e3ff);
  color: #fff !important; border-radius: 999px; padding-left: 1rem; padding-right: 1rem;
  margin-left: 0.35rem; box-shadow: 0 4px 16px rgba(123,47,247,.35);
}
.nav__link--highlight:hover { color: #fff !important; filter: brightness(1.08); transform: translateY(-1px); }
.site-header .nav__link--highlight { color: #fff; }
@media (max-width: 1280px) {
  .nav__link--highlight { justify-content: flex-start; margin: 0.4rem 0; }
}

/* Secciones del menú aún no publicadas */
.nav__link.is-soon { opacity: 0.45; cursor: default; }
.nav__link.is-soon:hover { background: none; color: var(--white); }
.dropdown .is-soon {
  display: block; padding: 0.6rem 0.8rem; border-radius: 6px;
  font-size: 0.9rem; font-weight: 500; color: var(--ink); opacity: 0.45; cursor: default;
}
.dropdown .is-soon em, .site-footer .is-soon em {
  font-style: normal; font-size: 0.75em; text-transform: uppercase;
  letter-spacing: 0.06em; opacity: 0.8; margin-left: 0.3rem;
}
.site-footer .is-soon { display: block; color: rgba(255,255,255,0.4); font-size: 0.9rem; padding: 0.25rem 0; cursor: default; }

/* Toggle móvil */
.nav-toggle { display: none; background: none; border: 0; color: var(--white); cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--white); margin: 5px 0; transition: .2s; }

/* ==========================================================================
   HERO (home) — carrusel
   ========================================================================== */
.hero { position: relative; min-height: 620px; min-height: max(620px, calc(100svh - var(--header-h))); overflow: hidden; background: var(--black); }
.hero__slides { position: absolute; inset: 0; }
.hero__slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease;
  display: flex; align-items: center;
  background-size: cover; background-position: center;
}
.hero__slide.is-active { opacity: 1; }
.hero__slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,.15) 100%); }
/* Placeholders de imagen mientras no haya fotos reales */
.hero__slide--1 { background-image: linear-gradient(120deg, #0f2d44, #2575aa 60%, #4a90c8); }
.hero__slide--2 { background-image: linear-gradient(120deg, #102a3a, #1d5e8a 55%, #6f93b8); }
.hero__slide--3 { background-image: linear-gradient(120deg, #0b1f2e, #234e6e 60%, #b3c4de); }

.hero__inner { position: relative; z-index: 2; width: 100%; }
.hero__content { max-width: 640px; color: var(--white); }
.hero__kicker { font-family: var(--font-title); font-weight: 800; text-transform: uppercase; font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: 0.02em; }
.hero__title { font-size: clamp(3rem, 9vw, 6rem); line-height: 0.92; margin: 0.2rem 0 1rem; }
.hero__text { font-size: 1.15rem; max-width: 460px; margin-bottom: 1.8rem; }
.hero__ph { position: absolute; bottom: 1rem; right: 1.2rem; z-index: 3; font-size: 0.7rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.5); border: 1px dashed rgba(255,255,255,.35); padding: .3rem .6rem; border-radius: 4px; }

.hero__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,0.25); color: var(--white); font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.hero__arrow:hover { background: rgba(255,255,255,0.4); }
.hero__arrow--prev { left: 1rem; }
.hero__arrow--next { right: 1rem; }
.hero__dots { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 0.5rem; }
.hero__dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.4); cursor: pointer; }
.hero__dots button.is-active { background: var(--white); width: 26px; border-radius: 6px; }

/* ==========================================================================
   BLOQUE 3 COLUMNAS
   ========================================================================== */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); }
.trio__col { padding: clamp(2.5rem, 5vw, 4.5rem) 2rem; min-height: 320px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.trio__col h2 { margin-bottom: 1rem; }
.trio__col p { font-size: 1rem; }
.trio__col .btn { margin-top: 1.5rem; align-self: center; }
.trio__col--ocean { background: var(--ocean-blue); color: var(--white); }
.trio__col--white { background: var(--white); color: var(--ocean-blue); }
.trio__col--white p { color: var(--muted); }
.trio__col--ice   { background: var(--ice-blue); color: var(--ocean-blue-dark); }

/* ==========================================================================
   SECCIÓN OSCURA (Nuestra historia / genéricas)
   ========================================================================== */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section--dark { background: var(--bg-dark); color: var(--white); text-align: center; }
.section--dark .eyebrow { color: var(--ice-blue); }
.section--dark p { max-width: 720px; margin: 1.2rem auto 0; opacity: 0.85; }
.section--light { background: var(--white); }
.section--ice { background: var(--ice-blue); }
.section__head { text-align: center; max-width: 720px; margin: 0 auto 2.5rem; }
.section__head p { color: var(--muted); margin-top: 0.8rem; }

/* Tarjetas genéricas (páginas internas) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 1.8rem; transition: transform .15s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(37,117,170,0.12); }
.card h3 { color: var(--ocean-blue); margin-bottom: 0.6rem; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card__tag { display:inline-block; font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color: var(--ocean-blue); background: var(--ice-blue); padding:.25rem .6rem; border-radius:999px; margin-bottom: .9rem; }

/* Placeholder de imagen reutilizable */
.img-ph { background: repeating-linear-gradient(45deg, #eef2f8, #eef2f8 12px, #e3e9f3 12px, #e3e9f3 24px); border: 1px dashed var(--ice-blue); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: .1em; aspect-ratio: 16/10; }

/* ==========================================================================
   PAGE HERO (cabecera de páginas internas)
   ========================================================================== */
.page-hero { background: var(--ocean-blue); color: var(--white); padding: clamp(3rem, 7vw, 5rem) 0; position: relative; overflow: hidden; }
.page-hero::after { content:""; position:absolute; right:-80px; top:-80px; width:300px; height:300px; border-radius:50%; background: rgba(255,255,255,0.08); }
.page-hero .eyebrow { color: var(--ice-blue); }
.page-hero p { max-width: 620px; margin-top: 0.8rem; opacity: 0.9; }
.breadcrumb { font-size: 0.8rem; opacity: 0.8; margin-bottom: 0.6rem; }
.breadcrumb a:hover { text-decoration: underline; }

/* Páginas legales */
.legal { max-width: 820px; }
.legal .updated { font-style: italic; color: var(--muted); margin-bottom: 1.8rem; }
.legal h2 { font-family: var(--font-title); font-size: 1.3rem; font-weight: 700; text-transform: none; margin: 2.2rem 0 0.6rem; color: var(--ocean-blue); }
.legal p, .legal li { color: var(--muted); line-height: 1.7; }
.legal ul { margin: 0.6rem 0 0.6rem 1.2rem; }
.legal li { margin-bottom: 0.4rem; }
.legal a { color: var(--ocean-blue); text-decoration: underline; }
.legal strong { color: var(--ink); }

/* ==========================================================================
   FOOTER  (inyectado por layout.js)
   ========================================================================== */
.site-footer { background: var(--black); color: var(--white); padding: 3.5rem 0 1.5rem; }
.site-footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { font-family: var(--font-title); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.08em; margin-bottom: 1rem; color: var(--ice-blue); }
.site-footer a { display: block; color: rgba(255,255,255,0.75); font-size: 0.9rem; padding: 0.25rem 0; }
.site-footer a:hover { color: var(--white); }
.site-footer__brand p { color: rgba(255,255,255,0.6); font-size: 0.88rem; margin-top: 0.8rem; max-width: 280px; }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 2.5rem; padding-top: 1.5rem; font-size: 0.82rem; color: rgba(255,255,255,0.5); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; }
.site-footer__credit a { color: rgba(255,255,255,0.7); font-weight: 600; }
.site-footer__credit a:hover { color: var(--ice-blue); }
@media (max-width: 560px) { .site-footer__bottom { justify-content: center; text-align: center; } }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Trío apilado y footer a 2 columnas */
@media (max-width: 980px) {
  .trio { grid-template-columns: 1fr; }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
}

/* === Menú hamburguesa (panel lateral) — hasta 1080px === */
@media (max-width: 1280px) {
  .nav-toggle { display: block; z-index: 110; }

  .nav-panel {
    position: fixed;
    top: var(--header-h);
    right: 0;
    width: min(340px, 86vw);
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    margin-left: 0;
    background: var(--bg-dark);
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 1.2rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .28s ease;
    box-shadow: -14px 0 40px rgba(0,0,0,0.45);
  }
  body.nav-open .nav-panel { transform: translateX(0); }

  .nav { flex-direction: column; align-items: stretch; gap: 0.1rem; width: 100%; }
  .nav__item { width: 100%; }
  .nav__link { justify-content: space-between; padding: 0.85rem 0.9rem; font-size: 0.95rem; }

  /* Desplegables como acordeón */
  .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; background: rgba(255,255,255,0.05);
    margin: 0.15rem 0 0.4rem; min-width: 0; left: auto; right: auto;
    padding: 0 0.3rem 0 0.8rem;
    max-height: 0; overflow: hidden;
    transition: max-height .28s ease, padding .28s ease;
  }
  .dropdown::before { display: none; }
  .nav__item.open .dropdown { max-height: 420px; padding: 0.3rem 0.3rem 0.3rem 0.8rem; }
  .nav__item.open .caret { transform: rotate(180deg); }
  .dropdown a { color: var(--ice-blue); padding: 0.7rem 0.6rem; }

  /* Acciones a lo ancho, al pie del panel */
  .nav-actions {
    flex-direction: column; gap: 0.6rem; width: 100%;
    margin-top: 1rem; padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .nav-actions .btn { width: 100%; text-align: center; padding: 0.85rem; font-size: 0.85rem; }

  /* Animación X del botón */
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* === Móvil pequeño === */
@media (max-width: 640px) {
  .site-footer .container { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero { min-height: 520px; }
  .hero__arrow { width: 40px; height: 40px; font-size: 1.2rem; }
  .hero__arrow--prev { left: 0.5rem; }
  .hero__arrow--next { right: 0.5rem; }
  .trio__col { min-height: 240px; padding: 2.5rem 1.5rem; }
  .section { padding: 3rem 0; }
  .page-hero { padding: 2.5rem 0; }
  .cards { gap: 1rem; }
}
