/*
Theme Name: Shunya Blog
Theme URI: https://shunyadigit.com
Author: Harsh Chaudhary
Author URI: https://harshchaudhary.com
Description: Apple-style premium blog theme with AdSense, Rank Math & Site Kit support. Light/Dark mode, customizer-driven hero (70/30), featured 65/35 grid, 4 carousel widgets, popup ads, mobile hamburger menu, and locked footer credit.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shunya-blog
Tags: blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, dark-mode, light-mode
*/

/* ==========================================================
   0. RESET & BASE
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--transition), color var(--transition);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
button { font-family: inherit; }

/* ==========================================================
   1. CSS VARIABLES — LIGHT (DEFAULT)
   ========================================================== */
:root {
    --bg: #ffffff;
    --bg-soft: #f5f5f7;
    --text: #1d1d1f;
    --text-soft: #6e6e73;
    --border: #e5e5ea;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --card-bg: #ffffff;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.10);
    --radius: 16px;
    --radius-sm: 10px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================
   2. CSS VARIABLES — DARK
   ========================================================== */
[data-theme="dark"] {
    --bg: #000000;
    --bg-soft: #1c1c1e;
    --text: #f5f5f7;
    --text-soft: #a1a1a6;
    --border: #2c2c2e;
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --card-bg: #1c1c1e;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* ==========================================================
   3. LAYOUT CONTAINERS
   ========================================================== */
.sb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================
   4. HEADER
   ========================================================== */
.sb-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .sb-header {
    background: rgba(0, 0, 0, 0.72);
}
.sb-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 20px;
}

/* Logo */
.sb-logo { display: flex; align-items: center; gap: 10px; }
.sb-logo img { max-height: 40px; width: auto; }
.sb-logo .custom-logo-link { display: block; }
.sb-site-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.sb-site-tagline { font-size: 12px; color: var(--text-soft); margin: 0; }

/* Navigation — desktop */
.sb-nav ul {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.sb-nav a {
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    transition: color var(--transition);
}
.sb-nav a:hover { color: var(--accent); }
.sb-nav .current-menu-item > a { color: var(--accent); }

/* Header actions */
.sb-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ==========================================================
   5. DARK MODE TOGGLE (Apple-style)
   ========================================================== */
.sb-theme-toggle {
    width: 52px;
    height: 30px;
    border-radius: 30px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    padding: 0;
    transition: background var(--transition);
    flex-shrink: 0;
}
.sb-theme-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--text);
    transition: transform var(--transition), background var(--transition);
}
[data-theme="dark"] .sb-theme-toggle::after {
    transform: translateX(22px);
}

/* ==========================================================
   6. HAMBURGER BUTTON (mobile only)
   ========================================================== */
.sb-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px 9px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    border-radius: 10px;
    transition: background var(--transition);
    flex-shrink: 0;
}
.sb-menu-toggle:hover { background: var(--bg-soft); }
.sb-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
    transform-origin: center;
}

/* Hamburger → X animation */
.sb-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.sb-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.sb-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================
   7. HEADER AD BANNER
   ========================================================== */
.sb-header-ad {
    text-align: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.sb-header-ad img { display: inline-block; max-width: 100%; height: auto; }
.sb-ad-desktop { display: block; margin: 0 auto; }
.sb-ad-mobile { display: none; }
@media (max-width: 768px) {
    .sb-ad-desktop { display: none; }
    .sb-ad-mobile { display: block; margin: 0 auto; }
}

/* ==========================================================
   8. HERO SECTION — BASE
   ========================================================== */
.sb-hero { margin: 32px 0; }

/* Static Banner */
.sb-hero-banner img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: block;
}

/* ==========================================================
   9. HERO GRID (70% SLIDER / 30% SIDE POSTS)
   ========================================================== */
.sb-hero-grid {
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 20px;
    margin: 32px 0;
}

/* Slider wrapper — reduced height */
.sb-hero-slider-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    height: 400px;
}
.sb-swiper-hero {
    height: 100%;
    border-radius: var(--radius);
    overflow: hidden;
}
.sb-swiper-hero .swiper-slide { height: 100%; }
.sb-hero-slide-link {
    display: block;
    position: relative;
    height: 100%;
}
.sb-hero-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: auto !important;
}
.sb-hero-slide-link .sb-slide-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 60px 20px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
}
.sb-hero-slide-link .sb-slide-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.3;
    color: #fff;
}
.sb-hero-slide-link .sb-slide-date {
    font-size: 12px;
    color: #fff;
    opacity: 0.85;
}

/* Swiper nav for hero */
.sb-swiper-hero .swiper-button-next,
.sb-swiper-hero .swiper-button-prev {
    background: rgba(255, 255, 255, 0.85);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #000;
}
.sb-swiper-hero .swiper-button-next::after,
.sb-swiper-hero .swiper-button-prev::after {
    font-size: 14px;
    font-weight: 700;
}
.sb-swiper-hero .swiper-pagination { bottom: 10px; }
.sb-swiper-hero .swiper-pagination-bullet-active { background: #fff; }

/* Side: 2 latest posts stacked */
.sb-hero-side {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    height: 400px;
}
.sb-hero-side-card {
    position: relative;
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition);
}
.sb-hero-side-card:hover { transform: translateY(-2px); }
.sb-hero-side-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sb-hero-side-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 40px 14px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
    color: #fff;
}
.sb-hero-side-overlay h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: #fff;
}

/* Responsive hero */
@media (max-width: 900px) {
    .sb-hero-grid { grid-template-columns: 1fr; gap: 16px; }
    .sb-hero-slider-wrap { height: 260px; }
    .sb-hero-side {
        height: auto;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
    }
    .sb-hero-side-card { height: 140px; }
    .sb-hero-slide-link .sb-slide-title { font-size: 17px; }
}
@media (max-width: 480px) {
    .sb-hero-slider-wrap { height: 220px; }
    .sb-hero-side-card { height: 120px; }
    .sb-hero-slide-link .sb-slide-title { font-size: 15px; }
    .sb-hero-side-overlay h3 { font-size: 12px; }
}

/* Fallback slider (non-Swiper) */
.sb-slider {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.sb-slider-track {
    display: flex;
    transition: transform 0.5s ease;
}
.sb-slide { min-width: 100%; position: relative; }
.sb-slide img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.sb-slide-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 60px 24px 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
    color: #fff;
}
.sb-slide-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
    color: #fff;
}
.sb-slide-date { font-size: 13px; opacity: 0.85; color: #fff; }
.sb-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 2;
    font-size: 18px;
    color: #000;
}
.sb-slider-prev { left: 12px; }
.sb-slider-next { right: 12px; }

/* Swiper generic */
.sb-swiper {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.sb-swiper .swiper-button-next,
.sb-swiper .swiper-button-prev {
    background: rgba(255, 255, 255, 0.85);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #000;
    transition: background var(--transition);
}
.sb-swiper .swiper-button-next:hover,
.sb-swiper .swiper-button-prev:hover { background: rgba(255, 255, 255, 1); }
.sb-swiper .swiper-button-next::after,
.sb-swiper .swiper-button-prev::after {
    font-size: 16px;
    font-weight: 700;
}
.sb-swiper .swiper-pagination-bullet-active { background: #fff; }
.sb-swiper .swiper-pagination { bottom: 12px; }

/* ==========================================================
   10. GRID SECTIONS (65/35 LAYOUT)
   ========================================================== */
.sb-grid {
    display: grid;
    grid-template-columns: 65% 35%;
    gap: 24px;
    margin: 40px 0;
}
@media (max-width: 900px) {
    .sb-grid { grid-template-columns: 1fr; }
}
.sb-section-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* ==========================================================
   11. POST CARD (horizontal, featured grid)
   ========================================================== */
.sb-card {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 14px;
    transition: transform var(--transition), box-shadow var(--transition);
}
.sb-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.sb-card > a { display: block; }
.sb-card img {
    width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}
.sb-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.35;
}
.sb-card-title a { color: var(--text); }
.sb-card-title a:hover { color: var(--accent); }
.sb-card-excerpt {
    font-size: 13px;
    color: var(--text-soft);
    margin: 0 0 6px;
    line-height: 1.4;
}
.sb-card-meta { font-size: 12px; color: var(--text-soft); }

/* ==========================================================
   12. TICKER (35% sidebar)
   ========================================================== */
.sb-ticker {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    height: 100%;
    overflow: hidden;
}
.sb-ticker-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sb-ticker-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sb-ticker-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.4;
}
.sb-ticker-list li:last-child { border-bottom: none; }
.sb-ticker-list a { color: var(--text); font-weight: 500; }
.sb-ticker-list a:hover { color: var(--accent); }

/* ==========================================================
   13. CAROUSEL (horizontal scroll)
   ========================================================== */
.sb-carousel-wrap { margin: 40px 0; }
.sb-carousel { position: relative; }
.sb-carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sb-carousel-track::-webkit-scrollbar { display: none; }
.sb-carousel-item {
    min-width: 240px;
    max-width: 240px;
    scroll-snap-align: start;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.sb-carousel-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.sb-carousel-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}
.sb-carousel-body { padding: 12px; }
.sb-carousel-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 6px;
}
.sb-carousel-title a { color: var(--text); }
.sb-carousel-title a:hover { color: var(--accent); }
.sb-carousel-date { font-size: 12px; color: var(--text-soft); }

/* ==========================================================
   14. SINGLE POST
   ========================================================== */
.sb-single-wrap { padding: 40px 0; }
.sb-single { max-width: 800px; margin: 0 auto; }
.sb-single-thumb img {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 24px;
}
.sb-single-title {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    color: var(--text);
}

/* Meta */
.sb-single-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    color: var(--text-soft);
    margin: 0 0 24px;
}
.sb-meta-author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text);
}
.sb-meta-avatar { border-radius: 50%; }
.sb-meta-author a { color: var(--text); }
.sb-meta-author a:hover { color: var(--accent); }
.sb-meta-sep { opacity: 0.4; }

/* Breadcrumbs */
.sb-breadcrumbs {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 24px;
    padding: 10px 14px;
    background: var(--bg-soft);
    border-radius: 10px;
}
.sb-breadcrumbs a { color: var(--text-soft); }
.sb-breadcrumbs a:hover { color: var(--accent); }

/* Content */
.sb-single-content {
    font-size: 18px;
    line-height: 1.75;
    color: var(--text);
}
.sb-single-content ul,
.sb-single-content ol {
    padding-left: 1.5em;
    margin: 1em 0;
}
.sb-single-content li {
    margin: 0.5em 0;
    line-height: 1.6;
}
.sb-single-content li::marker {
    color: var(--accent);
    font-weight: 700;
}
.sb-single-content h2 {
    font-size: 28px;
    margin: 2em 0 0.6em;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.sb-single-content h3 {
    font-size: 22px;
    margin: 1.6em 0 0.5em;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.sb-single-content h4 {
    font-size: 18px;
    margin: 1.4em 0 0.4em;
}
.sb-single-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 8px 20px;
    background: var(--bg-soft);
    border-radius: 8px;
    margin: 1.5em 0;
    font-style: italic;
    color: var(--text-soft);
}
.sb-single-content a { text-decoration: underline; text-underline-offset: 3px; }
.sb-single-content img {
    border-radius: var(--radius-sm);
    margin: 1.5em auto;
}
.sb-single-content pre {
    background: var(--bg-soft);
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 14px;
}
.sb-single-content code {
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.sb-single-content pre code { background: transparent; padding: 0; }

/* Tags */
.sb-tags {
    margin: 32px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.sb-tag-label {
    font-size: 13px;
    color: var(--text-soft);
    font-weight: 600;
}
.sb-tags a {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 13px;
    color: var(--text);
    transition: all var(--transition);
}
.sb-tags a:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Post navigation */
.sb-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 40px 0;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.sb-post-nav-next { text-align: right; }
.sb-nav-label {
    display: block;
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sb-post-nav a {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}
.sb-post-nav a:hover { color: var(--accent); }

/* Related posts */
.sb-related { margin: 48px 0 0; }
.sb-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.sb-related-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.sb-related-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.sb-related-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
}
.sb-related-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 12px 12px 6px;
    line-height: 1.35;
}
.sb-related-card h3 a { color: var(--text); }
.sb-related-card h3 a:hover { color: var(--accent); }
.sb-related-card .sb-card-meta {
    display: block;
    font-size: 12px;
    color: var(--text-soft);
    margin: 0 12px 12px;
}

/* ==========================================================
   15. COMMENTS
   ========================================================== */
.sb-comments {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.sb-comments h3 { font-size: 20px; margin-bottom: 24px; }
.sb-comments ol { list-style: none; padding: 0; margin: 0; }
.sb-comments .comment-body {
    padding: 16px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.sb-comments .comment-form input[type="text"],
.sb-comments .comment-form input[type="email"],
.sb-comments .comment-form input[type="url"],
.sb-comments .comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    margin-bottom: 12px;
}
.sb-comments .comment-form input:focus,
.sb-comments .comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.sb-comments .comment-form .submit {
    padding: 12px 28px;
    border-radius: 99px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
.sb-comments .comment-form .submit:hover { background: var(--accent-hover); }

/* ==========================================================
   16. ARCHIVE / SEARCH / CATEGORY
   ========================================================== */
.sb-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.sb-archive-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.sb-archive-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.sb-archive-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.sb-archive-body { padding: 16px; }
.sb-archive-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.35;
}
.sb-archive-title a { color: var(--text); }
.sb-archive-title a:hover { color: var(--accent); }
.sb-archive-excerpt {
    font-size: 14px;
    color: var(--text-soft);
    margin: 0 0 10px;
    line-height: 1.5;
}

/* Pagination */
.pagination,
.navigation.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 32px 0;
    flex-wrap: wrap;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition);
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ==========================================================
   17. SEARCH FORM
   ========================================================== */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
    flex: 1;
    padding: 12px 16px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color var(--transition);
}
.search-form input[type="search"]:focus { border-color: var(--accent); }
.search-form input[type="submit"],
.search-form button {
    padding: 12px 24px;
    border-radius: 99px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
.search-form input[type="submit"]:hover,
.search-form button:hover { background: var(--accent-hover); }

/* ==========================================================
   18. SIDEBAR & WIDGETS
   ========================================================== */
.sb-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.sb-widget {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.sb-widget-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text);
}
.sb-widget ul { list-style: none; padding: 0; margin: 0; }
.sb-widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.sb-widget ul li:last-child { border-bottom: none; }
.sb-widget a { color: var(--text); }
.sb-widget a:hover { color: var(--accent); }

/* ==========================================================
   19. PAGE TEMPLATE
   ========================================================== */
.sb-page {
    max-width: 820px;
    margin: 40px auto;
    padding: 0 20px;
}
.sb-page h1 {
    font-size: 36px;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
    line-height: 1.2;
}

/* ==========================================================
   20. ADSENSE AD SLOTS
   ========================================================== */
.sb-ad-slot {
    overflow: hidden;
    margin: 28px 0;
    text-align: center;
}
.sb-ad-slot ins { display: block; }

/* ==========================================================
   21. POPUP AD
   ========================================================== */
.sb-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 12px;
    max-width: 260px;
    animation: sbPopupIn 0.4s ease;
    border: 1px solid var(--border);
}
.sb-popup img {
    border-radius: 10px;
    width: 100%;
    display: block;
}
.sb-popup a { display: block; }
.sb-popup-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--text);
    color: var(--bg);
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform var(--transition);
}
.sb-popup-close:hover { transform: scale(1.1); }
@keyframes sbPopupIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   22. FOOTER
   ========================================================== */
.sb-footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
    margin-top: 60px;
    color: var(--text);
}

/* Footer 3-column grid */
.sb-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr;
    gap: 40px;
    margin-bottom: 32px;
}

/* Brand column — logo, title, tagline */
.sb-footer-brand .custom-logo-link {
    display: block;
    margin-bottom: 12px;
    width: auto;
    max-width: 180px;
}
.sb-footer-brand .custom-logo-link img,
.sb-footer-brand .custom-logo,
.sb-footer-brand img.custom-logo {
    max-height: 40px !important;
    width: auto !important;
    height: auto !important;
    max-width: 180px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}
.sb-footer-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text);
    letter-spacing: -0.02em;
}
.sb-footer-tagline {
    font-size: 14px;
    color: var(--text-soft);
    margin: 0;
    line-height: 1.5;
    max-width: 340px;
}

/* Links column */
.sb-footer-links h4,
.sb-footer-connect h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--text);
    letter-spacing: -0.01em;
}
.sb-footer-col h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text);
}
.sb-footer-col p {
    font-size: 14px;
    color: var(--text-soft);
    margin: 0 0 8px;
    line-height: 1.5;
}
.sb-footer-col p a { color: var(--text-soft); }
.sb-footer-col p a:hover { color: var(--accent); }

/* Social icons */
.sb-social {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.sb-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    transition: all var(--transition);
}
.sb-social a:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Contact block (below social) */
.sb-footer-contact { margin-top: 22px; }
.sb-footer-contact h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--text);
}
.sb-footer-contact p {
    font-size: 13px;
    color: var(--text-soft);
    margin: 6px 0;
    line-height: 1.4;
}
.sb-footer-contact p a { color: var(--text-soft); }
.sb-footer-contact p a:hover { color: var(--accent); }

/* Footer menu */
.sb-footer-menu { list-style: none; padding: 0; margin: 0; }
.sb-footer-menu li { margin-bottom: 8px; }
.sb-footer-menu a {
    font-size: 14px;
    color: var(--text-soft);
    transition: color var(--transition);
}
.sb-footer-menu a:hover { color: var(--accent); }

/* Credit (locked) */
.sb-credit {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.6;
}
.sb-credit a {
    color: var(--accent);
    font-weight: 600;
}
.sb-credit a:hover { color: var(--accent-hover); }

/* Responsive footer */
@media (max-width: 900px) {
    .sb-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .sb-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .sb-footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ==========================================================
   23. MOBILE DRAWER (≤ 900px)
   ========================================================== */
@media (max-width: 900px) {

    .sb-header-inner {
        flex-wrap: nowrap;
        gap: 10px;
    }
    .sb-logo img,
    .sb-logo .custom-logo { max-height: 32px; width: auto; }
    .sb-site-title { font-size: 17px; }

    /* Show hamburger */
    .sb-menu-toggle { display: flex; }

    /* Nav becomes slide-in drawer */
    .sb-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 82%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        background: var(--card-bg);
        border-left: 1px solid var(--border);
        padding: 80px 24px 32px;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow-y: auto;
        box-shadow: -12px 0 48px rgba(0, 0, 0, 0.15);
        display: block;
    }
    .sb-nav.open { right: 0; }

    .sb-nav ul {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }
    .sb-nav ul li {
        border-bottom: 1px solid var(--border);
        width: 100%;
    }
    .sb-nav ul li:last-child { border-bottom: none; }
    .sb-nav ul a {
        display: block;
        padding: 16px 0;
        font-size: 16px;
        font-weight: 600;
        color: var(--text);
    }
    .sb-nav ul a:hover { color: var(--accent); }

    /* Sub-menu indent */
    .sb-nav ul ul {
        padding-left: 16px;
        border-top: 1px solid var(--border);
    }
    .sb-nav ul ul a { font-size: 15px; padding: 12px 0; }

    /* Overlay backdrop — MUST be BELOW header (100) and drawer (999) */
    .sb-nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }
    .sb-nav-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Desktop pe nav visible, hamburger hidden */
@media (min-width: 901px) {
    .sb-menu-toggle { display: none !important; }
    .sb-nav { display: block !important; position: static !important; }
    .sb-nav-overlay { display: none !important; }
}

/* ==========================================================
   24. WORDPRESS CORE CLASSES
   ========================================================== */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 1em auto; }
.wp-caption { max-width: 100%; text-align: center; }
.wp-caption-text { font-size: 13px; color: var(--text-soft); margin-top: 6px; }
.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px;
    height: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}
.sticky { display: block; }
.bypostauthor { display: block; }
.gallery-caption { font-size: 13px; color: var(--text-soft); }
.wp-block-quote {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    font-style: italic;
}

/* ==========================================================
   25. SELECTION & SCROLLBAR
   ========================================================== */
::selection {
    background: var(--accent);
    color: #fff;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }

/* ==========================================================
   26. RESPONSIVE — TABLET
   ========================================================== */
@media (max-width: 1024px) {
    .sb-container { padding: 0 16px; }
    .sb-single-title { font-size: 32px; }
    .sb-slide-title { font-size: 20px; }
}

/* ==========================================================
   27. RESPONSIVE — MOBILE
   ========================================================== */
@media (max-width: 768px) {
    body { font-size: 16px; }

    /* Header */
    .sb-header-inner { padding: 12px 0; }

    /* Single */
    .sb-single-title { font-size: 28px; }
    .sb-single-content { font-size: 17px; }

    /* Cards */
    .sb-card { grid-template-columns: 100px 1fr; padding: 12px; }
    .sb-card img { width: 100px; height: 80px; }

    /* Carousel */
    .sb-carousel-item { min-width: 200px; max-width: 200px; }
    .sb-carousel-item img { height: 120px; }

    /* Hero */
    .sb-slide-title { font-size: 18px; }
    .sb-slide-overlay { padding: 40px 16px 16px; }

    /* Related */
    .sb-related-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .sb-related-card img { height: 110px; }

    /* Post nav */
    .sb-post-nav { grid-template-columns: 1fr; }
    .sb-post-nav-next { text-align: left; }

    /* Popup */
    .sb-popup {
        max-width: 200px;
        bottom: 12px;
        right: 12px;
        padding: 10px;
    }

    /* Footer */
    .sb-footer { padding: 32px 0 16px; }
    .sb-footer-grid { gap: 24px; }
}

/* ==========================================================
   28. RESPONSIVE — SMALL MOBILE
   ========================================================== */
@media (max-width: 480px) {
    .sb-container { padding: 0 14px; }
    .sb-single-title { font-size: 24px; }
    .sb-section-title { font-size: 18px; }
    .sb-related-grid { grid-template-columns: 1fr; }
    .sb-archive-grid { grid-template-columns: 1fr; }
    .sb-theme-toggle { width: 44px; height: 26px; }
    .sb-theme-toggle::after { width: 20px; height: 20px; }
    [data-theme="dark"] .sb-theme-toggle::after { transform: translateX(18px); }
    .sb-header-actions { gap: 6px; }
    .sb-menu-toggle { width: 38px; height: 38px; padding: 8px; }
    .sb-menu-toggle span { width: 22px; }
}

/* ==========================================================
   29. PRINT STYLES
   ========================================================== */
@media print {
    .sb-header,
    .sb-footer,
    .sb-popup,
    .sb-header-ad,
    .sb-post-nav,
    .sb-related,
    .sb-comments,
    .sb-breadcrumbs,
    .sb-tags,
    .sb-theme-toggle,
    .sb-menu-toggle,
    .sb-nav-overlay,
    .sb-ad-slot { display: none !important; }
    body { background: #fff; color: #000; }
    .sb-single { max-width: 100%; }
}

/* ==========================================================
   30. ACCESSIBILITY & FOCUS
   ========================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}