/* ==========================================================================
   framework.css - additions to the old safferhelp.com style.css, which is
   kept byte-for-byte unchanged: the hamburger menu drawer - pin open on
   desktop, pop-up on mobile (same behaviour as JudeMed.AI / NutraLife).
   Site colours only.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Header row: logo left, hamburger right, on every screen size
   (overrides the old <=1024px column layout that existed for the long menu)
   -------------------------------------------------------------------------- */

header .header-content {
    flex-direction: row;
    flex-wrap: nowrap;
    text-align: left;
}

.nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.6rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    margin-left: auto;
    line-height: 0;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-toggle-bar {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--us-white);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease, width 0.2s ease;
    transform-origin: center;
}

/* Bars turn into an X while the drawer is open or pinned */
body.nav-open .nav-toggle .nav-toggle-bar:nth-child(1),
body.nav-pinned .nav-toggle .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.nav-open .nav-toggle .nav-toggle-bar:nth-child(2),
body.nav-pinned .nav-toggle .nav-toggle-bar:nth-child(2) {
    opacity: 0;
    width: 0;
}
body.nav-open .nav-toggle .nav-toggle-bar:nth-child(3),
body.nav-pinned .nav-toggle .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Backdrop: dims the page while the pop-up drawer is open (not when pinned) */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

body.nav-open .nav-overlay {
    opacity: 1;
    pointer-events: all;
}

/* Right-side drawer: SA green with a gold edge */
.site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 270px;
    background: #004d20;
    border-left: 4px solid var(--sa-gold);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    /* style.css styles every <nav> as the old top menu (flex-grow, right/centre
       aligned, width 100% at <=1024px); undo that for the drawer. */
    flex-grow: 0;
    justify-content: flex-start;
    padding: 1.25rem 1.25rem 2rem;
    overflow-y: auto;
    box-shadow: -6px 0 28px rgba(0, 0, 0, 0.35);
}

body.nav-open .site-nav,
body.nav-pinned .site-nav {
    transform: translateX(0);
}

.nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    min-height: 2.5rem;
}

.nav-pin,
.nav-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    color: var(--us-white);
    line-height: 0;
}

/* Pin: desktop only */
.nav-pin {
    display: none;
    opacity: 0.5;
    transition: opacity 0.15s ease, color 0.15s ease, transform 0.25s ease;
}

.nav-pin:hover { opacity: 0.9; }

body.nav-pinned .nav-pin {
    color: var(--sa-gold);
    opacity: 1;
    transform: rotate(45deg);
}

.nav-close {
    opacity: 0.6;
    margin-left: auto;
    transition: opacity 0.15s ease;
}

.nav-close:hover { opacity: 1; }

@media (min-width: 769px) {
    .nav-pin { display: block; }
    /* Pinned: the pin (or the hamburger) closes it, so the X is hidden */
    body.nav-pinned .nav-close { display: none; }
    /* Pinned: the page makes room for the drawer */
    body.nav-pinned { padding-right: 270px; }
}

/* Drawer links: same labels and order as the old top menu, one per line
   (style.css makes "nav ul" a wrapping flex row - reset it here). */
.site-nav ul {
    display: block;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav li {
    margin: 0;
}

.site-nav a {
    display: block;
    color: var(--us-white);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.6rem 0.7rem;
    border-radius: 4px;
    white-space: normal;
    transition: background 0.3s, color 0.2s;
}

.site-nav a:hover,
.site-nav a:focus {
    background-color: rgba(255, 255, 255, 0.2);
}

.site-nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--sa-gold);
    font-weight: bold;
}


@media (max-width: 768px) {
    .site-nav { width: min(85vw, 320px); }
}

/* Refugee News group: the link expands its list of the latest articles */
.site-nav .nav-group > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.nav-group.open .nav-chevron {
    transform: rotate(-135deg);
}

.site-nav .nav-sub {
    display: none;
    margin: 0.2rem 0 0.4rem 0.7rem;
    padding-left: 0.6rem;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.site-nav .nav-group.open .nav-sub {
    display: block;
}

.site-nav .nav-sub a {
    font-size: 0.9rem;
    font-weight: normal;
    padding: 0.45rem 0.6rem;
    opacity: 0.9;
}

.site-nav .nav-sub a.current {
    color: var(--sa-gold);
    font-weight: bold;
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Splash screen (homepage): shown once per tab session. header.php adds
   .splash-seen to <html> before the page is drawn when this tab has already
   seen it, so it never flashes up again on "Home".
   -------------------------------------------------------------------------- */

html.splash-seen #splash-screen {
    display: none;
}

/* --------------------------------------------------------------------------
   Video briefing box in Refugee News articles (video_credit.php): credits
   Colonel Chris Wyatt and links his video and channel.
   -------------------------------------------------------------------------- */

.video-credit {
    background: var(--us-white);
    border-radius: 8px;
    padding: 1.8rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border-left: 6px solid var(--us-red);
    border-top: 1px solid #f1d4da;
}

.video-credit-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--us-red);
    margin-bottom: 0.9rem;
}

/* Small red "play" badge drawn in CSS (no external icon) */
.video-credit-play {
    width: 30px;
    height: 21px;
    border-radius: 5px;
    background: var(--us-red);
    position: relative;
    flex-shrink: 0;
}

.video-credit-play::after {
    content: "";
    position: absolute;
    left: 12px;
    top: 5px;
    border-style: solid;
    border-width: 5.5px 0 5.5px 9px;
    border-color: transparent transparent transparent var(--us-white);
}

.video-credit p {
    margin-bottom: 0.8rem;
    color: #444;
}

.video-credit .video-credit-title {
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
}

.video-credit .video-credit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.2rem;
    margin-bottom: 0;
}

.video-credit .affiliate-link {
    margin-top: 0;
}

.video-credit-subscribe {
    color: var(--us-blue);
    font-weight: bold;
    text-decoration: underline;
}

.video-credit-subscribe:hover {
    color: var(--us-red);
}

/* --------------------------------------------------------------------------
   Sub-headings inside the brand-equivalents table (sastuff.html), e.g.
   "Pantry & Cooking". Lighter than the column header row.
   -------------------------------------------------------------------------- */

.equivalents-table tr.table-group th {
    background-color: #e8eef7;
    color: var(--us-blue);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0.7rem 1.2rem;
    border-top: 2px solid var(--us-blue);
}

/* --------------------------------------------------------------------------
   Step-by-step flows in articles (e.g. news-6: register / report): numbered
   boxes with arrows, side by side on wide screens, stacked on phones.
   -------------------------------------------------------------------------- */

.content-block ol.flow {
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem;
    list-style: none;
    margin: 1.2rem 0 1.5rem;
    padding: 0;
}

.flow-step {
    position: relative;
    flex: 1 1 140px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: #f0f4f8;
    border: 2px solid var(--us-blue);
    border-radius: 8px;
    padding: 1.6rem 0.9rem 0.9rem;
    margin: 0;
    font-size: 0.88rem;
    color: #444;
}

.flow-step strong {
    color: var(--us-blue);
    font-size: 0.95rem;
}

.flow-num {
    position: absolute;
    top: -0.9rem;
    left: 0.8rem;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: var(--us-blue);
    color: var(--us-white);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Result of a flow: full-width green box below the steps */
.content-block p.flow-result {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 2px solid var(--sa-green);
    background: #e2f9e9;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin: -0.4rem 0 1.5rem;
    font-size: 0.9rem;
}

.content-block p.flow-result .flow-num {
    position: static;
    flex-shrink: 0;
    background: var(--sa-green);
}

.content-block p.flow-result strong {
    color: var(--sa-green);
}

/* Arrow to the next step */
.flow-step:not(:last-child)::after {
    content: "\2192";
    position: absolute;
    right: -1.35rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--us-red);
    font-weight: bold;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .content-block ol.flow { flex-direction: column; }
    .flow-step:not(:last-child)::after {
        content: "\2193";
        right: auto;
        left: 50%;
        top: auto;
        bottom: -1.5rem;
        transform: translateX(-50%);
    }
}

/* Two-way choice ("lost money?" / "no money lost?") */
.flow-branches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.flow-branch {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border: 2px solid var(--us-blue);
    border-radius: 8px;
    padding: 1rem;
    background: var(--us-white);
    font-size: 0.9rem;
    color: #444;
}

.flow-branch strong {
    color: var(--us-blue);
}

.flow-branch.flow-branch-danger {
    border-color: var(--us-red);
    background: #fdecec;
}

.flow-branch.flow-branch-danger strong {
    color: var(--us-red);
}
