/*
 * UAEFMA Newsroom v3 — institutional shell
 * Header, navigation, advertising frame and footer only.
 */
:root {
    --v3-ink: #0b1f33;
    --v3-ink-2: #18364f;
    --v3-green: #0d6e63;
    --v3-green-dark: #0d6e63;
    --v3-sand: #faf7f2;
    --v3-copper: #c59a3d;
    --v3-paper: #fff;
    --v3-mist: #f4f7f8;
    --v3-rule: #d7dfe4;
    --v3-muted: #5f6f7e;
    --en-sans: "Manrope", sans-serif;
    --en-serif: "Source Serif 4", serif;
    --ar-body: "IBM Plex Sans Arabic", sans-serif;
    --ar-head: "Noto Kufi Arabic", sans-serif;
}

body {
    color: var(--v3-ink);
    background: #faf7f2;
}

.lang-en { font-family: var(--en-sans); }
.lang-ar { font-family: var(--ar-body); }

.topbar {
    min-height: 40px;
    background: var(--v3-ink);
    color: #fff;
    border: 0;
}
.topbar-inner { min-height: 40px; }
.topbar-ticker-wrap { min-width: 0; }
.topbar-markets { min-height: 40px; overflow: hidden; }
.mkt-item {
    min-height: 40px;
    border-color: rgba(255,255,255,.14);
    padding-inline: clamp(12px, 1.8vw, 26px);
}
.mkt-label, .topbar-date { color: rgba(255,255,255,.82); }
.mkt-source { padding-inline: 12px; color: rgba(255,255,255,.56); font-size: 9px; white-space: nowrap; }
.mkt-delayed { color: #e6b455; font-weight: 600; }
.mkt-val { color: #fff; }
.topbar-meta { flex: 0 0 auto; }
.topbar-sep { color: rgba(255,255,255,.25); }
.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 5px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 4px;
    color: rgba(255,255,255,.5);
}
.language-switch .lang-btn {
    border: 0;
    padding: 1px 5px;
    background: transparent;
    color: rgba(255,255,255,.7);
}
.language-switch .lang-btn.is-current {
    color: #fff;
    background: var(--v3-green);
}

.site-header {
    min-height: 150px;
    /* Soft ivory, near-flat. The gradient only lifts the upper edge so the
       masthead reads as paper rather than a filled block. */
    background: linear-gradient(180deg, #fdfbf7 0%, #faf7f2 55%, #f7f2ea 100%);
    border-bottom: 1px solid #e8e1d8;
}
.hdr-inner {
    min-height: 150px;
    gap: clamp(1rem, 2.2vw, 2.75rem);
}
.hdr-brand {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 300px;
}
.hdr-logo-text {
    color: var(--v3-ink);
    font-family: var(--en-serif);
    font-size: clamp(46px, 4.5vw, 72px);
    letter-spacing: .025em;
}
.hdr-brand-divider {
    width: 4px;
    height: 42px;
    background: var(--v3-copper);
}
.hdr-newsroom {
    max-width: none;
    color: var(--v3-ink);
    font-family: var(--en-serif);
    font-size: 17px;
    line-height: 1.3;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.hdr-wing { max-width: 340px; }
.hdr-wing-name { color: var(--v3-ink); font-size: 14px; }
.hdr-wing-sup { color: var(--v3-muted); }
.nf-masthead__tools { display: flex; justify-content: flex-end; gap: 15px; margin-top: 14px; }
.nf-masthead__tools a { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--v3-rule); border-radius: 50%; color: var(--v3-ink); }

/* ── Left wing: official mark only ───────────────────────────────────────
   The artwork is genuinely transparent (71% of pixels) with dark multi-colour
   ink, so it needs a clean white ground to read crisply against the ivory
   masthead. Kept flat and squared-off — a white field, not a floating card. */
.hdr-wing--logo { justify-content: center; align-items: flex-start; }
.hdr-official-logo {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    text-decoration: none;
    /* The artwork is dark ink on transparency; the ivory masthead does not
       give it enough ground, so it keeps a white field. Same treatment as
       the footer plate, via tokens. */
    padding: 12px 18px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.hdr-official-logo img {
    height: clamp(46px, 4.6vw, 64px);   /* preserve aspect ratio, never stretched */
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
/* Only rendered when no managed logo exists — keeps the wing from collapsing. */
.hdr-official-logo__fallback {
    color: var(--v3-muted);
    font-size: clamp(10px, .78vw, 11.5px);
    line-height: 1.3;
    letter-spacing: .13em;
    text-transform: uppercase;
}

/* ── Right wing: chairman ──────────────────────────────────────────────── */
.hdr-wing--chairman {
    position: relative;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    text-align: end;
    padding-inline-start: clamp(16px, 1.8vw, 28px);
}
/* Short muted-gold rule: refined, and deliberately not full header height. */
.hdr-wing--chairman::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 48px;
    background: linear-gradient(180deg,
        rgba(197,154,61,0) 0%,
        rgba(197,154,61,.34) 24%,
        rgba(197,154,61,.34) 76%,
        rgba(197,154,61,0) 100%);
}
.hdr-chairman__title {
    color: var(--v3-copper);
    font-size: clamp(10px, .78vw, 11.5px);
    line-height: 1.3;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.hdr-chairman__name {
    color: var(--v3-ink);
    font-family: var(--en-serif);
    font-size: clamp(18px, 1.55vw, 22px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .005em;
    white-space: nowrap;
}

/* Footer sits on a dark ground — the white plate keeps the official logo
   legible even when no dark variant has been uploaded. */
.footer-logo--img {
    height: 40px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    display: block;
    padding: 8px 14px;
    background: var(--surface);
    border-radius: var(--radius);
    box-sizing: content-box;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 90;
    border-block: 1px solid var(--v3-rule);
    background: rgba(250,247,242,.97);
    box-shadow: none;
    backdrop-filter: blur(12px);
}
.nav-inner { min-height: 54px; }
.nav-list { gap: clamp(12px, 1.7vw, 28px); }
.nav-list a {
    color: var(--v3-ink-2);
    font-family: var(--en-sans);
    font-size: 11px;
    letter-spacing: .015em;
}
/* Desktop nav height. --nav-h drives the link box here and the sticky offsets
   in article.css, so raising the token keeps those in step. Everything is
   scoped above the mobile breakpoint: below it the nav is a drawer, which
   also reads --nav-h and must keep its existing metrics. Declared after the
   base rules above so it wins at equal specificity. */
@media (min-width: 769px) {
    :root { --nav-h: 60px; }
    .nav-inner { min-height: 60px; }
    .nav-list a { padding-block: 0; }  /* height comes from --nav-h; padding squeezed it */
    /* Refined 3px active rule, keeping the existing green accent. */
    .nav-list li a { border-bottom-width: 3px; }
}
.lang-ar .nav-list a { font-family: var(--ar-body); }
.nav-list a:hover, .nav-list a.is-active { color: var(--v3-green); }
.nav-search {
    width: 38px;
    height: 38px;
    border-color: var(--v3-rule);
    color: var(--v3-ink);
}

.breaking-bar {
    min-height: 38px;
    background: #a91e2c;
}
.brk-label { background: #881522; }

.sitewide-ad {
    padding-block: 14px;
    background: var(--v3-mist);
    border-bottom: 1px solid var(--v3-rule);
}
.sitewide-ad--footer {
    padding-block: 24px;
    border-block: 1px solid var(--v3-rule);
}
.sitewide-ad .ad-slot {
    max-width: 1200px;
    margin-inline: auto;
}

.ad-slot {
    border-color: #c9d3d9;
    background: #f7f9fa;
}
.ad-slot--leaderboard { min-height: 90px; }
.ad-slot--billboard { min-height: 160px; }
.ad-sponsored-label {
    color: #586775;
    font-family: var(--en-sans);
    font-weight: 700;
    text-transform: uppercase;
}
.ad-zone {
    padding-block: 18px;
    border-block: 1px solid #edf0f2;
}
.ad-zone + .ad-zone { border-top: 0; }

.site-footer {
    padding-top: clamp(42px, 6vw, 72px);
    background: var(--v3-ink) !important;
    color: #d8e1e7 !important;
    border-top: 5px solid var(--v3-green) !important;
}
.footer-grid {
    gap: clamp(28px, 4vw, 70px);
    padding-bottom: 48px;
}
.site-footer .footer-logo {
    color: #fff !important;
    font-size: 34px;
}
.site-footer .footer-brand p {
    max-width: 290px;
    color: #b9c7d0 !important;
    line-height: 1.7;
}
.site-footer h4 {
    margin-bottom: 16px;
    color: #fff !important;
    font-size: 12px;
    letter-spacing: .09em;
}
.site-footer li { margin-block: 8px; }
.site-footer a {
    color: #c9d5dc !important;
    font-size: 13px;
}
.site-footer a:hover { color: #fff !important; }
.site-footer .footer-language {
    display: inline-flex;
    margin-top: 14px;
    padding: 6px 11px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 4px;
    color: #fff !important;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.14) !important;
    background: #071727;
    color: #9fb0bb;
}
.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-block: 18px;
    font-size: 11px;
}
/* Discreet staff entrance — subdued, never a public CTA. */
.footer-admin-login {
    color: rgba(159,176,187,.55);
    text-decoration: none;
    font-size: 11px;
    white-space: nowrap;
    transition: color .15s;
}
.footer-admin-login:hover,
.footer-admin-login:focus-visible { color: #cfe0ea; text-decoration: underline; }

/* Tablet: all three columns stay. Everything scales down and the gaps tighten;
   the chairman divider is the first thing dropped, ahead of any content. */
@media (max-width: 1024px) {
    .topbar-markets .mkt-item:nth-child(n+4) { display: none; }
    .site-header, .hdr-inner { min-height: 116px; }
    .hdr-brand { min-width: 0; }
    .hdr-official-logo img { height: 46px; }
    .hdr-official-logo { padding: 9px 13px; }
    .hdr-chairman__name { font-size: 17px; }
    .hdr-chairman__title { font-size: 9.5px; letter-spacing: .12em; }
    .hdr-wing--chairman { padding-inline-start: 12px; }
    .hdr-wing--chairman::before { display: none; }
    .footer-grid { grid-template-columns: 1.4fr repeat(2, 1fr); }
}

@media (max-width: 680px) {
    .topbar { min-height: 38px; }
    .topbar-markets .mkt-item:nth-child(n+3), .topbar-date, .topbar-sep { display: none; }
    .language-switch { font-size: 10px; }
    .nf-masthead__tools { display: none; }
    .hdr-newsroom { font-size: 9px; }
    .site-nav { top: 0; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-bottom .container { flex-direction: column; }
}

/* Phone: responsive.css collapses .hdr-inner to a single centred column and
   hides both wings. Bring the mark back so the header still carries the
   official logo — stacked above the masthead — and drop the chairman block,
   which has no room here. Order is logo, UAEFMA, FINANCIAL NEWS. */
@media (max-width: 768px) {
    .hdr-wing--logo {
        display: flex;
        align-items: center;
        justify-content: center;
        max-width: 100%;
    }
    .hdr-wing--chairman { display: none; }
    .hdr-official-logo img { height: 38px; }
    .hdr-official-logo { padding: 7px 11px; }
    .site-header, .hdr-inner { min-height: 0; }
    .hdr-inner { row-gap: 8px; padding-block: 12px; }
}

/* ══════════════════════════════════════════════════════
   RELEASE POLISH — compact footer (was too tall / airy)
   ══════════════════════════════════════════════════════ */
.site-footer { padding-top: clamp(32px, 4vw, 48px); }
.footer-grid { gap: clamp(22px, 3vw, 44px); padding-bottom: 30px; }
.site-footer .footer-logo { font-size: 28px; }
.site-footer h4 { margin-bottom: 12px; }
.site-footer li { margin-block: 6px; }
.footer-bottom .container { padding-block: 14px; }
@media (max-width: 680px) {
    .site-footer { padding-top: 30px; }
    .footer-grid { gap: 26px 22px; padding-bottom: 22px; }
}
