/* ========================================
   Malakwal.pk - Global CSS
   ======================================== */

/*
 * This block deliberately declares NO theme colours.
 *
 * appearance.php is required by header.php:488, i.e. BEFORE this file is
 * linked at header.php:493, and it already publishes every theme colour from
 * the admin's Appearance settings. Because this file loads SECOND, any
 * duplicate here wins the equal-specificity tie and silently overrides the
 * admin. That is exactly how --color-primary, --color-primary-hover,
 * --container-width and --border-radius were frozen at hardcoded values while
 * the Appearance settings appeared to do nothing in light mode.
 *
 * appearance.php is also the real fallback: it ships a complete default array
 * and keeps it if the settings query fails, so nothing is lost by removing the
 * copies here.
 *
 * Theme colours belong in appearance.php. This file is the stylesheet, not the
 * theme. Only non-theme values that appearance.php does not publish belong here.
 */

:root {
    --transition: 0.2s ease;
}

/*
 * SUPERSEDED - do not add colours here.
 *
 * Every property below is re-declared on `html[data-theme="dark"]` later in
 * this file (specificity 0,1,1 beats this block's 0,1,0), or by appearance.php
 * from the admin's Appearance settings. This slate palette therefore never
 * renders; it is left in place only so the values are not lost.
 *
 * It is kept as a warning rather than deleted: it is the second of five
 * competing theme blocks in this project, and chasing a colour that "does not
 * apply" through them is exactly how the dark-background bug was born.
 */
[data-theme="dark"] {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-surface-2: #334155;
    --color-text: #f8fafc;
    --color-text-muted: #94a3b8;
    --color-border: #334155;
    --color-primary: #4ade80;
    --color-primary-hover: #86efac;
    --color-header: #111827;
    --color-footer: #000000;
}

/* Reset */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-family) !important;
    line-height: 1.6;
    transition:
        background-color var(--transition),
        color var(--transition);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Global container */

.container {
    width: min(100% - 30px, var(--container-width));
    margin-inline: auto;
}

/* Header */

.site-header {
    background: var(--color-header);
    border-bottom: 1px solid var(--color-border);
    transition:
        background-color var(--transition),
        border-color var(--transition);
}

.site-header-inner {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.site-logo {
    color: var(--color-text);
    font-size: 24px;
    font-weight: 700;
    white-space: nowrap;
}

.site-logo:hover {
    color: var(--color-primary);
}

.main-nav {
    font-family: var(--font-family) !important;
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: 25px;
    font-family: var(--font-family);
}

.main-nav a {
    font-family: var(--font-family) !important;
    color: var(--color-text);
    font-weight: 600;
    font-family: var(--font-family);
}

.main-nav a:hover {
    color: var(--color-primary);
}

/* Theme button */

.theme-toggle {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    transition:
        background-color var(--transition),
        color var(--transition),
        border-color var(--transition);
}

.theme-toggle:hover {
    background: var(--color-surface-2);
}

/* Main */

.site-main {
    min-height: calc(100vh - 150px);
    padding: 50px 0;
}

/* Footer */

.site-footer {
    background: var(--color-footer);
    color: var(--color-text);
    padding: 35px 0;
    transition:
        background-color var(--transition),
        color var(--transition);
}

.site-footer a {
    color: var(--color-text);
}

/* Buttons */

.button {
    display: inline-block;
    border: 0;
    border-radius: var(--button-radius);
    background: var(--color-button);
    color: #ffffff;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 15px;
    transition: background-color var(--transition);
}

.button:hover {
    background: var(--color-button-hover);
    color: var(--color-text);
}

/* Forms */

input,
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

/* Cards */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 20px;
}

/* Mobile */

@media (max-width: 768px) {

    .site-header-inner {
        flex-wrap: wrap;
        padding: 15px 0;
    }

    .main-nav {
        width: 100%;
        flex-wrap: wrap;
        gap: 12px 18px;
    }

    .site-main {
        padding: 35px 0;
    }
}
/* =========================================================
   HEADER - DESKTOP
   ========================================================= */

.site-header-inner {
    min-height: 72px;
}

.site-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-logo img {
    width: auto;
    max-height: 48px;
    object-fit: contain;
}

.main-nav {
    flex: 1;
    justify-content: flex-start;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Search icon */

.header-search {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--input-radius);
    color: var(--color-text);
    font-size: 28px;
    line-height: 1;
}

.header-search:hover {
    background: var(--color-surface-2);
    color: var(--color-primary);
}

/* Login */

.header-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: var(--color-text);
    font-weight: 600;
}

.header-login:hover {
    background: var(--color-surface-2);
    color: var(--color-primary);
}

/* Register */

.header-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    background: var(--color-primary);
    color: #ffffff !important;
    font-weight: 600;
}

.header-register:hover {
    background: var(--color-primary-hover);
    color: #ffffff !important;
}

/* Account */

.header-account {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: var(--color-text);
    font-weight: 600;
}

/* Theme button */

.header-actions .theme-toggle {
    min-width: 40px;
    min-height: 40px;
    padding: 7px 10px;
}


/* =========================================================
   MOBILE MENU BUTTON
   ========================================================= */

.mobile-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.mobile-menu-toggle:hover {
    background: var(--color-surface-2);
}


/* =========================================================
   MOBILE MENU OVERLAY
   ========================================================= */

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* =========================================================
   MOBILE MENU DRAWER
   ========================================================= */

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: min(420px, 88vw);
    height: 100vh;
    z-index: 9999;
    overflow-y: auto;

    background: var(--color-bg);
    color: var(--color-text);

    transform: translateX(-100%);
    visibility: hidden;

    transition:
        transform 0.25s ease,
        visibility 0.25s ease;

    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.20);
}

.mobile-menu.active {
    transform: translateX(0);
    visibility: visible;
}


/* Drawer header */

.mobile-menu-header {
    min-height: 64px;
    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: var(--color-header);
    border-bottom: 1px solid var(--color-border);
}

.mobile-menu-header strong {
    font-size: 22px;
}

.mobile-menu-close {
    width: 42px;
    height: 42px;
    padding: 0;

    border: 0;
    background: transparent;

    color: var(--color-text);

    font-size: 38px;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;
}

.mobile-menu-close:hover {
    color: var(--color-primary);
}


/* =========================================================
   MOBILE MENU TABS
   ========================================================= */

.mobile-menu-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;

    border-bottom: 1px solid var(--color-border);

    background: var(--color-surface);
}

.mobile-menu-tab {
    min-height: 58px;

    border: 0;
    border-bottom: 3px solid transparent;

    background: transparent;
    color: var(--color-text-muted);

    font: inherit;
    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
}

.mobile-menu-tab:hover {
    color: var(--color-primary);
    background: var(--color-surface-2);
}

.mobile-menu-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: var(--color-bg);
}


/* =========================================================
   MOBILE MENU PANELS
   ========================================================= */

.mobile-menu-panel {
    display: none;
}

.mobile-menu-panel.active {
    display: block;
}


/* Every menu item gets a horizontal divider */

.mobile-menu-panel > a {
    min-height: 64px;

    display: flex;
    align-items: center;
    gap: 15px;

    padding: 0 22px;

    border-bottom: 1px solid var(--color-border);

    color: var(--color-text);

    font-size: 17px;
    font-weight: 500;

    background: var(--color-bg);
}

.mobile-menu-panel > a:hover {
    background: var(--color-surface);
    color: var(--color-primary);
}


/* Menu icons */

.menu-icon {
    width: 28px;
    min-width: 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: var(--color-text-muted);

    font-size: 21px;
    line-height: 1;
}

.mobile-menu-panel > a:hover .menu-icon {
    color: var(--color-primary);
}


/* =========================================================
   MOBILE USER PROFILE
   ========================================================= */

.mobile-user-profile {
    min-height: 76px !important;
    gap: 14px !important;
}

.mobile-user-avatar {
    width: 46px;
    height: 46px;
    min-width: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--color-surface-2);
    color: var(--color-text);

    font-size: 23px;
}

.mobile-user-profile > span:last-child {
    display: flex;
    flex-direction: column;
}

.mobile-user-profile strong {
    font-size: 16px;
}

.mobile-user-profile small {
    margin-top: 2px;
    color: var(--color-text-muted);
    font-size: 13px;
}


@media (max-width: 768px) {

    .site-header .container {
        width: 100%;
        max-width: none;
        padding-left: 0;
        padding-right: 0;
    }

    .site-header-inner {
        min-height: 64px;
        flex-wrap: nowrap;
        padding: 10px 15px;
    }

    .site-logo {
        flex: 1;
        min-width: 0;
        margin-left: 0px;
    }

    .site-logo img {
        max-height: 28px;
    }

    .main-nav {
        display: none;
    }

    .header-actions {
        gap: 7px;
    }

    /* Hide desktop actions on mobile */

    .header-search,
    .header-login,
    .header-register,
    .header-account {
        display: none;
    }

    /* Theme comes immediately before hamburger */

    .header-actions .theme-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;

        padding: 0;

        font-size: 18px;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

}
body.mobile-menu-open {
    overflow: hidden;
}
/* =========================================================
   MOBILE MENU - HIDDEN ON DESKTOP
   ========================================================= */

.mobile-menu,
.mobile-menu-overlay {
    display: none;
}


/* =========================================================
   MOBILE ONLY
   ========================================================= */

@media (max-width: 768px) {

    .mobile-menu {
        display: block;
    }

    .mobile-menu-overlay {
        display: block;
    }

}
/* =========================================================
   HEADER REFINEMENTS
   ========================================================= */

/* ---------------------------------------------------------
   Overall website container width
   ---------------------------------------------------------
   --container-width is NOT declared here.

   It used to be hardcoded twice in this file (1250px in the first
   :root and 1350px in a second one). Because the later declaration
   won, the Appearance Settings value emitted by
   includes/appearance.php was silently ignored.

   The variable now has exactly one source: appearance.php, driven by
   Admin -> Appearance -> Content Max Width. The 1250px in the :root
   block at the top of this file is only a fallback for pages that
   load main.css without appearance.php.
   --------------------------------------------------------- */


/* Slightly smaller desktop navigation */

.main-nav {
    gap: 20px;
}

.main-nav a {
    font-size: 13px;
}


/* Search box */

.header-search {
    width: 170px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    padding: 0 14px;

    border: 1px solid var(--color-border);
    border-radius: 20px;

    background: var(--color-surface);

    color: var(--color-text);
    font-size: 14px;
}

.header-search::after {
    content: "Search";
    margin-left: 8px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.header-search:hover {
    background: var(--color-surface-2);
    color: var(--color-primary);
}


/* Smaller Login button */

.header-login {
    min-height: 36px;
    height: 36px;
    padding: 6px 14px;

    font-size: 14px;
}


/* Smaller Register button */

.header-register {
    min-height: 36px;
    height: 36px;
    padding: 6px 15px;

    font-size: 14px;
}


/* Smaller Account button */

.header-account {
    min-height: 36px;
    height: 36px;
    padding: 6px 14px;

    font-size: 14px;
}


/* Keep mobile header unaffected */

@media (max-width: 768px) {

    .header-search {
        display: none;
    }

    .header-login,
    .header-register,
    .header-account {
        display: none;
    }

}
/* =========================================================
   DESKTOP HEADER SEARCH
   ========================================================= */

.header-search-form {
    width: 300px;
    height: 38px;

    display: flex;
    align-items: center;

    border: 1px solid var(--color-border);
    border-radius: 20px;

    background: var(--color-surface);

    overflow: hidden;
}

.header-search-icon {
    width: 42px;
    min-width: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--color-text-muted);
    font-size: 22px;
}

.header-search-form input {
    width: 100%;
    height: 100%;

    padding: 0 14px 0 0;

    border: 0;
    outline: 0;

    border-radius: 0;

    background: transparent;
    color: var(--color-text);

    font-size: 14px;
}

.header-search-form input::placeholder {
    color: var(--color-text-muted);
}

.header-search-form input:focus {
    outline: 0;
    box-shadow: none;
}


/* =========================================================
   HEADER LAYOUT
   ========================================================= */

.header-actions {
    margin-left: auto;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .header-search-form {
        display: none;
    }

}
.site-logo,
.main-nav {
    align-self: center;
}

.main-nav {
    align-items: center;
}

.main-nav a {
    display: flex;
    align-items: center;
    line-height: 1;
}
.main-nav a {
    position: relative;
    transition: color 0.2s ease;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -7px;
    width: 100%;
    height: 1px;
    background: var(--color-primary);

    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.main-nav a:hover {
    color: var(--color-primary);
}

.main-nav a:hover::after {
    transform: scaleX(1);
}
/* =====================================================
   DARK MODE
   -----------------------------------------------------
   The page colour is the admin's "Dark background color",
   published by appearance.php as --color-bg. Nothing in this
   file may pin body / .site-header / .site-footer / .site-main
   to a literal colour, or that setting stops reaching them.

   That is exactly what this block used to do. It set
   `body { background-color: #000000 }` and
   `.site-main { background-color: #000000 }`, both more
   specific than `body { background: var(--color-bg) }` above,
   so the page stayed black no matter what was chosen - while
   every rule that fell back to var(--color-bg) (the account
   cards, form inputs, the mobile menu) picked the setting up
   instead. The result looked like "the colour applies to
   containers but not the page".

   Everything else here is DERIVED by mixing the page colour
   toward the text colour. The direction is deliberate: it
   always pushes a surface AWAY from the background, so cards
   stay visible and borders stay legible whether the admin
   picks a near-black page or a light grey one.

   --color-card is defined only in dark mode. In light mode it
   stays undefined, so cards keep falling back to --color-bg,
   which is the existing white-card look.
   ===================================================== */

html[data-theme="dark"] {
    --color-surface: color-mix(in srgb, var(--color-bg) 88%, var(--color-text));
    --color-surface-2: color-mix(in srgb, var(--color-bg) 80%, var(--color-text));
    --color-surface-alt: color-mix(in srgb, var(--color-bg) 80%, var(--color-text));
    --color-card: color-mix(in srgb, var(--color-bg) 86%, var(--color-text));

    --color-text-muted: color-mix(in srgb, var(--color-text) 70%, var(--color-bg));
    --color-border: color-mix(in srgb, var(--color-text) 22%, var(--color-bg));
}


/* Main page. The background comes from --color-bg via the `body` rule above -
   deliberately not repeated here. */

html[data-theme="dark"] body {
    color: var(--color-text);
}


/* Header */

html[data-theme="dark"] .site-header {
    background-color: var(--color-header) !important;
    color: var(--color-text) !important;
    border-bottom-color: var(--color-border);
}


/* Header logo/navigation */

html[data-theme="dark"] .site-header .site-logo,
html[data-theme="dark"] .site-header .main-nav a {
    color: var(--color-text) !important;
}


/* Navigation hover */

html[data-theme="dark"] .main-nav a:hover {
    color: var(--color-primary) !important;
}


/* Search box */

html[data-theme="dark"] .header-search-form {
    background-color: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

html[data-theme="dark"] .header-search-form input {
    background-color: transparent;
    color: var(--color-text);
}

html[data-theme="dark"] .header-search-form input::placeholder {
    color: var(--color-text-muted);
}


/* Login button */

html[data-theme="dark"] .header-login {
    background-color: var(--color-surface) !important;
    color: var(--color-text) !important;
    border: 1px solid var(--color-border) !important;
}


/* Login hover */

html[data-theme="dark"] .header-login:hover {
    background-color: var(--color-surface-2) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}


/* Register button */

html[data-theme="dark"] .header-register {
    color: var(--color-text) !important;
}


/* Theme toggle */

html[data-theme="dark"] .theme-toggle {
    background-color: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}


/* Main content. Deliberately NO background: .site-main is transparent so the
   body colour shows through and the page reads as one surface. */

html[data-theme="dark"] .site-main {
    color: var(--color-text);
}



/* Logo theme switching */

.site-logo .logo-dark {
    display: none;
}

html[data-theme="dark"] .site-logo .logo-light {
    display: none;
}

html[data-theme="dark"] .site-logo .logo-dark {
    display: block;
}
/* Keep light and dark logos exactly the same size */
.site-logo {
    display: flex;
    align-items: center;
}

.site-logo img {
    width: 170px;
    height: auto;
    display: block;
}

.site-logo .logo-light,
.site-logo .logo-dark {
    width: 170px;
    height: auto;
}
/* =========================================================
   PREMIUM FOOTER
   ========================================================= */

.site-footer {
    margin-top: 60px;
    background: var(--color-footer);
    color: var(--color-text);
    border-top: 1px solid var(--color-border);
    transition:
        background-color var(--transition),
        color var(--transition),
        border-color var(--transition);
}

/* Main footer */

.footer-grid {
    display: grid;
    grid-template-columns:
        1.5fr
        1fr
        1fr
        1.2fr;

    gap: 50px;

    padding-top: 30px;
    padding-bottom: 40px;
}


/* Columns */

.footer-column {
    min-width: 0;
}


.footer-column h3 {
    margin: 0 0 22px;
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
}


/* About */

.footer-about {
    max-width: 360px;
}


.footer-logo {
    display: inline-flex;
    margin-bottom: 20px;
}


.footer-logo img {
    width: 150px;
    max-width: 100%;
    height: auto;
    display: block;
}


.footer-brand {
    display: inline-block;
    margin-bottom: 20px;

    color: var(--color-text);
    font-size: 25px;
    font-weight: 800;
    text-decoration: none;
}


.footer-about-text {
    margin: 0;

    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.8;
}


/* Social */

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}


.footer-social a {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--color-border);
    border-radius: 50%;

    color: var(--color-text);
    background: var(--color-surface);

    font-size: 15px;
    font-weight: 700;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.footer-social a:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);

    transform: translateY(-2px);
}


/* Footer links */

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}


.footer-links li {
    margin-bottom: 12px;
}


.footer-links a {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--color-text-muted);

    font-size: 13px;
    line-height: 1.5;

    text-decoration: none;

    transition:
        color 0.2s ease,
        padding-left 0.2s ease;
}


.footer-links a:hover {
    color: var(--color-text);
    padding-left: 4px;
}


/* Link icons */

.footer-link-icon {
    width: 19px;
    height: 19px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    color: var(--color-primary);
}


.footer-link-icon svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Contact */

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin-bottom: 17px;

    color: var(--color-text-muted);

    font-size: 13px;
    line-height: 1.6;
}


.footer-contact-item a {
    color: #b8c0cc;
    text-decoration: none;

    transition: color 0.2s ease;
}


.footer-contact-item a:hover {
    color: var(--color-text);
}


.footer-contact-icon {
    width: 22px;
    min-width: 22px;

    display: inline-flex;
    justify-content: center;

    color: var(--color-primary);

    font-size: 17px;
}


/* Bottom */

.footer-bottom {
    border-top: 1px solid var(--color-border);
}


.footer-bottom .container {
    padding-top: 20px;
    padding-bottom: 20px;
}


.footer-bottom p {
    margin: 0;

    text-align: center;

    color: var(--color-text-muted);

    font-size: 13px;
}


/* =========================================================
   DARK MODE
   ========================================================= */



html[data-theme="dark"] .footer-bottom {
    border-top-color: var(--color-border);
}


/* =========================================================
   MOBILE FOOTER
   ========================================================= */

@media (max-width: 900px) {

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px 30px;
    }

}


@media (max-width: 600px) {

    .footer-grid {
        grid-template-columns: 1fr;

        gap: 35px;

        padding-top: 45px;
        padding-bottom: 40px;
    }


    .footer-about {
        max-width: none;
    }


    .footer-logo img {
        width: 150px;
    }

}


/* =========================================================
   FOOTER THEME + LOGO SWITCHING
   ========================================================= */

/* Light mode */
.site-footer {
    background: #ffffff;
    color: #111827;
}

.site-footer .footer-column h3,
.site-footer .footer-brand {
    color: #111827;
}

.site-footer .footer-about-text,
.site-footer .footer-links a,
.site-footer .footer-contact-item,
.site-footer .footer-contact-item a,
.site-footer .footer-bottom p {
    color: #64748b;
}

.site-footer .footer-social a {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #111827;
}

.site-footer .footer-bottom {
    border-top-color: #e2e8f0;
}

/* Only the light logo is visible in light mode */
.footer-logo {
    display: inline-flex;
    align-items: center;
    margin-bottom: 20px;
}

.footer-logo-light {
    display: block !important;
}

.footer-logo-dark {
    display: none !important;
}

.footer-logo img {
    width: 150px;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Dark mode. These follow the Appearance "Dark background color" setting via
   --color-footer / --color-text / --color-text-muted rather than literals, so
   the footer matches the page instead of staying black underneath it. */

html[data-theme="dark"] .site-footer {
    background: var(--color-footer) !important;
    color: var(--color-text);
}

html[data-theme="dark"] .site-footer .footer-column h3,
html[data-theme="dark"] .site-footer .footer-brand {
    color: var(--color-text);
}

html[data-theme="dark"] .site-footer .footer-about-text,
html[data-theme="dark"] .site-footer .footer-links a,
html[data-theme="dark"] .site-footer .footer-contact-item,
html[data-theme="dark"] .site-footer .footer-contact-item a,
html[data-theme="dark"] .site-footer .footer-bottom p {
    color: var(--color-text-muted);
}

html[data-theme="dark"] .site-footer .footer-social a {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

html[data-theme="dark"] .site-footer .footer-bottom {
    border-top-color: var(--color-border);
}

/* Only the dark logo is visible in dark mode */
html[data-theme="dark"] .footer-logo-light {
    display: none !important;
}

html[data-theme="dark"] .footer-logo-dark {
    display: block !important;
}
.mobile-menu .mobile-post-ad,
.mobile-menu .mobile-post-ad span {
    color: #ffffff !important;
}

.mobile-menu .mobile-post-ad {
    background: var(--color-primary) !important;
}

/* =========================================================
   CONTENT PAGES
   Shared by about / contact / help / privacy / terms.
   ========================================================= */

/*
 * Everything here is a NEW class name, so no existing page changes.
 * It lives in main.css rather than in five per-page <style> blocks because
 * five copies of the same typography is five places to fix one bug.
 *
 * Colours come from the theme variables only. Nothing sets a background on
 * the page wrapper: appearance.php owns the page background, and pinning it
 * here would stop the admin's "Dark background color" reaching these pages.
 *
 * Links use --color-text with an underline, NOT --color-primary. The admin's
 * Primary colour is published unchanged into both themes, so on a dark page it
 * can be almost invisible (the live palette measures 1.18:1). Body copy has to
 * stay readable whatever the admin picks.
 */

.content-page {
    max-width: 880px;

    margin: 0 auto;

    padding: 58px 20px 84px;

    box-sizing: border-box;

    color: var(--color-text, #111827);
}

.content-page--wide {
    max-width: 1060px;
}

.content-hero {
    margin: 0 0 46px;
}

.content-hero h1 {
    margin: 0 0 14px;

    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    line-height: 1.15;
}

.content-hero p {
    margin: 0;

    max-width: 660px;

    font-size: 17px;
    line-height: 1.65;

    opacity: 0.75;
}

.content-section {
    margin: 0 0 38px;
}

.content-section h2 {
    margin: 0 0 14px;

    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.content-section h3 {
    margin: 0 0 9px;

    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.4;
}

.content-section p {
    margin: 0 0 14px;

    font-size: 15.5px;
    line-height: 1.75;
}

.content-section ul,
.content-section ol {
    margin: 0 0 14px;

    padding-left: 22px;
}

.content-section li {
    margin-bottom: 9px;

    font-size: 15.5px;
    line-height: 1.75;
}

.content-section a {
    color: var(--color-text, #111827);

    text-decoration: underline;

    text-underline-offset: 3px;
}

.content-section a:hover {
    opacity: 0.7;
}

/* A bordered panel for one idea, one FAQ answer, one contact block. */

.content-card {
    background: var(--color-card, var(--color-surface, #f8fafc));

    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.10));
    border-radius: var(--border-radius, 12px);

    padding: 20px 22px;

    margin: 0 0 14px;

    box-sizing: border-box;
}

.content-card h3 {
    margin-top: 0;
}

.content-card p:last-child,
.content-card ul:last-child {
    margin-bottom: 0;
}

/* A tinted aside. The tint is low-alpha Primary so it can never be invisible. */

.content-note {
    background: color-mix(
        in srgb,
        var(--color-primary, #eb5524) 9%,
        transparent
    );

    border-left: 3px solid var(--color-text, #111827);
    border-radius: 0 var(--border-radius, 12px) var(--border-radius, 12px) 0;

    padding: 15px 19px;

    margin: 0 0 16px;

    font-size: 14.5px;
    line-height: 1.7;
}

.content-note p:last-child {
    margin-bottom: 0;
}

.content-grid {
    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));

    gap: 14px;

    margin: 0 0 18px;
}

/* Closing call to action. */

.content-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;

    flex-wrap: wrap;

    gap: 18px;

    background: var(--color-card, var(--color-surface, #f8fafc));

    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.10));
    border-radius: var(--border-radius, 12px);

    padding: 24px 26px;

    margin: 0 0 8px;

    box-sizing: border-box;
}

.content-cta h2 {
    margin: 0 0 6px;

    font-size: 19px;
    font-weight: 700;
}

.content-cta p {
    margin: 0;

    font-size: 14.5px;
    line-height: 1.65;

    opacity: 0.75;
}

.content-meta {
    margin: 34px 0 0;

    padding-top: 20px;

    border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.10));

    font-size: 13.5px;

    opacity: 0.6;
}

.content-actions {
    display: flex;

    flex-wrap: wrap;

    gap: 12px;

    margin: 0 0 30px;
}

.content-btn {
    display: inline-block;

    padding: 13px 26px;

    font-size: 15px;
    font-weight: 600;

    text-decoration: none;

    border-radius: var(--button-radius, 8px);

    transition:
        background-color var(--transition),
        border-color var(--transition),
        color var(--transition);
}

.content-btn-ghost {
    background: transparent;

    color: var(--color-text, #111827);

    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.18));
}

.content-btn-ghost:hover {
    background: var(--color-surface, #f8fafc);

    border-color: var(--color-text, #111827);

    color: var(--color-text, #111827);
}

/* Contact details list. */

.content-details {
    list-style: none;

    margin: 0 0 18px;

    padding: 0;
}

.content-details li {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    margin-bottom: 14px;

    font-size: 15px;
    line-height: 1.6;
}

.content-details i {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    flex: 0 0 32px;

    border-radius: 9px;

    background: color-mix(
        in srgb,
        var(--color-primary, #eb5524) 14%,
        transparent
    );

    color: currentColor;

    font-size: 13.5px;
}

@media (max-width: 768px) {

    .content-page {
        padding: 42px 16px 64px;
    }

    .content-hero {
        margin-bottom: 34px;
    }

    .content-section {
        margin-bottom: 30px;
    }

    .content-cta {
        padding: 20px 18px;
    }

    .content-cta .content-btn {
        width: 100%;

        box-sizing: border-box;

        text-align: center;
    }
}
