/* ============================================================
   tsa-layout.css — Shared Header + Navbar + Footer styles
   Single source of truth for the TSA site chrome (EN + AR).
   Loaded by every page. Do NOT duplicate these rules inline.
   ============================================================ */

/* ---------- Anti-shift: always reserve scrollbar space ----------
   Pages with little content have no scrollbar; long pages do.
   That ~15px difference shifts the centered navbar sideways
   when navigating. Forcing the gutter keeps every page identical. */
html {
    scrollbar-gutter: stable;
    overflow-y: scroll;          /* fallback for browsers without scrollbar-gutter */
}

/* Normalize body margin — some pages set margin:0 inline, others rely on
   style.css which doesn't, causing an ~8px shift. Force it everywhere. */
body {
    margin: 0;
}

/* ---------- Logo ---------- */
.navbar-brand .logo {
    height: 80px;
    width: auto;
}
.navbar-brand {
    padding: 0;
}
@media (max-width: 576px) {
    .navbar-brand .logo {
        height: 55px;
    }
}

/* ---------- Sticky navbar + scroll shadow (pro touch) ---------- */
.navbar.navbar-expand-lg {
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: box-shadow 0.3s ease, padding 0.3s ease;
}
.navbar.navbar-expand-lg.tsa-scrolled {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12) !important;
}

/* ---------- Consistent vertical alignment for ALL nav items ----------
   Dropdown carets, the Donate button's padding/margin, and plain links
   can otherwise sit at slightly different heights. Force them to align. */
.navbar-nav {
    align-items: center;
}
.navbar-nav .nav-item {
    display: flex;
    align-items: center;
}
.navbar-nav .nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    line-height: 1.5;            /* same line box for plain + dropdown links */
}
/* Dropdown caret: keep it on the same baseline as the text */
.navbar-nav .dropdown-toggle::after {
    vertical-align: middle;
    margin-top: 0;
}
/* The lang switch and donate button must center on the same row too */
.navbar-nav .nav-item .lang-switch {
    line-height: 1.5;
}

/* ---------- Active link highlight ----------
   IMPORTANT: changing font-weight makes the word wider, which shifts
   the whole centered navbar between pages. So we DO NOT bold the active
   link. Instead we indicate active with color + an underline that does
   NOT affect layout width (absolutely positioned). Zero reflow ever.
   The Donate button is excluded (it has its own bordered style). */
.navbar-nav .nav-link.tsa-active:not(.custom-btn) {
    color: #227fba !important;
    font-weight: 400;            /* keep normal weight = no width change */
}
.navbar-nav .nav-link.tsa-active:not(.custom-btn)::before {
    content: "";
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    bottom: -2px;
    height: 2px;
    background: #227fba;
    border-radius: 2px;
}
.dropdown-item.tsa-active {
    color: #227fba !important;
    font-weight: 700;
    background: rgba(34, 127, 186, 0.08);
}

/* Donate button: remove the stray top margin from style.css so it sits
   vertically centered with the rest of the items (no more offset). */
.navbar-expand-lg .navbar-nav .nav-link.custom-btn {
    margin-top: 0;
}

/* ---------- Language switch ---------- */
.lang-switch {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
}
.lang-option {
    cursor: pointer;
    padding: 4px 6px;
    color: #555;
    transition: all 0.3s ease;
}
.lang-option:hover {
    color: #227fba;
}
.lang-option.active {
    color: #227fba;
    font-weight: 700;
}
.lang-switch .divider {
    margin: 0 4px;
    color: #aaa;
}

/* ---------- RTL dropdown alignment ---------- */
[dir="rtl"] .dropdown-menu {
    text-align: right;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    font-family: Arial, sans-serif;
    color: #fff;
}

.footer-top {
    background: #2f2f33;
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
    padding: 60px 80px;
}
.footer-col h4 {
    margin-bottom: 15px;
    font-size: 18px;
}
.footer-col ul {
    list-style: none;
    padding: 0;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul li a {
    color: #fff;
    text-decoration: none;
}
.footer-col ul li a:hover {
    text-decoration: underline;
}
.logo-col {
    text-align: center;
}
.logo-col h3 {
    margin: 10px 0 0;
}
.logo-col .tagline {
    display: block;
    font-size: 14px;
    letter-spacing: 1px;
    margin-bottom: 20px;
}
.logo-col p {
    max-width: 420px;
    line-height: 1.6;
    text-align: start;
}
.footer-logo {
    max-width: 80px;
}

/* Newsletter form */
.footer-col form label {
    display: block;
    margin-bottom: 4px;
}
.footer-col input {
    width: 100%;
    padding: 12px;
    border: none;
    margin: 10px 0 20px;
    border-radius: 4px;
}
.footer-col button {
    background: #227fba;
    color: #fff;
    border: none;
    padding: 14px;
    width: 100%;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.25s ease;
}
.footer-col button:hover {
    background: #1b6898;
}

/* Newsletter inline status message (pro touch) */
.footer-newsletter-msg {
    font-size: 13px;
    margin: -10px 0 10px;
    min-height: 18px;
    display: block;
}
.footer-newsletter-msg.ok  { color: #6ee7a8; }
.footer-newsletter-msg.err { color: #ffb4b4; }

/* Middle bar */
.footer-middle {
    background: #227fba;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 80px;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-middle a {
    color: #fff;
    margin-inline-start: 15px;
    text-decoration: none;
    font-size: 14px;
}
.footer-middle a:hover {
    text-decoration: underline;
}

/* Bottom bar */
.footer-bottom {
    background: #1b6898;
    text-align: center;
    padding: 15px 40px;
    font-size: 13px;
}

/* Footer responsive */
@media (max-width: 900px) {
    .footer-top {
        grid-template-columns: 1fr;
        padding: 40px 20px;
        gap: 30px;
        text-align: center;
    }
    .logo-col p {
        margin: 0 auto;
        text-align: center;
    }
    .footer-middle {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }
    .footer-middle a {
        margin: 0 8px;
    }
}

/* ---------- FOUC / layout-shift guard ---------- */
#tsa-header:empty {
    min-height: 142px;   /* topbar (~42) + navbar (~100) reserve */
}
@media (max-width: 991px) {
    #tsa-header:empty { min-height: 96px; }
}
