/* =========================================================
   ANDES · layout.css
   Contenedores, secciones, grillas, header y footer
   ========================================================= */

.container { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.container-narrow { width: min(820px, 100% - 32px); margin-inline: auto; }

.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head-row {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  flex-wrap: wrap; margin-bottom: 48px;
}
.section-head-row .section-head { margin-bottom: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.mt-lg { margin-top: 48px; }
.mt-md { margin-top: 24px; }

/* ---------- Header ---------- */
/* El header es zona de marca: negro en ambos temas, con la franja tricolor abajo */
.site-header {
  position: sticky; top: 0; z-index: 60; height: var(--header-h);
  background: rgba(0, 0, 0, .94); backdrop-filter: blur(10px);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--bo-red) 0 33.33%, var(--bo-yellow) 33.33% 66.66%, var(--bo-green) 66.66%);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { height: 46px; width: auto; object-fit: contain; }
.brand .media-empty.is-logo { width: 46px !important; }
.brand-sub {
  font-family: var(--font-head); font-size: .66rem; font-weight: 600; line-height: 1.35;
  letter-spacing: .16em; text-transform: uppercase; color: var(--gold);
  padding-left: 14px; border-left: 1px solid #2e2e2e;
}
.brand-sub small { display: block; color: #9a9a9a; letter-spacing: .1em; font-weight: 500; }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; color: var(--muted);
  transition: color .2s, background-color .2s;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn.menu-toggle { display: none; }

/* Icono del tema */
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

/* ---------- Encabezado de páginas internas (zona de marca con montañas) ---------- */
.page-hero { padding: 72px 0 190px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--accent-text); }
.page-hero h1 { margin-bottom: 0; }
.page-hero .lead { max-width: 560px; }

/* ---------- Footer (zona de marca) ---------- */
.site-footer { position: relative; overflow: hidden; padding: 64px 0 28px; }
.footer-logo { width: 220px; height: auto; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid h4 { font-size: 1rem; letter-spacing: .1em; margin-bottom: 14px; }
.footer-links a { display: block; color: var(--muted); font-size: .92rem; padding: 4px 0; transition: color .2s; }
.footer-links a:hover { color: var(--accent-text); }
.footer-about p { max-width: 320px; margin-top: 14px; font-size: .92rem; }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-bottom {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: .82rem; color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .main-nav.open { max-height: 480px; }
  .main-nav a { padding: 14px 16px; border-top: 1px solid var(--border); border-radius: 0; }
  .main-nav a.active { box-shadow: inset 3px 0 0 var(--accent); }
  .icon-btn.menu-toggle { display: grid; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .section { padding: 72px 0; }
  .grid-2, .grid-3, .split { grid-template-columns: 1fr; }
  .split { gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none !important; }
}

@media (max-width: 540px) {
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .page-hero { padding: 48px 0 150px; }
}

/* Con 7 enlaces en el menú, el subtítulo del logo se oculta en pantallas medianas */
@media (max-width: 1440px) {
  .site-header .brand-sub { display: none; }
}
