/* ============================================
   AI Tool Scout — Editorial Magazine Stylesheet
   Warm, refined, publication-grade design
   ============================================ */

/* --- Reset & Variables --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f7f5f0;
    --bg-card: #ffffff;
    --text: #1b1b2a;
    --text-secondary: #5a5a6a;
    --text-muted: #9a9aaa;
    --accent: #b83a3a;
    --accent-hover: #9e2e2e;
    --border: #e6e3dd;
    --border-light: #f0eee8;
    --tag-bg: #f0ede6;
    --header-bg: rgba(247, 245, 240, 0.85);
    --footer-bg: #1b1b2a;
    --footer-text: rgba(255,255,255,0.6);
    --rating: #c48b2a;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 1.25em; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}
h1 { font-size: 2.5rem; letter-spacing: -0.01em; }
h2 { font-size: 1.65rem; margin-bottom: 0.6em; }
h3 { font-size: 1.25rem; }
h4 { font-family: var(--font-body); font-weight: 600; font-size: 1rem; }
p { margin-bottom: 1.1em; color: var(--text-secondary); }
strong { color: var(--text); font-weight: 600; }

.section-title {
    font-size: 1.75rem;
    margin-bottom: 1.25em;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--accent);
    margin-top: 10px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 0;
    border: 2px solid var(--text);
    cursor: pointer;
    transition: all 0.25s ease;
    background: transparent;
    color: var(--text);
}
.btn:hover {
    background: var(--text);
    color: var(--bg);
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.btn-full { width: 100%; justify-content: center; }
.btn-arrow { transition: transform 0.25s ease; }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}
.site-header.scrolled {
    border-bottom-color: var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text);
    letter-spacing: -0.02em;
}
.logo-icon { font-size: 1.3rem; color: var(--accent); }

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}
.nav-links a {
    padding: 6px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.2s ease;
}
.nav-links a:hover { color: var(--text); background: var(--tag-bg); }
.nav-links a.active { color: var(--accent); font-weight: 600; }

.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.mobile-nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: all 0.3s ease;
}
.mobile-nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-nav-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================
   HERO SECTION (Homepage Only)
   ============================================ */
.hero {
    padding: 120px 0 64px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.hero-badge {
    display: inline-block;
    padding: 5px 12px;
    background: var(--tag-bg);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.hero-text h1 { font-size: 2.75rem; margin-bottom: 16px; }
.hero-text p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    max-width: 480px;
}
.hero-visual {
    position: relative;
    height: 280px;
}
.hero-card {
    position: absolute;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    min-width: 150px;
    transition: transform 0.3s ease;
}
.hero-card:hover { transform: translateY(-4px); }
.hero-card-1 { top: 5%; left: 0; }
.hero-card-2 { top: 40%; right: 5%; }
.hero-card-3 { bottom: 8%; left: 15%; }
.card-icon { font-size: 1.4rem; margin-bottom: 4px; }
.card-label { font-weight: 600; font-size: 0.9rem; }
.card-rating { font-size: 0.8rem; color: var(--rating); margin-top: 2px; }

/* ============================================
   ARTICLE CARDS (Homepage)
   ============================================ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}
.post-card:hover { border-color: var(--accent); }
.post-card-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border-light);
}
.post-card-body { padding: 20px; }
.post-card-body h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 6px;
    line-height: 1.4;
}
.post-card-body h3 a:hover { color: var(--accent); }
.post-card-body p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Post List (Recent) */
.posts-list { display: flex; flex-direction: column; gap: 16px; }
.post-row {
    display: flex;
    gap: 20px;
    background: var(--bg-card);
    padding: 18px;
    border: 1px solid var(--border-light);
    transition: all 0.25s ease;
}
.post-row:hover { border-color: var(--border); }
.post-row-img {
    width: 110px;
    min-height: 80px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
}
.post-row-body h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}
.post-row-body h3 a:hover { color: var(--accent); }
.post-row-body p { font-size: 0.85rem; color: var(--text-secondary); }

/* Category Tags */
.post-category {
    display: inline-block;
    padding: 2px 8px;
    background: var(--tag-bg);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.post-date { font-size: 0.8rem; color: var(--text-muted); }

/* ============================================
   CONTENT ROW (Main + Sidebar)
   ============================================ */
.content-row {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    padding: 32px 24px 48px;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar { position: sticky; top: 84px; align-self: start; }
.sidebar-card {
    background: var(--bg-card);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}
.sidebar-card h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
}
.sidebar-card p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 10px; }
.sidebar-link { color: var(--accent); font-weight: 500; font-size: 0.85rem; }
.sidebar-link:hover { text-decoration: underline; }

.sidebar-list { list-style: none; padding: 0; }
.sidebar-list li {
    padding: 7px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}
.sidebar-list li:last-child { border-bottom: none; }

.sidebar-newsletter input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    font-family: var(--font-body);
    font-size: 0.88rem;
    margin-bottom: 8px;
    outline: none;
    background: var(--bg);
    border-radius: 0;
}
.sidebar-newsletter input:focus { border-color: var(--text); }

.sidebar-toc ol { padding-left: 1.2em; margin: 0; }
.sidebar-toc li { padding: 4px 0; font-size: 0.85rem; }
.sidebar-toc a { color: var(--text-secondary); }
.sidebar-toc a:hover { color: var(--accent); }

/* Sidebar Ad */
.sidebar-ad {
    background: var(--tag-bg);
    padding: 20px;
    margin-bottom: 20px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================
   AD PLACEHOLDERS
   ============================================ */
.ad-container {
    background: var(--tag-bg);
    padding: 20px;
    margin: 16px 24px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}
.ad-inline { margin: 28px 0; }

/* ============================================
   ARTICLE PAGE
   ============================================ */
.article-header-section {
    padding: 120px 0 36px;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
}
.article-header-content { max-width: 760px; margin: 0 auto; }
.article-header-section h1 { font-size: 2.25rem; margin: 12px 0 12px; }
.article-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}
.article-meta-top {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.article-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.author-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.article-main { max-width: 760px; }
.article-body {
    font-size: 1.02rem;
    line-height: 1.85;
}
.article-body p { margin-bottom: 1.1em; color: var(--text-secondary); }

/* Tool & Feature Cards */
.tool-card {
    background: var(--bg-card);
    padding: 28px;
    margin: 28px 0;
    border: 1px solid var(--border);
}
.tool-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
}
.tool-rating { font-size: 1.05rem; color: var(--rating); margin-bottom: 6px; }
.rating-num { color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; }
.tool-card h3 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 10px;
}
.tool-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.tool-roundup {
    background: var(--tag-bg);
    padding: 28px;
    margin: 36px 0;
}

/* Comparison Tables */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 24px;
    font-size: 0.88rem;
    border: 1px solid var(--border);
}
.comparison-table th {
    background: var(--text);
    color: var(--bg);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
}
.comparison-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border-light);
}
.comparison-table tr:nth-child(even) { background: var(--tag-bg); }

/* Price Tags & Badges */
.price-tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--text);
    font-size: 0.82rem;
    padding: 3px 10px;
    font-weight: 600;
    margin-right: 6px;
    border: 1px solid var(--border);
}
.badge {
    display: inline-block;
    background: var(--text);
    color: var(--bg);
    font-size: 0.78rem;
    padding: 2px 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stars { color: var(--rating); letter-spacing: 1px; margin: 4px 0 6px; }

/* Code Blocks */
pre {
    background: var(--text);
    color: #e0ddd5;
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 0.82rem;
    margin: 16px 0;
    line-height: 1.6;
}
code { font-family: 'Courier New', monospace; }

/* Disclosure */
.article-footer-disclaimer {
    background: var(--tag-bg);
    padding: 18px 22px;
    border: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 36px;
}

/* ============================================
   PAGE HEADER (About, Privacy)
   ============================================ */
.page-header {
    padding: 110px 0 36px;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
}
.page-header h1 { margin-bottom: 6px; }
.page-header p { color: var(--text-secondary); font-size: 1.02rem; }

.about-section { margin-bottom: 32px; }
.about-section h2 { margin-bottom: 14px; }
.about-section p { margin-bottom: 10px; }
.about-steps { padding-left: 1.5em; margin-bottom: 14px; }
.about-steps li { margin-bottom: 8px; color: var(--text-secondary); }

/* Legal Content */
.legal-content section { margin-bottom: 28px; }
.legal-content h2 { font-size: 1.3rem; margin-bottom: 10px; }
.legal-content p, .legal-content ul { margin-bottom: 10px; color: var(--text-secondary); }
.legal-content li { margin-bottom: 4px; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 44px 0 0;
    margin-top: 48px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-grid h4 {
    font-family: var(--font-body);
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 14px;
}
.footer-grid p { font-size: 0.85rem; line-height: 1.7; color: var(--footer-text); }
.footer-grid a {
    display: block;
    font-size: 0.85rem;
    color: var(--footer-text);
    margin-bottom: 7px;
    transition: color 0.2s;
}
.footer-grid a:hover { color: #fff; }
.footer-bottom {
    padding: 18px 0;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    text-align: center;
}

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

@media (max-width: 968px) {
    .hero-grid { grid-template-columns: 1fr; gap: 36px; }
    .hero-visual { height: 200px; }
    .hero-card { transform: scale(0.85); transform-origin: top left; }
    .hero-text h1 { font-size: 2rem; }
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .content-row { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .article-header-section h1 { font-size: 1.8rem; }
}

@media (max-width: 640px) {
    .mobile-nav-toggle { display: flex; }
    .nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--header-bg);
        backdrop-filter: blur(16px);
        padding: 16px;
        border-bottom: 1px solid var(--border);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
        gap: 2px;
    }
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .nav-links a { padding: 10px 14px; width: 100%; }

    .hero { padding: 100px 0 40px; }
    .hero-text h1 { font-size: 1.6rem; }
    .hero-visual { height: 160px; }
    .hero-card { transform: scale(0.75); transform-origin: top left; }

    .posts-grid { grid-template-columns: 1fr; }
    .post-row { flex-direction: column; gap: 10px; }
    .post-row-img { width: 100%; height: 140px; }
    .section-title { font-size: 1.4rem; }
    .content-row { padding: 24px 16px 32px; }
    .container { padding: 0 16px; }
    .tool-card { padding: 20px; }
    .tool-meta { flex-direction: column; gap: 2px; }
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .article-header-section h1 { font-size: 1.5rem; }
    h1 { font-size: 1.8rem; }
    .article-meta-top { font-size: 0.8rem; gap: 8px; }
}
