/* ========================================
   REXFORD EDUCATES — Modern Design System
   ======================================== */

:root {
    --primary: #002fff;
    --primary-dark: #0020cc;
    --primary-rgb: 0, 47, 255;
    --primary-light: #e8edff;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --dark: #0f1923;
    --dark-2: #0c1ec4;
    --mid: #3a5068;
    --light: #f4f7fb;
    --white: #ffffff;
    --text: #1e2d3d;
    --text-muted: #6b7f92;
    --border: #dde5ee;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;

    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;

    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 20px rgba(0, 47, 255, 0.08);
    --shadow-md: 0 8px 32px rgba(0, 47, 255, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 47, 255, 0.16);

    --container: 1140px;
    --header-h: 72px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* FIX 1: html must NOT have overflow-y: visible — that breaks containment.
   Just smooth scroll is enough here. */
html {
    scroll-behavior: smooth;
}

/* FIX 2: body overflow-x hidden is the ONE place to stop horizontal scroll.
   Never combine with overflow-y: scroll on body — it triggers a stacking context
   bug in WebKit/Blink that makes position:fixed drawers expand the scroll width. */
body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--white);
    line-height: 1.65;
    overflow-x: clip;
    /* 'clip' is safer than 'hidden' — doesn't create scroll container */
    width: 100%;
}

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

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

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

em {
    font-family: var(--font-display);
    font-style: italic;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 47, 255, 0.3);
}

.btn-download {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-light);
    padding: 10px 18px;
    font-size: 0.88rem;
    flex-shrink: 0;
    /* never shrink the button */
    white-space: nowrap;
}

.btn-download:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.full-width {
    width: 100%;
    justify-content: center;
}

/* ========== HEADER ========== */
.site-header {
    position: relative;
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--border);
    z-index: 10;
    /* FIX 3: contain header to viewport width */
    width: 100%;
    overflow: hidden;
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
    white-space: nowrap;
}

.logo-text em {
    display: inline;
    font-size: 1.5rem;
    color: var(--primary);
    font-family: var(--font-body);
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.5px;
}

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

.header-social {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-social a {
    width: 80px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.0rem;
    transition: all 0.2s;
}

.header-social a:hover {
    background: var(--primary);
    color: var(--white);
}

/* ========== SUB NAV ========== */
/* FIX 4: nav-wrapper must be width-contained. 100vw causes overflow;
   use width:100% instead, and contain any children. */
.nav-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 6px 24px 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: padding 0.25s ease;
    width: 100%;
}

.nav-wrapper.stuck {
    padding: 0;
}

.sub-nav {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 4px;
    background: var(--primary);
    border-radius: 50px;
    padding: 6px 24px;
    flex: 1;
    /* FIX 5: prevent sub-nav from stretching beyond viewport */
    max-width: 100%;
    overflow: visible;
    /* must be visible so dropdown isn't clipped */
    transition: border-radius 0.25s ease, padding 0.25s ease;
}

.nav-wrapper.stuck .sub-nav {
    border-radius: 0;
    padding: 8px 24px;
    box-shadow: 0 4px 24px rgba(0, 47, 255, 0.18);
}

.sub-nav a {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.sub-nav a:hover,
.sub-nav a.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* FIX 6: Mobile overlay + drawer — must NOT add to document width.
   Use overflow:hidden on a wrapping context, or ensure the drawer is
   truly off-screen without contributing to scroll width. */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1010;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mobile-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: var(--white);
    z-index: 1020;
    padding: 80px 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    transition: right 0.35s cubic-bezier(.4, 0, .2, 1);
    /* FIX 7: fixed elements don't affect layout, but make sure it's truly fixed */
    overflow-y: auto;
}

.mobile-drawer.open {
    right: 0;
}

.mobile-drawer a {
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 8px;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
}

.mobile-drawer a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.drawer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--mid);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.drawer-close:hover {
    background: var(--light);
}

/* ========== SECTIONS ========== */
.section {
    padding: 96px 24px;
    /* FIX 8: every section is bounded to viewport */
    width: 100%;
    overflow: hidden;
}

.section-container {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.section-container.centered {
    display: block;
    text-align: center;
}

/* Let grid children shrink to the column instead of being sized by their longest one-line text */
.section-container > * {
    min-width: 0;
}

.section-label {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 50px;
    margin-bottom: 16px;
}

.section-container h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--dark);
    line-height: 1.15;
    margin-bottom: 16px;
}

.section-container.centered h2 {
    margin: 0 auto 16px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto 48px;
}

/* ========== HERO ========== */
/* FIX 9: use padding with safe values — avoid vw-based padding which can
   miscount scrollbar width and cause 1–2px overflow. Use % inside a
   width-bounded element instead. */
.hero {
    min-height: 80vh;
    background: var(--dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 80px 5%;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.hero-slides {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-slides img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: heroFade 20s infinite;
}

.hero-slides img:nth-child(1) {
    animation-delay: 0s;
}

.hero-slides img:nth-child(2) {
    animation-delay: 5s;
}

.hero-slides img:nth-child(3) {
    animation-delay: 10s;
}

.hero-slides img:nth-child(4) {
    animation-delay: 15s;
}

@keyframes heroFade {
    0% {
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    23% {
        opacity: 1;
    }

    28% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

.hero-slides::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-content {
    z-index: 2;
    max-width: 580px;
    flex-shrink: 0;
    position: relative;
    /* FIX 10: prevent content from pushing hero wider than viewport */
    min-width: 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    color: gold;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
    animation: fadeUp 0.6s ease forwards;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    color: var(--white);
    line-height: 1.05;
    margin-bottom: 24px;
    animation: fadeUp 0.7s 0.1s ease both;
}

.hero-title em {
    color: gold;
}

.hero-sub {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 36px;
    animation: fadeUp 0.7s 0.2s ease both;
}

.hero-ctas {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 48px;
    animation: fadeUp 0.7s 0.3s ease both;
}

/* Outline button sitting on the dark hero image stays white */
.hero .btn-outline {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.7);
    background: transparent;
}

.hero .btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--white);
    color: var(--white);
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    animation: fadeUp 0.7s 0.4s ease both;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    padding: 16px 24px;
    border-radius: 12px;
    /* FIX 11: allow stats to wrap rather than overflow */
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat strong {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
    margin-bottom: 4px;
}

.stat span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
}

.hero-visual {
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
    animation: fadeUp 0.8s 0.3s ease both;
    position: relative;
    /* FIX 12: prevent visual column from pushing layout */
    min-width: 0;
}

.hero-card {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 240px;
}

.hero-card i {
    font-size: 1.8rem;
    color: var(--accent);
    flex-shrink: 0;
}

.hero-card p {
    color: var(--white);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.hero-card span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.floating {
    animation: floating 4s ease-in-out infinite;
}

.delay-1 {
    animation-delay: 1s;
}

.delay-2 {
    animation-delay: 2s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== ABOUT ========== */
.about-section {
    background: var(--light);
}

.about-visual {
    display: flex;
    justify-content: center;
    position: relative;
    padding-bottom: 20px;
    padding-right: 20px;
}

.about-img-frame {
    width: 340px;
    height: 380px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
    border: 5px solid var(--primary);
}

.about-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.about-badge-card {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
}

.about-badge-card i {
    color: var(--accent);
    font-size: 1.6rem;
}

.about-badge-card strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}

.about-badge-card span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.about-text .section-label {
    margin-bottom: 12px;
}

.about-text h2 {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.5vw, 2.5rem);
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 20px;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.about-highlights {
    margin: 24px 0 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.highlight {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
}

.highlight i {
    color: var(--success);
}

/* ========== SERVICES ========== */
.services-section {
    background: var(--white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 8px;
    text-align: left;
}

.service-card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 32px 28px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    background: var(--white);
}

.service-icon {
    width: 52px;
    height: 52px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--primary);
    margin-bottom: 20px;
    transition: all 0.3s;
}

.service-card:hover .service-icon {
    background: var(--primary);
    color: var(--white);
}

.service-card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========== BLOG ========== */
.blog-section {
    background: var(--light);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    text-align: left;
}

.blog-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

/* Picture at the top of a blog card. The gradient + icon sit underneath, so a post with no image
   (or an image that fails to load) still gets a tidy, same-height header. */
.blog-card-image {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;          /* phones: one wide card per row */
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.blog-card-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.blog-card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-image img,
.related-card:hover .blog-card-image img {
    transform: scale(1.05);
}

/* Related articles (bottom of a post) */
.related-card {
    padding: 0;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.related-card-body {
    padding: 1rem 1.25rem 1.25rem;
}

.blog-card-body {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.blog-tag {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
    letter-spacing: 0.3px;
}

.blog-card-body h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--dark);
    line-height: 1.3;
    /* never more than 2 lines of title */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-body p {
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.5;
    flex: 1;
    /* never more than 3 lines of summary */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 600;
    margin-top: 8px;
    transition: gap 0.2s;
}

.read-more:hover {
    gap: 10px;
    color: var(--primary-dark);
}

/* ========== YOUTUBE ========== */
/* FIX 13: youtube row must be clipped, not just overflow-x:auto on a flex row,
   because the flex container itself can stretch the parent if not contained. */
.youtube {
    display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
    gap: 15px;
    margin-bottom: 50px;
    background-color: rgb(254, 255, 254);
    padding: 20px;
    overflow-x: auto;
    /* Key fix: explicit width so the scroll happens inside, not outside */
    width: 100%;
    max-width: 100%;
    scroll-behavior: smooth;
    /* Prevent the scrollable container itself from leaking */
    -webkit-overflow-scrolling: touch;
}

iframe {
    border-radius: 10px;
    flex-shrink: 0;
    /* FIX 14: cap iframe width so it never exceeds viewport on small screens */
    max-width: calc(100vw - 48px);
}

/* ========== RESOURCES ========== */
.resources-section {
    background-image: url("/static/images/hero/16fb6f1961895322cb603f29928c9b70.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.resources-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

.resources-section .section-container {
    align-items: start;
    position: relative;
    z-index: 1;
}

.resources-section h2,
.resources-section p,
.resources-section li {
    color: var(--white);
}

.resources-section .section-label {
    color: var(--white);
    background: rgba(255, 255, 255, 0.15);
}

.resources-section h2 em {
    color: #60b4f5;
}

.resources-section>.section-container>.resources-text>p {
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 28px;
}

.resources-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 0;
}

.resources-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

.resources-list li i {
    color: var(--success);
}

.resources-downloads {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.download-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: background 0.2s;
    flex-wrap: nowrap;
    /* prevent wrapping */
    min-width: 0;
    /* allow shrinking inside grid */
}

.download-card:hover {
    background: rgba(255, 255, 255, 0.12);
}

.download-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(0, 47, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #60b4f5;
    flex-shrink: 0;
}

.download-info {
    flex: 1;
    min-width: 0;
    /* allows text to shrink properly */
}

.download-info h4 {
    color: var(--white);
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    /* keep title on one line */
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-info p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    white-space: nowrap;
    /* keep description on one line */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== ALERTS ========== */
.alerts-section {
    background: var(--white);
}

.alerts-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 720px;
    margin: 0 auto;
    text-align: left;
}

.alert-card {
    background: var(--light);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
}

.alert-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.alert-green .alert-dot {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.alert-blue .alert-dot {
    background: var(--info);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.alert-yellow .alert-dot {
    background: var(--warning);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-type {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.alert-green .alert-type {
    color: var(--success);
}

.alert-blue .alert-type {
    color: var(--info);
}

.alert-yellow .alert-type {
    color: var(--warning);
}

.alert-card h4 {
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 6px;
}

.alert-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.alert-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 4px;
}

/* ========== CONTACT ========== */
.contact-section {
    background: var(--light);
}

.contact-info {
    padding-right: 16px;
}

.contact-info h2 {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.5vw, 2.5rem);
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 16px;
}

.contact-info>p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text);
}

.contact-detail i {
    width: 38px;
    height: 38px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.social-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-row a {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.social-row a:hover {
    background: var(--primary);
    color: var(--white);
}

.contact-form-wrap {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.form-group input,
.form-group textarea {
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    /* FIX 15: inputs can exceed their container without this */
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 47, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
}

#formMessage {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--success);
    text-align: center;
}

/* ========== FOOTER ========== */
.site-footer {
    background: var(--dark-2);
    color: var(--white);
    padding: 32px 12px 0;
    border-top: 15px solid yellow;
    border-radius: 10px 10px 0 0;
    /* FIX 16: footer must stay in bounds */
    width: 100%;
    overflow: hidden;
    position: relative;
    bottom: 0px;
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand .logo {
    color: var(--white);
    margin-bottom: 16px;
    display: inline-flex;
}

.footer-brand .logo-text {
    color: var(--white);
}

.footer-brand .logo-text em {
    color: var(--white);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.88rem;
    line-height: 1.7;
}

.footer-links h4,
.footer-social-col h4 {
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links ul li a {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.88rem;
    transition: color 0.2s;
}

.footer-links ul li a:hover {
    color: var(--white);
}

.footer-social {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-social a {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    transition: all 0.2s;
}

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

.footer-bottom {
    max-width: var(--container);
    margin: 0 auto;
    padding: 10px 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.83rem;
}

/* ========== SCROLL REVEAL ========== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "brand   social"
            "links   resources";
        gap: 2rem 2.5rem;
    }

    .footer-brand {
        grid-area: brand;
    }

    .footer-social-col {
        grid-area: social;
    }

    .footer-links:first-of-type {
        grid-area: links;
    }

    .footer-links:last-of-type {
        grid-area: resources;
    }
}

@media (max-width: 860px) {

    /* Header */
    .header-inner {
        justify-content: space-between;
    }

    .header-social {
        display: flex;
        gap: 8px;
    }

    .header-social a {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .logo-text em {
        font-size: 1.1rem;
    }

    .logo-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    /* Sub-nav on mobile: full-width blue bar with links + hamburger.
     FIX 17: no padding on the wrapper — avoids any side gap. */
    .nav-wrapper {
        padding: 0;
        background: var(--primary);
        justify-content: space-between;
    }

    .sub-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        background: transparent;
        border-radius: 0;
        padding: 8px 12px;
        gap: 2px;
        flex: 1;
        /* FIX 18: allow wrapping instead of growing wider */
        overflow: visible;
    }

    .sub-nav a {
        font-size: 0.78rem;
        padding: 5px 8px;
    }

    /* When stuck: hide text links, show only hamburger icon */
    .nav-wrapper.stuck .sub-nav {
        display: none;
    }

    .nav-wrapper.stuck {
        justify-content: flex-end;
        padding: 8px 16px;
    }

    .hamburger {
        display: flex;
        margin-right: 8px;
    }

    /* Hero */
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 48px 24px 64px;
    }

    .hero-ctas {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-visual {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-card {
        min-width: 160px;
        flex: 1;
    }

    /* Sections */
    .section {
        padding: 72px 24px;
    }

    .section-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-visual {
        order: -1;
    }

    .about-img-frame {
        width: 280px;
        height: 300px;
    }

    .resources-section .section-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-section .section-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-form-wrap {
        padding: 28px;
    }

    /* Footer */
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

@media (max-width: 640px) {
    .services-grid {
        grid-template-columns: 1fr;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .header-social a {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .header-inner {
        padding: 0 12px;
        gap: 8px;
    }

    .sub-nav a {
        font-size: 0.7rem;
        padding: 4px 6px;
    }

    /* Home page "Featured Resources" cards: icon + text on the first line, button full width underneath */
    .download-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "icon info"
            "action action";
        align-items: start;
        gap: 12px;
        padding: 14px;
    }

    .download-icon {
        grid-area: icon;
        width: 42px;
        height: 42px;
    }

    .download-info {
        grid-area: info;
    }

    .download-info h4 {
        white-space: normal;
        line-height: 1.3;
    }

    .download-info p {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .btn-download {
        grid-area: action;
        width: 100%;
        justify-content: center;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "brand    brand"
            "links    resources"
            "social   social";
        gap: 1.5rem 1rem;
        padding-bottom: 24px;
    }

    .footer-brand {
        grid-area: brand;
        text-align: center;
    }

    .footer-brand .logo {
        justify-content: center;
    }

    .footer-links:first-of-type {
        grid-area: links;
    }

    .footer-links:last-of-type {
        grid-area: resources;
    }

    .footer-social-col {
        grid-area: social;
        text-align: center;
    }

    .footer-social-col .footer-social {
        justify-content: center;
    }

    .site-footer {
        padding: 32px 16px 0;
        border-radius: 24px 24px 0 0;
    }

    .footer-bottom {
        padding: 12px 0;
    }

    /* FIX 19: hide decorative side column so hero text
     has full width on small phones */
    .hero-visual {
        display: none;
    }

    .hero-title {
        font-size: 2.4rem;
    }

    /* FIX 20: tighten hero padding on small screens */
    .hero {
        padding: 40px 16px 48px;
    }

    .contact-info {
        padding-right: 0;
    }
}

@media (max-width: 425px) {

    /* FIX 21: remove max-width override — it was a no-op and confusing */
    .section {
        padding: 56px 16px;
    }

}

@media (max-width: 360px) {
    .header-social {
        gap: 2px;
    }

    .header-social a {
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
    }

    .download-card {
        padding: 12px;
    }
}

/* ── Auth Header Links ──────────────────────────────────── */
.header-auth-links {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-left: .75rem;
}

.auth-link {
    font-size: 0.8rem;
    color: rgba(235, 224, 224, 0.85);
    text-decoration: none;
    padding: .3rem .65rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, .3);
    transition: background .2s, color .2s;
    white-space: nowrap;
}

.auth-link:hover {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.auth-link-highlight {
    background: var(--clr-accent, #e2a020);
    color: #fff !important;
    border-color: transparent;
}

.auth-link-highlight:hover {
    background: #c8891a;
}

/* ── Flash Messages ─────────────────────────────────────── */
.flash-container {
    position: fixed;
    top: 5rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: 360px;
    width: calc(100% - 2.5rem);
}

.flash {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    animation: slideIn .3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.flash-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.flash-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.flash-info {
    background: #dbe4ff;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: inherit;
    opacity: .6;
    flex-shrink: 0;
    padding: 0;
}

.flash-close:hover {
    opacity: 1;
}

/* ── Auth Pages ─────────────────────────────────────────── */
.auth-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background: #f4f7fb;
}

.auth-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .1);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 440px;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--dark-2);
    color: #fff;
    border-radius: 50%;
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.auth-card-header h2 {
    margin: 0 0 .35rem;
}

.auth-card-header p {
    color: #666;
    font-size: .9rem;
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.form-group label {
    font-size: .875rem;
    font-weight: 600;
    color: #333;
}

.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrap>i {
    position: absolute;
    left: .9rem;
    color: #aaa;
    font-size: .9rem;
    pointer-events: none;
}

.input-icon-wrap input {
    width: 100%;
    padding: .7rem .9rem .7rem 2.4rem;
    border: 1.5px solid #dde2ec;
    border-radius: 9px;
    font-size: .95rem;
    background: #fafbfc;
    transition: border .2s, box-shadow .2s;
    box-sizing: border-box;
}

.input-icon-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 47, 255, .12);
    background: #fff;
}

.toggle-pw {
    position: absolute;
    right: .75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: .9rem;
    padding: 0;
}

.toggle-pw:hover {
    color: #666;
}

.btn-full {
    width: 100%;
    justify-content: center;
    margin-top: .5rem;
    padding: .8rem;
    font-size: 1rem;
}

.auth-footer-text {
    text-align: center;
    font-size: .875rem;
    color: #666;
    margin-top: 1.25rem 0 0;
}

.auth-footer-text a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

/* ── Lock / Outline buttons ─────────────────────────────── */
.btn-lock {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border: 1.5px dashed #cbd5e1 !important;
}

.btn-lock:hover {
    background: #e2e8f0 !important;
}

.btn-outline {
    border-color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: .55rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.btn-outline:hover {
    border-color: var(--white);
    background: var(--primary);
    color: #fff;
}

/* ── Blog page search bar ───────────────────────────────── */
.search-wrap {
    max-width: 500px;
    margin: 0 auto 40px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrap .search-icon {
    top: 50%;
    transform: translateY(-50%);
    position: absolute;
    left: .9rem;
    color: #aaa;
    pointer-events: none;
}

.search-bar {
    font-family: var(--font-body);
    display: block;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    padding: .65rem .9rem .65rem 2.4rem;
    border: 1.5px solid #dde2ec;
    border-radius: 9px;
    font-size: .95rem;
    background: #fff;
    box-sizing: border-box;
}

.search-bar:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 47, 255, .1);
}

/* ══════════════════════════════════════════════════════════════
   BLOG LISTING PAGE  (/blog)
   ══════════════════════════════════════════════════════════════ */

/* ── Hero banner at the top of /blog ─────────────────────────── */
.page-hero {
    background: var(--dark-2);
    padding: 4rem 2rem 3rem;
    text-align: center;
}

.page-hero .section-label {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.page-hero h1 {
    color: #ffffff;
    font-size: 2.4rem;
    line-height: 1.2;
    margin: 0.5rem 0;
}

.page-hero h1 em {
    color: gold;
    font-style: normal;
}

.page-hero p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ── Search & filter row ──────────────────────────────────────── */
.blog-filter-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

/* Override: on the /blog page the search wrap flexes inline */
.blog-filter-row .search-wrap {
    flex: 1;
    min-width: 200px;
    max-width: 360px;
    margin: 0;
    /* remove the default centered block margin */
    display: flex;
    align-items: center;
}

.blog-filter-row .search-bar {
    border-radius: 9px;
    /* slightly less round than homepage version */
}

/* Category dropdown */
.filter-select {
    padding: 0.65rem 1rem;
    border: 1.5px solid #dde2ec;
    border-radius: 9px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 47, 255, 0.1);
}

/* ── Blog listing page content wrapper ───────────────────────── */
.blog-page-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* ── "No posts found" message ────────────────────────────────── */
.blog-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
    width: 100%;
}

.blog-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.4;
}

/* ── Pagination buttons ───────────────────────────────────────── */
.blog-pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.blog-pagination .btn {
    min-width: 2.5rem;
    text-align: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

/* ══════════════════════════════════════════════════════════════
   BLOG POST PAGE  (/blog/<slug>)
   ══════════════════════════════════════════════════════════════ */

/* ── Outer wrapper that centres the article ──────────────────── */
.post-wrap {
    max-width: 780px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

/* ── Breadcrumb  Home > Blog > Post Title ────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

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

.breadcrumb .separator {
    color: #cbd5e1;
}

.breadcrumb .current {
    color: #475569;
    font-weight: 500;
    /* truncate very long titles on small screens */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

/* ── Post header (tag + title + date) ────────────────────────── */
.post-header {
    margin-bottom: 2rem;
}

.post-header .blog-tag {
    margin-bottom: 0.75rem;
}

.post-title {
    font-size: 2.2rem;
    line-height: 1.25;
    color: #1e293b;
    margin: 0.5rem 0 0.6rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.875rem;
    color: #94a3b8;
    flex-wrap: wrap;
}

.post-meta i {
    margin-right: 0.3rem;
    color: var(--primary);
}

/* ── Divider line between header and content ─────────────────── */
.post-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1.5rem 0 2rem;
}

/* ── The article body — everything the admin types ───────────── */
.post-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #334155;
}

/* Make headings inside the article look good */

.post-content h4 {
    font-size: 1rem;
    color: #1e293b;
    font-weight: 700;
    margin: 1.5rem 0 0.5rem;
}

/* ── Bottom action row (Back to Blog button) ─────────────────── */
.post-actions {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── Related articles section ────────────────────────────────── */
.related-section {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 2px solid #f1f5f9;
}

.related-section h3 {
    font-size: 1.2rem;
    color: var(--primary-dark);
    margin-bottom: 1.25rem;
}

/* Related articles use a 2-column grid */
.related-section .blog-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE ADJUSTMENTS
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .page-hero h1 {
        font-size: 1.75rem;
    }

    .post-title {
        font-size: 1.65rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .blog-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .blog-filter-row .search-wrap {
        max-width: 100%;
    }

    .breadcrumb .current {
        max-width: 160px;
    }
}

/* ══════════════════════════════════════════════════════════════
   ABOUT PAGE  (/about)
   ══════════════════════════════════════════════════════════════ */

/* ── Outer section background ────────────────────────────────── */
.about-page-section {
    background: #ffffff;
    padding: 3.5rem 0;
}

/* ── Centred content wrapper with max-width ──────────────────── */
.about-page-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ── THE FLOAT — image sits top-left, text flows around it ───── */
.about-float-img {
    float: left;
    /* pull out of normal flow, sit left  */
    margin: 0 2.5rem 1.5rem 0;
    /* gap: right and bottom only         */
    width: 280px;
    /* fixed width so text has room       */
}

/* The photo itself */
.about-page-img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    object-position: center top;
    /* show the face, not the feet    */
    border-radius: 16px;
    border: 4px solid var(--primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    display: block;
}

/* Badge card that sits directly below the photo */
.about-float-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 18px;
    margin-top: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.about-float-badge i {
    font-size: 1.8rem;
    color: var(--accent);
    flex-shrink: 0;
}

.about-float-badge strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.about-float-badge span {
    font-size: 0.78rem;
    color: #64748b;
}

/* ── Section label above the heading ─────────────────────────── */
.about-page-section .section-label {
    margin-bottom: 8px;
}

/* ── Main heading ─────────────────────────────────────────────── */
.about-page-heading {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: var(--primary-dark);
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

/* ── Body paragraphs ──────────────────────────────────────────── */
.about-page-section p {
    color: #475569;
    line-height: 1.85;
    margin-bottom: 1.1rem;
    font-size: 1rem;
}

.about-page-section p strong {
    color: #1e293b;
}

/* ── Highlights list ──────────────────────────────────────────── */
/* .about-highlights and .highlight already exist in styles.css   */
/* so we just adjust spacing for the about page context           */
.about-page-section .about-highlights {
    margin: 1.5rem 0 1.75rem;
}

/* ── Clearfix — forces the float to end before the buttons ───── */
/* Without this, the buttons would appear beside the image        */
.about-clearfix {
    clear: both;
    /* tells the browser: nothing beside the float below this point */
}

/* ── Call-to-action buttons ───────────────────────────────────── */
.about-page-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* ── Mission & Vision section ─────────────────────────────────── */
.about-mission-section {
    background: #f8fafc;
    padding: 3.5rem 0;
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.mission-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 2rem 1.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mission-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.mission-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #dbe4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.mission-icon--accent {
    background: #fef3c7;
    color: var(--accent);
}

.mission-icon--red {
    background: #fee2e2;
    color: #dc2626;
}

.mission-card h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.mission-card p {
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.75;
    margin: 0;
}

/* ── Responsive — on small screens stop floating ─────────────── */
/* The float layout only works well on screens wide enough        */
/* On mobile we stack the image above the text instead           */
@media (max-width: 600px) {
    .about-float-img {
        float: none;
        /* cancel the float on mobile         */
        width: 100%;
        /* take full width                    */
        margin: 0 0 1.75rem 0;
        /* gap below the image only           */
    }

    .about-page-img {
        height: 280px;
    }

    .about-page-actions {
        flex-direction: column;
    }

    .about-page-actions .btn {
        text-align: center;
        justify-content: center;
    }
}

/* ══════════════════════════════════════════════════════════════
   OTP VERIFICATION PAGE
   ══════════════════════════════════════════════════════════════ */

/* Slightly wider card for the OTP boxes */
.otp-card {
    max-width: 460px;
}

/* The email address shown in the subtitle */
.otp-email-display {
    display: inline-block;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 4px;
    word-break: break-all;
}

/* ── Six digit boxes ──────────────────────────────────────────── */
.otp-boxes {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 0.5rem;
}

.otp-box {
    width: 52px;
    height: 60px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
    color: var(--primary-dark);
    border: 2px solid #dde2ec;
    border-radius: 10px;
    background: #fafbfc;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
    /* remove browser default number arrows */
    -moz-appearance: textfield;
}

.otp-box::-webkit-inner-spin-button,
.otp-box::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp-box:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 47, 255, 0.15);
    background: #ffffff;
    transform: scale(1.05);
}

/* A box that has a digit in it gets a subtle filled look */
.otp-box:not(:placeholder-shown) {
    border-color: var(--primary);
    background: #eef2ff;
}

/* ── Timer ────────────────────────────────────────────────────── */
.otp-timer {
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
    margin: 0.5rem 0 0.25rem;
}

.otp-timer strong {
    color: var(--primary-dark);
    font-variant-numeric: tabular-nums;
    /* stops the layout shifting as numbers change */
}

/* ── Divider ──────────────────────────────────────────────────── */
.otp-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 0.75rem;
    color: #94a3b8;
    font-size: 0.8rem;
}

.otp-divider::before,
.otp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* On small screens reduce box size slightly */
@media (max-width: 400px) {
    .otp-box {
        width: 42px;
        height: 52px;
        font-size: 1.3rem;
        border-radius: 8px;
    }

    .otp-boxes {
        gap: 7px;
    }
}

/* ══════════════════════════════════════════════════════════════
   RESOURCES PAGE  (/resources)
   ══════════════════════════════════════════════════════════════ */

/* ── Hero banner — uses CSS variables so colours stay consistent ── */
.res-hero {
    background: var(--dark-2);
    padding: 4rem 2rem 3rem;
    text-align: center;
}

.res-hero .section-label {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.res-hero h1 {
    color: #ffffff;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin: 0.5rem 0 1rem;
    line-height: 1.2;
}

.res-hero h1 em {
    color: gold;
    font-style: normal;
}

.res-hero p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    max-width: 520px;
    margin: 0 auto;
}

.res-hero p a {
    color: gold !important;
    font-weight: 700;
    text-decoration: none;
}

.res-hero p a:hover {
    text-decoration: underline;
}

/* ── Section wrapper ──────────────────────────────────────────── */
.res-section {
    background: #f4f6fb;
    padding: 2.5rem 0 4rem;
}

.res-wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ══ TABS ══════════════════════════════════════════════════════ */
.res-tabs {
    display: flex;
    gap: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    overflow: hidden;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.res-tab {
    flex: 1;
    min-width: 140px;
    padding: 0.9rem 1rem;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.res-tab:hover {
    color: var(--primary);
    background: #eef2ff;
}

.res-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: #eef2ff;
}

.res-tab i {
    font-size: 0.9rem;
}

/* ══ PANELS ════════════════════════════════════════════════════ */
.res-panel {
    display: none;
    /* hidden by default */
}

.res-panel.active {
    display: block;
    /* shown when tab is active */
}

.res-panel-intro {
    font-size: 0.92rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Empty state inside a panel */
.res-panel-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.res-panel-empty i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.35;
}

/* ══ ACCORDION (Lesson Notes) ══════════════════════════════════ */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.accordion-item {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
}

.accordion-item:has(.accordion-body.open) {
    box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
    border-color: var(--primary);
}

/* ── Accordion header button ──────────────────────────────────── */
.accordion-header {
    width: 100%;
    background: #ffffff;
    border: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    text-align: left;
    transition: background 0.15s;
}

.accordion-header:hover {
    background: #f8fafc;
}

.accordion-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.accordion-label i {
    color: var(--primary);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Arrow icon rotates when open */
.accordion-arrow i {
    color: #94a3b8;
    transition: transform 0.25s ease;
}

.accordion-body.open+.accordion-header .accordion-arrow i,
.accordion-header.open .accordion-arrow i {
    transform: rotate(180deg);
}

/* ── Accordion body (collapsible) ────────────────────────────── */
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.accordion-body.open {
    max-height: 8000px;
    /* large enough for any content, even a long list of files on a phone */
}

.accordion-inner {
    border-top: 1px solid #e2e8f0;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Term group inside an accordion ──────────────────────────── */
.term-group {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.9rem 1rem;
}

.term-label {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

/* "Coming soon" message inside a term group */
.res-empty-term {
    color: #94a3b8;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.4rem 0;
}

.res-empty-term i {
    opacity: 0.5;
}

/* ══ FILE ROWS (shared across all panels) ══════════════════════ */
.res-file-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.res-file-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.15s;
}

.res-file-row:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, .08);
}

/* Inside accordion, file rows are on slightly different bg */
.accordion-inner .res-file-row {
    background: #ffffff;
}

.res-file-icon {
    font-size: 1.6rem;
    min-width: 2rem;
    text-align: center;
    color: var(--primary);
    flex-shrink: 0;
}

/* Colour each file type differently */
.res-file-icon .fa-file-excel {
    color: #16a34a;
}

.res-file-icon .fa-file-word {
    color: #2563eb;
}

.res-file-icon .fa-file-pdf {
    color: #dc2626;
}

.res-file-icon .fa-file-powerpoint {
    color: #ea580c;
}

.res-file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    /* allows text-overflow to work */
}

.res-file-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.res-file-desc {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
}

/* Smaller download/lock buttons inside the file rows */
.btn.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Login prompt at the bottom ───────────────────────────────── */
.res-login-prompt {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #ffffff;
    border-radius: 14px;
    padding: 1.75rem 2rem;
    margin-top: 2.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.res-login-prompt>i {
    font-size: 2.2rem;
    color: var(--primary);
    flex-shrink: 0;
}

.res-login-prompt>div {
    flex: 1;
}

.res-login-prompt h3 {
    font-size: 1.05rem;
    color: #1e293b;
    margin: 0 0 0.3rem;
}

.res-login-prompt p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

.res-login-btns {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .res-tabs {
        flex-direction: column;
        border-radius: 10px;
    }

    .res-tab {
        border-bottom: none;
        border-left: 3px solid transparent;
        justify-content: flex-start;
    }

    .res-tab.active {
        border-left-color: var(--primary);
        border-bottom-color: transparent;
    }

    /* Phones: the text used to be squeezed into a ~100px column between the icon and the button.
       Now the icon and text sit together on the first line and the button gets its own full-width line. */
    .res-file-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "icon info"
            "action action";
        align-items: start;
        gap: 0.6rem 0.75rem;
        padding: 0.75rem;
    }

    .res-file-icon {
        grid-area: icon;
        min-width: 0;
        font-size: 1.5rem;
        line-height: 1.2;
    }

    .res-file-info {
        grid-area: info;
    }

    .res-file-row > .btn {
        grid-area: action;
        width: 100%;
        justify-content: center;
    }

    .res-file-title {
        white-space: normal;
        font-size: 0.92rem;
        line-height: 1.3;
    }

    .res-file-desc {
        font-size: 0.8rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* a little air between stacked rows (they used to touch) */
    .term-group .res-file-row + .res-file-row,
    .res-file-list .res-file-row + .res-file-row {
        margin-top: 0.5rem;
    }

    /* less padding wrapped around the rows = more width for the text */
    .res-wrap {
        padding: 0 0.75rem;
    }

    .accordion-inner {
        padding: 0.6rem;
        gap: 0.75rem;
    }

    .term-group {
        padding: 0.65rem 0.6rem;
    }

    .res-login-prompt {
        flex-direction: column;
        text-align: center;
    }

    .res-login-btns {
        justify-content: center;
    }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE DRAWER — AUTH LINKS
   ══════════════════════════════════════════════════════════════ */

/* Thin divider line separating nav links from auth links */
.drawer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0.75rem 1.5rem;
}

/* "Hi, Rexford" greeting shown when logged in */
.drawer-user-greeting {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.5rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.drawer-user-greeting i {
    font-size: 1rem;
    color: var(--clr-accent, #e2a020);
}

/* Base style for Login and Sign Up links in the drawer */
.drawer-auth-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.drawer-auth-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.drawer-auth-link i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

/* Sign Up gets an accent colour to stand out */
.drawer-signup {
    color: var(--clr-accent, #e2a020);
    font-weight: 700;
}

.drawer-signup:hover {
    color: var(--clr-accent, #e2a020);
    background: rgba(226, 160, 32, 0.1);
}

/* Logout link gets a subtle red tint */
.drawer-logout {
    color: rgba(252, 165, 165, 0.9);
}

.drawer-logout:hover {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
}

/* Hide auth links in drawer on desktop — they're already in the header */
@media (min-width: 769px) {

    .drawer-divider,
    .drawer-user-greeting,
    .drawer-auth-link {
        display: none;
    }
}

/* ── Hide header auth links on tablet and below — drawer handles them ── */
@media (max-width: 1024px) {
    .header-auth-links {
        display: none;
    }
}

/* ══════════════════════════════════════════════════════════════
   BLOG SIDEBAR LAYOUT
   Three-column grid: left sidebar | main content | right sidebar
   ══════════════════════════════════════════════════════════════ */

.blog-layout-section {
    overflow-x: clip;      /* safety net: the page itself can never scroll sideways */
    background: #f4f6fb;
    padding: 2.5rem 0 4rem;
}

.blog-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 240px;
    grid-template-areas: "left main right";
    gap: 2rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    align-items: start;
}

.blog-sidebar-left {
    grid-area: left;
}

.blog-main {
    grid-area: main;
    min-width: 0;          /* lets long words, tables and images shrink to the screen */
}

.blog-sidebar-right {
    grid-area: right;
}

/* Sidebars stick as you scroll down the page */
.blog-sidebar-left,
.blog-sidebar-right {
    position: sticky;
    top: 80px;
    /* clears the sticky nav bar */
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Individual widget card ───────────────────────────────────── */
.sidebar-widget {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e2e8f0;
}

/* Widget heading row */
.sidebar-widget-title {
    margin: 0 0 0.9rem;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #e2e8f0;
}

/* ── Search widget ────────────────────────────────────────────── */
.sidebar-search-wrap {
    display: flex;
    border: 1.5px solid #dde2ec;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.sidebar-search-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 47, 255, 0.1);
}

.sidebar-search-input {
    flex: 1;
    border: none;
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: transparent;
    outline: none;
    color: #1e293b;
}

.sidebar-search-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0 0.85rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.sidebar-search-btn:hover {
    opacity: 0.85;
    background: var(--primary-dark);
}

/* ── Category list ────────────────────────────────────────────── */
.sidebar-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-cat-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 7px;
    font-size: 0.875rem;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar-cat-link i {
    width: 16px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--primary);
}

.sidebar-cat-link:hover {
    background: #eef2ff;
    color: var(--primary);
}

.sidebar-cat-link.active {
    background: #dbe4ff;
    color: var(--primary);
    font-weight: 700;
}

/* ── Author card ──────────────────────────────────────────────── */
.sidebar-author {
    text-align: center;
}

.sidebar-author-img {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 0.75rem;
    border: 3px solid var(--primary);
    background: #dbe4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
}

.sidebar-author-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.sidebar-author h4 {
    font-size: 0.9rem;
    color: #1e293b;
    margin: 0 0 0.35rem;
}

.sidebar-author p {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 1rem;
}

/* ── Resources / sign-up CTA widget ──────────────────────────── */
.sidebar-cta {
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #ffffff;
    text-align: center;
    border: none;
}

.sidebar-cta-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    margin: 0 auto 0.75rem;
}

.sidebar-cta h4 {
    font-size: 0.95rem;
    color: #fff;
    margin: 0 0 0.4rem;
}

.sidebar-cta p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin: 0 0 1rem;
}

/* ── Sign-up CTA for guests ───────────────────────────────────── */
.sidebar-signup-cta {
    text-align: center;
    background: #fef9f0;
    border-color: #fde68a;
}

.sidebar-lock-icon {
    font-size: 1.8rem;
    color: var(--accent);
    display: block;
    margin-bottom: 0.6rem;
}

.sidebar-signup-cta h4 {
    font-size: 0.9rem;
    color: #1e293b;
    margin: 0 0 0.35rem;
}

.sidebar-signup-cta p {
    line-height: 1.5;
    font-size: 0.78rem;
    color: #64748b;
    margin: 0 0 0.75rem;
}

.sidebar-login-link {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: var(--primary);
    text-decoration: none;
    text-align: center;
}

.sidebar-login-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ── Quote widget ─────────────────────────────────────────────── */
.sidebar-quote {
    border-color: transparent;
    position: relative;
    padding-top: 1.5rem;
    background: linear-gradient(135deg, #fef9f0, #fff8ec);
    border-left: 4px solid var(--accent);
    border-top: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0 12px 12px 0;
}

.sidebar-quote-icon {
    font-size: 1.5rem;
    color: var(--accent);
    opacity: 0.5;
    display: block;
    margin-bottom: 0.5rem;
}

.sidebar-quote blockquote {
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.7;
    font-style: italic;
    margin: 0 0 0.6rem;
    border: none;
    padding: 0;
    background: none;
}

.sidebar-quote cite {
    font-size: 0.78rem;
    color: #94a3b8;
    font-style: normal;
    font-weight: 600;
}

/* ── Teaching tip widget ──────────────────────────────────────── */
.sidebar-tip {
    background: #f0fdf4;
    border-radius: 8px;
    padding: 0.75rem;
    border-left: 3px solid #16a34a;
}

.sidebar-tip p {
    font-size: 0.85rem;
    color: #166534;
    line-height: 1.65;
    margin: 0;
}

/* ── Post meta list (date, category) ─────────────────────────── */
.sidebar-meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-meta-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: #475569;
}

.sidebar-meta-list i {
    color: var(--primary);
    width: 16px;
    text-align: center;
}

/* ── Related posts list (sidebar) ────────────────────────────── */
.sidebar-post-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sidebar-post-link {
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 0.5rem;
    border-radius: 7px;
    text-decoration: none;
    transition: background 0.15s;
}

.sidebar-post-link:hover {
    background: #eef2ff;
}

.sidebar-post-cat {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
}

.sidebar-post-title {
    transition: color 0.15s;
    font-size: 0.85rem;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.4;
}

/* ── Social follow / share links ─────────────────────────────── */
.sidebar-social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-social-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.15s;
}

.sidebar-social-link:hover {
    opacity: 0.85;
    transform: translateX(3px);
}

.sidebar-social-link i {
    width: 18px;
    text-align: center;
}

.sidebar-yt {
    background: #fee2e2;
    color: #dc2626;
}

.sidebar-fb {
    background: #dbe4ff;
    color: #1d4ed8;
}

.sidebar-tw {
    background: #e0f2fe;
    color: #0284c7;
}

.sidebar-wa {
    background: #dcfce7;
    color: #16a34a;
}

/* ── Full-width sidebar buttons ───────────────────────────────── */
.sidebar-btn {
    display: flex;
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.55rem 1rem;
    margin-top: 0.25rem;
}

/* ── Extra sidebar rules (CTA buttons, meta icons, related-post hover) ── */
.blog-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sidebar-cta .btn-primary {
    background: var(--accent);
    border-color: transparent;
}

.sidebar-cta .btn-outline {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.sidebar-meta-list li i {
    color: var(--primary);
    width: 14px;
    text-align: center;
}

.sidebar-post-link:last-child {
    border-bottom: none;
}

.sidebar-post-link:hover .sidebar-post-title {
    color: var(--primary);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — collapse sidebars on smaller screens
   ══════════════════════════════════════════════════════════════ */

/* Tablet: drop to two columns — hide left sidebar, keep right */
@media (max-width: 1100px) {
    .blog-layout {
        grid-template-columns: minmax(0, 1fr) 220px;
        grid-template-areas:
            "main right";
    }

    .blog-sidebar-left {
        display: none;
    }
}

/* Mobile: single column — hide both sidebars */
@media (max-width: 700px) {
    .blog-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "main";
        padding: 0 1rem;
    }

    .blog-sidebar-left,
    .blog-sidebar-right {
        display: none;
        position: static;
    }
}

/* ══════════════════════════════════════════════════════════════
   NAV DROPDOWN  (Resources hover menu)
   ══════════════════════════════════════════════════════════════ */

/* Wrapper — sits inline with other nav links */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* The clickable "Resources ▾" trigger — styled exactly like other nav links */
.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    white-space: nowrap;
    /* inherits colour and padding from .sub-nav a */
}

/* Arrow icon — rotates on hover */
.nav-dropdown-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-arrow {
    transform: rotate(180deg);
}

/* The dropdown panel — hidden by default */
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    /* sits just below the nav bar */
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    border: 1px solid #e2e8f0;
    padding: 0.4rem 0;
    z-index: 9999;
    /* above nav-wrapper (1000) and hero (2) */

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

/* Show on hover */
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Small triangle pointer above the menu */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #e2e8f0;
}

.nav-dropdown-menu::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #ffffff;
}

/* Each item inside the dropdown */
.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    /* override any inherited sub-nav border/colour */
    border: none !important;
    border-bottom: none !important;
}

.nav-dropdown-menu a:hover {
    background: #eef2ff;
    color: var(--primary);
}

.nav-dropdown-menu a i {
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--primary);
}

/* Divider between items — optional, adds a subtle separator */
.nav-dropdown-menu a+a {
    border-top: 1px solid #f1f5f9 !important;
}

/* ── Hide dropdown on mobile — drawer handles navigation ────── */
@media (max-width: 860px) {
    .nav-dropdown-menu {
        display: none !important;
    }

    /* On mobile keep "Resources" as a plain link in the drawer */
}

/* ══════════════════════════════════════════════════════════════
   ADMIN ANALYTICS PAGE
   ══════════════════════════════════════════════════════════════ */

.analytics-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #e2e8f0;
}

.analytics-section-title i {
    color: var(--primary);
}

/* Two-column grid for analytics cards */
.analytics-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .analytics-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ── Bar chart rows ───────────────────────────────────────────── */
.analytics-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.analytics-bar-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    min-width: 68px;
    white-space: nowrap;
}

.analytics-bar-track {
    flex: 1;
    height: 10px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
}

.analytics-bar-fill {
    height: 100%;
    border-radius: 99px;
    min-width: 4px;
    transition: width 0.6s ease;
}

.analytics-bar--blue {
    background: #3b82f6;
}

.analytics-bar--purple {
    background: #8b5cf6;
}

.analytics-bar--green {
    background: #22c55e;
}

.analytics-bar--gold {
    background: #f59e0b;
}

.analytics-bar-count {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    min-width: 32px;
    text-align: right;
}

/* ── Popular content rows ─────────────────────────────────────── */
.analytics-popular-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.analytics-popular-row:last-child {
    border-bottom: none;
}

.analytics-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.analytics-popular-row:first-child .analytics-rank {
    background: #fef9c3;
    color: #b45309;
}

.analytics-popular-row:nth-child(2) .analytics-rank {
    background: #f1f5f9;
    color: #475569;
}

.analytics-popular-row:nth-child(3) .analytics-rank {
    background: #fff7ed;
    color: #c2410c;
}

/* ══════════════════════════════════════════════════════════════
   RICH BLOG POST CONTENT
   These styles ensure Quill-generated HTML looks great on
   the live blog post page.
   ══════════════════════════════════════════════════════════════ */

.post-content h1 {
    font-size: 1.75rem;
    color: var(--primary-dark);
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #e2e8f0;
    line-height: 1.25;
}

.post-content h2 {
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin: 2rem 0 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e2e8f0;
}

.post-content h3 {
    font-size: 1.15rem;
    color: var(--primary);
    margin: 1.75rem 0 0.5rem;
}

.post-content p {
    margin-bottom: 1.1rem;
    line-height: 1.9;
}

.post-content ul,
.post-content ol {
    margin: 0.75rem 0 1.25rem 1.75rem;
    line-height: 1.85;
}

.post-content li {
    margin-bottom: 0.4rem;
}

.post-content strong {
    color: #1e293b;
    font-weight: 700;
}

.post-content em {
    color: #475569;
}

.post-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content a:hover {
    opacity: 0.8;
}

/* Blockquote */
.post-content blockquote {
    border-left: 4px solid var(--primary);
    background: #eef2ff;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 10px 10px 0;
    color: #334155;
    font-style: italic;
    font-size: 1.02rem;
}

/* Code block */
.post-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.7;
    margin: 1.25rem 0;
}

/* Inline code */
.post-content code {
    background: #f1f5f9;
    color: #be185d;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
    padding: 0.15em 0.45em;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* Don't double-style code inside pre */
.post-content pre code {
    background: transparent;
    color: inherit;
    border: none;
    padding: 0;
    font-size: inherit;
}

/* Images */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1rem 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
    display: block;
}

/* Tables */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.9rem;
}

.post-content table th {
    background: #f8fafc;
    color: #1e293b;
    font-weight: 700;
    text-align: left;
    padding: 0.65rem 0.9rem;
    border: 1px solid #e2e8f0;
}

.post-content table td {
    padding: 0.6rem 0.9rem;
    border: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: top;
}

.post-content table tr:nth-child(even) td {
    background: #f8fafc;
}

/* Text alignment (Quill classes) */
.post-content .ql-align-center {
    text-align: center;
}

.post-content .ql-align-right {
    text-align: right;
}

.post-content .ql-align-justify {
    text-align: justify;
}

/* Indent levels */
.post-content .ql-indent-1 {
    padding-left: 2em;
}

.post-content .ql-indent-2 {
    padding-left: 4em;
}

.post-content .ql-indent-3 {
    padding-left: 6em;
}

/* ══════════════════════════════════════════════════════════════
   ADMIN — POST STATUS SYSTEM
   ══════════════════════════════════════════════════════════════ */

/* Status filter tab row */
.posts-filter-tabs {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #e2e8f0;
}

.posts-filter-tab {
    padding: .6rem 1.1rem;
    font-size: .85rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.posts-filter-tab:hover {
    color: var(--primary);
}

.posts-filter-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Count pills inside tab */
.posts-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
}

.posts-filter-count.published {
    background: #dcfce7;
    color: #15803d;
}

.posts-filter-count.draft {
    background: #f1f5f9;
    color: #64748b;
}

.posts-filter-count.review {
    background: #fef9c3;
    color: #854d0e;
}

.posts-filter-count.scheduled {
    background: #ede9fe;
    color: #6d28d9;
}

.posts-filter-count.archived {
    background: #fee2e2;
    color: #b91c1c;
}

/* Status badges in the table */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .7rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge i {
    font-size: .55rem;
}

.status-published {
    background: #dcfce7;
    color: #15803d;
}

.status-draft {
    background: #f1f5f9;
    color: #475569;
}

.status-review {
    background: #fef9c3;
    color: #854d0e;
}

.status-scheduled {
    background: #ede9fe;
    color: #6d28d9;
}

.status-archived {
    background: #fee2e2;
    color: #b91c1c;
}

/* ══════════════════════════════════════════════════════════════
   FILE PREVIEW MODAL
   ══════════════════════════════════════════════════════════════ */

.file-preview-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.file-preview-modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 40, 0.55);
    backdrop-filter: blur(4px);
}

.modal-card {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.modal-file-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    flex-shrink: 0;
    font-family: 'DM Sans', sans-serif;
}

.modal-file-icon.pdf {
    background: #fee2e2;
    color: #dc2626;
}

.modal-file-icon.docx {
    background: #dbe4ff;
    color: #2563eb;
}

.modal-file-icon.xlsx {
    background: #dcfce7;
    color: #16a34a;
}

.modal-file-icon.pptx {
    background: #fff7ed;
    color: #ea580c;
}

.modal-file-icon.zip {
    background: #fef9c3;
    color: #ca8a04;
}

.modal-file-icon.other {
    background: #f1f5f9;
    color: #64748b;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1.1rem;
    line-height: 1;
    padding: .25rem;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.modal-close:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.modal-body {
    padding: 1.1rem 1.5rem 1.5rem;
}

.modal-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    margin: .9rem 0 1.1rem;
}

.modal-meta-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: .65rem .85rem;
}

.modal-meta-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    margin-bottom: .2rem;
}

.modal-meta-value {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
}

.modal-actions {
    display: flex;
    gap: .75rem;
}

.modal-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Download button with lock for guests */
.dl-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    color: var(--primary);
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dl-preview-btn:hover {
    opacity: .8;
}

/* ── Role badges (admin users table) ──────────────────────── */
.role-badge {
    display: inline-block;
    padding: .2rem .65rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
}

/* Permission pills */
.perm-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: .7rem;
}

.perm-yes {
    background: #dcfce7;
    color: #16a34a;
}

.perm-no {
    background: #f1f5f9;
    color: #cbd5e1;
}

/* ══════════════════════════════════════════════════════════════
   GES ALERTS — empty state (alerts are managed in the admin panel)
   ══════════════════════════════════════════════════════════════ */
.alerts-empty {
    max-width: 520px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    color: var(--text-muted);
    background: var(--light);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.alerts-empty i {
    display: block;
    font-size: 2rem;
    margin-bottom: .6rem;
    color: var(--primary);
    opacity: .6;
}


/* ══════════════════════════════════════════════════════════════
   BLOG CARDS — SIZE (laptop) · BLOG POST — FIT THE SCREEN (mobile)
   ══════════════════════════════════════════════════════════════ */

/* The blog page already has two sidebars, so its cards sit in a narrow column.
   Let them flow into as many ~260px cards as fit, instead of three squeezed ~210px ones. */
.blog-main .blog-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 20px;
}

/* Laptops / tablets: a shorter picture strip keeps cards compact */
@media (min-width: 701px) {
    .blog-card-image {
        aspect-ratio: 2.3 / 1;
    }
}

/* ── Post header pieces (these class names had no styles before) ── */
.blog-post-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.blog-post-breadcrumb a {
    color: #94a3b8;
    text-decoration: none;
}

.blog-post-breadcrumb a:hover {
    color: var(--primary);
}

.blog-category-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
}

.blog-post-title {
    font-size: clamp(1.45rem, 5.5vw, 2.2rem);
    line-height: 1.25;
    color: #1e293b;
    margin: 0.6rem 0 0.75rem;
    overflow-wrap: anywhere;
}

/* ── The post card + featured picture ── */
.post-card {
    padding: 2rem 2.5rem;
    min-width: 0;
}

.post-featured {
    margin-bottom: 1.5rem;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

/* ── Article text: everything wraps inside the screen ── */
.post-content {
    min-width: 0;
    overflow-wrap: anywhere;       /* long words and URLs break instead of pushing the page wider */
    word-break: break-word;
}

.post-content img,
.post-content video,
.post-content iframe,
.post-content figure,
.post-content embed,
.post-content object {
    max-width: 100%;
}

.post-content img,
.post-content video {
    height: auto;
}

/* videos / embeds keep their shape while shrinking */
.post-content iframe,
.post-content .ql-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: 10px;
}

.post-content p,
.post-content div,
.post-content blockquote,
.post-content ul,
.post-content ol,
.post-content pre {
    max-width: 100%;
}

/* wide tables scroll inside themselves instead of stretching the page */
.post-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.post-content pre {
    white-space: pre-wrap;         /* code lines wrap too */
    overflow-wrap: anywhere;
}

/* ── Phones ── */
@media (max-width: 600px) {
    .blog-layout-section {
        padding: 1rem 0 2.5rem;
    }

    .blog-layout {
        padding: 0 0.75rem;
    }

    /* Article page: no side gutters around the card, so the text gets the full screen width
       (just a small reading margin) and the featured picture spans edge to edge. */
    .post-layout {
        padding: 0;
    }

    .post-layout .post-card {
        background: var(--white);
        padding: 1.1rem 0.9rem 1.5rem;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }

    .post-layout .post-featured {
        border-radius: 0;
        margin-bottom: 0;
        box-shadow: none;
    }

    .post-layout .post-related {
        padding: 0 0.9rem 1rem;
    }

    .post-content {
        font-size: 1rem;
        line-height: 1.75;
    }

    .post-content h1 { font-size: 1.4rem; }
    .post-content h2 { font-size: 1.2rem; }
    .post-content h3 { font-size: 1.05rem; }

    .post-content pre {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .post-content blockquote {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0.9rem;
    }

    .post-content ul,
    .post-content ol {
        padding-left: 1.25rem;
    }

    .post-meta {
        gap: 0.5rem 1rem;
    }
}
