/* ====================================
   UpBrightSkills - Main Stylesheet
   Design matching the provided mockup
   ==================================== */

/* ---- CSS Variables ---- */
:root {
    --primary: #3A7BBF;
    --primary-dark: #2E6399;
    --primary-light: #EBF3FB;
    --secondary: #1B2E4A;
    --secondary-dark: #142338;
    --accent: #4CAF50;
    --accent-light: #E8F5E9;
    --bg: #EEF3F8;
    --bg-white: #FFFFFF;
    --bg-dark: #1a2332;
    --text: #333333;
    --text-light: #5A5E5F;
    --text-muted: #888888;
    --border: #E2E8F0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.3s ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-white: #1e293b;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
    --primary-light: #172a3d;
    --accent-light: #1d2e1a;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    background: linear-gradient(180deg, #EAF1F8 0%, #F3F6FA 34%, #EEF3F8 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Reading Progress Bar ---- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    z-index: 10000;
    transition: width 0.1s linear;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58,123,191,0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-icon {
    width: 40px; height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* ---- Header ---- */
.header {
    background: var(--bg-white);
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    color: var(--text);
    flex-shrink: 0;
}

.logo-icon {
    width: 44px; height: 44px;
    flex-shrink: 0;
}
.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text {
    font-weight: 600;
    color: var(--primary);
    font-size: 22px;
}
.logo-text strong {
    color: var(--accent);
    font-weight: 700;
}

.logo-tagline {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.3px;
}

.main-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 18px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 15px;
    color: var(--text);
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 25px;
    padding: 6px 16px;
    width: 200px;
    transition: var(--transition);
}
.search-box:focus-within {
    border-color: var(--primary);
    width: 280px;
    box-shadow: 0 0 0 3px rgba(58,123,191,0.1);
}

.search-icon {
    color: var(--text-muted);
    font-size: 14px;
    margin-right: 8px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    width: 100%;
    color: var(--text);
    font-family: var(--font);
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 100;
    max-height: 320px;
    overflow-y: auto;
}
.search-suggestions.active { display: block; }

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: var(--transition);
}
.search-suggestion-item:hover {
    background: var(--primary-light);
}
.search-suggestion-item img {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}
.search-suggestion-item span {
    font-size: 14px;
    font-weight: 500;
}

/* User Menu */
.user-menu { position: relative; }
.user-btn {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}
.user-avatar-small {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-white);
    min-width: 220px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 100;
    overflow: hidden;
}
.user-dropdown.active { display: block; }

.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dropdown-header strong { font-size: 14px; }
.dropdown-header small { color: var(--text-muted); font-size: 12px; }

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text);
}
.user-dropdown a:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.user-dropdown a i {
    width: 18px;
    text-align: center;
    color: var(--text-muted);
}
.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0;
}

.dropdown-form button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
}
.dropdown-form button:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.dropdown-form button i {
    width: 18px;
    text-align: center;
    color: var(--text-muted);
}
.mobile-toggle {
    display: none;
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text);
}

/* Search icon for very small screens (shown at 480px, hidden otherwise) */
.search-icon-mobile {
    display: none;
    border: none;
    background: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text);
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    text-decoration: none;
}
.search-icon-mobile:hover {
    background: var(--bg);
    color: var(--primary);
}

/* ---- Alerts ---- */
.alert {
    padding: 14px 0;
    font-size: 14px;
    font-weight: 500;
}
.alert .container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #D4EDDA; color: #155724; }
.alert-danger { background: #F8D7DA; color: #721C24; }
.alert-close {
    margin-left: auto;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}
.alert-close:hover { opacity: 1; }

/* ---- Hero Section ---- */
.hero {
    background: linear-gradient(135deg, #3A7BBF 0%, #4A8ECC 25%, #5A9E6A 60%, #6EA532 100%);
    padding: 70px 0;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 20px 20px;
}
.hero::before {
    content: none;
}
.hero::after {
    content: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.hero-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.15;
    margin-bottom: 16px;
}

.hero-tagline {
    font-size: 17px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 32px;
    font-weight: 400;
    line-height: 1.7;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-showcase {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1fr);
    gap: 34px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-showcase .hero-content {
    max-width: 680px;
}

.hero-showcase-no-carousel {
    grid-template-columns: minmax(0, 860px);
    justify-content: center;
    text-align: center;
}

.hero-showcase-no-carousel .hero-content {
    max-width: 860px;
    margin: 0 auto;
}

.hero-showcase-no-carousel .hero-tagline {
    margin-left: auto;
    margin-right: auto;
    max-width: 760px;
}

.hero-showcase-no-carousel .hero-buttons {
    justify-content: center;
}

.hero-label {
    letter-spacing: 0;
}

.home-carousel,
.related-carousel {
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.home-carousel {
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(20,35,56,0.16);
}

.carousel-track {
    position: relative;
    min-height: 100%;
}

.home-carousel .carousel-slide {
    display: none;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
    min-height: 360px;
    background: var(--bg-white);
}

.home-carousel .carousel-slide.active {
    display: grid;
    animation: carouselFade 0.45s ease both;
}

.carousel-media {
    display: block;
    min-height: 100%;
    background: var(--primary-light);
    overflow: hidden;
}

.carousel-media img,
.carousel-media .placeholder-image {
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
}

.carousel-copy {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.carousel-kicker,
.eyebrow {
    display: inline-flex;
    width: fit-content;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 14px;
}

.carousel-copy h2 {
    font-size: 25px;
    line-height: 1.25;
    color: var(--secondary);
    margin-bottom: 12px;
}

.carousel-copy h2 a:hover {
    color: var(--primary);
}

.carousel-copy p {
    color: var(--text-light);
    line-height: 1.65;
    margin-bottom: 18px;
}

.carousel-link {
    color: var(--primary);
    font-weight: 700;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.carousel-link:hover {
    color: var(--accent);
    gap: 12px;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--bg-white);
    color: var(--primary);
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 4;
}

.carousel-control:hover {
    background: var(--primary);
    color: #fff;
}

.carousel-control.prev {
    left: 14px;
}

.carousel-control.next {
    right: 14px;
}

.carousel-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 5;
}

.carousel-dots button {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 50%;
    background: rgba(58,123,191,0.28);
    cursor: pointer;
    transition: var(--transition);
}

.carousel-dots button.active {
    width: 26px;
    border-radius: 999px;
    background: var(--accent);
}

@keyframes carouselFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.home-stats-band {
    padding: 24px 0 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card span {
    display: block;
    color: var(--primary);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
}

.stat-card p {
    color: var(--text-light);
    line-height: 1.5;
    font-size: 14px;
}

.section-subtitle {
    color: var(--text-light);
    margin-top: 12px;
    max-width: 680px;
    line-height: 1.6;
}

.section-header.compact {
    margin-bottom: 22px;
}

.topic-strip-section {
    padding-top: 10px;
    padding-bottom: 28px;
}

.topic-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--secondary);
    font-weight: 700;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.topic-chip i {
    color: var(--primary);
}

.topic-chip strong {
    min-width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
}

.topic-chip:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--primary);
}

.home-insights-section {
    padding-top: 20px;
}

.insights-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}

.insight-panel {
    background: linear-gradient(135deg, var(--secondary), var(--primary-dark));
    color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.insight-panel h2 {
    font-size: 28px;
    line-height: 1.25;
    margin-bottom: 14px;
}

.insight-panel p {
    color: rgba(255,255,255,0.86);
    line-height: 1.7;
    margin-bottom: 22px;
}

.insight-panel .eyebrow {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.insight-list {
    display: grid;
    gap: 14px;
}

.insight-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    padding: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.insight-item i {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
}

.insight-item h3 {
    color: var(--secondary);
    font-size: 17px;
    margin-bottom: 6px;
}

.insight-item p {
    color: var(--text-light);
    line-height: 1.55;
    font-size: 14px;
}

.btn-outline-white {
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    background: transparent;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-outline-white:hover {
    background: #FFFFFF;
    color: var(--primary);
}

.btn-white {
    background: #FFFFFF;
    color: var(--primary);
    border: 2px solid #FFFFFF;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-white:hover {
    background: transparent;
    color: #FFFFFF;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-ad {
    position: relative;
    z-index: 1;
}

/* ---- Ad Banners ---- */
.ad-banner {
    width: 100%;
    min-width: 0;
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    background: var(--bg-white);
    box-shadow: var(--shadow);
    border: 0;
    padding: 0;
    cursor: pointer;
}
.ad-banner:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.ad-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ad-banner iframe {
    width: 100%;
    height: 100%;
    min-height: 180px;
    border: 0;
    display: block;
}
.ad-slot {
    min-width: 0;
    width: 100%;
}
.ad-slot + .ad-slot {
    margin-top: 16px;
}
.ad-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.video-ad-thumbnail {
    position: relative;
    overflow: hidden;
    min-height: 160px;
}
.video-ad-thumbnail .play-icon-overlay {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(0,0,0,0.72);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.video-ad-thumbnail .play-icon-overlay i {
    margin-left: 3px;
}
.ad-post {
    min-height: 110px;
    max-width: 970px;
    margin-inline: auto;
}
.ad-post iframe {
    aspect-ratio: 16 / 9;
}
.ad-post-top,
.ad-post-inline,
.ad-post-bottom {
    margin: 28px auto;
}

/* Header Ad */
.header-ad-section {
    padding: 18px 0 22px;
    background: #EAF1F8;
    border-bottom: 1px solid rgba(58,123,191,0.12);
}
.home-ad-grid,
.footer-ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 22px;
    align-items: stretch;
}
.home-ad-grid-1,
.footer-ads-count-1 {
    grid-template-columns: minmax(0, 1fr);
}
.home-ad-grid-2,
.footer-ads-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-ad-grid-3,
.footer-ads-count-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ad-header {
    width: 100%;
    max-width: none;
    margin: 0;
    height: 100% !important;
    min-height: 0 !important;
    border-radius: var(--radius);
}
.home-ad-grid .ad-slot {
    display: flex;
    align-items: stretch;
    height: clamp(170px, 13vw, 210px);
}
.home-ad-grid .ad-banner {
    height: 100% !important;
    min-height: 0 !important;
}
.ad-header img,
.ad-header iframe {
    height: 100% !important;
    min-height: 0 !important;
    object-fit: cover;
}
.ad-header.video-ad-thumbnail {
    display: flex;
}

.ad-placeholder {
    background: linear-gradient(135deg, #E2E8F0, #CBD5E1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 16px;
    min-height: 120px;
    margin-bottom: 16px;
}

/* Sidebar Ads */
.ad-sidebar {
    margin-bottom: 0;
    min-height: 150px;
    height: 100%;
    width: 100%;
}
.home-side-ads {
    display: grid;
    gap: 16px;
}
.home-side-ads-1 {
    grid-template-columns: 1fr;
}
.home-side-ads-1 .ad-sidebar {
    aspect-ratio: 16 / 9;
}
.home-side-ads-2,
.home-side-ads-3 {
    grid-template-columns: 1fr;
}

/* ---- Sections ---- */
.section {
    padding: 50px 0;
}

.trending-section,
.latest-section,
.topic-strip-section {
    background: transparent;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--secondary);
    position: relative;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.view-all {
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.view-all:hover {
    color: var(--primary);
}

/* ---- Content Layout ---- */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
    align-items: start;
}
.home-featured-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
    align-items: stretch;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(58,123,191,0.14);
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 14px 34px rgba(20,35,56,0.07);
}
.home-featured-layout.has-featured-ads {
    grid-template-columns: minmax(0, 1fr) clamp(260px, 24vw, 360px);
}

/* ---- Post Cards ---- */
.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 24px;
}
.featured-grid {
    align-items: stretch;
    height: 100%;
}
.featured-count-1 {
    grid-template-columns: minmax(280px, 420px);
}
.featured-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.featured-count-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.home-featured-layout.has-featured-ads .featured-count-3 {
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}
.featured-ad-stack {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(0, 1fr);
    gap: 16px;
    align-self: stretch;
    height: 100%;
    min-height: 0;
}
.featured-ad-stack-1 {
    grid-template-rows: minmax(0, 1fr);
}
.featured-ad-stack-2 {
    grid-template-rows: repeat(2, minmax(0, 1fr));
}
.featured-ad-stack-3 {
    grid-template-rows: repeat(3, minmax(0, 1fr));
}
.featured-ad-card {
    min-height: 0;
    height: 100%;
    aspect-ratio: auto;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.featured-ad-stack-1 .featured-ad-card {
    aspect-ratio: auto;
}
.featured-ad-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.trending-section .section-header {
    align-items: end;
}

.post-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-card-image {
    height: 180px;
    overflow: hidden;
    background: var(--bg);
}
.post-card-image img { width: 100%; height: 100%; object-fit: contain; background: var(--bg);
    transition: transform 0.4s ease;
}
.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3A7BBF 0%, #5A9E6A 50%, #6EA532 100%);
    color: rgba(255,255,255,0.5);
    font-size: 40px;
}

.post-card-body {
    padding: 16px;
    display: flex;
    flex: 1;
    flex-direction: column;
}
.post-card-body .btn {
    align-self: flex-start;
    margin-top: auto;
}

.post-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.post-card-meta i {
    margin-right: 4px;
}

/* ---- Horizontal Post Card ---- */
.post-horizontal {
    display: flex;
    gap: 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: var(--transition);
}
.post-horizontal:hover {
    box-shadow: var(--shadow-lg);
}

.post-h-image { width: 200px; min-height: 160px; flex-shrink: 0; overflow: hidden; background: var(--bg); } .post-h-image img { width: 100%; height: 100%; object-fit: contain;
}

.post-h-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.post-h-body .btn {
    align-self: flex-start;
}

.post-h-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}
.post-h-title a:hover {
    color: var(--primary);
}

.post-excerpt {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar-ads {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar {
    position: sticky;
    top: 90px;
}

.widget {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.category-list li {
    margin-bottom: 8px;
}
.category-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-light);
    transition: var(--transition);
}
.category-list li a:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.category-list li a i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

/* Newsletter Widget */
.newsletter-widget {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    text-align: center;
}
.newsletter-widget .widget-title {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.3);
}
.newsletter-widget p {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.newsletter-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 12px;
    font-family: var(--font);
    background: rgba(255,255,255,0.15);
    color: #fff;
    transition: var(--transition);
}
.newsletter-form input::placeholder {
    color: rgba(255,255,255,0.6);
}
.newsletter-form input:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255,255,255,0.25);
}
.newsletter-form .btn {
    width: 100%;
    justify-content: center;
    background: #fff;
    color: var(--primary);
    font-weight: 700;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
}
.newsletter-form .btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ---- Footer Ads ---- */
.footer-ads-section {
    padding: 30px 0;
    background: linear-gradient(135deg, #E8EDF5 0%, #F0F4FA 50%, #E5EBF5 100%);
}

.footer-ads-grid {
    align-items: stretch;
}

.footer-ads-grid .ad-footer {
    height: 200px;
    border-radius: var(--radius);
}

/* ---- Footer ---- */
.footer {
    background: linear-gradient(135deg, #142338 0%, #1B3A5C 40%, #1E4A3A 70%, #1A3D2D 100%);
    color: #CBD5E1;
    padding: 60px 0 0;
    position: relative;
}
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3A7BBF, #4CAF50);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer h4 {
    color: white;
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer p {
    font-size: 14px;
    line-height: 1.7;
    color: #94A3B8;
}

.footer ul li {
    margin-bottom: 10px;
}
.footer ul li a {
    font-size: 14px;
    color: #94A3B8;
    transition: var(--transition);
}
.footer ul li a:hover {
    color: var(--primary);
    padding-left: 4px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 42px; height: 42px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    transition: var(--transition);
}
.social-link:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.footer-contact-form input,
.footer-contact-form textarea {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    color: white;
    font-size: 14px;
    font-family: var(--font);
}
.footer-contact-form input::placeholder,
.footer-contact-form textarea::placeholder {
    color: #64748B;
}
.footer-contact-form input:focus,
.footer-contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 14px;
    color: #64748B;
}

/* ---- Dark Mode Toggle ---- */
.dark-mode-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.dark-mode-toggle:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.scroll-top-btn {
    position: fixed;
    right: 30px;
    bottom: 92px;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 998;
    transition: var(--transition);
}

.scroll-top-btn:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

/* ---- Blog List Page ---- */
.page-header {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    padding: 40px 0;
    color: white;
    margin-bottom: 40px;
}
.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}
.page-header p {
    font-size: 16px;
    opacity: 0.8;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}
.blog-pagination {
    width: 100%;
    margin: 4px 0 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text);
    transition: var(--transition);
}
.pagination a:hover, .pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.blog-pagination .btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    width: auto;
}
.blog-pagination .btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---- Single Post Page ---- */
.post-single {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
}

.post-single-header {
    margin-bottom: 30px;
}

.post-category-badge {
    display: inline-block;
    padding: 4px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.post-single-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--secondary);
    margin-bottom: 16px;
}

.post-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 14px;
    color: var(--text-muted);
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.post-meta-bar i { margin-right: 4px; }

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}
.author-info div strong {
    display: block;
    color: var(--text);
    font-size: 15px;
}
.author-info div span {
    font-size: 13px;
    color: var(--text-muted);
}

.post-stats {
    display: flex;
    gap: 16px;
    align-items: center;
}
.post-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-muted);
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.post-author-info img {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.post-featured-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 30px;
    max-height: 460px;
}
.post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Table of Contents */
.toc {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary);
}
.toc h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--secondary);
}
.toc ul { counter-reset: toc; }
.toc li {
    counter-increment: toc;
    margin-bottom: 6px;
}
.toc li a {
    font-size: 14px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.toc li a::before {
    content: counter(toc) ".";
    font-weight: 600;
    color: var(--primary);
}
.toc li a:hover { color: var(--primary); }
.toc li.toc-h3 { padding-left: 20px; }
.toc li.toc-h4 { padding-left: 40px; }

/* Post Content */
.post-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text);
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
    overflow: hidden;
}
.post-content * {
    max-width: 100%;
}
.post-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 36px 0 16px;
    color: var(--secondary);
}
.post-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 28px 0 12px;
    color: var(--secondary);
}
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6,
.post-content p,
.post-content span {
    background: transparent !important;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
}
.post-content .ql-align-center,
.post-content [style*="text-align: center"] {
    text-align: center;
}
.post-content .ql-align-right,
.post-content [style*="text-align: right"] {
    text-align: right;
}
.post-content .ql-align-justify,
.post-content [style*="text-align: justify"] {
    text-align: justify;
}
.post-content p { margin-bottom: 18px; }
.post-content p,
.post-content li {
    max-width: 100%;
    white-space: normal;
}
.post-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 20px 0;
}
.post-content iframe,
.post-content video,
.post-content .ql-video {
    display: block;
    width: min(100%, 760px) !important;
    max-width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
    min-height: 0;
    max-height: 430px;
    margin: 24px 0;
    border: 0;
    border-radius: var(--radius);
    background: #000;
}
.post-content .video-embed {
    margin: 24px 0;
    width: min(100%, 760px);
    max-width: 100%;
    overflow: hidden;
}
.post-content a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 768px) {
    .single-post .container {
        width: min(100% - 28px, 1200px);
    }
    .post-content {
        font-size: 16px;
    }
    .post-content iframe,
    .post-content video,
    .post-content .ql-video {
        max-height: none;
    }
}
.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 24px;
    background: var(--primary-light);
    margin: 24px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}
.post-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 20px 0;
}
.post-content code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}
.post-content pre code {
    background: none;
    padding: 0;
}
.post-content .ql-code-block-container,
.post-content .ql-code-block {
    background: #1e293b;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
}
.post-content .ql-code-block-container {
    padding: 20px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 20px 0;
}
.post-content ul, .post-content ol {
    margin: 16px 0;
    padding-left: 24px;
    list-style: disc;
}
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 8px; }
.post-content a { color: var(--primary); text-decoration: underline; }

.post-dek {
    margin-top: 18px;
    padding: 16px 18px;
    border-left: 4px solid var(--accent);
    background: var(--primary-light);
    color: var(--text);
    line-height: 1.7;
    border-radius: 0 8px 8px 0;
}

/* Post Actions */
.post-actions, .post-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 30px 0;
}
.post-actions-left {
    display: flex;
    gap: 12px;
}
.post-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.share-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    margin-right: 4px;
}
.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    transition: var(--transition);
}
.action-btn:hover, .action-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 8px;
}
.share-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    transition: var(--transition);
}
.share-btn:hover { transform: translateY(-2px); opacity: 0.9; }
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.linkedin { background: #0A66C2; }
.share-btn.whatsapp { background: #25D366; }
.share-btn.telegram { background: #0088cc; }
.share-btn.copy { background: var(--text-muted); }

/* Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}
.tag-badge {
    padding: 4px 14px;
    background: var(--bg);
    border-radius: 25px;
    font-size: 13px;
    color: var(--text-light);
    transition: var(--transition);
    border: 1px solid var(--border);
}
.tag-badge:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Author Bio */
.author-card {
    display: flex;
    gap: 20px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 30px 0;
}
.author-card img {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
}
.author-card h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 4px;
}
.author-card p {
    font-size: 14px;
    color: var(--text-light);
}

/* Post Navigation */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}
.post-nav-item {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.post-nav-item:hover {
    box-shadow: var(--shadow-lg);
}
.post-nav-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.post-nav-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.post-nav-next { text-align: right; }

/* Related Posts */
.related-posts {
    margin: 40px 0;
}
.related-posts h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--secondary);
}

.related-carousel {
    padding: 4px 2px 42px;
}

.related-carousel .related-carousel-track {
    display: flex;
    transition: transform 0.35s ease;
}

.related-carousel .carousel-slide {
    min-width: 100%;
    padding: 0 2px;
}

.related-carousel .post-card {
    max-width: 520px;
}

.related-carousel .carousel-control {
    top: auto;
    bottom: 0;
    transform: none;
}

.related-carousel .carousel-control.prev {
    left: 0;
}

.related-carousel .carousel-control.next {
    right: auto;
    left: 46px;
}

.related-carousel .carousel-dots {
    left: 112px;
    right: auto;
    bottom: 12px;
}

.post-content .post-media-carousel {
    position: relative;
    overflow: hidden;
    margin: 28px 0;
    border-radius: 8px;
    background: var(--bg-white);
    box-shadow: var(--shadow);
}

.post-content .post-media-carousel .carousel-track {
    min-height: 260px;
}

.post-content .post-media-carousel .carousel-slide {
    display: none;
    width: 100%;
    background: #000;
}

.post-content .post-media-carousel .carousel-slide.active {
    display: block;
    animation: carouselFade 0.35s ease both;
}

.post-content .post-media-carousel img,
.post-content .post-media-carousel iframe,
.post-content .post-media-carousel video {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
    min-height: 260px;
    object-fit: contain;
    margin: 0;
    border-radius: 0;
    background: #000;
}

.post-content .post-media-carousel .carousel-dots {
    bottom: 12px;
}

.post-content .builder-hero,
.post-content .builder-section,
.post-content .builder-two-col,
.post-content .builder-card-grid,
.post-content .builder-cta,
.post-content .builder-faq,
.post-content .builder-timeline,
.page-content .builder-hero,
.page-content .builder-section,
.page-content .builder-two-col,
.page-content .builder-card-grid,
.page-content .builder-cta,
.page-content .builder-faq,
.page-content .builder-timeline {
    margin: 28px 0;
}

.post-content .builder-hero,
.page-content .builder-hero {
    padding: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    border: 1px solid var(--border);
}

.builder-eyebrow {
    display: inline-flex;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--bg-white);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 12px;
}

.builder-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 700;
}

.builder-button:hover {
    background: var(--accent);
}

.post-content .builder-section,
.page-content .builder-section,
.post-content .builder-faq,
.page-content .builder-faq,
.post-content .builder-timeline,
.page-content .builder-timeline {
    padding: 24px;
    border-radius: 8px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.post-content .builder-two-col,
.page-content .builder-two-col,
.post-content .builder-card-grid,
.page-content .builder-card-grid {
    display: grid;
    gap: 18px;
}

.post-content .builder-two-col,
.page-content .builder-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-content .builder-card-grid,
.page-content .builder-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.builder-card {
    padding: 20px;
    border-radius: 8px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.builder-cta {
    padding: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--secondary), var(--primary-dark));
    color: #fff;
}

.builder-cta h2,
.builder-cta p {
    color: #fff !important;
}

@media (max-width: 768px) {
    .post-content .builder-two-col,
    .page-content .builder-two-col,
    .post-content .builder-card-grid,
    .page-content .builder-card-grid {
        grid-template-columns: 1fr;
    }
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Author Box */
.author-box {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--bg);
    border-radius: var(--radius);
    margin: 30px 0;
    border: 1px solid var(--border);
}
.author-box-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--primary-light);
}
.author-box-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 4px;
}
.author-box-info p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Post Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 30px 0;
}
.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    max-width: 45%;
}
.post-nav-link:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.nav-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}
.nav-title {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
}

/* Comments Section */
.comments-section {
    margin-top: 40px;
}
.comments-section h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--secondary);
}

.comment-form {
    margin-bottom: 30px;
}
.comment-form textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    resize: vertical;
    min-height: 100px;
    background: var(--bg-white);
    color: var(--text);
}
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-item, .comment {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.comment-item img, .comment-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}
.comment-author {
    font-weight: 600;
    font-size: 14px;
}
.comment-date {
    font-size: 12px;
    color: var(--text-muted);
}
.comment-text {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 8px;
}
.comment-actions {
    display: flex;
    gap: 16px;
    font-size: 13px;
}
.comment-actions button, .comment-actions a {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}
.comment-actions button:hover, .comment-actions a:hover {
    color: var(--primary);
}

.comment-replies {
    margin-left: 60px;
    margin-top: 10px;
}
.comment-replies .comment-item,
.comment-replies .comment {
    background: var(--bg);
}

.reply-toggle,
.edit-toggle {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.reply-toggle:hover,
.edit-toggle:hover {
    background: var(--bg);
    color: var(--primary-dark, var(--primary));
}
.edit-toggle {
    color: var(--text-muted);
}
.edit-toggle:hover {
    color: var(--secondary);
}

.reply-form {
    display: none;
    margin-top: 12px;
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.reply-form.active { display: block; }
.reply-form .form-group,
.edit-form .form-group { margin-bottom: 10px; }
.reply-form textarea,
.edit-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.reply-form textarea:focus,
.edit-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.reply-form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Edit Form */
.edit-form {
    display: none;
    margin-top: 12px;
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.comment-pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.comment-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}
.comment-page-btn:hover,
.comment-page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.no-comments {
    color: var(--text-muted);
    text-align: center;
    padding: 30px;
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

/* ---- Auth Pages ---- */
.auth-wrapper {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}
.auth-card h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--secondary);
    text-align: center;
}
.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    transition: var(--transition);
    background: var(--bg-white);
    color: var(--text);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58,123,191,0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='gray' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-check input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--primary);
}

.auth-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
    color: var(--text-muted);
    font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.btn-google {
    background: #fff;
    color: #1f2937;
    border: 1px solid var(--border);
    width: 100%;
    justify-content: center;
}
.btn-google:hover {
    background: var(--bg);
    border-color: #cbd5e1;
}
.btn-google i {
    color: #4285F4;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-link a {
    color: var(--primary);
    font-weight: 600;
}

/* ---- Contact Page ---- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px 0;
}

.contact-info h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--secondary);
}

.contact-form .form-control {
    margin-bottom: 16px;
}

/* ---- Search Page ---- */
.search-results {
    padding: 40px 0;
}

.search-header {
    margin-bottom: 30px;
}
.search-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary);
}
.search-header p {
    color: var(--text-muted);
}

.search-input-large {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}
.search-input-large input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: var(--font);
    background: var(--bg-white);
    color: var(--text);
}
.search-input-large input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ---- Categories Page ---- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    padding: 40px 0;
}

.category-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.category-card i {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 16px;
}
.category-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--secondary);
}
.category-card p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* ---- User Dashboard ---- */
.user-dashboard {
    padding: 40px 0;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

.user-sidebar {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 90px;
    height: fit-content;
}
.user-sidebar-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.user-sidebar-header img {
    width: 80px; height: 80px;
    border-radius: 50%;
    margin: 0 auto 12px;
    object-fit: cover;
}
.user-sidebar-header h4 { font-size: 16px; font-weight: 600; }
.user-sidebar-header small { color: var(--text-muted); }

.user-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
}
.user-sidebar-nav a:hover, .user-sidebar-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
}
.user-sidebar-nav a i {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
}

.user-content {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}
.user-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 24px;
}

/* ---- Stats Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card:nth-child(1)::before { background: linear-gradient(90deg, #3A7BBF, #60A5FA); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, #10B981, #34D399); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #EF4444, #F87171); }
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon.blue { background: linear-gradient(135deg, #3A7BBF, #60A5FA); color: white; }
.stat-icon.green { background: linear-gradient(135deg, #10B981, #34D399); color: white; }
.stat-icon.orange { background: linear-gradient(135deg, #F59E0B, #FBBF24); color: white; }
.stat-icon.red { background: linear-gradient(135deg, #EF4444, #F87171); color: white; }
.stat-icon.purple { background: linear-gradient(135deg, #8B5CF6, #A78BFA); color: white; }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.stat-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---- Tables ---- */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    background: var(--bg);
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}
.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.data-table tr:hover td {
    background: var(--primary-light);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 25px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* ---- Page Content ---- */
.page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
}
.page-content h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 24px;
}
.page-content .content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
}
.page-content .content h2 { font-size: 24px; margin: 30px 0 16px; }
.page-content .content p { margin-bottom: 16px; }

/* ---- Utility Classes ---- */
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 16px; }
.mt-3 { margin-top: 16px; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

/* ---- Page Hero Section ---- */
.page-hero {
    background: linear-gradient(135deg, #3A7BBF 0%, #4A8ECC 45%, #5A9E6A 100%);
    padding: 62px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid var(--accent);
    box-shadow: 0 18px 40px rgba(20,35,56,0.12);
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 30%, rgba(255,255,255,0.18), transparent 28%),
        linear-gradient(90deg, rgba(255,255,255,0.08), transparent 55%);
    pointer-events: none;
}
.page-hero .container {
    position: relative;
    z-index: 1;
}
.page-hero h1 {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}
.page-hero p {
    color: rgba(255,255,255,0.88);
    font-size: 16px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Content Grid (Blog listing) ---- */
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
    padding: 40px 0;
    align-items: start;
    max-width: 100%;
    overflow: hidden;
}
.content-grid > .main-content,
.content-grid > .sidebar,
.single-post,
.page-content-wrapper {
    min-width: 0;
    max-width: 100%;
}
.content-grid > .main-content {
    overflow: hidden;
}
.blog-listing-page .blog-content-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 26px;
    padding: 28px 0 52px;
    overflow: visible;
}
.blog-listing-page .main-content {
    overflow: visible;
}
.blog-listing-page .posts-list {
    gap: 18px;
}

.single-post .container {
    width: min(100% - 40px, 1200px);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
}

.post-header,
.post-actions-bar,
.table-of-contents,
.post-content,
.post-tags,
.author-box,
.post-navigation,
.related-posts,
.comments-section {
    max-width: 100%;
    min-width: 0;
}

.post-title,
.post-content h1 {
    max-width: 100%;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.18;
    overflow-wrap: break-word;
    word-break: normal;
}

/* ---- Post Card Horizontal (Blog/Category listing) ---- */
.post-card-horizontal {
    display: flex;
    gap: 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: var(--transition);
}
.blog-listing-page .post-card-horizontal {
    margin-bottom: 0;
    min-height: 156px;
}
.post-card-horizontal:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.post-card-horizontal .post-card-image {
    width: 260px;
    min-height: 200px;
    flex-shrink: 0;
    overflow: hidden;
    display: block;
}
.post-card-horizontal .post-card-image img { width: 100%; height: 100%; object-fit: contain; background: var(--bg);
    transition: transform 0.4s ease;
}
.blog-listing-page .post-card-horizontal .post-card-image {
    width: 240px;
    min-height: 156px;
    background: var(--bg);
}
.blog-listing-page .post-card-horizontal .post-card-content {
    padding: 18px 20px;
    min-width: 0;
}
.blog-listing-page .post-card-excerpt {
    max-width: 100%;
}
.blog-listing-page .post-card-meta {
    gap: 12px 14px;
    flex-wrap: wrap;
}
.post-card-horizontal:hover .post-card-image img {
    transform: scale(1.05);
}
.post-card-horizontal .post-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.post-card-category {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
    width: fit-content;
}
.post-card-horizontal .post-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}
.post-card-horizontal .post-card-title a:hover {
    color: var(--primary);
}
.post-card-excerpt {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Sidebar Widgets ---- */
.sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.blog-listing-page .sidebar {
    align-self: start;
}
.blog-listing-page .sidebar-widget {
    margin-bottom: 18px;
}
.blog-listing-page .category-list li a {
    padding: 8px 0;
}
.sidebar-widget .widget-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

/* Sidebar Newsletter Override */
.sidebar-widget.newsletter-widget {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    text-align: center;
}
.sidebar-widget.newsletter-widget .widget-title {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.3);
}
.sidebar-widget.newsletter-widget p {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ---- Tag Cloud ---- */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-badge {
    display: inline-block;
    padding: 5px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-light);
    transition: var(--transition);
}
.tag-badge:hover, .tag-badge.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}
.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text);
}

/* ---- Auth Page Enhancements ---- */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}
.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
}
.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    color: var(--text);
    margin-bottom: 20px;
}
.auth-logo .logo-icon {
    width: 42px;
    height: 42px;
    background: none;
    border-radius: 0;
}
.auth-logo .logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.auth-logo span strong {
    color: var(--accent);
}
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* ---- Form Elements (Global inside auth & contact) ---- */
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="tel"],
.auth-form input[type="url"],
.auth-form textarea,
.auth-form select,
.contact-grid input[type="text"],
.contact-grid input[type="email"],
.contact-grid input[type="tel"],
.contact-grid textarea,
.contact-grid select,
.admin-card input[type="text"],
.admin-card input[type="email"],
.admin-card input[type="password"],
.admin-card input[type="tel"],
.admin-card input[type="url"],
.admin-card input[type="number"],
.admin-card input[type="date"],
.admin-card textarea,
.admin-card select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    transition: var(--transition);
    background: var(--bg-white);
    color: var(--text);
    outline: none;
}
.auth-form input:focus,
.contact-grid input:focus,
.contact-grid textarea:focus,
.admin-card input:focus,
.admin-card textarea:focus,
.admin-card select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58,123,191,0.12);
}
.auth-form input::placeholder,
.contact-grid input::placeholder,
.contact-grid textarea::placeholder {
    color: var(--text-muted);
}

/* Password with toggle */
.password-input {
    position: relative;
    display: flex;
    align-items: center;
}
.password-input input {
    padding-right: 44px !important;
}
.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: var(--transition);
}
.password-toggle:hover {
    color: var(--primary);
}

/* Form row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
.form-error {
    display: block;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
}

.btn-full {
    width: 100%;
    justify-content: center;
}
.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
}

/* ---- Contact Page Enhancements ---- */
.contact-form-wrapper {
    width: 100%;
}
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.contact-info-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.contact-info-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.contact-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.contact-info-item h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 4px;
}
.contact-info-item p,
.contact-info-card p {
    font-size: 14px;
    color: var(--text-light);
}
.contact-info-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 12px;
}
.social-links-contact {
    display: flex;
    gap: 12px;
}
.social-links-contact a {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-light);
    font-size: 18px;
    transition: var(--transition);
}
.social-links-contact a:hover {
    background: var(--primary);
    color: white;
}

/* ---- Admin Card ---- */
.admin-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.admin-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 16px;
    color: var(--secondary);
}
.admin-card-body {
    padding: 24px;
}

/* ---- Categories Grid ---- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 40px 0;
}

/* ---- Trending Page ---- */
.trending-list {
    padding: 40px 0;
}
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    .home-featured-layout.has-featured-ads {
        grid-template-columns: 1fr;
    }
    .featured-ad-stack {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        height: auto;
    }
    .featured-ad-card {
        min-height: 160px;
        height: auto;
    }
    .sidebar-ads {
        flex-direction: row;
    }
    .home-side-ads {
        grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .trending-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    }
}

@media (max-width: 768px) {
    /* Header */
    .hero {
        padding: 40px 0;
    }
    .hero-title { font-size: 32px; }
    .hero-content { text-align: center; }
    .hero-buttons { justify-content: center; }
    .logo-tagline { display: none; }

    .main-nav {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 24px 20px;
        box-shadow: var(--shadow-lg);
        z-index: 998;
        overflow-y: auto;
        gap: 4px;
    }
    .main-nav.active { display: flex; }
    .main-nav .nav-link {
        font-size: 16px;
        padding: 12px 16px;
        border-radius: var(--radius-sm);
    }

    .mobile-toggle { display: block; }
    .search-box { width: 140px; }
    .search-box:focus-within { width: 180px; }

    /* Grid / Layout */
    .trending-grid, .posts-grid, .related-grid {
        grid-template-columns: 1fr;
    }

    .post-horizontal {
        flex-direction: column;
    }
    .post-h-image {
        width: 100%;
        height: 220px;
        min-height: unset;
    }
    .post-card-horizontal {
        flex-direction: column;
    }
    .post-card-horizontal .post-card-image {
        width: 100%;
        height: 220px;
        min-height: unset;
    }
    .post-card-image {
        height: 200px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
    .footer-ads-grid {
        grid-template-columns: 1fr;
    }
    .home-ad-grid,
    .home-ad-grid-2,
    .home-ad-grid-3,
    .home-featured-layout.has-featured-ads,
    .featured-count-1,
    .featured-count-2,
    .featured-count-3,
    .featured-ad-stack,
    .home-side-ads,
    .footer-ads-count-1,
    .footer-ads-count-2,
    .footer-ads-count-3 {
        grid-template-columns: 1fr;
    }

    /* Section header wrap */
    .section-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Post single */
    .post-single-title { font-size: 26px; }
    .post-nav { grid-template-columns: 1fr; }
    .post-meta-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
    .post-single { padding: 24px 0; }

    /* Comments */
    .comment-replies { margin-left: 36px; }

    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .user-sidebar {
        position: static;
    }

    /* Contact + content grids */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .content-grid {
        grid-template-columns: 1fr;
    }
    .blog-listing-page .blog-content-grid {
        grid-template-columns: 1fr;
        padding-top: 24px;
    }
    .blog-pagination {
        width: 100%;
        justify-content: center;
        margin-top: 0;
    }

    /* Auth */
    .auth-card {
        padding: 28px 20px;
    }

    /* Category + stats */
    .categories-grid {
        grid-template-columns: 1fr 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Page header */
    .page-header h1 { font-size: 26px; }
    .page-header { padding: 30px 0; }
}

@media (max-width: 480px) {
    .container { padding: 0 14px; }
    .section { padding: 28px 0; }
    .hero { padding: 32px 0; }
    .hero-title { font-size: 24px; }
    .hero-subtitle { font-size: 15px; }

    /* Header: hide search box; show search icon link */
    .search-box { display: none; }
    .search-icon-mobile { display: flex !important; }

    /* Tighten header actions */
    .header-actions { gap: 6px; }
    .header-inner { gap: 10px; }
    .logo-text { font-size: 18px; }
    .logo-icon { width: 34px; height: 34px; }

    /* Grids */
    .categories-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .trending-grid, .posts-grid { grid-template-columns: 1fr; }

    /* Post */
    .post-single-title { font-size: 22px; }
    .post-card-image { height: 175px; }
    .post-h-image { height: 185px; }
    .page-hero {
        padding: 42px 0;
    }
    .blog-listing-page .blog-content-grid {
        padding-top: 18px;
    }
    .blog-listing-page .post-card-horizontal .post-card-image {
        width: 100%;
        min-height: unset;
    }

    /* Comments */
    .comment-avatar { width: 36px !important; height: 36px !important; }
    .comment-replies { margin-left: 24px; }

    /* Auth */
    .auth-card { padding: 24px 16px; }
    .auth-card h2 { font-size: 22px; }

    /* Pagination */
    .pagination a, .pagination span { width: 34px; height: 34px; font-size: 13px; }

    /* Footer */
    .footer-col h4 { font-size: 15px; }

    /* Page header */
    .page-header h1 { font-size: 22px; }
    .page-header p { font-size: 14px; }
}

/* =============================================
   USER DASHBOARD - Sidebar & Navigation
   ============================================= */

.dashboard-sidebar {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 90px;
    height: fit-content;
}

.dashboard-user-card {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.dashboard-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
    display: block;
    border: 3px solid var(--primary-light);
}

.dashboard-user-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.dashboard-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dashboard-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    transition: var(--transition);
    text-decoration: none;
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.dashboard-nav a i {
    width: 18px;
    text-align: center;
    color: var(--text-muted);
}

.dashboard-nav a.active i,
.dashboard-nav a:hover i {
    color: var(--primary);
}

.dashboard-nav a.text-danger {
    color: #EF4444 !important;
}

.dashboard-nav a.text-danger:hover {
    background: #FEF2F2;
    color: #DC2626 !important;
}

.dashboard-logout-form,
.dropdown-form {
    margin: 0;
}

.dashboard-nav .dashboard-logout-form button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    font: inherit;
    color: #EF4444;
    text-align: left;
    cursor: pointer;
}

.dashboard-nav .dashboard-logout-form button:hover {
    background: #FEF2F2;
    color: #DC2626;
}

.user-dropdown .dropdown-form button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 15px;
    border: 0;
    background: transparent;
    color: var(--text-color);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.user-dropdown .dropdown-form button:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.dashboard-main {
    min-height: 500px;
}

.dashboard-main h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

/* Empty state for bookmarks/comments */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--secondary);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Posts list in bookmarks */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Avatar upload preview */
.avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

/* =============================================
   HEADER NAV - User Dropdown Styling
   ============================================= */

.user-menu {
    position: relative;
}

.user-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 220px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.active {
    display: block;
}

.dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

.dropdown-header strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary);
}

.dropdown-header small {
    font-size: 12px;
    color: var(--text-muted);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text);
    transition: background 0.15s;
    text-decoration: none;
}

.user-dropdown a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.user-dropdown a i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

/* =============================================
   MOBILE RESPONSIVE - Admin improvements
   ============================================= */

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-sidebar {
        position: static;
    }
    .user-dropdown {
        right: -10px;
    }
}


/* ---- User Dashboard Global Styles ---- */
.dashboard-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; display: block; border: 3px solid var(--primary-light); }
.dashboard-user-card { text-align: center; margin-bottom: 20px; }
.avatar-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); display: block; margin-bottom: 10px;}
.dashboard-grid { display: grid; grid-template-columns: 240px 1fr; gap: 30px; align-items: start; }
.dashboard-nav { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; }
.dashboard-nav a { display: block; padding: 12px 15px; border-radius: 6px; color: var(--text-color); text-decoration: none; transition: 0.2s; border: 1px solid var(--border); background: #fff; }
.dashboard-nav a:hover, .dashboard-nav a.active { background: var(--primary); color: white; border-color: var(--primary); }
.dashboard-nav a.text-danger { border-color: #dc3545; color: #dc3545; }
.dashboard-nav a.text-danger:hover { background: #dc3545; color: white; }
.dashboard-nav i { width: 24px; text-align: center; margin-right: 6px; }

/* Breadcrumb Styles */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px 20px;
    margin-top: 20px;
    margin-bottom: 30px;
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
}
.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
.breadcrumb a:hover {
    color: var(--primary-dark);
}
.breadcrumb span {
    margin: 0 12px;
    color: var(--border);
    font-size: 14px;
}
.breadcrumb .current {
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    margin: 0;
}

@media (max-width: 1024px) {
    .hero-showcase,
    .insights-grid,
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .home-carousel .carousel-slide {
        grid-template-columns: 1fr;
    }

    .carousel-media img,
    .carousel-media .placeholder-image {
        min-height: 240px;
    }
}

@media (max-width: 768px) {
    .hero-showcase,
    .insights-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero-showcase .hero-content {
        text-align: left;
    }

    .hero-buttons {
        justify-content: flex-start;
    }

    .home-carousel .carousel-slide {
        min-height: auto;
    }

    .carousel-copy {
        padding: 22px;
    }

    .carousel-copy h2,
    .insight-panel h2 {
        font-size: 22px;
    }

    .carousel-control {
        width: 34px;
        height: 34px;
    }

    .topic-strip {
        display: grid;
        grid-template-columns: 1fr;
    }

    .topic-chip {
        justify-content: space-between;
    }

    .related-carousel .post-card {
        max-width: none;
    }

    .scroll-top-btn {
        right: 18px;
        bottom: 82px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        gap: 10px;
    }

    .stat-card,
    .insight-panel,
    .insight-item {
        padding: 16px;
    }

    .insight-item {
        grid-template-columns: 1fr;
    }

    .home-carousel .carousel-dots {
        bottom: 10px;
    }
}
