/* ===== The QA Chronicles — Global Styles ===== */

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

:root {
    --navy:      #0f172a;
    --navy-mid:  #1e293b;
    --navy-soft: #334155;
    --accent:    #38bdf8;
    --accent-dark: #0ea5e9;
    --accent-light: #e0f7ff;
    --green:     #10b981;
    --amber:     #f59e0b;
    --red:       #ef4444;
    --text:      #1a1a2e;
    --text-light: #475569;
    --text-muted: #94a3b8;
    --border:    #e2e8f0;
    --bg:        #ffffff;
    --bg-alt:    #f8fafc;
    --code-bg:   #f1f5f9;
    --info-bg:   #f0f9ff;
    --max-width: 1200px;
}

body {
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 16px;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--navy); }
img { max-width: 100%; }

/* ===== HEADER ===== */
.site-header {
    background: var(--navy);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.site-header .inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.site-logo {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.site-logo .logo-main {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.site-logo .logo-sub {
    font-size: 0.68rem;
    color: var(--accent);
    letter-spacing: 1.8px;
    text-transform: uppercase;
    font-weight: 600;
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 32px;
}

.site-nav ul li a {
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 600;
    transition: color 0.2s;
    letter-spacing: 0.2px;
}

.site-nav ul li a:hover,
.site-nav ul li a.active { color: var(--accent); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #fff;
}

/* ===== HOMEPAGE HERO ===== */
.home-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1a3a5c 100%);
    padding: 90px 24px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.home-hero::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(56,189,248,0.12) 0%, transparent 70%);
    border-radius: 50%;
}

.home-hero::after {
    content: '';
    position: absolute;
    bottom: -40px; left: -40px;
    width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(16,185,129,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-eyebrow {
    display: inline-block;
    background: rgba(56,189,248,0.15);
    border: 1px solid rgba(56,189,248,0.3);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 6px 18px;
    border-radius: 20px;
    margin-bottom: 24px;
}

.home-hero h1 {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 20px;
    line-height: 1.15;
    letter-spacing: -1px;
    position: relative;
    z-index: 1;
}

.home-hero h1 span { color: var(--accent); }

.home-hero p {
    font-size: 1.15rem;
    color: #94a3b8;
    max-width: 560px;
    margin: 0 auto 36px;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    position: relative;
    z-index: 1;
}

.hero-stat strong {
    display: block;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}

.hero-stat span {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ===== FILTER TABS ===== */
.filter-section {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
}

.filter-section .inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 6px;
}

.filter-btn {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

/* ===== ARTICLE GRID ===== */
.articles-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 52px 24px 80px;
}

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: #6b7280;
    font-weight: 700;
    margin-bottom: 32px;
}

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

.article-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.article-card:hover {
    box-shadow: 0 16px 40px rgba(15,23,42,0.12);
    transform: translateY(-5px);
    border-color: var(--accent);
}

.card-icon {
    width: 44px; height: 44px;
    background: var(--navy);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 16px;
    flex-shrink: 0;
}

.card-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.card-tag.manual { background: #dbeafe; color: #1d4ed8; }
.card-tag.automation { background: #d1fae5; color: #065f46; }
.card-tag.mobile { background: #fce7f3; color: #9d174d; }
.card-tag.fundamentals { background: #fef3c7; color: #92400e; }
.card-tag.api { background: #ede9fe; color: #5b21b6; }
.card-tag.performance { background: #fee2e2; color: #991b1b; }
.card-tag.linux { background: #ecfdf5; color: #166534; }
.card-tag.networking { background: #e0f2fe; color: #0c4a6e; }
.card-tag.security  { background: #fff1f2; color: #9f1239; }
.card-tag.devops    { background: #eef2ff; color: #3730a3; }

.article-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-card p {
    font-size: 0.92rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.7;
    flex-grow: 1;
}

.card-meta {
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.read-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0369a1;
    transition: gap 0.2s, color 0.2s;
}

.read-link:hover { gap: 10px; color: var(--navy); }

/* ===== ARTICLE HEADER ===== */
.article-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    padding: 60px 24px 48px;
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 10px 24px;
    transition: gap 0.2s;
}

.back-link:hover { gap: 10px; color: #fff; }

.article-header .card-tag { margin-bottom: 18px; }

.article-header h1 {
    font-size: 2.2rem;
    font-weight: 900;
    color: #fff;
    max-width: 760px;
    margin: 0 auto 18px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.article-meta {
    font-size: 0.85rem;
    color: #94a3b8;
}

.article-meta span { margin: 0 10px; }

/* ===== ARTICLE LAYOUT ===== */
.article-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px 72px;
    display: grid;
    grid-template-columns: 220px 1fr 290px;
    gap: 36px;
    align-items: start;
}

/* ===== TOC ===== */
.toc {
    position: sticky;
    top: 84px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 20px;
}

.toc h4 {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-weight: 800;
}

.toc ul { list-style: none; }
.toc ul li { margin-bottom: 8px; }

.toc ul li a {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.4;
    transition: color 0.2s;
    display: block;
    padding: 2px 0;
}

.toc ul li a:hover { color: var(--accent-dark); }
.toc ul li a.active {
    color: var(--accent-dark);
    font-weight: 700;
    border-left: 3px solid var(--accent-dark);
    padding-left: 8px;
}

/* ===== ARTICLE CONTENT ===== */
.article-content { min-width: 0; font-size: 1.05rem; }

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy);
    margin: 44px 0 18px;
    padding-left: 16px;
    border-left: 4px solid var(--accent-dark);
    line-height: 1.3;
    letter-spacing: -0.2px;
}

.article-content h2:first-child { margin-top: 0; }

.article-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy-soft);
    margin: 28px 0 12px;
}

.article-content p { margin-bottom: 18px; color: #334155; line-height: 1.8; }

.article-content ul,
.article-content ol {
    margin: 0 0 18px 26px;
    color: #334155;
}

.article-content ul li,
.article-content ol li { margin-bottom: 10px; line-height: 1.7; }

/* Info box */
.info-box {
    background: var(--info-bg);
    border-left: 4px solid var(--accent-dark);
    border-radius: 0 10px 10px 0;
    padding: 18px 22px;
    margin: 24px 0;
    font-size: 0.97rem;
    line-height: 1.7;
}

.info-box strong { color: var(--accent-dark); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 24px 0; border-radius: 10px; border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }

thead tr { background: var(--navy); color: #fff; }

thead th {
    padding: 13px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.88rem;
}

tbody tr:nth-child(even) { background: var(--bg-alt); }

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.6;
}

/* Code blocks */
pre {
    background: #0f172a;
    border-radius: 10px;
    padding: 24px;
    overflow-x: auto;
    margin: 24px 0;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #e2e8f0;
    border: 1px solid #1e293b;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.88em;
    background: var(--code-bg);
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid var(--border);
    color: #0369a1;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

/* ===== DIAGRAMS ===== */
.diagram {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 20px;
    margin: 28px 0;
    text-align: center;
    overflow-x: auto;
}

.diagram-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 24px;
}

.flow-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

.flow-step {
    background: #fff;
    border: 2px solid var(--accent-dark);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-dark);
    min-width: 110px;
    text-align: center;
    line-height: 1.3;
    flex-shrink: 0;
}

.flow-step.filled { background: var(--navy); border-color: var(--navy); color: var(--accent); }
.flow-step.green { border-color: var(--green); color: var(--green); }
.flow-step.green.filled { background: var(--green); border-color: var(--green); color: #fff; }
.flow-step.orange { border-color: var(--amber); color: var(--amber); }
.flow-step.orange.filled { background: var(--amber); border-color: var(--amber); color: #fff; }
.flow-step.red { border-color: var(--red); color: var(--red); }
.flow-step.red.filled { background: var(--red); border-color: var(--red); color: #fff; }

.flow-arrow { font-size: 1.2rem; color: var(--text-muted); margin: 0 6px; flex-shrink: 0; }
.flow-arrow.down { display: block; margin: 6px auto; }

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 24px 0;
    text-align: center;
}

.matrix-cell {
    border-radius: 10px;
    padding: 16px 12px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.4;
}

.matrix-cell.header { background: var(--navy); color: var(--accent); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.5px; }
.matrix-cell.high-high { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.matrix-cell.high-med  { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.matrix-cell.med-high  { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.matrix-cell.low-low   { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.matrix-cell.med-med   { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.matrix-cell.label     { background: #f8fafc; color: #334155; border: 1px solid var(--border); font-size: 0.82rem; }

/* ===== RIGHT SIDEBAR ===== */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 84px;
}

.sidebar-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.sidebar-heading {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--text-muted);
    font-weight: 800;
    margin-bottom: 14px;
}

.author-avatar {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--navy), var(--accent-dark));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}

.author-card h4 { font-size: 0.98rem; font-weight: 700; color: var(--navy); margin-bottom: 7px; }
.author-card p { font-size: 0.85rem; color: var(--text-light); line-height: 1.6; margin-bottom: 12px; }

.author-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-dark);
    background: var(--accent-light);
    padding: 7px 14px;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.author-links a:hover { background: var(--navy); color: var(--accent); }

.promo-banner {
    border-radius: 14px;
    padding: 22px 18px;
    text-align: center;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.promo-banner:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.18); }

.promo-banner.hire { background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%); }
.promo-banner.cv   { background: linear-gradient(135deg, #0f172a 0%, var(--navy-mid) 100%); }
.promo-banner.cert { background: linear-gradient(135deg, #059669 0%, #047857 100%); }

.promo-banner .banner-icon { font-size: 1.8rem; margin-bottom: 10px; display: block; color: var(--accent); }
.promo-banner h4 { font-size: 1rem; font-weight: 800; margin-bottom: 7px; color: #fff; }
.promo-banner p { font-size: 0.82rem; color: rgba(255,255,255,0.75); line-height: 1.5; margin-bottom: 14px; }
.promo-banner .banner-btn {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: background 0.2s;
}

.promo-banner:hover .banner-btn { background: rgba(255,255,255,0.28); }

.quick-links { list-style: none; }
.quick-links li { margin-bottom: 8px; }
.quick-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-light);
    font-weight: 500;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.quick-links li a:hover { background: var(--accent-light); color: var(--accent-dark); border-color: #bae6fd; }
.quick-links li a i { color: var(--accent-dark); font-size: 0.85rem; width: 16px; text-align: center; }

.social-sidebar { display: flex; flex-direction: column; gap: 8px; }
.social-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.2s;
    color: #fff;
}
.social-btn:hover { opacity: 0.88; transform: translateX(3px); color: #fff; }
.social-btn.linkedin  { background: #0077b5; }
.social-btn.twitter   { background: #1da1f2; }
.social-btn.instagram { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

/* ===== RELATED POSTS ===== */
.related-posts {
    background: var(--navy);
    padding: 56px 24px;
}

.related-posts .inner { max-width: var(--max-width); margin: 0 auto; }

.related-posts h3 {
    font-size: 0.72rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 28px;
    font-weight: 800;
}

.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.related-card {
    background: var(--navy-mid);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 22px;
    transition: border-color 0.2s, transform 0.2s;
}

.related-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.related-card .card-tag { margin-bottom: 10px; }
.related-card h4 { font-size: 0.95rem; font-weight: 700; color: #f1f5f9; margin-bottom: 14px; line-height: 1.4; }
.related-card a.read-link { font-size: 0.85rem; color: var(--accent); }
.related-card a.read-link:hover { color: #fff; }

/* ===== NEWSLETTER ===== */
.newsletter-section {
    background: linear-gradient(135deg, var(--accent-dark) 0%, #0f172a 100%);
    padding: 64px 24px;
    text-align: center;
}

.newsletter-section h2 { font-size: 1.8rem; font-weight: 900; color: #fff; margin-bottom: 12px; }
.newsletter-section p { font-size: 1rem; color: rgba(255,255,255,0.75); margin-bottom: 28px; }

.newsletter-form { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.newsletter-form input {
    padding: 13px 20px;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    width: 280px;
    outline: none;
}

.newsletter-form button {
    background: var(--navy);
    color: var(--accent);
    border: none;
    padding: 13px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.newsletter-form button:hover { background: #0f2744; }

/* ===== FOOTER ===== */
.site-footer {
    background: #060e1a;
    color: #94a3b8;
    padding: 40px 24px;
}

.site-footer .inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand .logo-main { font-size: 1rem; font-weight: 800; color: #fff; }
.footer-brand .logo-sub { font-size: 0.65rem; color: var(--accent); letter-spacing: 1.5px; text-transform: uppercase; }

.footer-links { display: flex; gap: 24px; }
.footer-links a { color: #94a3b8; font-size: 0.85rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

.footer-social { display: flex; gap: 18px; }
.footer-social a { color: #94a3b8; font-size: 1.1rem; transition: color 0.2s; }
.footer-social a:hover { color: var(--accent); }

.footer-copy { width: 100%; text-align: center; font-size: 0.82rem; color: #94a3b8; padding-top: 20px; border-top: 1px solid #1e293b; margin-top: 10px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .article-container { grid-template-columns: 200px 1fr 260px; gap: 28px; }
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .article-container { grid-template-columns: 1fr; }
    .toc { position: static; margin-bottom: 28px; }
    .right-sidebar { position: static; }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .home-hero h1 { font-size: 2.2rem; }
    .hero-stats { gap: 28px; }
}

@media (max-width: 640px) {
    .articles-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .home-hero h1 { font-size: 1.8rem; }
    .article-header h1 { font-size: 1.6rem; }
    .article-container { padding: 32px 16px 48px; }
    .site-nav { display: none; }
    .site-nav.open {
        display: block;
        position: absolute;
        top: 68px; left: 0; right: 0;
        background: var(--navy-mid);
        border-bottom: 1px solid #334155;
        padding: 20px 24px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    }
    .site-nav.open ul { flex-direction: column; gap: 16px; }
    .nav-toggle { display: block; }
    .site-footer .inner { flex-direction: column; align-items: center; text-align: center; }
    .footer-links { justify-content: center; }
}

.author-certs { font-size: 0.78rem; color: var(--accent); font-weight: 600; letter-spacing: 0.5px; margin-bottom: 10px; }
