/* =====================================================
   SurfSafe Blog Styles
   Self-contained — defines own variables so it works
   independently of styles.css loading order
   ===================================================== */

/* ---- Variable definitions (mirrors styles.css) ---- */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --dark: #0f172a;
    --gray: #1e293b;
    --light: #94a3b8;
    --white: #ffffff;
}

/* ---- Reset blog content areas ---- */
.blog-hero *,
.blog-index *,
.blog-post-wrap * {
    box-sizing: border-box;
}

/* =====================================================
   BLOG INDEX PAGE
   ===================================================== */

/* ---- Blog Hero ---- */
.blog-hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--gray) 100%);
    color: white;
    padding: 100px 2rem 60px;
    margin-top: 70px;
    text-align: center;
}

.blog-hero .container {
    max-width: 1100px;
    margin: 0 auto;
}

.blog-hero-label {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #60a5fa;
    font-weight: 700;
    margin-bottom: 1rem;
    background: rgba(96, 165, 250, 0.1);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.blog-hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    line-height: 1.2;
    color: white;
}

.blog-hero p {
    font-size: 1.1rem;
    color: #94a3b8;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ---- Blog Start Here Authority Section ---- */
.blog-start-here {
    background: var(--dark);
    padding: 56px 2rem 60px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.blog-start-here .container {
    max-width: 1100px;
    margin: 0 auto;
}

.blog-start-here-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.blog-start-here-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.25);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    margin-bottom: 0.9rem;
}

.blog-start-here-subhead {
    color: #94a3b8;
    font-size: 0.975rem;
    max-width: 520px;
    margin: 0.5rem auto 0;
    line-height: 1.65;
}

.blog-start-here-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.pillar-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 12px;
    padding: 1.75rem 1.75rem 1.5rem;
    text-decoration: none;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.pillar-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

.pillar-card--1::before { background: linear-gradient(90deg, #3b82f6, #818cf8); }
.pillar-card--2::before { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.pillar-card--3::before { background: linear-gradient(90deg, #10b981, #34d399); }

.pillar-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.pillar-card-layer {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.pillar-card-body {
    flex: 1;
}

.pillar-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 0.6rem 0;
    line-height: 1.3;
}

.pillar-card-desc {
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.65;
    margin: 0;
}

.pillar-card-cta {
    font-size: 0.8rem;
    font-weight: 600;
    color: #60a5fa;
    margin-top: 1.25rem;
    letter-spacing: 0.01em;
    transition: color 0.2s;
}

.pillar-card:hover .pillar-card-cta {
    color: #93c5fd;
}

/* ---- Latest Articles heading ---- */
.blog-index-heading {
    margin-bottom: 1.5rem;
}

.blog-index-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #64748b;
    margin: 0;
}

/* ---- Responsive: Start Here ---- */
@media (max-width: 768px) {
    .blog-start-here-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .blog-start-here {
        padding: 44px 1.5rem 48px;
    }
}

/* ---- Category Filter Bar ---- */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.category-pill {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1.5px solid #cbd5e1;
    color: #475569;
    text-decoration: none;
    background: white;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.category-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-pill--active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.category-pill--active:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

/* ---- Category Content Slots ---- */
.category-intro {
    background: white;
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 0.975rem;
    line-height: 1.75;
    color: #334155;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.category-start-here {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
}

.category-start-here h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    font-weight: 700;
    margin: 0 0 0.75rem 0;
}

.category-start-here ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.category-start-here ul li::before {
    content: "→ ";
    color: var(--primary);
    font-weight: 700;
}

.category-start-here ul a {
    color: #1e40af;
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 500;
    transition: color 0.2s;
}

.category-start-here ul a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ---- Blog Index Grid ---- */
.blog-index {
    padding: 60px 2rem 80px;
    background: #f8fafc;
    min-height: 400px;
}

.blog-index .container {
    max-width: 1100px;
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.75rem;
    margin-bottom: 4rem;
}

/* ---- Blog Card ---- */
.blog-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 8px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-top: 3px solid var(--primary);
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.10), 0 8px 32px rgba(0,0,0,0.05);
}

.card-category {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-decoration: none;
    transition: color 0.2s;
}

.card-category:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.card-title {
    font-size: 1.2rem;
    line-height: 1.4;
    margin: 0;
    font-weight: 700;
}

.card-title a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s;
}

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

.card-description {
    color: #475569;
    font-size: 0.93rem;
    line-height: 1.65;
    flex: 1;
    margin: 0;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.card-reading-time::before {
    content: " · ";
}

.card-read-more {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    margin-top: 0.5rem;
    transition: color 0.2s;
}

.card-read-more:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ---- Blog Index Bottom CTA ---- */
.blog-index-cta {
    text-align: center;
    background: linear-gradient(135deg, var(--dark) 0%, var(--gray) 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 14px;
    max-width: 680px;
    margin: 0 auto;
}

.blog-index-cta h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: white;
}

.blog-index-cta p {
    color: #94a3b8;
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
    line-height: 1.65;
}

/* =====================================================
   BLOG POST PAGE
   ===================================================== */

/* ---- Post Hero ---- */
.blog-post-wrap {
    background: #f8fafc;
    min-height: 80vh;
}

.post-hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--gray) 100%);
    color: white;
    padding: 100px 2rem 56px;
    margin-top: 70px;
}

.post-hero .container {
    max-width: 820px;
    margin: 0 auto;
}

.post-meta-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.back-link {
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.back-link:hover {
    color: white;
}

.post-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #60a5fa;
    font-weight: 700;
    background: rgba(96, 165, 250, 0.15);
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.post-hero h1 {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem 0;
    color: white;
}

.post-description {
    font-size: 1.1rem;
    color: #94a3b8;
    line-height: 1.7;
    margin: 0 0 1.5rem 0;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.85rem;
    color: #60a5fa;
}

.post-reading-time::before {
    content: " · ";
}

/* ---- Post Body ---- */
.post-body {
    padding: 48px 2rem 80px;
    background: #f8fafc;
}

.post-body .container {
    max-width: 820px;
    margin: 0 auto;
}

/* ---- Post Content Card ---- */
.post-content {
    background: white;
    padding: 3rem 3.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06), 0 4px 20px rgba(0,0,0,0.04);
    font-size: 1.05rem;
    line-height: 1.8;
    color: #334155;
    border: 1px solid #e2e8f0;
}

/* ---- Post Typography ---- */
.post-content > *:first-child {
    margin-top: 0;
}

.post-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 2.5rem 0 0.875rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    line-height: 1.3;
}

.post-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 2rem 0 0.625rem;
    line-height: 1.4;
}

.post-content p {
    margin: 0 0 1.125rem;
}

.post-content ul,
.post-content ol {
    padding-left: 1.5rem;
    margin: 0 0 1.125rem;
}

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

.post-content strong {
    color: #0f172a;
    font-weight: 600;
}

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

.post-content code {
    background: #f1f5f9;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875em;
    color: #dc2626;
    font-family: 'Courier New', 'Consolas', monospace;
    border: 1px solid #e2e8f0;
}

.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 0.875rem 1.25rem;
    background: #eff6ff;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
    color: #334155;
    font-style: italic;
}

.post-content hr {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 2.5rem 0;
}

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

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

/* ---- In-Post CTA Box ---- */
.post-cta-box {
    margin: 2rem 0 0;
}

.post-cta-inner {
    background: linear-gradient(135deg, var(--dark) 0%, var(--gray) 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
}

.post-cta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #60a5fa;
    margin: 0 0 0.625rem;
    font-weight: 600;
}

.post-cta-inner h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: white;
}

.post-cta-inner > p {
    color: #94a3b8;
    margin: 0 0 1.5rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.65;
    font-size: 0.975rem;
}

.post-cta-buttons {
    display: flex;
    gap: 0.875rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* =====================================================
   SHARED UTILITY
   ===================================================== */

.blog-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 1.1rem;
    padding: 4rem 0;
}

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

@media (max-width: 900px) {
    .post-content {
        padding: 2rem 2rem;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 80px 1.25rem 48px;
        margin-top: 60px;
    }

    .blog-hero h1 {
        font-size: 1.875rem;
    }

    .blog-index {
        padding: 40px 1.25rem 60px;
    }

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

    .post-hero {
        padding: 80px 1.25rem 40px;
        margin-top: 60px;
    }

    .post-hero h1 {
        font-size: 1.625rem;
    }

    .post-body {
        padding: 32px 1.25rem 60px;
    }

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

    .post-cta-inner {
        padding: 1.75rem 1.25rem;
    }

    .post-cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .blog-index-cta {
        padding: 2rem 1.25rem;
    }
}
