/**
 * WriteDrip Theme CSS
 * @version 1.0.0
 */

/* ═══════════════════════════════════════════
   CSS Variables
   ═══════════════════════════════════════════ */
:root {
    --wd-blue: #2563eb;
    --wd-blue-bright: #3b82f6;
    --wd-blue-light: #dbeafe;
    --wd-teal: #19e6c1;
    --wd-green: #059669;
    --wd-orange: #ea580c;
    --wd-dark: #0a0d12;
    --wd-dark-alt: #0f1519;
    --wd-dark-card: #151b24;
    --wd-dark-line: #1e2a38;
    --wd-text: #0f172a;
    --wd-text-sub: #475569;
    --wd-text-dim: #94a3b8;
    --wd-text-light: #f1f5f9;
    --wd-line: #e2e8f0;
    --wd-bg: #ffffff;
    --wd-bg-alt: #f8fafc;
    --wd-radius: 10px;
    --wd-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ═══════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--wd-font);
    color: var(--wd-text);
    background: var(--wd-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-top: 64px; /* Fixed header height */
}
::selection { background: var(--wd-blue-light); color: #1e3a8a; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--wd-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Skip link */
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 99999;
    padding: 8px 16px; background: var(--wd-blue); color: #fff;
    text-decoration: none; border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }

/* ═══════════════════════════════════════════
   Header
   ═══════════════════════════════════════════ */
.wd-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--wd-line);
}
.wd-header-inner {
    max-width: 1200px; margin: 0 auto;
    padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between;
}

/* Logo */
.wd-logo-link {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}
.wd-logo-link:hover { text-decoration: none; }
.wd-logo-mark {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--wd-blue); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.wd-logo-text {
    font-size: 19px; font-weight: 800; letter-spacing: -0.5px;
    color: var(--wd-text);
}
.wd-logo-tagline {
    font-size: 11px; color: var(--wd-text-dim); font-weight: 500;
    letter-spacing: 0.3px; margin-left: -4px;
}

/* Nav */
.wd-nav {
    display: flex; gap: 28px; align-items: center;
}
.wd-nav-link {
    color: var(--wd-text-sub); font-size: 14px; font-weight: 600;
    text-decoration: none; transition: color 0.2s;
}
.wd-nav-link:hover { color: var(--wd-blue); text-decoration: none; }

/* Primary button */
.wd-btn-primary {
    display: inline-block; padding: 9px 20px; border-radius: 8px;
    background: var(--wd-blue); color: #fff !important; font-size: 14px;
    font-weight: 700; text-decoration: none !important;
    box-shadow: 0 2px 10px rgba(37,99,235,0.3);
    transition: background 0.2s, transform 0.2s;
}
.wd-btn-primary:hover {
    background: #1d4ed8; transform: translateY(-1px);
}

/* Mobile menu button */
.wd-mobile-menu-btn {
    display: none; background: none; border: none; cursor: pointer;
    padding: 8px; flex-direction: column; gap: 4px;
}
.wd-mobile-menu-btn span {
    display: block; width: 22px; height: 2px;
    background: var(--wd-text); border-radius: 2px;
}

/* Mobile nav */
.wd-mobile-nav {
    display: flex; flex-direction: column;
    max-height: 0; opacity: 0; overflow: hidden;
    transition: max-height 280ms ease, opacity 180ms ease;
    border-top: 1px solid transparent;
}
.wd-mobile-nav.open {
    max-height: 400px; opacity: 1;
    padding: 12px 0 0; border-top-color: var(--wd-line); margin-top: 8px;
}
.wd-mobile-nav a {
    display: block; color: var(--wd-text); font-weight: 500;
    font-size: 17px; padding: 11px 24px; text-decoration: none;
}
.wd-mobile-nav a:hover { color: var(--wd-blue); }

@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: flex !important; }
    .wd-logo-tagline { display: none; }
}
@media (min-width: 769px) {
    .show-mobile { display: none !important; }
}

/* ═══════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════ */
.wd-footer {
    background: var(--wd-dark);
    padding: 36px 24px;
    border-top: 1px solid var(--wd-dark-line);
}
.wd-footer-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 16px;
}
.wd-footer-brand {
    display: flex; align-items: center; gap: 10px;
}
.wd-footer-copy {
    font-size: 13px; color: var(--wd-text-dim);
}
.wd-footer-links {
    display: flex; gap: 24px;
}
.wd-footer-links a {
    color: var(--wd-text-dim); font-size: 13px; font-weight: 500;
    text-decoration: none;
}
.wd-footer-links a:hover { color: var(--wd-text-light); }

/* ═══════════════════════════════════════════
   Blog Archive
   ═══════════════════════════════════════════ */
.wd-archive {
    max-width: 1000px; margin: 0 auto; padding: 60px 24px 80px;
}
.wd-archive-header {
    text-align: center; margin-bottom: 48px;
}
.wd-archive-header h1 {
    font-size: 36px; font-weight: 800; letter-spacing: -1px;
    margin-bottom: 8px;
}
.wd-archive-header p {
    font-size: 16px; color: var(--wd-text-sub); max-width: 500px;
    margin: 0 auto;
}
.wd-archive-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Post card */
.wd-card {
    background: var(--wd-bg); border: 1.5px solid var(--wd-line);
    border-radius: 14px; overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.wd-card:hover {
    border-color: var(--wd-blue);
    box-shadow: 0 4px 20px rgba(37,99,235,0.08);
}
.wd-card-image img {
    width: 100%; height: 200px; object-fit: cover;
}
.wd-card-body { padding: 24px; }
.wd-card-meta {
    font-size: 12px; color: var(--wd-text-dim); font-weight: 600;
    margin-bottom: 8px; display: flex; gap: 6px;
}
.wd-card-title {
    font-size: 18px; font-weight: 700; line-height: 1.3;
    margin-bottom: 8px;
}
.wd-card-title a { color: var(--wd-text); text-decoration: none; }
.wd-card-title a:hover { color: var(--wd-blue); }
.wd-card-excerpt {
    font-size: 14px; color: var(--wd-text-sub); line-height: 1.65;
    margin-bottom: 12px;
}
.wd-card-link {
    font-size: 14px; font-weight: 600; color: var(--wd-blue);
}

.wd-pagination { margin-top: 48px; text-align: center; }
.wd-pagination .nav-links { display: flex; gap: 8px; justify-content: center; }
.wd-pagination a, .wd-pagination span {
    padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.wd-pagination a {
    background: var(--wd-bg-alt); color: var(--wd-text-sub);
    text-decoration: none;
}
.wd-pagination a:hover { background: var(--wd-blue-light); color: var(--wd-blue); }
.wd-pagination .current {
    background: var(--wd-blue); color: #fff;
}

.wd-empty { text-align: center; padding: 80px 0; }
.wd-empty h2 { font-size: 24px; margin-bottom: 8px; }
.wd-empty p { color: var(--wd-text-sub); }

/* ═══════════════════════════════════════════
   Single Post
   ═══════════════════════════════════════════ */
.wd-single {
    max-width: 760px; margin: 0 auto; padding: 48px 24px 80px;
}
.wd-article-header { margin-bottom: 36px; }
.wd-article-meta {
    font-size: 13px; color: var(--wd-text-dim); font-weight: 500;
    margin-bottom: 12px; display: flex; gap: 6px; align-items: center;
}
.wd-article-meta a { color: var(--wd-blue); font-weight: 600; }
.wd-meta-sep { color: var(--wd-line); }
.wd-article-title {
    font-size: clamp(28px, 5vw, 40px); font-weight: 800;
    line-height: 1.15; letter-spacing: -1px; color: var(--wd-text);
}

/* Article body — the content WriteDrip publishes */
.wd-article-body {
    font-size: 17px; line-height: 1.8; color: #334155;
}
.wd-article-body h2 {
    font-size: 24px; font-weight: 700; margin: 40px 0 16px;
    color: var(--wd-text); letter-spacing: -0.5px;
}
.wd-article-body h3 {
    font-size: 19px; font-weight: 700; margin: 32px 0 12px;
    color: var(--wd-text);
}
.wd-article-body p { margin-bottom: 18px; }
.wd-article-body ul, .wd-article-body ol {
    margin: 0 0 18px 24px;
}
.wd-article-body li { margin-bottom: 6px; }
.wd-article-body a { color: var(--wd-blue); text-decoration: underline; }

/* Tables (comparison tables from WriteDrip content) */
.wd-article-body table {
    width: 100%; border-collapse: collapse; margin: 24px 0;
    font-size: 15px;
}
.wd-article-body thead th {
    background: var(--wd-bg-alt); padding: 12px 16px;
    text-align: left; font-weight: 700; font-size: 13px;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--wd-text-sub);
    border-bottom: 2px solid var(--wd-line);
}
.wd-article-body td {
    padding: 12px 16px; border-bottom: 1px solid var(--wd-line);
    color: var(--wd-text);
}
.wd-article-body tbody tr:hover {
    background: rgba(37,99,235,0.03);
}

/* FAQ section within articles */
.wd-article-body h2:last-of-type ~ h3 {
    font-size: 17px; font-weight: 700; color: var(--wd-text);
    margin: 24px 0 8px;
}

/* Article footer */
.wd-article-footer {
    margin-top: 40px; padding-top: 24px;
    border-top: 1px solid var(--wd-line);
}
.wd-tag {
    display: inline-block; padding: 4px 12px; border-radius: 6px;
    background: var(--wd-bg-alt); font-size: 12px; font-weight: 600;
    color: var(--wd-text-dim); margin: 0 6px 6px 0;
}

/* Post navigation */
.wd-post-nav {
    display: flex; justify-content: space-between; gap: 24px;
    margin-top: 40px; padding-top: 24px;
    border-top: 1px solid var(--wd-line);
}
.wd-post-nav a {
    font-size: 14px; font-weight: 600; color: var(--wd-blue);
    text-decoration: none;
}
.wd-post-nav a:hover { text-decoration: underline; }
.wd-post-nav-next { text-align: right; }

/* ═══════════════════════════════════════════
   Generic Page
   ═══════════════════════════════════════════ */
.wd-page {
    max-width: 760px; margin: 0 auto; padding: 48px 24px 80px;
}
.wd-page-title {
    font-size: 36px; font-weight: 800; letter-spacing: -1px;
    margin-bottom: 24px;
}
.wd-page-body {
    font-size: 17px; line-height: 1.8; color: #334155;
}
.wd-page-body h2 { font-size: 24px; font-weight: 700; margin: 32px 0 12px; }
.wd-page-body p { margin-bottom: 16px; }

/* ═══════════════════════════════════════════
   404
   ═══════════════════════════════════════════ */
.wd-404 {
    min-height: 60vh; display: flex; align-items: center; justify-content: center;
}
.wd-404-inner { text-align: center; }
.wd-404-inner h1 {
    font-size: 96px; font-weight: 800; color: var(--wd-line);
    line-height: 1;
}
.wd-404-inner p {
    font-size: 18px; color: var(--wd-text-sub); margin: 16px 0 32px;
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    body { padding-top: 56px; }
    .wd-header-inner { padding: 10px 16px; }
    .wd-logo-mark { width: 28px; height: 28px; font-size: 13px; }
    .wd-logo-text { font-size: 17px; }
    .wd-single { padding: 32px 16px 60px; }
    .wd-archive { padding: 40px 16px 60px; }
    .wd-archive-grid { grid-template-columns: 1fr; }
    .wd-article-body { font-size: 16px; }
    .wd-article-body table { font-size: 14px; }
    .wd-article-body td, .wd-article-body th { padding: 8px 10px; }
    .wd-footer-inner { flex-direction: column; text-align: center; }
}

/* iOS form zoom prevention */
@media (max-width: 768px) {
    input[type="text"], input[type="email"], input[type="tel"],
    input[type="url"], input[type="search"], textarea, select {
        font-size: 16px !important;
    }
}
