/* =========================================================
 * RankwellPress — Header Base Styles
 * ========================================================= */

/* ============================================
   CONTAINER
   ============================================ */
.rwp-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

@media (min-width: 1025px) {
    .rwp-container { max-width: var(--rw-container-desktop, 1200px); }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .rwp-container { max-width: var(--rw-container-tablet, 95%); padding: 0 15px; }
}
@media (max-width: 767px) {
    .rwp-container { max-width: 100%; padding: 0 20px; }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.rwp-skip-link {
    position: absolute;
    top: -100px;
    left: 6px;
    z-index: 100000;
    padding: 10px 16px;
    background: #ffffff;
    color: #111827;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: top 0.2s ease;
}
.rwp-skip-link:focus {
    top: 6px;
}

/* ============================================
   TOP BAR — Shared by all layouts
   ============================================ */
.rwp-topbar {
    background: var(--rw-topbar-bg, #0f1e33);
    color: var(--rw-topbar-text, #f9fafb);
    font-size: 0.85rem;
    padding: 6px 0;
    position: relative;
    z-index: 1001;
}

.rwp-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.rwp-topbar-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
}
.rwp-topbar-nav a {
    color: var(--rw-topbar-text, #f9fafb);
    text-decoration: none;
    transition: opacity var(--rw-transition-fast, 0.2s ease);
}
.rwp-topbar-nav a:hover { opacity: 0.8; }

.rwp-topbar-social-label { display: none; }
@media (min-width: 768px) {
    .rwp-topbar-social-label { display: inline; margin-left: 4px; }
}

@media (max-width: 480px) {
    .rwp-topbar-inner {
        justify-content: center;
        text-align: center;
    }
}

/* ============================================
   ICON BUTTON
   ============================================ */
.rwp-btn-icon,
.rwp-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: currentColor;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}
.rwp-btn-icon:hover,
.rwp-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.rwp-btn-icon:focus-visible,
.rwp-icon-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ============================================
   FLOATING BUTTON
   ============================================ */
.rwp-floating-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--rwp-mobile-icon-bg, #ffffff) !important;
    color: var(--rwp-mobile-icon-text, #111827) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, var(--rw-glass-glow, 0.12));
    cursor: pointer;
    margin: 0 !important;
    padding: 0;
    transition:
        border-radius var(--rw-transition-fast, 0.2s ease),
        transform var(--rw-transition-fast, 0.2s ease),
        background-color var(--rw-transition-fast, 0.2s ease),
        box-shadow var(--rw-transition-fast, 0.2s ease);
}

.rwp-floating-circle:active {
    transform: scale(0.96);
}

.rwp-floating-circle.rwp-floating-square   { border-radius: 8px; }
.rwp-floating-circle.rwp-floating-rounded  { border-radius: 12px; }
.rwp-floating-circle.rwp-floating-squircle { border-radius: 22%; }

/* ============================================
   FLOATING PILL
   ============================================ */
.rwp-floating-pill {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 1px;
    border-radius: 100px;
    background-color: var(--rwp-mobile-icon-bg, #ffffff);
    box-shadow: 0 2px 10px rgba(0, 0, 0, var(--rw-glass-glow, 0.12));
    margin: 0 !important;
}

.rwp-floating-pill .rwp-icon-btn,
.rwp-floating-pill .rwp-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent !important;
    color: var(--rwp-mobile-icon-text, #111827) !important;
}
.rwp-floating-pill .rwp-icon-btn:active,
.rwp-floating-pill .rwp-btn-icon:active {
    background-color: rgba(0, 0, 0, 0.05) !important;
    transform: scale(0.96);
}

@media (max-width: 480px) {
    .rwp-floating-circle { width: 32px; height: 32px; }
    .rwp-floating-pill .rwp-icon-btn,
    .rwp-floating-pill .rwp-btn-icon { width: 28px; height: 28px; }
}

/* ============================================
   HAMBURGER ICON
   ============================================ */
.rwp-hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
}
.rwp-hamburger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: currentColor;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.rwp-hamburger-icon--two span:nth-child(3) { display: none; }

@media (max-width: 480px) {
    .rwp-hamburger-icon {
        gap: 3px;
        width: 16px;
    }
}

/* ============================================
   DESKTOP GUARD (NEW FIX)
   ============================================ */
@media (min-width: 992px) {
    .rwp-mobile-header-only {
        display: none !important;
    }
}

/* ============================================
   MOBILE DROPDOWNS
   ============================================ */
.rwp-mobile-dropdown {
    position: fixed;
    top: 60px;
    left: 10px;
    right: 10px;
    width: auto;
    background: var(--rw-bg-content, #ffffff);
    border: 1px solid var(--rw-border-light, #e5e7eb);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition:
        opacity 0.3s ease,
        transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        visibility 0.3s;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.rwp-mobile-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rwp-mobile-dropdown:not(.is-open) {
    pointer-events: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: -1 !important;
}

/* ============================================
   MOBILE SEARCH FORM
   ============================================ */
.rwp-mobile-search-form {
    display: flex;
    gap: 10px;
    margin: 0;
    width: 100%;
}

.rwp-mobile-search-input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--rw-border-light, #e5e7eb);
    font-size: 16px;
    background: var(--rw-bg-content, #ffffff);
    color: var(--rw-text-body, #4b5563);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}
.rwp-mobile-search-input:focus {
    border-color: var(--rw-color-primary, #0d7c3e);
}

.rwp-mobile-search-btn {
    background: var(--rw-color-primary, #0d7c3e);
    color: var(--rw-text-inverse, #ffffff);
    padding: 0 20px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ============================================
   MOBILE MENU CONTENTS
   ============================================ */
.rwp-mobile-nav { margin-bottom: 15px; }

.rwp-mobile-primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}
.rwp-mobile-primary-menu li {
    border-bottom: 1px solid var(--rw-border-light, rgba(0, 0, 0, 0.05));
}
.rwp-mobile-primary-menu li:last-child { border-bottom: none; }

.rwp-mobile-primary-menu a {
    display: block;
    padding: 12px 0;
    color: var(--rw-text-heading, #111827);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.2s ease, padding-left 0.2s ease;
}
.rwp-mobile-primary-menu a:hover {
    color: var(--rw-color-primary, #0d7c3e);
    padding-left: 6px;
}

.rwp-mobile-menu-footer {
    border-top: 1px solid var(--rw-border-light, rgba(0, 0, 0, 0.05));
    padding-top: 15px;
}

.rwp-mobile-top-links {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}
.rwp-mobile-top-links a {
    color: var(--rw-text-muted, #6b7280);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.rwp-mobile-socials {
    display: flex;
    gap: 15px;
    justify-content: center;
}
.rwp-mobile-social-link {
    color: var(--rw-text-muted, #6b7280);
    transition: color 0.2s ease;
}
.rwp-mobile-social-link:hover {
    color: var(--rw-color-primary, #0d7c3e);
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.rwp-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.rwp-search-overlay[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.rwp-search-box {
    width: 90%;
    max-width: 600px;
    position: relative;
}
.rwp-search-box .rwp-mobile-search-form { gap: 0; }
.rwp-search-box .rwp-mobile-search-input {
    border-radius: 8px 0 0 8px;
    border: none;
    padding: 16px 20px;
    font-size: 18px;
    background: #ffffff;
    color: #111827;
}
.rwp-search-box .rwp-mobile-search-btn {
    border-radius: 0 8px 8px 0;
    padding: 0 24px;
    font-size: 16px;
}

.rwp-search-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 32px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}
.rwp-search-close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}

/* ============================================
   SCROLL STATE
   ============================================ */
.rwp-header {
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

/* ============================================
   NON-STICKY HEADER
   ============================================ */
body.rwp-no-sticky-header .rwp-header {
    position: static !important;
    top: auto !important;
}

/* ============================================
   DARK MODE
   ============================================ */
html[data-theme="dark"] .rwp-mobile-dropdown {
    background: #1e293b !important;
    border-color: #334155 !important;
}
html[data-theme="dark"] .rwp-mobile-primary-menu a {
    color: #f8fafc !important;
}
html[data-theme="dark"] .rwp-mobile-primary-menu li {
    border-bottom-color: #334155 !important;
}
html[data-theme="dark"] .rwp-mobile-search-input {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}




/* ============================================
   TOP BAR — MOBILE FIX
   ============================================ */
@media (max-width: 767px) {
    /* 1. Stack the left (date) and right (nav) items */
    .rwp-topbar-inner {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 8px; 
        padding: 8px 0;
    }

    .rwp-topbar-date {
        font-size: 0.8rem;
        opacity: 0.9;
    }

    /* 2. The scrollable container */
    .rwp-topbar-nav {
        width: 100%;
        overflow-x: auto;
        /* Hide scrollbar */
        -ms-overflow-style: none;  
        scrollbar-width: none;  
    }
    .rwp-topbar-nav::-webkit-scrollbar {
        display: none;
    }

    /* 3. The list of links */
    .rwp-topbar-nav ul {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start; /* CHANGED: Starts from the left instead of centering */
        gap: 20px; /* Slightly wider gap for easier tapping */
        padding: 0 15px; /* Adds padding so the first item isn't glued to the edge */
        margin: 0;
        white-space: nowrap;
    }

    /* 4. The links */
    .rwp-topbar-nav a {
        font-size: 0.85rem;
        padding: 4px 0;
        display: inline-block;
    }
}




/* ============================================
   ABSOLUTE DESKTOP GUARD (Bundled Safely)
   ============================================ */
@media (min-width: 992px) {
    .rwp-mobile-header-only,
    .rwp-mobile-dropdown {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        z-index: -9999 !important;
    }
}