/* ================================================
   CODERSERA GHOST THEME — Brand overrides on Casper
   ================================================ */

/* --- Reset Casper header padding ----------------------------------------- */
.site-content,
.is-head-stacked .site-content,
.is-head-left-logo .site-content,
.is-head-middle-logo .site-content {
    padding-top: 0 !important;
}
.gh-head { display: none !important; }

/* --- Viewport flex so footer stays at bottom ------------------------------ */
.viewport {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.site-content { flex: 1; }

/* ============================================================
   NAVBAR
   ============================================================ */
.cs-navbar {
    position: sticky;
    top: 0;
    z-index: 2999;
    background-color: #011034;
    width: 100%;
}

.cs-navbar-inner {
    max-width: 1272px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    min-height: 70px;
}

/* Brand */
.cs-brand {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    width: 20%;
    flex-shrink: 0;
    gap: 10px;
    border: none !important;
    box-shadow: none !important;
}
.cs-brand-name {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Desktop nav links */
.cs-nav {
    display: flex;
    justify-content: space-evenly;
    width: 40%;
    align-items: center;
}
.cs-nav a {
    color: #fff;
    text-decoration: none !important;
    font-size: 15px;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border: none !important;
    box-shadow: none !important;
    transition: opacity 0.2s;
}
.cs-nav a:hover { opacity: 0.8; }

/* CTA buttons */
.cs-nav-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 13px;
    flex: 1;
}

.cs-btn-primary {
    background-color: #ffdb41;
    color: #011443 !important;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 3px;
    text-decoration: none !important;
    white-space: nowrap;
    display: inline-block;
    transition: opacity 0.2s;
    box-shadow: none !important;
}
.cs-btn-primary:hover { opacity: 0.9; }

.cs-btn-outline {
    border: 2px solid #228fff;
    color: #228fff !important;
    background: #fff;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 3px;
    text-decoration: none !important;
    white-space: nowrap;
    display: inline-block;
    transition: opacity 0.2s;
    box-shadow: none !important;
}
.cs-btn-outline:hover { opacity: 0.9; }

/* Hamburger */
.cs-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
}
.cs-burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.cs-burger-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cs-burger-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.cs-burger-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu panel */
.cs-mobile-menu {
    background-color: #011034;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
}
.cs-mobile-menu.cs-mobile-open { max-height: 100vh; }

.cs-mobile-nav {
    display: flex;
    flex-direction: column;
    padding: 20px 20px 5px;
}
.cs-mobile-nav a {
    color: #fff;
    text-decoration: none !important;
    font-size: 15px;
    letter-spacing: 0.04em;
    padding: 18px 0;
    border: none !important;
    border-bottom: 1px solid #4d5069 !important;
    box-shadow: none !important;
    display: block;
}
.cs-mobile-nav a:last-child { border-bottom: none !important; }

.cs-mobile-actions {
    display: flex;
    flex-direction: column;
    padding: 16px 20px 28px;
    gap: 16px;
}
.cs-mobile-btn {
    width: 100%;
    text-align: center;
    display: block;
    box-sizing: border-box;
}

/* Responsive navbar */
@media (max-width: 768px) {
    .cs-nav,
    .cs-nav-actions { display: none; }
    .cs-burger { display: flex; }
    .cs-brand { width: auto; }
    .cs-navbar-inner { justify-content: space-between; }
}

/* ============================================================
   POST BODY LAYOUT — Toptal-style flex row: article + sidebar
   ============================================================ */
.cs-post-layout {
    display: flex;
    align-items: flex-start;
    max-width: 1260px;
    margin: 0 auto;
    padding: 0;
}

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

/* Sidebar — hidden on mobile, shows as inline column at desktop */
.cs-post-sidebar {
    display: none;
}

@media (min-width: 1100px) {
    .cs-post-sidebar {
        display: block;
        flex: 0 0 280px;
        width: 280px;
        padding: 40px 24px 0 0;
    }
}

.cs-sidebar-sticky {
    position: sticky;
    top: 90px;
}

/* CTA card */
.cs-cta-card {
    background: linear-gradient(135deg, #228fff 0%, #1a73e8 100%);
    padding: 24px 20px;
    border-radius: 12px;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 15px rgba(34, 143, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.cs-cta-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    margin: 0 0 8px !important;
}
.cs-cta-card h4 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.3;
    color: #fff;
}
.cs-cta-card p {
    font-size: 13px;
    margin: 0 0 14px;
    line-height: 1.5;
    opacity: 0.95;
    color: #fff;
}
.cs-cta-benefits {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 18px;
    font-size: 12px;
    opacity: 0.9;
    color: #fff;
}
.cs-cta-btn {
    display: block;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.2s ease;
}
.cs-cta-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d63031 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    color: #fff !important;
    text-decoration: none !important;
}

/* ============================================================
   FOOTER
   ============================================================ */
.cs-footer {
    background-color: #011443;
    margin-top: auto;
}

/* Casper's own .site-footer — hide it */
.site-footer { display: none !important; }

.cs-footer-main {
    padding: 48px 0 40px;
}

.cs-footer-inner {
    max-width: 1272px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    gap: 40px;
    align-items: flex-start;
}

/* Brand column */
.cs-footer-brand-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 28%;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.cs-footer-logo {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    gap: 8px;
    border: none !important;
    box-shadow: none !important;
}
.cs-footer-logo-text {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.cs-footer-rating { display: flex; flex-direction: column; gap: 4px; }
.cs-footer-rating-stars { display: flex; align-items: center; }
.cs-rating-value { color: #fff; font-size: 1.7em; padding-left: 6px; }
.cs-rating-total { color: #fff; font-size: 0.9em; }
.cs-rating-label { color: #fff; font-size: 13px; margin: 4px 0 0; }

.cs-footer-ctas { display: flex; flex-direction: column; gap: 10px; }

.cs-footer-btn-outline {
    border: 1px solid rgba(255,255,255,0.5);
    color: #ffdb41 !important;
    background: transparent;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 3px;
    text-decoration: none !important;
    text-align: center;
    display: block;
    box-shadow: none !important;
    transition: opacity 0.2s;
}
.cs-footer-btn-outline:hover { opacity: 0.8; }

.cs-footer-btn-text {
    border: 1px solid rgba(255,255,255,0.5);
    color: #fff !important;
    background: transparent;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 3px;
    text-decoration: none !important;
    text-align: center;
    display: block;
    box-shadow: none !important;
    transition: opacity 0.2s;
}
.cs-footer-btn-text:hover { opacity: 0.8; }

/* Link columns */
.cs-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    flex: 1;
    justify-content: space-between;
}

.cs-footer-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 110px;
}

.cs-footer-col-title {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 10px;
    padding: 0;
}

.cs-footer-col a {
    color: #b3b4bf !important;
    font-size: 13px;
    text-decoration: none !important;
    line-height: 1.4;
    padding: 4px 0;
    border: none !important;
    box-shadow: none !important;
    transition: color 0.2s;
}
.cs-footer-col a:hover { color: #fff !important; }

/* Bottom bar */
.cs-footer-bottom { background-color: #010529; }

.cs-footer-bottom-inner {
    max-width: 1272px;
    margin: 0 auto;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cs-footer-copyright { color: #fff; font-size: 13px; }

.cs-footer-social { display: flex; gap: 14px; align-items: center; }
.cs-footer-social a {
    color: #fff !important;
    border: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.cs-footer-social a:hover { opacity: 1; }

/* Footer mobile */
@media (max-width: 768px) {
    .cs-footer-inner {
        flex-direction: column-reverse;
        align-items: center;
        padding: 0 16px;
        text-align: center;
    }
    .cs-footer-brand-col {
        width: 100%;
        align-items: center;
    }
    .cs-footer-rating-stars { justify-content: center; }
    .cs-footer-links {
        width: 100%;
        justify-content: flex-start;
        flex-direction: column;
    }
    .cs-footer-bottom-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 20px 16px;
    }
}

/* ============================================================
   BLOG INDEX — Hero, Post Grid, Cards
   ============================================================ */

/* Strip Casper's padding from the main wrapper on the index page */
.cs-blog-index-main {
    padding: 0 !important;
}

/* Hero */
.cs-blog-hero {
    background: #081e95;
    padding: 64px 24px;
}
.cs-blog-hero-inner {
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
}
.cs-blog-hero-title {
    color: #fff;
    font-size: 42px;
    font-weight: 800;
    margin: 0 0 16px;
    line-height: 1.2;
}
.cs-blog-hero-subtitle {
    color: rgba(255,255,255,0.85);
    font-size: 18px;
    line-height: 1.6;
    margin: 0 auto 28px;
    max-width: 580px;
}
.cs-blog-hero .cs-btn-primary {
    font-size: 15px;
    padding: 13px 30px;
}

/* Container */
.cs-blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

/* Section heading */
.cs-section-heading {
    font-size: 26px;
    font-weight: 700;
    color: #011034;
    margin: 0 0 28px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e8ecf0;
}

/* Post grid — 3 columns */
.cs-post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    align-items: start;
}

/* Regular card */
.cs-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e8ecf0;
    box-shadow: 0 2px 10px rgba(1,16,52,0.07);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cs-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(1,16,52,0.13);
}

/* Featured first card — spans full width, horizontal layout */
.cs-card-featured {
    grid-column: 1 / -1;
    flex-direction: row;
    background: #f0f7ff;
    border-color: #cce0ff;
}
.cs-card-featured .cs-card-image-link {
    width: 55%;
    flex-shrink: 0;
    overflow: hidden;
}
.cs-card-featured .cs-card-image {
    height: 380px;
    width: 100%;
    object-fit: cover;
}
.cs-card-featured .cs-card-body {
    padding: 36px 40px;
    justify-content: center;
}
.cs-card-featured .cs-card-excerpt {
    -webkit-line-clamp: 4;
    font-size: 15px;
}

/* Card image */
.cs-card-image-link {
    display: block;
    overflow: hidden;
    border: none !important;
    box-shadow: none !important;
}
.cs-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s;
}
.cs-card:hover .cs-card-image { transform: scale(1.04); }

/* Card body */
.cs-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Tag badge */
.cs-card-tag {
    display: inline-block;
    background: #e8f0fe;
    color: #228fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 10px;
    align-self: flex-start;
}

/* Title link */
.cs-card-title-link {
    color: inherit;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
}
.cs-card-title-link:hover .cs-card-title { color: #228fff; }

.cs-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #011034;
    line-height: 1.4;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cs-card-title-lg {
    font-size: 28px;
    font-weight: 800;
    -webkit-line-clamp: 4;
    margin-bottom: 14px;
}

/* Excerpt */
.cs-card-excerpt {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta (date / reading time) */
.cs-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    font-size: 13px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f2f5;
}

/* Pagination */
.cs-blog-container .pagination {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 48px;
}
.cs-blog-container .pagination a {
    padding: 10px 22px;
    border: 2px solid #228fff;
    color: #228fff !important;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: background 0.2s, color 0.2s;
}
.cs-blog-container .pagination a:hover {
    background: #228fff;
    color: #fff !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .cs-post-grid { grid-template-columns: repeat(2, 1fr); }
    .cs-card-featured .cs-card-image { height: 300px; }
}
@media (max-width: 768px) {
    .cs-blog-hero { padding: 40px 16px; }
    .cs-blog-hero-title { font-size: 28px; }
    .cs-blog-hero-subtitle { font-size: 15px; }
    .cs-blog-container { padding: 32px 16px 48px; }
    .cs-section-heading { font-size: 22px; }
    .cs-card-featured {
        flex-direction: column;
        grid-column: auto;
    }
    .cs-card-featured .cs-card-image-link { width: 100%; }
    .cs-card-featured .cs-card-image { height: 220px; }
    .cs-card-featured .cs-card-body { padding: 20px; }
    .cs-card-featured .cs-card-title-lg { font-size: 22px; }
    .cs-post-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ARTICLE READING EXPERIENCE
   Targets only .gh-content (the post body) — nothing outside.
   Uses same child selectors as Casper to ensure cascade wins.
   ============================================================ */

/* Body text — match Casper's selector specificity exactly */
.gh-content > p,
.gh-content > ul,
.gh-content > ol,
.gh-content > dl,
.gh-content > blockquote:not([class]) {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 300;
    line-height: 1.875;
    color: #262d3d;
    font-size: 1.6rem;
}

/* Focused reading column — extra side padding at desktop */
@media (min-width: 1024px) {
    .gh-content {
        padding-left: 48px;
        padding-right: 48px;
    }
}

/* Headings — sans-serif (Inter) like Toptal, navy for visual hierarchy */
.gh-content > [id],
.article-title {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #0f1f6e;
}
.gh-content h2 {
    font-size: 2.6rem;
    font-weight: 600;
    line-height: 1.25;
}
.gh-content h3 {
    font-size: 2.2rem;
    font-weight: 600;
    line-height: 1.3;
}
.gh-content h4 {
    font-size: 1.9rem;
    font-weight: 600;
}

/* Links — blue, underlined */
.gh-content a:not(.kg-btn):not(.kg-bookmark-container):not(.kg-nft-link) {
    color: #204ecf;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.gh-content a:not(.kg-btn):not(.kg-bookmark-container):not(.kg-nft-link):hover {
    color: #183a9e;
}

/* Lists — keep Casper spacing, just improve font weight */
.gh-content > ul li,
.gh-content > ol li {
    font-weight: 300;
}

/* Blockquote — blue left border instead of Casper's accent color */
.gh-content > blockquote:not([class]) {
    border-left: 3px solid #204ecf;
    padding-left: 24px;
    color: #455065;
    line-height: 1.7;
}
.gh-content > blockquote:not([class])::before {
    background: #204ecf;
}

/* Inline code only — :not(pre)> excludes code inside <pre> blocks */
.gh-content :not(pre) > code:not([class]) {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    color: #262d3d;
    font-weight: 400;
}

/* Mobile */
@media (max-width: 767px) {
    .gh-content > p,
    .gh-content > ul,
    .gh-content > ol,
    .gh-content > dl,
    .gh-content > blockquote:not([class]) {
        font-size: 1.6rem;
        line-height: 1.75;
    }
    .gh-content {
        padding-left: 0;
        padding-right: 0;
    }
    .gh-content h2 { font-size: 2.2rem; }
    .gh-content h3 { font-size: 1.9rem; }
    .gh-content h4 { font-size: 1.7rem; }
}

/* ============================================================
   TABLES — force white background + dark text everywhere.
   Ghost/Koenig tables have near-white text and dark gradient
   backgrounds from the editor's dark theme inline styles.
   ============================================================ */
.gh-content table:not(.gist table),
.gh-content table:not(.gist table) thead,
.gh-content table:not(.gist table) tbody,
.gh-content table:not(.gist table) tr,
.gh-content table:not(.gist table) th,
.gh-content table:not(.gist table) td {
    background: #fff !important;
    color: #262d3d !important;
    border-color: #c8d0dc !important;
}
/* Cover strong/em/span/p inside cells that have their own inline color */
.gh-content table:not(.gist table) * {
    color: #262d3d !important;
}
.gh-content table:not(.gist table) th {
    font-weight: 700;
}
.gh-content table:not(.gist table) td {
    vertical-align: top;
}

/* ============================================================
   READ MORE — post-page "more posts" section
   Override Casper's .read-more grid with our cs-card grid
   ============================================================ */
.read-more-wrap {
    background: #f8f9fb;
    border-top: 1px solid #e8ecf0;
    padding: 48px 24px;
}
.read-more-wrap::before {
    content: 'More Stories';
    display: block;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 24px;
    max-width: 1260px;
    margin-left: auto;
    margin-right: auto;
}
.read-more {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 28px !important;
    align-items: start !important;
    max-width: 1260px;
    margin: 0 auto;
}
@media (max-width: 1024px) {
    .read-more { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 640px) {
    .read-more { grid-template-columns: 1fr !important; }
    .read-more-wrap { padding: 32px 16px; }
}
