/* =============================================
   Cloud Factory EST — Editorial Theme
   Overrides CSS custom properties from style.css

   Reference: Cloud_Factory_Blog_EST.html
   Brand: Blue #0057FF, Navy #0A1628, Orange #FF6B2C
   Fonts: Poppins (body), Space Grotesk (headings)
   ============================================= */

/* ── LIGHT MODE CUSTOM PROPERTIES ── */

:root {
    /* Primary - CF Blue (buttons, links, actions) */
    --primary-50: #e8f0ff;
    --primary-100: #c4d9ff;
    --primary-200: #91b5ff;
    --primary-300: #5e91ff;
    --primary-400: #2b6dff;
    --primary-500: #0057FF;
    --primary-600: #0046d6;
    --primary-700: #003CBB;
    --primary-800: #002d8a;
    --primary-900: #001d59;

    /* Secondary - Deep Navy (gradients, dark accents) */
    --secondary-50: #f0f4f8;
    --secondary-100: #d6e0ec;
    --secondary-200: #b0c4db;
    --secondary-300: #64748B;
    --secondary-400: #475569;
    --secondary-500: #1E293B;
    --secondary-600: #142c47;
    --secondary-700: #0F2847;
    --secondary-800: #0A1628;
    --secondary-900: #060e1a;

    /* Accent - Orange */
    --accent-50: #fff3ed;
    --accent-100: #ffe0cc;
    --accent-200: #ffc299;
    --accent-300: #ffa366;
    --accent-400: #FF6B2C;
    --accent-500: #FF6B2C;
    --accent-600: #e05520;

    /* Typography — Poppins body, Space Grotesk headings */
    --font-sans: "Poppins", Helvetica, Arial, sans-serif;

    /* Text colors — navy/slate from EST HTML */
    --text-primary: #0A1628;
    --text-secondary: #1E293B;
    --text-tertiary: #64748B;

    /* Neutral — slate scale */
    --neutral-50: #F8FAFC;
    --neutral-100: #F1F5F9;
    --neutral-200: #E2E8F0;
    --neutral-300: #CBD5E1;
    --neutral-400: #94A3B8;
    --neutral-500: #64748B;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1E293B;
    --neutral-900: #0F172A;

    /* Functional */
    --background: #F8FAFC;
    --background-secondary: #F1F5F9;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --border-default: #E2E8F0;
    --border-strong: #CBD5E1;
    --border-subtle: #F1F5F9;
    --focus-ring: rgba(0, 87, 255, 0.5);

    /* Hero — navy-to-blue gradient with blue/orange orbs */
    --hero-bg: linear-gradient(135deg, #0A1628 0%, #0F2847 40%, #003CBB 100%);
    --hero-glow-1: rgba(0, 87, 255, 0.25);
    --hero-glow-2: rgba(0, 87, 255, 0.15);
    --hero-glow-3: rgba(255, 107, 44, 0.1);
    --hero-label-color: #c4d9ff;
    --hero-label-line: rgba(196, 217, 255, 0.5);

    /* Footer — navy */
    --footer-bg: #0A1628;

    /* Line heights — EST HTML uses 1.7 body */
    --line-height-normal: 1.7;
    --line-height-relaxed: 1.8;

    /* Shadows — subtle like EST HTML */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.08), 0 20px 48px rgba(0, 0, 0, 0.1);

    /* Border radius — EST uses 16px / 10px */
    --radius-default: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 16px;
}

/* ── DARK MODE ── */

[data-theme="dark"] {
    --primary-50: #001d59;
    --primary-100: #002d8a;
    --primary-200: #003CBB;
    --primary-300: #0046d6;
    --primary-400: #0057FF;
    --primary-500: #2b6dff;
    --primary-600: #5e91ff;
    --primary-700: #91b5ff;
    --primary-800: #c4d9ff;
    --primary-900: #e8f0ff;

    --secondary-50: #060e1a;
    --secondary-100: #0A1628;
    --secondary-200: #0F2847;
    --secondary-300: #142c47;
    --secondary-400: #1E293B;
    --secondary-500: #64748B;
    --secondary-600: #94A3B8;
    --secondary-700: #CBD5E1;
    --secondary-800: #E2E8F0;
    --secondary-900: #F1F5F9;

    --accent-50: #68250b;
    --accent-100: #903411;
    --accent-200: #b84318;
    --accent-300: #e05520;
    --accent-400: #FF6B2C;
    --accent-500: #ff8544;
    --accent-600: #ffa366;

    --neutral-50: #0F172A;
    --neutral-100: #1E293B;
    --neutral-200: #334155;
    --neutral-300: #475569;
    --neutral-400: #64748B;
    --neutral-500: #94A3B8;
    --neutral-600: #CBD5E1;
    --neutral-700: #E2E8F0;
    --neutral-800: #F1F5F9;
    --neutral-900: #F8FAFC;

    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-tertiary: #64748B;

    --background: #060e1a;
    --background-secondary: #0A1628;
    --surface: #0A1628;
    --surface-elevated: #142c47;
    --surface-hover: #142c47;
    --border-default: #1E293B;
    --border-strong: #334155;
    --border-subtle: #0F2847;

    --focus-ring: rgba(43, 109, 255, 0.5);

    --hero-bg: linear-gradient(135deg, #060e1a 0%, #0A1628 40%, #002d8a 100%);
    --hero-glow-1: rgba(43, 109, 255, 0.2);
    --hero-glow-2: rgba(43, 109, 255, 0.1);
    --hero-glow-3: rgba(255, 107, 44, 0.08);
    --hero-label-color: #91b5ff;
    --hero-label-line: rgba(145, 181, 255, 0.4);

    --footer-bg: #060e1a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.3), 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* ── BRAND MARK ── */

.brand-mark {
    background: #0057FF;
    border-radius: 10px;
    transform: rotate(0deg);
    overflow: hidden;
}

.brand-mark::after {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 18px;
    height: 18px;
}

[data-theme="dark"] .brand-mark {
    background: #2b6dff;
}

/* ── NAVBAR ── */

.navbar {
    border-bottom-color: #E2E8F0;
}

[data-theme="dark"] .navbar {
    background-color: rgba(10, 22, 40, 0.92);
    border-bottom-color: #1E293B;
}

/* ── HEADINGS — Space Grotesk ── */

h1, h2, h3, h4, h5, h6 {
    font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
}

.hero-title {
    font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
}

/* ── POST CONTENT — Poppins body, Space Grotesk headings ── */

.post-content {
    font-family: "Poppins", Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
}

.post-content h2 {
    font-size: 30px;
    letter-spacing: -0.3px;
    line-height: 1.25;
    margin-top: 52px;
    margin-bottom: 20px;
}

.post-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 14px;
}

.post-content p {
    margin-bottom: 24px;
}

/* Lead paragraph — blue left border like EST HTML */
.post-content blockquote {
    border-left: 3px solid #0057FF;
    padding-left: 24px;
    font-style: normal;
    font-size: 20px;
    color: #0A1628;
    line-height: 1.75;
}

[data-theme="dark"] .post-content blockquote {
    border-left-color: #2b6dff;
    color: var(--text-primary);
}

/* ── CODE — blue tinted inline code ── */

code {
    background: #F1F5F9;
    padding: 2px 8px;
    border-radius: 6px;
    border: none;
    color: #003CBB;
}

[data-theme="dark"] code {
    background: #1E293B;
    color: #91b5ff;
}

/* ── GRADIENT BARS — blue/navy/orange ── */

.featured-post::before {
    background: linear-gradient(90deg, #0057FF, #0A1628, #FF6B2C);
}

.featured-post::after {
    background: linear-gradient(180deg, #0057FF, #0A1628, #FF6B2C);
}

.post-card::before {
    background: linear-gradient(90deg, #0057FF, #0A1628);
}

/* ── ARTICLE PAGE — EST hero-like layout ── */

/* Article header as full-width dark hero section */
.article-header {
    max-width: none;
    /* Break out of container to full viewport width */
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-top: -2.5rem;
    margin-bottom: 0;
    /* Hero styling */
    background: linear-gradient(135deg, #0A1628 0%, #0F2847 40%, #003CBB 100%);
    padding: 80px 32px 72px;
    border-bottom: none;
    color: #ffffff;
    overflow: hidden;
}

/* Blue glow orb (replaces gradient bar) */
.article-header::before {
    top: -40%;
    right: -10%;
    left: auto;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 87, 255, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

/* Orange glow orb at bottom-left */
.article-header::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 107, 44, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Center inner elements within the full-width header */
.article-header > * {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

/* Text colors on dark hero background */
.article-breadcrumb a {
    color: rgba(255, 255, 255, 0.65);
}

.article-breadcrumb a:hover {
    color: rgba(255, 255, 255, 0.9);
}

.article-title {
    font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
    color: #ffffff;
}

.article-header .author-avatar {
    background: rgba(255, 255, 255, 0.15);
}

.article-header .author-name {
    color: #ffffff;
}

.article-header .author-date {
    color: rgba(255, 255, 255, 0.45);
}

.article-header .reading-time {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.article-header .reading-time::before {
    border-color: rgba(255, 255, 255, 0.4);
}

.article-header .badge-primary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.article-header .share-btn {
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.article-header .share-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.article-header .btn-outline {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.25);
}

.article-header .btn-outline:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Language switcher on dark background */
.article-header .language-switcher svg {
    color: rgba(255, 255, 255, 0.6);
}

.article-header .lang-pill {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
    background: transparent;
}

.article-header .lang-pill:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.article-header .lang-pill.active {
    background: #0057FF;
    border-color: #0057FF;
    color: #ffffff;
}

/* Dark mode article header */
[data-theme="dark"] .article-header {
    background: linear-gradient(135deg, #060e1a 0%, #0A1628 40%, #002d8a 100%);
}

/* Post content as white card overlapping the hero */
.post-content {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.06);
    padding: clamp(32px, 5vw, 64px);
    margin-top: -32px;
    position: relative;
    z-index: 2;
}

[data-theme="dark"] .post-content {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ── NAVBAR LINK UNDERLINE ── */

.navbar-link::after {
    background: linear-gradient(90deg, #0057FF, #0A1628);
}

/* ── FRONT PAGE — EST editorial style ── */

/* Hero — larger title, editorial feel */
.hero {
    padding: 80px 0 72px;
}

.hero-title {
    font-size: clamp(36px, 5.5vw, 56px);
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 18px;
    line-height: 1.7;
}

/* Hero label — hidden in EST design */
.hero-label {
    display: none;
}

/* Search form on hero — EST clean style */
.search-form-hero .form-input {
    border-radius: 10px;
}

.search-form-hero .btn-primary {
    border-radius: 10px;
}

/* Featured Post — EST editorial card */
.featured-post {
    background: var(--surface);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.06);
}

/* Top bar — single blue line */
.featured-post::before {
    height: 3px;
    background: #0057FF;
    opacity: 1;
}

/* Left bar — blue to navy */
.featured-post::after {
    width: 3px;
    background: linear-gradient(180deg, #0057FF, #0A1628);
}

.featured-post:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(0, 0, 0, 0.08);
}

.featured-post-label {
    color: #0057FF;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.featured-post-label::before {
    background: #0057FF;
}

.featured-post-title {
    font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
    font-size: clamp(28px, 3.5vw, 36px);
    font-weight: 400;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.featured-post-title a {
    color: #0A1628;
}

.featured-post-title a:hover {
    color: #0057FF;
}

[data-theme="dark"] .featured-post-title a {
    color: var(--text-primary);
}

[data-theme="dark"] .featured-post-title a:hover {
    color: #5e91ff;
}

.featured-post-excerpt {
    font-size: 17px;
    line-height: 1.7;
    color: #1E293B;
}

[data-theme="dark"] .featured-post-excerpt {
    color: var(--text-secondary);
}

[data-theme="dark"] .featured-post {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Post Cards — EST clean editorial style */
.post-card {
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.06);
    border-color: var(--border-default);
}

.post-card::before {
    height: 3px;
    background: linear-gradient(90deg, #0057FF, #003CBB);
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
    border-color: #91b5ff;
}

[data-theme="dark"] .post-card:hover {
    border-color: #2b6dff;
}

[data-theme="dark"] .post-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.post-card-title {
    font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
    font-weight: 400;
    letter-spacing: -0.2px;
}

.post-card-title a {
    color: #0A1628;
}

.post-card-title a:hover {
    color: #0057FF;
}

[data-theme="dark"] .post-card-title a {
    color: var(--text-primary);
}

[data-theme="dark"] .post-card-title a:hover {
    color: #5e91ff;
}

.post-card-excerpt {
    line-height: 1.7;
}

.post-card-number {
    color: #0057FF;
    font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
}

[data-theme="dark"] .post-card-number {
    color: #5e91ff;
}

/* Stat numbers — JetBrains Mono */
.stat-number,
.section-title {
    font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
}

/* Pagination — EST blue */
.pagination .btn-outline {
    border-color: #E2E8F0;
    color: #0A1628;
    border-radius: 10px;
}

.pagination .btn-outline:hover {
    border-color: #0057FF;
    color: #0057FF;
    background: rgba(0, 87, 255, 0.04);
}

[data-theme="dark"] .pagination .btn-outline {
    border-color: #1E293B;
    color: var(--text-primary);
}

[data-theme="dark"] .pagination .btn-outline:hover {
    border-color: #2b6dff;
    color: #5e91ff;
}

/* ── TABLES — navy header like EST price table ── */

.table thead,
table thead {
    background-color: #0A1628;
    color: #ffffff;
}

[data-theme="dark"] .table thead,
[data-theme="dark"] table thead {
    background-color: #142c47;
}

/* ── RESPONSIVE ── */

@media (max-width: 640px) {
    .hero {
        padding: 56px 0 52px;
    }

    .article-header {
        padding: 56px 20px 52px;
    }

    .post-content {
        padding: 28px;
    }

    .featured-post {
        padding: 28px;
    }
}
