/*
Theme Name: Edugrown Theme
Theme URI: https://edugrown.in/
Author: Edugrown
Author URI: https://edugrown.in/
Description: Fully customizable WordPress theme with extensive admin panel options for header, footer, sidebar, mobile menu, typography, menu icons (visual picker + custom HTML), scroll-to-top button, and colors. Designed for educational institutions.
Version: 1.7.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gcb
Tags: education, college, custom-colors, custom-header, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, right-sidebar, threaded-comments, translation-ready
*/

/* =========================================================
   1. RESET & BASE  (strict overflow control for mobile)
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: clip;
    max-width: 100%;
}
body {
    margin: 0;
    font-family: var(--gcb-body-font, 'Inter', sans-serif);
    font-size: var(--gcb-body-size, 16px);
    color: var(--gcb-body-color, #333);
    line-height: 1.6;
    background: var(--gcb-body-bg, #ffffff);
    overflow-x: clip;
    max-width: 100vw;
    width: 100%;
}
img, video, iframe, embed, object, picture {
    max-width: 100%;
    height: auto;
    display: block;
}
a { color: var(--gcb-link-color, #0073aa); text-decoration: none; }
a:hover { color: var(--gcb-link-hover-color, #005177); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--gcb-heading-font, 'Inter', sans-serif);
    color: var(--gcb-heading-color, #111);
    margin: 0 0 .6em;
    line-height: 1.25;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
h1 { font-size: var(--gcb-h1-size, 2.25rem); color: var(--gcb-h1-color, inherit); }
h2 { font-size: var(--gcb-h2-size, 1.85rem); color: var(--gcb-h2-color, inherit); }
h3 { font-size: var(--gcb-h3-size, 1.5rem); color: var(--gcb-h3-color, inherit); }
h4 { font-size: var(--gcb-h4-size, 1.25rem); color: var(--gcb-h4-color, inherit); }
p  {
    font-size: var(--gcb-p-size, 1rem);
    color: var(--gcb-p-color, inherit);
    margin: 0 0 1em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.container {
    max-width: var(--gcb-container-max, 1280px);
    margin: 0 auto;
    padding: 0 var(--gcb-container-pad, 20px);
    width: 100%;
}

/* Force long content to break on mobile */
.gcb-site, .gcb-site-content, .gcb-main, .gcb-post, .gcb-post-content {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}
.gcb-post-content table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.gcb-post-content pre,
.gcb-post-content code {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}
.gcb-post-content img,
.gcb-post-content iframe,
.gcb-post-content video,
.gcb-post-content embed {
    max-width: 100% !important;
    height: auto !important;
}

/* =========================================================
   2. TOP HEADER (thin bar above main header)
   ========================================================= */
.gcb-top-header {
    background: var(--gcb-top-bg, #111827);
    color: var(--gcb-top-color, #ffffff);
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.gcb-top-header a { color: var(--gcb-top-color, #fff); }
.gcb-top-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.gcb-top-left, .gcb-top-right {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.gcb-top-left span, .gcb-top-right a { display: inline-flex; align-items: center; gap: 6px; }
.gcb-social-icons { display: flex; gap: 10px; }
.gcb-social-icons a { font-size: 14px; opacity: .9; }
.gcb-social-icons a:hover { opacity: 1; }

/* =========================================================
   3. MAIN HEADER
   ========================================================= */
.gcb-header {
    background: var(--gcb-header-bg, #ffffff);
    color: var(--gcb-header-color, #111);
    height: var(--gcb-header-height, 90px);
    max-width: var(--gcb-header-width, 100%);
    margin: 0 auto;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    position: relative;
    z-index: 100;
}
/* Logo + Menu sit together on the left.
   Header actions (search, mobile toggle) are pushed to the right
   via margin-left:auto so the logo can grow without disturbing menus. */
.gcb-header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    gap: 0;
}
.gcb-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;            /* never let logo collapse */
    line-height: 0;
}
.gcb-logo img {
    max-height: var(--gcb-logo-height, 60px);
    width: var(--gcb-logo-width, auto);
    max-width: none;            /* allow large logos; height limit is the real cap */
    height: auto;
    object-fit: contain;
    display: block;
}
.gcb-logo-placeholder {
    display: inline-block;
    padding: 6px 12px;
    background: #f3f4f6;
    color: #555;
    border-radius: 6px;
    font-size: 13px;
}
.gcb-main-menu {
    display: flex;
    align-items: center;
    margin-left: var(--gcb-logo-menu-gap, 40px);   /* configurable gap from logo */
    min-width: 0;
}
.gcb-header-actions {
    margin-left: auto;          /* pushes search/mobile-toggle to far right */
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.gcb-main-menu ul {
    list-style: none; margin: 0; padding: 0;
    display: flex;
    gap: var(--gcb-menu-gap, 6px);
}
.gcb-main-menu ul li { position: relative; }
.gcb-main-menu ul li a {
    display: block;
    padding: 10px var(--gcb-menu-padding, 14px);
    font-family: var(--gcb-menu-font, inherit);
    font-size: var(--gcb-menu-size, 15px);
    font-weight: 500;
    color: var(--gcb-menu-color, #111);
    border-radius: 6px;
    transition: all .2s;
}
.gcb-main-menu ul li a:hover,
.gcb-main-menu ul li.current-menu-item > a {
    color: var(--gcb-menu-hover-color, #ffffff);
    background: var(--gcb-menu-hover-bg, #0073aa);
}

/* Desktop Menu Separator (between top-level items) */
.gcb-main-menu > div > ul > li + li::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--gcb-menu-gap, 6px) / 2);
    top: 50%;
    transform: translateY(-50%);
    height: var(--gcb-desktop-sep-height, 18px);
    width: var(--gcb-desktop-sep-width, 1px);
    background: var(--gcb-desktop-sep-color, #e5e7eb);
    display: var(--gcb-desktop-sep-display, block);
}

/* =========================================================
   Header Menu Alignment (Desktop)
   - Left (default) = menu sits next to logo (existing behavior).
   - Center        = menu centered between logo and header actions.
   - Right         = menu pushed to far right, search/login icons
                     sit next to it with a small gap.
   These rules only need to override the default (left) layout for
   center & right — left is already handled by the base .gcb-main-menu
   and .gcb-header-actions rules above.
   ========================================================= */
.gcb-header-inner.gcb-menu-align-center .gcb-main-menu {
    margin-left: auto;
    margin-right: auto;
}
.gcb-header-inner.gcb-menu-align-center .gcb-header-actions {
    margin-left: 0;
}

.gcb-header-inner.gcb-menu-align-right .gcb-main-menu {
    margin-left: auto;
    margin-right: 0;
}
.gcb-header-inner.gcb-menu-align-right .gcb-header-actions {
    margin-left: 12px;
}

/* Submenu (Desktop) - 1st level dropdown */
.gcb-main-menu ul ul {
    position: absolute; top: 100%; left: 0;
    min-width: 220px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border-radius: 8px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 99;
    list-style: none;
}
.gcb-main-menu ul li:hover > ul,
.gcb-main-menu ul li:focus-within > ul { display: flex; }
.gcb-main-menu ul ul li { width: 100%; }
.gcb-main-menu ul ul li a {
    color: #333;
    padding: 9px 14px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-start;   /* was space-between — caused icon/label to split to opposite edges */
    gap: 8px;
}
.gcb-main-menu ul ul li a:hover {
    background: var(--gcb-menu-hover-bg, #0073aa);
    color: var(--gcb-menu-hover-color, #fff);
}

/* Top-level item with children → ▼ arrow */
.gcb-main-menu > div > ul > li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    margin-left: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: .8;
    vertical-align: middle;
}

/* 2nd-level item with children → ▶ arrow (right side) */
.gcb-main-menu ul ul li.menu-item-has-children > a::after {
    content: '';
    width: 7px; height: 7px;
    border-right: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: .7;
    flex-shrink: 0;
    margin-left: auto;   /* keeps the chevron pinned to the right even when an icon is present */
}

/* 3rd-level (sub-sub-menu) — slides out to the right */
.gcb-main-menu ul ul ul {
    top: -8px;
    left: 100%;
    margin-left: 4px;
}
/* If not enough space on right, fallback to left */
.gcb-main-menu ul ul ul.gcb-flip-left {
    left: auto; right: 100%; margin-left: 0; margin-right: 4px;
}

/* Header Search Icon */
.gcb-search-toggle {
    background: none; border: none; cursor: pointer;
    color: var(--gcb-header-color, #111);
    padding: 0;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s, color .2s;
}
.gcb-search-toggle:hover {
    background: rgba(0,0,0,.06);
    color: var(--gcb-link-color, #0073aa);
}
.gcb-search-toggle svg { display: block; }

/* Search Popup */
.gcb-search-popup {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.85);
    display: none;
    align-items: center; justify-content: center;
    z-index: 9999;
    padding: 20px;
}
.gcb-search-popup.active { display: flex; }
.gcb-search-popup form { width: 100%; max-width: 600px; position: relative; }
.gcb-search-popup input[type="search"] {
    width: 100%;
    padding: 18px 60px 18px 20px;
    font-size: 22px;
    border: none;
    border-radius: 50px;
    outline: none;
}
.gcb-search-popup .gcb-search-close {
    position: absolute;
    top: -50px; right: 0;
    background: none; border: none;
    color: #fff; font-size: 30px; cursor: pointer;
}

/* Mobile Menu Toggle (admin-customizable: bg, opacity, size, radius, border, line color/thickness) */
.gcb-mobile-toggle {
    display: none;
    background: var(--gcb-mobile-btn-bg, rgba(255,255,255,0.3));
    border: var(--gcb-mobile-btn-border-width, 0) solid var(--gcb-mobile-btn-border-color, #000);
    cursor: pointer;
    color: var(--gcb-mobile-icon-color, #000);
    padding: 0;
    width:  var(--gcb-mobile-btn-size, 44px);
    height: var(--gcb-mobile-btn-size, 44px);
    align-items: center; justify-content: center;
    border-radius: var(--gcb-mobile-btn-radius, 8px);
    transition: background .2s, transform .15s;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.gcb-mobile-toggle:hover,
.gcb-mobile-toggle:focus { filter: brightness(.92); }
.gcb-mobile-toggle:active { transform: scale(.96); }
.gcb-mobile-toggle svg {
    width:  var(--gcb-mobile-icon-size, 28px);
    height: var(--gcb-mobile-icon-size, 28px);
    display: block;
}

/* =========================================================
   4. MOBILE MENU (slide drawer)
   ========================================================= */
.gcb-mobile-menu {
    position: fixed; top: 0;
    width: 80%; max-width: 340px; height: 100vh;
    background: var(--gcb-mobile-bg, #111827);
    color: var(--gcb-mobile-color, #fff);
    z-index: 9998;
    overflow-y: auto;
    transition: transform .35s ease;
    padding: 20px;
    box-shadow: 0 0 30px rgba(0,0,0,.3);
}
.gcb-mobile-menu.gcb-mobile-left { left: 0; transform: translateX(-100%); }
.gcb-mobile-menu.gcb-mobile-right { right: 0; transform: translateX(100%); }
.gcb-mobile-menu.active { transform: translateX(0); }

.gcb-mobile-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9997;
    display: none;
}
.gcb-mobile-overlay.active { display: block; }

.gcb-mobile-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none; border: none; cursor: pointer;
    color: var(--gcb-close-color, #fff);
    padding: 0;
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    z-index: 10;
}
.gcb-mobile-close svg { width: var(--gcb-close-size, 26px); height: var(--gcb-close-size, 26px); }
.gcb-mobile-close:hover { background: rgba(255,255,255,.1); }

.gcb-mobile-top-info {
    border-bottom: 1px solid rgba(255,255,255,.1);
    padding: 50px 0 16px;
    margin-bottom: 16px;
    font-size: 13px;
}
.gcb-mobile-top-info p { margin: 4px 0; }
.gcb-mobile-top-info .gcb-social-icons { margin-top: 10px; }

.gcb-mobile-search { margin-bottom: 16px; position: relative; }
.gcb-mobile-search input[type="search"] {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    color: #fff;
    outline: none;
}
.gcb-mobile-search input[type="search"]::placeholder { color: rgba(255,255,255,.6); }
.gcb-mobile-search button {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #fff; cursor: pointer;
    width: 34px; height: 34px;
}

.gcb-mobile-menu ul { list-style: none; margin: 0; padding: 0; }

/* FIX (mobile menu): kill any inherited/cream background on the nav container,
   its inner div (added by wp_nav_menu), the <ul>, and the <li>s.
   Force the dark drawer background to show through, and explicit text color. */
.gcb-mobile-menu .gcb-mobile-nav,
.gcb-mobile-menu .gcb-mobile-nav > div,
.gcb-mobile-menu .gcb-mobile-nav ul,
.gcb-mobile-menu .gcb-mobile-nav li {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--gcb-mobile-color, #ffffff);
}

.gcb-mobile-menu > .gcb-mobile-nav > div > ul > li,
.gcb-mobile-menu .gcb-mobile-nav .menu-item {
    position: relative;
    border-bottom: var(--gcb-mobile-sep-height, 1px) var(--gcb-mobile-sep-style, solid) var(--gcb-mobile-sep-color, rgba(255,255,255,.12));
}
.gcb-mobile-menu .gcb-mobile-nav a {
    display: block;
    padding: 12px 8px;
    color: var(--gcb-mobile-color, #ffffff) !important;
    background: transparent !important;
    font-size: 16px;
    text-decoration: none;
}
.gcb-mobile-menu .gcb-mobile-nav a:hover,
.gcb-mobile-menu .gcb-mobile-nav a:focus {
    color: var(--gcb-menu-hover-color, #ffffff) !important;
    background: var(--gcb-menu-hover-bg, rgba(255,255,255,.08)) !important;
    border-radius: 6px;
}
.gcb-mobile-menu .gcb-mobile-nav .sub-menu {
    display: none;
    padding-left: 16px;
    background: transparent !important;
    border-top: var(--gcb-mobile-sep-height, 1px) var(--gcb-mobile-sep-style, solid) var(--gcb-mobile-sep-color, rgba(255,255,255,.12));
}
.gcb-mobile-menu .gcb-mobile-nav .sub-menu a {
    color: var(--gcb-mobile-color, #ffffff) !important;
    opacity: .9;
}
.gcb-mobile-menu .gcb-mobile-nav .menu-item-has-children > a {
    padding-right: 44px;
    position: relative;
}
.gcb-mobile-menu .gcb-mobile-nav .menu-item-has-children > a::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    width: 9px; height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-75%) rotate(45deg);
    transition: transform .25s;
    opacity: .8;
}
.gcb-mobile-menu .gcb-mobile-nav .menu-item-has-children.gcb-open > a::after {
    transform: translateY(-25%) rotate(225deg);
}
.gcb-mobile-menu .gcb-mobile-nav .menu-item-has-children.gcb-open > .sub-menu { display: block; }

/* =========================================================
   5. CONTENT LAYOUT
   ========================================================= */
.gcb-site-content {
    background: var(--gcb-content-bg, #f9fafb);
    color: var(--gcb-content-color, #333);
    padding: 40px 0;
    min-height: 60vh;
}
.gcb-site-content .container { display: flex; gap: var(--gcb-sidebar-gap, 28px); align-items: flex-start; }
.gcb-main { flex: 1; min-width: 0; }
.gcb-no-sidebar .gcb-main { width: 100%; }

article.gcb-post {
    background: #fff;
    padding: var(--gcb-post-padding, 24px);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    margin-bottom: 24px;
}
.gcb-post-meta { font-size: 13px; opacity: .7; margin-bottom: 12px; }
.gcb-read-more {
    display: inline-block; margin-top: 10px;
    padding: 8px 18px;
    background: var(--gcb-link-color, #0073aa);
    color: #fff !important;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
}
.gcb-read-more:hover { opacity: .9; }

/* =========================================================
   6. SIDEBAR
   ========================================================= */
.gcb-sidebar {
    width: var(--gcb-sidebar-width, 300px); flex-shrink: 0;
    background: var(--gcb-sidebar-bg, #ffffff);
    color: var(--gcb-sidebar-color, #333);
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.gcb-sidebar .widget {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.gcb-sidebar .widget:last-child { margin-bottom: 0; padding-bottom: 0; border: none; }
.gcb-sidebar .widget-title {
    font-size: 17px;
    margin-bottom: 14px;
    font-weight: 700;
    color: var(--gcb-sidebar-color, #111);
}
.gcb-sidebar ul { list-style: none; margin: 0; padding: 0; }
.gcb-sidebar ul li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}
.gcb-sidebar ul li:last-child { border: none; }
.gcb-sidebar ul li a { color: var(--gcb-sidebar-color, #333); }
.gcb-sidebar ul li a:hover { color: var(--gcb-link-color, #0073aa); }

.gcb-sidebar .search-form { display: flex; gap: 6px; }
.gcb-sidebar .search-form input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    outline: none;
}
.gcb-sidebar .search-form button {
    padding: 0 14px;
    background: var(--gcb-link-color, #0073aa);
    color: #fff; border: none; border-radius: 6px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}

/* =========================================================
   7. FOOTER
   ========================================================= */
.gcb-footer {
    background: var(--gcb-footer-bg, #1f2937);
    color: var(--gcb-footer-color, #d1d5db);
    padding: 50px 0 0;
}
.gcb-footer a { color: var(--gcb-footer-color, #d1d5db); }
.gcb-footer a:hover { color: #fff; }
.gcb-footer-widgets {
    display: grid;
    gap: 32px;
    padding-bottom: 40px;
}
.gcb-footer-widgets.cols-1 { grid-template-columns: 1fr; }
.gcb-footer-widgets.cols-2 { grid-template-columns: repeat(2, 1fr); }
.gcb-footer-widgets.cols-3 { grid-template-columns: repeat(3, 1fr); }
.gcb-footer-widgets.cols-4 { grid-template-columns: repeat(4, 1fr); }
.gcb-footer .widget-title {
    font-size: 16px;
    color: #fff;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,.1);
}
.gcb-footer .widget ul { list-style: none; padding: 0; margin: 0; }
.gcb-footer .widget ul li { padding: 5px 0; }

.gcb-sub-footer {
    background: var(--gcb-subfooter-bg, #111827);
    color: var(--gcb-subfooter-color, #9ca3af);
    padding: 14px 0;
    font-size: 13px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,.06);
}
.gcb-sub-footer a { color: #fff; text-decoration: underline; }

/* =========================================================
   8. RESPONSIVE — strict, no horizontal overflow
   ========================================================= */
@media (max-width: 1024px) {
    .gcb-main-menu,
    .gcb-header-actions .gcb-search-toggle { display: none; }
    .gcb-mobile-toggle { display: inline-flex; }
    .gcb-site-content .container { flex-direction: column; }
    .gcb-sidebar { width: 100%; max-width: 100%; }
    .gcb-footer-widgets.cols-3,
    .gcb-footer-widgets.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .gcb-logo { max-width: 70%; }
    .gcb-logo img { max-height: calc(var(--gcb-logo-height, 60px) * 0.85); }
}

@media (max-width: 768px) {
    .container { padding: 0 var(--gcb-container-pad-mobile, 14px); }
    .gcb-logo { max-width: 75%; }

    /* Default mobile look: FLAT — no card padding/shadow/background.
       This gives the content much more breathing room on phones.
       Admin can opt in to the old card style by enabling
       "Show Card Style on Mobile" in Customizer. */
    article.gcb-post {
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin-bottom: 20px;
    }
    /* Opt-in: keep the white card on mobile if admin enabled it */
    body.gcb-mobile-card article.gcb-post {
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,.04);
        border-radius: 10px;
        padding: var(--gcb-post-padding, 16px);
    }

    .gcb-site-content { padding: 24px 0; }
    .gcb-footer { padding: 32px 0 0; }
    .gcb-footer-widgets { gap: 22px; padding-bottom: 24px; }

    /* Hide top header on mobile when admin disables it from Customizer */
    .gcb-top-header.gcb-top-hide-mobile { display: none !important; }
}

@media (max-width: 600px) {
    .gcb-top-inner { justify-content: center; text-align: center; flex-direction: column; gap: 6px; }
    .gcb-top-left, .gcb-top-right { justify-content: center; gap: 12px; font-size: 12px; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.15rem; }
    .gcb-footer-widgets { grid-template-columns: 1fr !important; }
    .gcb-logo { max-width: 78%; }
    .gcb-logo img { max-height: 42px; }
    .gcb-header { height: auto !important; min-height: 64px; padding: 8px 0; }
    .gcb-header-inner { gap: 8px; }
    .gcb-mobile-menu { width: 88%; max-width: 320px; padding: 18px; }
    .gcb-search-popup input[type="search"] { font-size: 18px; padding: 14px 50px 14px 16px; }
}

/* Catch-all: anything inside our containers must not overflow horizontally */
.gcb-site-content,
.gcb-footer,
.gcb-sub-footer,
.gcb-top-header,
.gcb-header { max-width: 100%; overflow-x: clip; }

/* Comments, forms, alignments */
.alignleft { float: left; margin-right: 1em; }
.alignright { float: right; margin-left: 1em; }
.aligncenter { display: block; margin: 0 auto; }
.screen-reader-text { position: absolute; left: -9999px; }

/* Pagination */
.gcb-pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 20px; }
.gcb-pagination .page-numbers {
    padding: 8px 14px;
    background: #fff;
    border-radius: 6px;
    color: #333;
    border: 1px solid #e5e7eb;
}
.gcb-pagination .page-numbers.current,
.gcb-pagination .page-numbers:hover {
    background: var(--gcb-link-color, #0073aa);
    color: #fff;
    border-color: transparent;
}

/* ============================================================
   LAYOUT: Default  (uses --gcb-container-max from Customizer)
   No body-class override needed — picks up base .container rules.
   ============================================================ */

/* ============================================================
   LAYOUT: Boxed  (narrower, more focused / readable)
   ============================================================ */
body.gcb-layout-boxed .gcb-site-content > .container {
    max-width: var(--gcb-boxed-max, 980px);
    margin: 0 auto;
}
body.gcb-layout-boxed article.gcb-post {
    box-shadow: 0 6px 24px rgba(0,0,0,.07);
    border-radius: 12px;
}

/* ============================================================
   LAYOUT: Full Width  (true edge-to-edge, no container, no card)
   ============================================================ */
body.gcb-layout-full-width .gcb-site-content {
    padding-left: 0;
    padding-right: 0;
}
body.gcb-layout-full-width .gcb-site-content > .container {
    max-width: 100%;
    padding: 0;
    display: block;
}
body.gcb-layout-full-width .gcb-main {
    width: 100%;
    max-width: 100%;
    padding: 0;
}
body.gcb-layout-full-width article.gcb-post {
    max-width: 100%;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
}
body.gcb-layout-full-width .gcb-post-content {
    max-width: 100%;
}
.gcb-fullwidth-wrap {
    width: 100%;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================
   STICKY HEADER (admin-controllable, desktop & mobile separately)
   ============================================================ */
@media (min-width: 1025px) {
    body.gcb-sticky-desktop .gcb-header {
        position: sticky;
        top: 0;
        z-index: 100;
    }
    body.gcb-sticky-desktop.gcb-sticky-shadow .gcb-header {
        box-shadow: 0 2px 12px rgba(0,0,0,.08);
    }
}
@media (max-width: 1024px) {
    body.gcb-sticky-mobile .gcb-header {
        position: sticky;
        top: 0;
        z-index: 100;
    }
    body.gcb-sticky-mobile.gcb-sticky-shadow .gcb-header {
        box-shadow: 0 2px 12px rgba(0,0,0,.10);
    }
}

/* ============================================================
   FLOATING MOBILE TOGGLE BUTTON
   When body.gcb-floating-toggle is present, the hamburger button
   becomes position:fixed so it stays visible even if the header
   scrolls off-screen. Position is set by .gcb-fab-{corner} class.
   ============================================================ */
body.gcb-floating-toggle .gcb-mobile-toggle {
    position: fixed;
    z-index: var(--gcb-fab-zindex, 9990);
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
body.gcb-floating-toggle.gcb-fab-top-right    .gcb-mobile-toggle { top: var(--gcb-fab-offset-y, 16px);    right: var(--gcb-fab-offset-x, 16px); }
body.gcb-floating-toggle.gcb-fab-top-left     .gcb-mobile-toggle { top: var(--gcb-fab-offset-y, 16px);    left:  var(--gcb-fab-offset-x, 16px); }
body.gcb-floating-toggle.gcb-fab-bottom-right .gcb-mobile-toggle { bottom: var(--gcb-fab-offset-y, 16px); right: var(--gcb-fab-offset-x, 16px); }
body.gcb-floating-toggle.gcb-fab-bottom-left  .gcb-mobile-toggle { bottom: var(--gcb-fab-offset-y, 16px); left:  var(--gcb-fab-offset-x, 16px); }

/* When the drawer is open, hide the floating button so it doesn't
   overlap the close (×) button inside the menu. */
body.gcb-floating-toggle.gcb-menu-open .gcb-mobile-toggle {
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}

/* =========================================================
   9. MENU / SUBMENU ICONS
   Per-item Font Awesome icon OR custom HTML icon
   (Appearance → Menus → expand any menu item).
   ========================================================= */
.gcb-main-menu ul li a,
.gcb-mobile-menu .gcb-mobile-nav a {
    display: inline-flex;          /* let icon + label sit on the same line */
    align-items: center;
    gap: 8px;
}
/* Restore mobile nav link to block-level so it still spans full width */
.gcb-mobile-menu .gcb-mobile-nav a {
    display: flex;
    width: 100%;
}
.gcb-menu-icon {
    display: inline-block;
    font-size: 0.95em;
    line-height: 1;
    flex-shrink: 0;
    color: inherit;
    min-width: 1em;     /* gentle floor so icons of varied widths align */
}
/* Slightly nudge icons in deep submenus so they don't crowd the text */
.gcb-main-menu ul ul .gcb-menu-icon { font-size: 0.9em; opacity: .9; }

/* If a menu item has BOTH an icon and a child-arrow (▼), we don't want
   the icon to ever wrap onto a second line */
.gcb-main-menu .menu-item-has-children > a { flex-wrap: nowrap; }

/* Custom HTML icon wrapper — sizes user-pasted <img>/<svg>/<i> to fit
   the menu line so a 1000×1000 logo doesn't blow up the header. */
.gcb-menu-icon-html {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex-shrink: 0;
    height: 1.2em;
    color: inherit;
}
.gcb-menu-icon-html img,
.gcb-menu-icon-html svg {
    height: 1.2em;
    width: auto;
    max-width: 1.6em;
    display: block;
    vertical-align: middle;
}
.gcb-menu-icon-html i {
    font-size: 0.95em;
    line-height: 1;
    color: inherit;
}
.gcb-main-menu ul ul .gcb-menu-icon-html { height: 1.1em; }
.gcb-main-menu ul ul .gcb-menu-icon-html img,
.gcb-main-menu ul ul .gcb-menu-icon-html svg { height: 1.1em; max-width: 1.4em; }

/* =========================================================
   10. SCROLL-TO-TOP BUTTON
   Rendered by gcb_scroll_top_button() in template-functions.php.
   Position, icon, colors, size all come from Customizer.
   ========================================================= */
.gcb-scroll-top {
    position: fixed;
    bottom: var(--gcb-stt-offset-y, 24px);
    width:  var(--gcb-stt-size, 48px);
    height: var(--gcb-stt-size, 48px);
    border-radius: var(--gcb-stt-radius, 48px);
    background: var(--gcb-stt-bg, #0073aa);
    color: var(--gcb-stt-color, #ffffff);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9989;                  /* below the floating menu button (9990) and drawer */
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease, background .2s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    padding: 0;
}
.gcb-scroll-top.gcb-stt-bottom-right { right: var(--gcb-stt-offset-x, 24px); }
.gcb-scroll-top.gcb-stt-bottom-left  { left:  var(--gcb-stt-offset-x, 24px); }
.gcb-scroll-top svg {
    width: 60%;
    height: 60%;
    display: block;
}
.gcb-scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.gcb-scroll-top:hover,
.gcb-scroll-top:focus {
    background: var(--gcb-stt-hover-bg, #005177);
    transform: translateY(-2px);
    outline: none;
}
.gcb-scroll-top:active { transform: translateY(0); }

/* When mobile menu drawer is open, keep the button hidden so it doesn't overlap */
body.gcb-menu-open .gcb-scroll-top {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

@media (max-width: 600px) {
    .gcb-scroll-top {
        width:  calc(var(--gcb-stt-size, 48px) * 0.9);
        height: calc(var(--gcb-stt-size, 48px) * 0.9);
        bottom: calc(var(--gcb-stt-offset-y, 24px) * 0.7);
    }
    .gcb-scroll-top.gcb-stt-bottom-right { right: calc(var(--gcb-stt-offset-x, 24px) * 0.7); }
    .gcb-scroll-top.gcb-stt-bottom-left  { left:  calc(var(--gcb-stt-offset-x, 24px) * 0.7); }
}

/* =========================================================
   11. ADMIN MENU-ITEM ICON FIELD (subtle styling only)
   ========================================================= */
.field-gcb-menu-icon input.code {
    font-family: Menlo, Consolas, monospace;
}
