/* ===========================================================
IAEG PERU — Shared stylesheet
=========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
/* Color palette extracted from iaegperu.org */
--azul-oscuro: #0a1f33; /* Primary deep blue used by header and dark sections */
--azul-medio: #103152; /* Used for secondary backgrounds, buttons and blocks */
--dorado: #f2b41c; /* Gold/yellow for highlighted titles, active states and accents */
--blanco: #ffffff; /* Main page and card backgrounds */
--gris-claro: #f4f6f9; /* Soft background for alternate sections (.alt) */
--texto-oscuro: #1e293b; /* Primary high-legibility text */
--texto-suave: #64748b; /* Secondary text for descriptions */
--linea-sutil: rgba(15, 23, 42, 0.08); /* Subtle modern borders */

/* New header gray variable for easier maintenance */
--header-gray: #EDEFEA;

--serif: 'Fraunces', Georgia, serif;
--sans: 'Inter', -apple-system, Segoe UI, sans-serif;
--mono: 'IBM Plex Mono', monospace;
}

{ box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
margin: 0;
font-family: var(--sans);
color: var(--texto-oscuro);
background: var(--blanco);
line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0 0 .5em; }
p { margin: 0 0 1em; color: var(--texto-suave); }

.eyebrow {
font-family: var(--mono);
font-size: .72rem;
letter-spacing: .14em;
text-transform: uppercase;
color: var(--dorado);
display: flex;
align-items: center;
gap: .6em;
}
.eyebrow::before {
content: "";
width: 22px; height: 2px; background: var(--dorado); display: inline-block;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* ---------- Header / Nav (Adjusted to new light header) ---------- */
header.site {
position: sticky;
top: 0;
z-index: 50;
background: var(--header-gray); /* changed from var(--azul-oscuro) to header gray */
border-bottom: 1px solid rgba(10, 31, 51, 0.08);
color: var(--azul-oscuro);
}
.nav-row {
display: flex; align-items: center; justify-content: space-between;
padding: 16px 32px; max-width: 1120px; margin: 0 auto;
}
.nav-right { display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 40px; width: auto; }

/* Brand text switches to dark blue for readability on light header */
.brand-text { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; letter-spacing: .01em; color: var(--azul-oscuro); }
.brand-text span { display: block; font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; color: var(--dorado); text-transform: uppercase; font-weight: 400; }

/* International link styling adjusted for light background */
.intl-link {
display: flex; align-items: center; gap: 8px;
padding-left: 16px; margin-left: 4px; border-left: 1px solid rgba(10, 31, 51, 0.06);
flex-shrink: 0;
}
.intl-link img { height: 26px; width: auto; opacity: .95; transition: opacity .15s; }
.intl-link span { font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: rgba(10, 31, 51, 0.75); line-height: 1.2; max-width: 9ch; }
.intl-link:hover img { opacity: 1; }
@media (max-width: 960px) { .intl-link span { display: none; } .intl-link { padding-left: 10px; } }
@media (max-width: 600px) { .intl-link { display: none; } }

/* Navigation links now dark on light header; hover uses mid-blue accent */
nav.primary ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
nav.primary a {
font-size: .86rem; font-weight: 500; color: rgba(10, 31, 51, 0.88);
padding: 6px 2px; border-bottom: 2px solid transparent; transition: border-color .15s, color .15s;
}
nav.primary a:hover, nav.primary a.active { color: var(--azul-medio); border-color: var(--azul-medio); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--azul-oscuro); }

@media (max-width: 820px) {
nav.primary {
position: absolute; top: 100%; left: 0; right: 0; background: var(--header-gray);
border-bottom: 1px solid rgba(10, 31, 51, 0.06);
flex-direction: column; padding: 8px 32px 20px; display: none;
} nav.primary.open { display: block; }
nav.primary ul { flex-direction: column; gap: 2px; }
nav.primary li { border-bottom: 1px solid rgba(10, 31, 51, 0.06); }
nav.primary a { display: block; padding: 12px 0; color: var(--azul-oscuro); }
.nav-toggle { display: block; }
}

/* ---------- Strata Divider (keeps original accent colors) ---------- */
.strata {
height: 14px;
background:
linear-gradient(90deg, var(--dorado) 0 18%, transparent 18% 100%),
linear-gradient(90deg, var(--azul-medio) 0 34%, transparent 34% 100%),
var(--azul-oscuro);
background-size: 100% 100%;
opacity: .95;
}

/* ---------- Hero ---------- */
.hero {
background: var(--gris-claro);
padding: 96px 0 72px;
border-bottom: 1px solid var(--linea-sutil);
}
.hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); max-width: 14ch; color: var(--azul-oscuro); }
.hero p.lead { font-size: 1.1rem; max-width: 56ch; color: var(--texto-suave); }
.hero-media { margin-top: 48px; border-radius: 4px; overflow: hidden; position: relative; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); }
.hero-media img { width: 100%; height: min(60vh, 460px); object-fit: cover; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
section.alt { background: var(--gris-claro); }
.section-head { max-width: 60ch; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); color: var(--azul-oscuro); }

/* ---------- Card Grid ---------- */
.grid { display: grid; gap: 28px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.card {
background: var(--blanco);
border: 1px solid var(--linea-sutil);
border-radius: 6px;
overflow: hidden;
transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
transform: translateY(-4px);
box-shadow: 0 12px 20px -8px rgba(10,31,51,0.12);
}
.card img { height: 210px; object-fit: cover; }
.card .body { padding: 22px; }
.card h3 { font-size: 1.15rem; margin-bottom: .35em; color: var(--azul-oscuro); }
.card .meta { font-family: var(--mono); font-size: .72rem; color: var(--azul-medio); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .6em; font-weight: 500; }

/* ---------- Buttons (kept with site accent behavior) ---------- */
.btn {
display: inline-flex; align-items: center; gap: 8px;
font-family: var(--sans); font-weight: 600; font-size: .88rem;
padding: 13px 24px; border: 1px solid var(--azul-medio);
background: var(--azul-medio); color: var(--blanco);
border-radius: 4px;
transition: background .15s, color .15s, border-color .15s;
cursor: pointer;
}
.btn:hover { background: var(--dorado); color: var(--azul-oscuro); border-color: var(--dorado); }
.btn.ghost { background: transparent; color: var(--azul-medio); }
.btn.ghost:hover { background: var(--azul-medio); color: var(--blanco); }

/* ---------- Stats Block ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--linea-sutil); border-bottom: 1px solid var(--linea-sutil); }
.stat { flex: 1 1 200px; padding: 32px; border-left: 1px solid var(--linea-sutil); }
.stat:first-child { border-left: none; }
.stat .num { font-family: var(--serif); font-size: 2.2rem; color: var(--azul-medio); font-weight: 700; }
.stat .label { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-suave); }

/* ---------- Committee List ---------- */
.committee {
display: grid; grid-template-columns: 110px 1fr; gap: 24px;
padding: 26px 0; border-top: 1px solid var(--linea-sutil);
}
.committee:last-child { border-bottom: 1px solid var(--linea-sutil); }
.committee .code { font-family: var(--mono); color: var(--azul-medio); font-weight: 600; font-size: .85rem; padding-top: 4px; }

/* ---------- Events timeline ---------- */
.timeline-item {
display: grid; grid-template-columns: 140px 1fr; gap: 28px;
padding: 30px 0; border-top: 1px solid var(--linea-sutil);
}
.timeline-item:last-child { border-bottom: 1px solid var(--linea-sutil); }
.timeline-item .when { font-family: var(--mono); font-size: .82rem; color: var(--azul-medio); padding-top: 3px; font-weight: 500; }
.timeline-item .when strong { display: block; font-family: var(--serif); font-size: 1.3rem; color: var(--azul-oscuro); font-weight: 600; }

/* ---------- Footer (Kept dark basalt style with subtle links) ---------- */
footer.site { background: var(--azul-oscuro); color: var(--gris-claro); padding: 56px 0 28px; border-top: 4px solid var(--dorado); }
footer.site a { color: var(--blanco); opacity: .85; }
footer.site a:hover { color: var(--dorado); opacity: 1; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer-grid h4 { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--dorado); margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 20px; font-size: .78rem; color: var(--texto-suave); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Inner page header ---------- */
.page-head { background: var(--gris-claro); padding: 64px 0 48px; border-bottom: 1px solid var(--linea-sutil); }
.page-head h1 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); color: var(--azul-oscuro); }

/* ---------- Page header with photo ---------- */
.page-head.has-photo {
position: relative;
background-size: cover;
background-position: center;
color: var(--blanco);
overflow: hidden;
padding: 96px 0 64px;
}
.page-head.has-photo::before {
content: "";
position: absolute; inset: 0;
background: linear-gradient(180deg, rgba(10,31,51,.55) 0%, rgba(10,31,51,.88) 100%);
}
.page-head.has-photo .wrap { position: relative; z-index: 1; }
.page-head.has-photo h1 { color: var(--blanco); }
.page-head.has-photo .lead { color: rgba(255,255,255,.88); }
.page-head.has-photo .eyebrow { color: var(--dorado); }

/* ============================================
Additional blocks appended (kept and translated)
============================================ */

.news-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1.5rem;
margin-top: 2rem;
}

.news-card {
display: block;
text-decoration: none;
color: inherit;
border: 1px solid #e5e5e5;
border-radius: 10px;
overflow: hidden;
transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.news-card:hover {
transform: translateY(-3px);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.news-card img {
width: 100%;
height: 180px;
object-fit: cover;
display: block;
}

.news-card-body {
padding: 1rem;
}

.news-card-body h3 {
margin: 0 0 0.4rem;
font-size: 1.05rem;
line-height: 1.3;
}

.news-date {
font-size: 0.85rem;
opacity: 0.65;
margin: 0 0 0.5rem;
}

/* Individual post page */
.post {
max-width: 760px;
margin: 0 auto;
padding: 2rem 1rem;
}

.post-back a {
text-decoration: none;
font-size: 0.9rem;
opacity: 0.7;
}

.post-meta {
opacity: 0.65;
margin-top: -0.5rem;
}

.post-hero {
width: 100%;
max-height: 420px;
object-fit: cover;
border-radius: 10px;
margin: 1.5rem 0;
}

.post-body img {
max-width: 100%;
border-radius: 8px;
}

.post-body {
line-height: 1.7;
}
