/* =========================================================
   BRICS YSF — About pages
   (about-us.php, about-dst.php, about-nias.php, brics-sti-coordinating-ministries.php)
   Loaded after home.css by header.php. Uses the colour and font tokens from home.css.
   ========================================================= */

/* ---------- Page title band ---------- */

.page-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: flex-end;
    background: var(--navy);
    color: #fff;
}
.page-hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center 30%;
}
.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(8, 18, 36, 0.96) 0%, rgba(8, 18, 36, 0.86) 45%, rgba(8, 18, 36, 0.55) 100%),
        linear-gradient(0deg, rgba(8, 18, 36, 0.6), rgba(8, 18, 36, 0) 60%);
}
.page-hero-inner {
    padding-block: 56px 48px;
}
.page-hero h1 {
    max-width: 860px;
    margin: 0;
    color: #fff;
    font-size: clamp(2.3rem, 5vw, 3.8rem);
    line-height: 1.05;
}
.page-eyebrow {
    margin: 0 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c5);
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
    font-size: 0.82rem;
}
.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.65);
}
.breadcrumb li + li::before {
    content: "›";
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    line-height: 1;
}
.breadcrumb a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}
.breadcrumb a:hover {
    color: var(--c5);
    text-decoration: underline;
}
.breadcrumb [aria-current] {
    color: #fff;
    font-weight: 600;
}

.brics-bar {
    display: flex;
    height: 5px;
}
.brics-bar span {
    flex: 1;
}
.brics-bar span:nth-child(1) { background: var(--c1); }
.brics-bar span:nth-child(2) { background: var(--c2); }
.brics-bar span:nth-child(3) { background: var(--c3); }
.brics-bar span:nth-child(4) { background: var(--c4); }
.brics-bar span:nth-child(5) { background: var(--c5); }

/* ---------- Section switcher (links on 3 pages, tabs on About Us) ---------- */

.section-bar {
    position: sticky;
    top: 84px;
    z-index: 40;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 24px -22px rgba(12, 27, 51, 0.5);
}
.section-bar-list {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.section-bar-list::-webkit-scrollbar {
    display: none;
}
.section-bar-list a,
.section-bar-list [role="tab"] {
    position: relative;
    flex: none;
    padding: 1.05rem 1.1rem;
    border: 0;
    background: none;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s;
}
.section-bar-list a::after,
.section-bar-list [role="tab"]::after {
    content: "";
    position: absolute;
    left: 1.1rem;
    right: 1.1rem;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.25s;
}
.section-bar-list a:hover,
.section-bar-list [role="tab"]:hover {
    color: var(--navy);
}
.section-bar-list a[aria-current="page"],
.section-bar-list [role="tab"][aria-selected="true"] {
    color: var(--navy);
}
.section-bar-list a[aria-current="page"]::after,
.section-bar-list [role="tab"][aria-selected="true"]::after {
    transform: scaleX(1);
}

/* ---------- Main + sidebar layout ---------- */

.about-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    align-items: start;
    padding-block: 48px 88px;
}
.about-main {
    display: grid;
    gap: 24px;
    min-width: 0;
}
.tab-panel {
    display: grid;
    gap: 24px;
}
.tab-panel[hidden] {
    display: none;
}
.panel-title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: var(--navy);
}

.content-card {
    padding: clamp(24px, 3.5vw, 40px);
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 24px 40px -36px rgba(12, 27, 51, 0.5);
}
.card-title {
    position: relative;
    margin: 0 0 1.25rem;
    padding-bottom: 0.9rem;
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    color: var(--navy);
}
.card-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 3px;
    border-radius: 3px;
    background: var(--accent);
}

.prose p {
    margin: 0 0 1em;
    color: #3f4a5a;
    font-size: 1.02rem;
    line-height: 1.75;
}
.prose p:last-child {
    margin-bottom: 0;
}
.prose p.prose-lead {
    font-family: var(--serif);
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    line-height: 1.45;
    color: var(--navy);
}

.card-figure {
    margin: calc(-1 * clamp(24px, 3.5vw, 40px)) calc(-1 * clamp(24px, 3.5vw, 40px)) 28px;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--paper-2);
}
.card-figure img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center 35%;
}

/* DST: departments that grew from DST */
.legacy {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 14px;
    margin: 1.75rem 0;
}
.legacy-origin {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.3rem;
    padding: 1.4rem;
    border-radius: 14px;
    background: var(--navy);
    color: #fff;
    overflow: hidden;
}
.legacy-origin::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 5px;
    background: linear-gradient(
        90deg,
        var(--c1) 0 20%,
        var(--c2) 20% 40%,
        var(--c3) 40% 60%,
        var(--c4) 60% 80%,
        var(--c5) 80% 100%
    );
}
.legacy-year {
    font-family: var(--serif);
    font-size: 2.8rem;
    line-height: 1;
    color: var(--c5);
}
.legacy-origin strong {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.25;
}
.legacy-origin > span:last-child {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}
.legacy-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.legacy-grid li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.95rem 1rem;
    border-radius: 12px;
    background: var(--paper);
    border: 1px solid var(--line);
}
.legacy-grid abbr {
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent-dark);
}
.legacy-grid span {
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
}

.pull-quote {
    margin: 0 0 1.75rem;
    padding: 1.1rem 1.4rem;
    border-left: 4px solid var(--accent);
    border-radius: 0 12px 12px 0;
    background: var(--paper);
    font-family: var(--serif);
    font-size: 1.2rem;
    font-style: italic;
    line-height: 1.45;
    color: var(--navy);
}

.role-list {
    display: grid;
    gap: 10px;
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
}
.role-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    font-weight: 600;
    line-height: 1.45;
    transition: border-color 0.2s, background 0.2s;
}
.role-list li:hover {
    border-color: var(--accent);
    background: var(--paper);
}
.role-letter {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--c5);
    font-family: var(--serif);
    font-style: italic;
}

.evolution {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 16px;
    margin-top: 1.75rem;
}
.evolution-then {
    padding: 1.4rem;
    border-radius: 14px;
    background: var(--paper);
}
.evolution-now {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 1.4rem;
    border-radius: 14px;
    background: var(--navy);
    list-style: none;
}
.evolution-now li {
    position: relative;
    padding-left: 1.4rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
    line-height: 1.5;
}
.evolution-now li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c3);
}

.callout {
    position: relative;
    padding: clamp(24px, 3.5vw, 40px);
    border-radius: var(--radius);
    background: var(--navy);
    color: #fff;
    overflow: hidden;
}
.callout::before {
    content: "";
    position: absolute;
    right: -90px;
    top: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 137, 43, 0.35), transparent 70%);
}
.callout p {
    position: relative;
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.15rem, 1.9vw, 1.4rem);
    line-height: 1.5;
}
.callout-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.callout-columns p {
    padding-top: 1rem;
    border-top: 2px solid rgba(255, 255, 255, 0.18);
    font-family: var(--sans);
    font-size: 0.97rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.88);
}

/* NIAS mission */
.mission-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: mission;
}
.mission-list li {
    counter-increment: mission;
    display: flex;
    gap: 1.1rem;
    align-items: baseline;
    padding: 1.1rem 1.25rem;
    border-radius: 12px;
    background: var(--paper);
    font-weight: 600;
    line-height: 1.55;
}
.mission-list li::before {
    content: counter(mission, decimal-leading-zero);
    flex: none;
    font-family: var(--serif);
    font-size: 1.5rem;
    color: var(--accent-dark);
}

/* Ministries */
.ministry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.ministry-card {
    --flag: var(--navy);
    position: relative;
    padding: 1.6rem 1.6rem 1.75rem;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--line);
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
}
.ministry-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 5px;
    background: var(--flag);
}
.ministry-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.ministry-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}
.ministry-brazil { --flag: var(--c4); }
.ministry-russia { --flag: var(--c1); }
.ministry-india { --flag: var(--c3); }
.ministry-china { --flag: var(--c2); }
.ministry-south-africa { --flag: var(--c5); }
.ministry-country {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1rem;
    font-size: 1.6rem;
    color: var(--navy);
}
.ministry-flag {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--flag);
}
.ministry-card address {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-style: normal;
    line-height: 1.5;
    color: var(--muted);
}
.ministry-card address strong {
    margin-bottom: 0.2rem;
    color: var(--ink);
    font-size: 1rem;
}

/* ---------- Sidebar ---------- */

.about-sidebar {
    display: grid;
    gap: 20px;
}
.side-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--line);
}
.side-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1rem;
    font-size: 1.35rem;
    color: var(--navy);
}
.side-title::before {
    content: "";
    width: 4px;
    height: 1.1em;
    border-radius: 4px;
    background: var(--accent);
}
.doc-list {
    margin: 0 -0.5rem;
    padding: 0;
    list-style: none;
}
.doc-list a {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.6rem 0.5rem;
    border-radius: 10px;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.doc-list a:hover {
    background: var(--paper);
    color: var(--accent-dark);
}
.doc-icon {
    position: relative;
    flex: none;
    width: 22px;
    height: 26px;
    margin-top: 1px;
    border-radius: 3px 8px 3px 3px;
    background: #fdecea;
    border: 1.5px solid #d9534f;
}
.doc-icon::after {
    content: "PDF";
    position: absolute;
    left: 50%;
    bottom: 3px;
    transform: translateX(-50%);
    font-size: 6.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #c0392b;
}

.side-contact {
    background: var(--navy);
    border-color: transparent;
    color: rgba(255, 255, 255, 0.82);
}
.side-contact .side-title {
    color: #fff;
}
.contact-block + .contact-block {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.contact-block p {
    margin: 0;
}
.contact-org {
    margin-bottom: 0.4rem !important;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c5);
}
.contact-name {
    font-family: var(--serif);
    font-size: 1.2rem;
    color: #fff;
}
.contact-role {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
}
.side-contact address {
    margin: 0.6rem 0;
    font-size: 0.88rem;
    font-style: normal;
    line-height: 1.55;
}
.contact-lines {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.contact-lines li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.88rem;
}
.contact-lines a {
    color: #fff;
    text-decoration: none;
    word-break: break-word;
}
.contact-lines a:hover {
    color: var(--c5);
    text-decoration: underline;
}
.ci {
    flex: none;
    width: 16px;
    height: 16px;
    background: var(--c3);
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}
.ci-phone {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E");
}
.ci-mail {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5-8-5V6l8 5 8-5z'/%3E%3C/svg%3E");
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
    .about-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 24px;
    }
    .legacy {
        grid-template-columns: 1fr;
    }
    .legacy-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .about-layout {
        grid-template-columns: 1fr;
    }
    .about-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
    .callout-columns {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

@media (max-width: 680px) {
    .page-hero {
        min-height: 220px;
    }
    .page-hero-inner {
        padding-block: 36px 32px;
    }
    .page-hero::before {
        background: linear-gradient(90deg, rgba(8, 18, 36, 0.94), rgba(8, 18, 36, 0.8));
    }
    .section-bar {
        top: 70px;
    }
    .section-bar-list a,
    .section-bar-list [role="tab"] {
        padding: 0.9rem 0.8rem;
        font-size: 0.88rem;
    }
    .about-layout {
        padding-block: 28px 56px;
    }
    .about-sidebar,
    .evolution,
    .ministry-grid,
    .legacy-grid {
        grid-template-columns: 1fr;
    }
    .card-figure {
        aspect-ratio: 16 / 9;
    }
    .role-list li {
        align-items: flex-start;
    }
}

/* About BRICS YSF 2026: event details note */
.event-note {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
    padding: 1.5rem 1.6rem;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--line);
    border-left: 5px solid var(--c3);
}
.event-note p {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--navy);
}
.event-note-icon {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--navy);
    position: relative;
}
.event-note-icon::before {
    content: "";
    position: absolute;
    inset: 11px;
    background: var(--c5);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 680px) {
    .event-note {
        flex-direction: column;
        gap: 0.85rem;
    }
}

/* Documents card: title + sort buttons */
.side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.side-head .side-title {
    margin: 0;
}
