:root {
    --bg: #ece9df;
    --bg-strong: #d9d4c5;
    --surface: #fffdf8;
    --surface-muted: #f4efe3;
    --surface-warm: #efe7d5;
    --ink: #1b1f1c;
    --ink-soft: #4f564f;
    --brand: #0f5f45;
    --brand-dark: #0a3e2d;
    --brand-soft: #1f7a5b;
    --accent: #b48a2b;
    --line: rgba(10, 30, 20, 0.12);
    --shadow: 0 18px 40px rgba(20, 31, 24, 0.12);
    --shadow-soft: 0 10px 24px rgba(20, 31, 24, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(180, 138, 43, 0.1), transparent 45%),
        var(--bg);
    line-height: 1.6;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: var(--brand-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

section a:visited {
    color: #254e9f;
}

.site-header {
    position: relative;
    z-index: 1;
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.07), transparent 45%),
        linear-gradient(180deg, var(--brand-dark), var(--brand));
    color: #fff;
    border-bottom: 4px solid var(--accent);
    box-shadow: 0 12px 26px rgba(8, 23, 16, 0.18);
}

.site-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 35%),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 18px,
            rgba(255, 255, 255, 0.035) 18px,
            rgba(255, 255, 255, 0.035) 36px
        );
    pointer-events: none;
    opacity: 0.7;
}

.header-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 22px;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 18px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.logo img {
    width: clamp(76px, 11vw, 118px);
    height: auto;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.18));
    flex: 0 0 auto;
}

.brand-text h4 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.1rem, 1rem + 1vw, 1.75rem);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    max-width: 14ch;
}

.site-nav {
    position: relative;
    z-index: 1;
    min-width: 0;
    width: 100%;
}

.site-nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.site-nav-summary {
    display: none;
}

.site-nav > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.site-nav li {
    margin: 0;
    min-width: 0;
}

.site-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    text-wrap: balance;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transform: translateY(-1px);
}

.page-home .site-nav li:nth-child(1) a,
.page-somos .site-nav li:nth-child(1) a,
.page-representacion .site-nav li:nth-child(3) a,
.page-informacion .site-nav li:nth-child(4) a,
.page-adif .site-nav li:nth-child(4) a,
.page-ibercal .site-nav li:nth-child(4) a,
.page-comunicados .site-nav li:nth-child(5) a,
.page-contacto .site-nav li:nth-child(6) a,
.page-enlaces .site-nav li:nth-child(7) a {
    background: #fff;
    border-color: #fff;
    color: var(--brand-dark);
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 22px auto 52px;
    display: grid;
    gap: 24px;
}

.panel {
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 4vw, 38px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), #fffefb);
    border: 1px solid rgba(16, 48, 36, 0.1);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 8px;
    background: linear-gradient(180deg, var(--accent), var(--brand));
}

.panel::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(180, 138, 43, 0.1), rgba(15, 95, 69, 0.12), transparent 72%);
}

.panel h1 {
    margin: 0 0 18px;
    font-size: clamp(1.9rem, 1.55rem + 1.4vw, 3rem);
    line-height: 1.08;
    letter-spacing: 0;
    text-wrap: balance;
}

.panel h2 {
    margin: 0 0 18px;
    font-size: clamp(1.55rem, 1.3rem + 1vw, 2.3rem);
    line-height: 1.1;
    letter-spacing: 0;
    text-wrap: balance;
}

.panel h3 {
    margin: 26px 0 14px;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--brand-dark);
}

.panel p {
    margin: 0 0 14px;
    color: var(--ink-soft);
    font-size: 1.02rem;
}

.intro-label {
    font-weight: 700;
    color: var(--brand-dark);
}

.panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.panel li {
    position: relative;
    margin: 0 0 12px;
    padding: 16px 18px 16px 26px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)),
        var(--surface-muted);
    border: 1px solid rgba(16, 48, 36, 0.08);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.panel li::before {
    content: "";
    position: absolute;
    top: 23px;
    left: 12px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(180, 138, 43, 0.16);
}

.panel li p:last-child,
.panel li a:last-child {
    margin-bottom: 0;
}

.panel li p {
    color: var(--ink);
}

.panel a {
    font-weight: 700;
}

.panel-hero {
    background:
        linear-gradient(135deg, rgba(15, 95, 69, 0.14), transparent 58%),
        linear-gradient(180deg, rgba(180, 138, 43, 0.08), transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), #fffdf7);
    min-height: 0;
    display: grid;
    align-content: start;
    padding-block: clamp(18px, 2.2vw, 24px);
}

.panel-hero::after {
    content: "";
    position: absolute;
    inset: 22px 24px 22px auto;
    width: min(32vw, 280px);
    background: url("sut001.png") center/contain no-repeat;
    opacity: 0.1;
    pointer-events: none;
}

.page-home .home-shell {
    grid-template-columns: 1fr;
}

.page-home #bienvenida {
    grid-column: 1 / -1;
}

.page-home #bienvenida p {
    max-width: 34rem;
    font-size: 1.08rem;
}

.page-home #quienes-somos,
.page-somos #bienvenida,
.page-comunicados #representacion,
.page-representacion #representacion,
.page-contacto #contacto,
.page-contacto #redes,
.page-informacion #informacion,
.page-enlaces #enlaces,
.page-adif #adif,
.page-ibercal #ibercal {
    backdrop-filter: blur(2px);
}

.page-home #quienes-somos ul,
.page-somos #bienvenida ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.page-home #quienes-somos li,
.page-somos #bienvenida li {
    margin: 0;
    height: 100%;
}

.page-representacion #representacion ul,
.page-informacion #informacion ul,
.page-contacto #contacto ul,
.page-contacto #redes ul,
.page-enlaces #enlaces ul,
.page-adif #adif ul,
.page-ibercal #ibercal ul {
    display: grid;
    gap: 12px;
}

.page-contacto .split-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-informacion #informacion ul {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.page-representacion #representacion li,
.page-informacion #informacion li {
    min-height: 100%;
}

.page-comunicados .archive-shell {
    max-width: 980px;
}

.page-comunicados #representacion h3 {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 95, 69, 0.08);
    border: 1px solid rgba(15, 95, 69, 0.12);
}

.page-comunicados #representacion ul {
    margin-bottom: 12px;
}

.page-comunicados #representacion li {
    margin: 0;
}

.page-adif #adif,
.page-ibercal #ibercal,
.page-enlaces #enlaces,
.page-representacion #representacion,
.page-informacion #informacion,
.page-somos #bienvenida {
    max-width: 980px;
    width: min(100%, 980px);
    justify-self: center;
}

.site-footer {
    position: relative;
    z-index: 1;
    padding: 22px 16px 28px;
    background: transparent;
    text-align: center;
}

.site-footer p {
    display: inline-block;
    margin: 0;
    padding: 14px 18px;
    background: rgba(10, 62, 45, 0.92);
    color: #fff;
    border-radius: 999px;
    font-size: 0.95rem;
    box-shadow: 0 10px 22px rgba(8, 23, 16, 0.18);
}

@media (max-width: 900px) {
    .site-nav > ul {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .page-home .home-shell,
    .page-contacto .split-shell,
    .page-home #quienes-somos ul,
    .page-somos #bienvenida ul {
        grid-template-columns: 1fr;
    }

    .panel-hero::after {
        width: 180px;
        inset: auto 20px 20px auto;
    }
}

@media (max-width: 640px) {
    .header-shell {
        width: min(100% - 24px, 1180px);
        padding-top: 20px;
        padding-bottom: 16px;
        gap: 14px;
    }

    .logo {
        align-items: center;
        gap: 12px;
    }

    .logo img {
        width: 62px;
    }

    .brand-text h4 {
        font-size: 1rem;
        max-width: 18ch;
    }

    .site-nav-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 44px;
        padding: 10px 14px;
        border: 1px solid rgba(255, 255, 255, 0.24);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
        font-weight: 700;
        cursor: pointer;
        user-select: none;
    }

    .site-nav-summary::after {
        content: "+";
        font-size: 1.15rem;
        line-height: 1;
    }

    .site-nav-toggle:checked + .site-nav-summary::after {
        content: "-";
    }

    .site-nav > ul {
        grid-template-columns: 1fr;
        gap: 10px;
        display: none;
    }

    .site-nav a {
        min-height: 42px;
        border-radius: 12px;
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    .site-nav-toggle:checked ~ ul {
        display: grid;
        padding-top: 12px;
    }

    .page-shell {
        width: min(100% - 24px, 1180px);
        margin-top: 16px;
        gap: 18px;
    }

    .panel {
        padding: 20px 18px;
    }

    .panel h1 {
        font-size: clamp(1.7rem, 8vw, 2.2rem);
    }

    .panel-hero {
        min-height: 0;
        padding-block: 16px 18px;
    }

    .panel-hero::after {
        width: 132px;
        inset: auto 14px 16px auto;
    }

    .panel li {
        padding-top: 14px;
        padding-bottom: 14px;
        padding-right: 14px;
    }
}
