/*
Theme Name: Editorial Network
Description: Clean editorial reading experience for GeneratePress sites. Configurable typography and palette, single-column posts, whitespace-first design.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Template: generatepress
License: Proprietary
Text Domain: editorial-network
*/

/* ── Design tokens ───────────────────────────────────────────────────────
   This file is now byte-identical across every site in the network. All
   per-site variation is three constants in functions.php (EN_PALETTE,
   EN_TYPE, EN_ACCENT) — EN_PALETTE picks a class below, EN_ACCENT is
   injected as --en-accent via an inline <style> block in wp_head. Nothing
   in here should ever need hand-editing per site again. ──────────────── */

:root {
    --en-font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --homey-accent: var(--en-accent, #8a7a63);
}

.en-t-slab {
    --en-font: 'Roboto Slab', Georgia, Cambria, 'Times New Roman', serif;
}

.en-t-grotesk {
    --en-font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Palette: clay — warm off-white, soft radius, gentle shadow (the original
   1.0.x default look, kept as the baseline). */
.en-p-clay {
    --homey-bg: #f7f5f1;
    --homey-card-bg: #fffdfa;
    --homey-border: #ece7dd;
    --homey-radius: 10px;
    --homey-radius-lg: 12px;
    --homey-shadow: 0 1px 3px rgba(30, 20, 10, 0.05);
}

/* Palette: anodize — cool, flat, hairline borders, no shadow. */
.en-p-anodize {
    --homey-bg: #f2f4f6;
    --homey-card-bg: #ffffff;
    --homey-border: #dde2e7;
    --homey-radius: 4px;
    --homey-radius-lg: 6px;
    --homey-shadow: none;
}

/* Palette: fieldbook — warm paper tone, generous radius. */
.en-p-fieldbook {
    --homey-bg: #f7f2e7;
    --homey-card-bg: #fffcf4;
    --homey-border: #e8dcc0;
    --homey-radius: 14px;
    --homey-radius-lg: 16px;
    --homey-shadow: 0 1px 2px rgba(60, 45, 10, 0.06);
}

/* Palette: signal — near-white, high contrast, deeper shadow. */
.en-p-signal {
    --homey-bg: #fafafa;
    --homey-card-bg: #ffffff;
    --homey-border: #e4e4e4;
    --homey-radius: 16px;
    --homey-radius-lg: 20px;
    --homey-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Palette: shopfloor — utilitarian, square corners, solid border, flat. */
.en-p-shopfloor {
    --homey-bg: #eef0f1;
    --homey-card-bg: #ffffff;
    --homey-border: #c7cdd1;
    --homey-radius: 2px;
    --homey-radius-lg: 2px;
    --homey-shadow: none;
}

/* ── Base Typography ────────────────────────────────────────────────── */

body {
    font-family: var(--en-font);
    font-size: 16px;
    line-height: 1.5;
    color: #2e3236;
    background-color: var(--homey-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Headings ───────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6,
.entry-title {
    font-family: var(--en-font);
    color: #1a1a1a;
}

h1, .entry-title {
    font-size: 40px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.entry-content h2 {
    font-size: 32px;
    line-height: 1.3;
    font-weight: 600;
    margin-top: 2em;
    margin-bottom: 0.75em;
    padding-bottom: 0.35em;
    border-bottom: 1px solid var(--homey-border);
}

.entry-content h3 {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 600;
    margin-top: 1.75em;
    margin-bottom: 0.5em;
}

.entry-content h4 {
    font-size: 20px;
    line-height: 1.3;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

/* ── Body Content ───────────────────────────────────────────────────── */

.entry-content {
    line-height: 1.75;
}

.entry-content p {
    margin-bottom: 1.5em;
    font-weight: 400;
}

.entry-content > p:first-of-type {
    font-size: 1.07em;
    color: #333;
}

.entry-content a {
    color: var(--homey-accent);
    text-decoration-color: var(--homey-border);
}

.entry-content a:hover {
    color: #1a1a1a;
    text-decoration-color: var(--homey-accent);
}

.entry-content blockquote {
    font-family: Georgia, Cambria, 'Times New Roman', Times, serif;
    font-size: 1.08em;
    font-style: italic;
    line-height: 1.6;
    background: var(--homey-bg);
    border-left: 3px solid var(--homey-accent);
    border-radius: 0 6px 6px 0;
    margin: 1.5em 0;
    padding: 0.5em 1.5em;
    color: #555;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

.entry-content li {
    margin-bottom: 0.5em;
}

.entry-content img {
    border-radius: 4px;
}

/* ── Single Post Layout ─────────────────────────────────────────────── */

.editorial-single .site-content .content-area {
    max-width: 720px;
    margin: 0 auto;
    float: none;
}

.editorial-single .inside-article {
    padding: 44px 40px;
    border-radius: var(--homey-radius-lg);
}

.editorial-single .entry-header {
    margin-bottom: 2em;
}

.editorial-single .entry-meta {
    font-size: 14px;
    color: #888;
    margin-top: 0.75em;
    font-family: Georgia, Cambria, 'Times New Roman', Times, serif;
    font-style: italic;
    letter-spacing: 0.01em;
}

/* Scoped to .en-byline specifically, not the shared .entry-meta class —
   that class is also on the unrelated footer categories/tags block, and a
   flex layout change there would be a landmine. */
.editorial-single .en-byline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.editorial-single .en-byline .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* GP's single-post featured image wrapper is .featured-image (verified
   live — the theme never had a .post-image on singles; that class only
   exists in GP's archive-loop markup, see Archive Cards below). */
.editorial-single .featured-image {
    margin-bottom: 2em;
}

.editorial-single .featured-image img {
    width: 100%;
    height: auto;
    border-radius: var(--homey-radius);
}

/* ── Reading Time Badge ─────────────────────────────────────────────── */

.en-reading-time {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    letter-spacing: 0.02em;
    margin-top: 0.5em;
    font-family: Georgia, Cambria, 'Times New Roman', Times, serif;
    font-style: italic;
}

/* ── Header / Branding ──────────────────────────────────────────────── */
/* When a custom logo image already contains the site name, GeneratePress
   still renders a separate "main-title" text link next to it, which reads
   as a duplicated site name (most noticeable on mobile where the header
   stacks/compresses). Visually hide the redundant text link but keep it
   in the markup for accessibility/SEO — it only ever applies on sites
   that actually have a custom logo set (site-logo + site-branding are
   only adjacent siblings in that case), so this is a no-op everywhere
   else. */

.site-logo + .site-branding .main-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Navigation ─────────────────────────────────────────────────────── */

.main-navigation,
.main-navigation .main-nav ul li a {
    font-family: var(--en-font);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.02em;
}

/* ── Footer Archives ────────────────────────────────────────────────── */

.en-footer-archives {
    padding: 30px 0;
    border-top: 1px solid var(--homey-border);
    text-align: center;
    font-size: 13px;
    color: #595959;
    background-color: var(--homey-card-bg);
    border-radius: var(--homey-radius-lg) var(--homey-radius-lg) 0 0;
}

.en-footer-archives-title {
    font-weight: 600;
    color: #2e3236;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.en-footer-archives-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
}

.en-footer-archives-list a {
    color: #666;
    text-decoration: none;
}

.en-footer-archives-list a:hover {
    color: #2e3236;
    text-decoration: underline;
}

.en-footer-archives-list .count {
    color: #595959;
    font-size: 12px;
}

/* ── Author Bio Widget ──────────────────────────────────────────────── */

.en-bio {
    text-align: center;
}

.en-bio img {
    border-radius: 50%;
    margin-bottom: 12px;
}

.en-bio strong {
    display: block;
    font-family: var(--en-font);
    font-size: 15px;
    margin-bottom: 6px;
}

.en-bio p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* ── Archive/Homepage Cards ─────────────────────────────────────────── */

.site-content .inside-article {
    border-bottom: 1px solid #f0f0f0;
    background-color: var(--homey-card-bg);
    border: 1px solid var(--homey-border);
    border-radius: var(--homey-radius);
    box-shadow: var(--homey-shadow);
    margin-bottom: 24px;
    padding: 28px 28px 8px;
}

/* Real GP archive-loop markup (verified live on the blog index) — a plain
   .post-image wrapper, unscoped, distinct from .featured-image on singles.
   The old stylesheet had this under .editorial-single, which never matches
   an archive page and never matched anything. */
.post-image {
    margin-bottom: 1em;
}

.post-image img {
    width: 100%;
    height: auto;
    border-radius: var(--homey-radius);
}

/* ── Sidebar Tweaks (archive/home pages) ────────────────────────────── */

.widget-area .widget {
    font-family: var(--en-font);
    font-size: 14px;
}

.widget-area .widget-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2e3236;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    h1, .entry-title {
        font-size: 28px;
    }

    .entry-content h2 {
        font-size: 24px;
    }

    .entry-content h3 {
        font-size: 20px;
    }

    .editorial-single .inside-article {
        padding: 28px 20px;
    }

    .site-content .inside-article {
        padding: 20px 18px 4px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    body,
    .entry-content p,
    .entry-content li {
        font-size: 18px !important;
        line-height: 1.75 !important;
    }

    h1, .entry-title {
        font-size: 26px;
    }

    .entry-content h2 {
        font-size: 22px;
    }

    .entry-content h3 {
        font-size: 19px;
    }

    .entry-content h4 {
        font-size: 17px;
    }
}
