/* ============================================
   The Opinions — SHARED STYLES
   Loaded on every page (homepage, form pages,
   about/contact/gallery, etc.)

   The header (.site-header) and footer
   (.footer / .footer-grid) below are the ONE
   version used everywhere — no per-page variant.

   home.css (homepage-only: hero, mission,
   transparency, pillars, involved) loads AFTER
   this file, only on index.html.
   ============================================ */

:root {
    /* Base palette matched directly to the QALB logo: pure white field,
       solid black outline/type, and the logo's exact flat red. */
    --paper: #FFFFFF;
    --paper-deep: #EFEFEF;
    --ink: #111111;
    --ink-soft: #4D4D4D;
    --ink-deep: #000000;
    --brick: #1A1A1A;
    /* darkest — primary actions */
    --brick-deep: #000000;
    /* pure black — hover states */
    --marigold: #8C8C8C;
    /* mid gray — was gold accent */
    --teal: #5C5C5C;
    /* mid-dark gray — was teal accent */
    --moss: #737373;
    /* lighter gray — was moss accent */
    --line: rgba(17, 17, 17, 0.16);
    --line-light: rgba(255, 255, 255, 0.2);


    --brick-tint: #E8E8E8;
    --brick-tint-strong: #C4C4C4;

    --spotlight: #F7F7F7;
    --brick-glow: rgba(0, 0, 0, 0.10);

    --font-display: "Zilla Slab", Georgia, serif;
    --font-body: "Karla", "Segoe UI", sans-serif;
    --font-urdu: "Noto Nastaliq Urdu", serif;

    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2.25rem;
    --space-5: 3.5rem;
    --space-6: 5rem;
    --space-7: 7rem;

    --radius-sm: 6px;
    --radius-md: 12px;
    --max-width: 1180px;
}

/* ---------- Reset & base type ---------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}

a,
button {
    touch-action: manipulation;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    color: var(--ink);
    margin: 0;
    line-height: 1.15;
    font-weight: 600;
}

p {
    margin: 0;
    color: var(--ink-soft);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

svg {
    display: block;
}

ul {
    margin: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ink);
    color: var(--paper);
    padding: 0.75rem 1.25rem;
    z-index: 200;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    left: 0;
}

:focus-visible {
    outline: 2.5px solid var(--brick);
    outline-offset: 3px;
}

/* ---------- Section headings (reusable anywhere) ---------- */

.section-head {
    max-width: 46ch;
    margin: 0 auto var(--space-5);
    text-align: center;
}

.section-head h2 {
    font-size: clamp(1.7rem, 2.6vw, 2.2rem);
    margin-bottom: var(--space-1);
}

.section-head p {
    font-size: 1.05rem;
}

.section-head-light h2 {
    color: var(--paper);
}

.section-head-light p {
    color: rgba(255, 255, 255, 0.75);
}

.accent-underline {
    position: relative;
    display: inline-block;
}

.accent-underline::after {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 0.06em;
    height: 0.14em;
    background: var(--brick);
    opacity: 0.35;
    border-radius: 2px;
    z-index: -1;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    border: 1.5px solid transparent;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    cursor: pointer;
}

.btn-lg {
    padding: 1rem 1.9rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--brick);
    color: var(--paper);
}

.btn-primary:hover {
    background: var(--brick-deep);
}

.btn-ghost-light {
    background: transparent;
    border-color: var(--line-light);
    color: var(--paper);
}

.btn-ghost-light:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--paper);
}

.btn-light {
    background: var(--paper);
    color: var(--ink);
}

.btn-light:hover {
    background: var(--paper-deep);
}

.btn-whatsapp {
    padding: 0.6rem 1.1rem;
    font-size: 0.85rem;
    background: transparent;
    border-color: var(--line);
    color: var(--ink-soft);
}

.btn-whatsapp:hover {
    border-color: var(--teal);
    color: var(--teal);
}

/* ============================================
   SHARED SITE HEADER — used on EVERY page
   ============================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
    padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0.9rem var(--space-3);
    position: relative;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-right: auto;
    min-width: 0;
    /* Keeps the logo/name visible above the mobile drawer (.site-nav is
       position:fixed and would otherwise paint over it). */
    position: relative;
    z-index: 5;
}

.brand-mark {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.2;
    color: var(--ink);
}

/* The drawer covers most of the header's width on narrow phones, so
   the full brand name has nowhere left to sit without overlapping it
   (there just isn't 200+px of clear header space left of the drawer
   edge). Hiding the text and keeping only the round logo avoids that —
   the drawer's own links already make the site clear. */
body.nav-open .brand-name {
    display: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.site-nav>a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ink-soft);
    padding: 0.4rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.site-nav>a:hover,
.site-nav>a.active {
    color: var(--brick);
    border-color: var(--brick);
}

/* "Our work" dropdown */

.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ink-soft);
    padding: 0.4rem 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.nav-dropdown-btn:hover {
    color: var(--brick);
    border-color: var(--brick);
}

.nav-dropdown-btn svg {
    transition: transform 0.18s ease;
}

.nav-dropdown.open .nav-dropdown-btn svg {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 28px rgba(17, 17, 17, 0.14);
    padding: 0.4rem;
    min-width: 180px;
    display: grid;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 50;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
    padding: 0.55rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.nav-dropdown-menu a:hover {
    background: var(--paper-deep);
    color: var(--brick);
}

.nav-dropdown-empty {
    display: block;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.header-cta {
    white-space: nowrap;
    padding: 0.65rem 1.3rem;
    font-size: 0.9rem;
}

/* main.js clones the Join Now/Chat buttons into #siteNav so the mobile
   drawer has them too. Hidden by default; only the mobile media query
   below turns them back on, so they never also show up in the normal
   desktop nav row. */
.nav-drawer-actions {
    display: none;
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    /* Keeps the hamburger/X icon visible above the mobile drawer, same
       reasoning as .brand above. */
    z-index: 5;
}

/* Dim page overlay behind the mobile drawer. Created dynamically by
   main.js (initNavToggle) and appended to <body>, so it doesn't need to
   exist in every page's HTML. Sits below .site-header (z-index 100) so
   the header stays fully visible and undimmed while it's up. */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 90;
}

.nav-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* Prevents the page behind the drawer from scrolling while it's open. */
body.nav-open {
    overflow: hidden;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span {
    top: 19px;
}

.nav-toggle span::before {
    top: -7px;
}

.nav-toggle span::after {
    top: 7px;
}

.nav-toggle[aria-expanded="true"] span {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] span::before {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span::after {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1040px) {
    .site-nav {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        height: 100dvh;
        width: min(80vw, 320px);
        margin: 0;
        background: var(--paper);
        border: none;
        border-left: 1px solid var(--line);
        border-radius: 0 0 0 20px;
        box-shadow: -18px 0 45px rgba(17, 17, 17, 0.24);
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        padding: calc(4.5rem + env(safe-area-inset-top, 0px)) var(--space-3) calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
        transform: translateX(100%);
        opacity: 1;
        pointer-events: none;
        transition: transform 0.3s ease;
        overflow-y: auto;
        /* Low on purpose: .site-nav lives inside .site-header (z-index
           100), so the drawer as a whole already renders above the
           backdrop and page content outside the header. This number only
           has to lose to .brand and .nav-toggle (z-index 5) so the logo,
           name and the close icon are never covered by the drawer. */
        z-index: 1;
    }

    .site-nav.open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .site-nav>a {
        padding: 0.85rem 0.9rem;
        border-radius: var(--radius-sm);
        border-bottom: none;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .site-nav>a:hover,
    .site-nav>a:focus-visible,
    .site-nav>a.active {
        background: var(--paper-deep);
        color: var(--brick);
    }

    .nav-dropdown {
        border-bottom: none;
    }

    .nav-dropdown-btn {
        width: 100%;
        justify-content: space-between;
        padding: 0.85rem 0.9rem;
        border-bottom: none;
        border-radius: var(--radius-sm);
    }

    .nav-dropdown-btn:hover,
    .nav-dropdown.open .nav-dropdown-btn {
        background: var(--paper-deep);
        color: var(--brick);
    }

    .nav-dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        background: var(--paper-deep);
        border-radius: var(--radius-sm);
        display: none;
        min-width: 0;
        margin: 0.2rem 0 0.5rem;
        padding: 0.3rem;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        /* The desktop rule .nav-dropdown.open .nav-dropdown-menu sets
           transform: translateX(-50%) translateY(0) to center the panel
           under the nav-dropdown-btn. It has higher specificity than the
           plain .nav-dropdown-menu { transform: none; } above, so on
           mobile it was still applying — shifting the (now full-width,
           static) panel left by half its own width and pushing it
           off-screen. Reset it explicitly here so mobile stays static. */
        display: grid;
        transform: none;
    }

    .nav-dropdown-menu a {
        padding: 0.7rem 0.8rem;
    }

    .header-actions {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    /* Join Now / WhatsApp buttons, cloned into the drawer by main.js
       since .header-actions itself stays hidden on mobile. Pinned to
       the bottom of the panel so the drawer always ends on a clear
       primary action instead of trailing off after the last link. */
    .nav-drawer-actions {
        margin-top: auto;
        padding-top: var(--space-3);
        border-top: 1px solid var(--line);
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
    }

    .nav-drawer-actions .btn {
        width: 100%;
    }
}

/* ---------- Tab bar (optional strip under the header — form pages only) ---------- */

.tab-bar {
    display: flex;
    gap: 0.3rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-3);
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-bar:empty {
    display: none;
    border-bottom: none;
}

.tab-bar a,
.tab-bar button {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.87rem;
    color: var(--ink-soft);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.tab-bar a:hover,
.tab-bar button:hover {
    color: var(--brick);
}

.tab-bar a.active,
.tab-bar button.active {
    color: var(--brick);
    border-color: var(--brick);
}

/* ---------- Generic page content wrapper (form pages, sub-pages) ---------- */

.content {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-3);
}

/* Small heading block form/sub-pages can use at the top of .content
   for a page-specific title/status line (the shared header no longer
   carries per-page text). */
.page-heading {
    margin-bottom: var(--space-3);
}

.page-heading h1 {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
}

.page-heading p {
    font-size: 0.9rem;
    color: var(--ink-soft);
}

/* ============================================
   SHARED FOOTER — one layout, used on EVERY page
   ============================================ */

.footer {
    background: linear-gradient(340deg, var(--brick) 0%, var(--brick-deep) 48%, var(--ink) 100%);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--space-6) var(--space-3) var(--space-3);
}

.footer-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: var(--space-4);
}

.footer-col h4 {
    color: var(--paper);
    font-size: 0.95rem;
    margin-bottom: var(--space-2);
}

.footer-col a {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 0.6rem;
    transition: color 0.18s ease;
}

.footer-col a:hover {
    color: var(--marigold);
}

.footer-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.7rem;
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.72);
    ;
}

.footer-gand {
    color: rgba(255, 255, 255, 0.72);
}

.footer-brand-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--paper);
    display: block;
    margin-bottom: 0.3rem;
}

.footer-forms-empty {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
    font-style: italic;
}

.footer-tagline {
    font-size: 0.9rem;
    max-width: 26ch;
}

.footer-social {
    display: flex;
    gap: 0.8rem;
    margin-top: var(--space-2);
}

.footer-social a {
    display: flex;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.72);
    transition: color 0.18s ease;
    padding: 10px;
    margin: -10px;
    border-radius: 50%;
}

.footer-social a:hover {
    color: var(--marigold);
}

.footer-bottom-inner {
    max-width: var(--max-width);
    margin: var(--space-4) auto 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding-top: var(--space-3);
    border-top: 1px solid var(--line-light);
    font-size: 0.85rem;
}

.footer-credit a {
    color: var(--marigold);
    font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .tab-bar {
        padding: 0 var(--space-2);
    }

    .content {
        padding: var(--space-2);
    }
}

@media (max-width: 600px) {
    .footer {
        padding: var(--space-4) var(--space-2) var(--space-2);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }

    .footer-brand-col,
    .footer-col:last-child {
        grid-column: 1 / -1;
    }

    .footer-col a {
        margin-bottom: 0.45rem;
    }

    /* Logo, name and tagline centered as a block on mobile instead of
       sitting left-aligned. */
    .footer-brand-col {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-tagline {
        max-width: 30ch;
    }

    .footer-bottom-inner {
        margin-top: var(--space-3);
        flex-direction: column;
        text-align: center;
        gap: 0.35rem;
    }
}

.is-urdu {
    direction: rtl;
    text-align: right;
    font-family: var(--font-urdu);
}

.is-urdu ul,
.is-urdu ol {
    padding-left: 0;
    padding-right: 24px;
}