/*
Theme Name: The Broken Dictionary
Theme URI: https://thebrokendictionary.com
Author: Jeff Pierson
Author URI: https://thebrokendictionary.com
Description: A clean, professional editorial theme for policy analysis and civic commentary. Built for The Broken Dictionary.
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: broken-dictionary
Tags: editorial, policy, one-column, custom-menu, featured-images
*/

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #0f2439;
    --navy-mid: #1a3a5c;
    --blue: #2e75b6;
    --blue-light: #4a9ade;
    --accent: #3d6e99;
    --accent-dark: #2c5577;
    --dark: #0d1117;
    --text: #2d3748;
    --text-light: #64748b;
    --bg: #ffffff;
    --bg-light: #f7f8fa;
    --bg-warm: #faf9f7;
    --border: #e2e8f0;
    --border-light: #eef1f5;
    --max-width: 1140px;
    --content-width: 740px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--navy); }
img { max-width: 100%; height: auto; display: block; }

/* === LAYOUT === */
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; }
.content-narrow { max-width: var(--content-width); margin: 0 auto; }

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

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

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 1.3rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.site-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.site-title a { color: #fff; text-decoration: none; }
.site-title a:hover { color: #e0e0e0; }

/* === NAVIGATION === */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 0;
    align-items: center;
}

.main-nav a {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1.2rem 0.9rem;
    display: block;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.main-nav a:hover,
.main-nav .current-menu-item a,
.main-nav .current_page_item a {
    color: #fff;
    border-bottom-color: var(--accent);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 767px) {
    .menu-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--navy);
        border-top: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; }
    .main-nav a {
        padding: 1rem 2rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
}

/* === HERO === */
.site-hero {
    position: relative;
    background: var(--navy);
    padding: 5rem 0 4.5rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(46,117,182,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(61,110,153,0.12) 0%, transparent 50%),
        linear-gradient(180deg, rgba(15,36,57,1) 0%, rgba(26,58,92,1) 100%);
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: -20%;
    right: -5%;
    width: 400px;
    height: 140%;
    background: linear-gradient(135deg, transparent 45%, rgba(61,110,153,0.1) 45%, rgba(61,110,153,0.1) 46%, transparent 46%);
    transform: rotate(-15deg);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hero-eyebrow::before {
    content: '';
    display: block;
    width: 32px;
    height: 2px;
    background: var(--accent);
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    color: #ffffff;
    margin-bottom: 1.25rem;
    max-width: 700px;
}

.hero-title em {
    font-style: normal;
    color: rgba(255,255,255,0.45);
    text-decoration: line-through;
    text-decoration-color: rgba(255,255,255,0.25);
}

.hero-subtitle {
    font-size: 1.15rem;
    line-height: 1.65;
    color: rgba(255,255,255,0.6);
    max-width: 540px;
    margin-bottom: 2rem;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: background 0.2s;
}

.hero-cta:hover { background: var(--accent-dark); color: #fff; }

/* === SECTION HEADERS === */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    margin-top: 0.5rem;
}

.section-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    white-space: nowrap;
}

.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* === MAIN CONTENT === */
.site-content { flex: 1; padding: 3.5rem 0; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    color: var(--navy);
    line-height: 1.3;
}

.entry-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.entry-title a { color: var(--navy); }
.entry-title a:hover { color: var(--blue); }

.page-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--accent);
}

.entry-content h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border-light);
}

.entry-content h3 {
    font-size: 1.2rem;
    color: var(--accent);
    margin: 2rem 0 0.75rem;
}

.entry-content p { margin-bottom: 1.25rem; }

.entry-content ul,
.entry-content ol { margin: 1rem 0 1.5rem 1.5rem; }

.entry-content li { margin-bottom: 0.4rem; }

.entry-content blockquote {
    border-left: 4px solid var(--accent);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--bg-light);
    color: var(--text-light);
    font-style: italic;
}

/* === POST META === */
.entry-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.entry-meta .meta-date {
    font-weight: 600;
    color: var(--text);
}

.entry-meta .meta-category a {
    background: var(--navy);
    color: #fff;
    padding: 0.15rem 0.55rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.entry-meta .meta-category a:hover { background: var(--accent); }

/* === THREE PILLARS === */
.pillars-bar {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 3rem 0;
    overflow: hidden;
}

@media (max-width: 767px) { .pillars-bar { grid-template-columns: 1fr; } }

.pillar {
    padding: 2.25rem 2rem;
    text-align: center;
    position: relative;
}

.pillar + .pillar { border-left: 1px solid var(--border-light); }

@media (max-width: 767px) {
    .pillar + .pillar { border-left: none; border-top: 1px solid var(--border-light); }
}

.pillar-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 1rem;
    background: var(--navy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.85);
    font-size: 1.1rem;
}

.pillar h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.pillar p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.55;
}

/* === FEATURED POST === */
.featured-post {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 0 6px 6px 0;
    padding: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.featured-label {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #fff;
    background: var(--accent);
    padding: 0.2rem 0.65rem;
    border-radius: 3px;
    margin-bottom: 1rem;
}

.featured-post .entry-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

/* === POST CARDS === */
.post-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 767px) { .post-grid { grid-template-columns: 1fr; } }

.post-list { display: grid; gap: 1.5rem; }

.post-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 2rem;
    transition: all 0.25s ease;
    position: relative;
}

.post-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    border-color: var(--border);
    transform: translateY(-2px);
}

.post-card .entry-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.entry-excerpt {
    color: var(--text-light);
    line-height: 1.65;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.read-more {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.read-more:hover { color: var(--navy); }

/* === DOCUMENT LIBRARY === */
.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.document-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: all 0.2s;
}

.document-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.document-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 0.05em;
}

.document-icon.pdf { background: linear-gradient(135deg, #8b1a1a, #6e1515); }
.document-icon.docx { background: linear-gradient(135deg, var(--blue), #1e5a94); }
.document-icon.xlsx { background: linear-gradient(135deg, #1a7a3a, #145e2d); }
.document-icon.pptx { background: linear-gradient(135deg, #b84c2e, #943d25); }

.document-info h3 {
    font-size: 0.95rem;
    color: var(--navy);
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.document-info .doc-meta {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 0.4rem;
}

.doc-download {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
}

/* === CALLOUT BOXES === */
.callout {
    border-left: 4px solid var(--accent);
    background: var(--bg-light);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 4px 4px 0;
}

.callout.callout-warning { border-left-color: #8b1a1a; }
.callout.callout-key { border-left-color: var(--navy); }

.callout-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

/* === SIDEBAR === */
.widget { margin-bottom: 2.5rem; }

.widget-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--navy);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

/* === FOOTER === */
.site-footer {
    background: var(--dark);
    color: rgba(255,255,255,0.5);
    padding: 3.5rem 0 0;
    margin-top: auto;
    position: relative;
}

.footer-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--blue), var(--navy));
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}

@media (max-width: 767px) {
    .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
}

.footer-about .footer-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.footer-logo .logo-mark-sm {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 1rem;
    color: #fff;
}

.footer-logo span { color: #fff; font-weight: 700; font-size: 0.95rem; }
.footer-about p { font-size: 0.88rem; line-height: 1.65; }

.footer-nav h3,
.footer-contact h3 {
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
}

.footer-nav ul { list-style: none; }
.footer-nav a {
    color: rgba(255,255,255,0.5);
    font-size: 0.88rem;
    display: block;
    padding: 0.2rem 0;
}
.footer-nav a:hover { color: #fff; }

.footer-contact p { font-size: 0.88rem; margin-bottom: 0.3rem; }
.footer-contact a { color: rgba(255,255,255,0.5); }
.footer-contact a:hover { color: #fff; }

.footer-bottom {
    max-width: var(--max-width);
    margin: 2.5rem auto 0;
    padding: 1.25rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.footer-tagline {
    color: rgba(255,255,255,0.25);
    font-style: italic;
}

/* === PAGINATION === */
.pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pagination .current {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

/* === SEARCH === */
.search-form { display: flex; gap: 0; }

.search-form input[type="search"] {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 3px 0 0 3px;
    font-size: 0.9rem;
    font-family: inherit;
}

.search-form button {
    padding: 0.6rem 1.2rem;
    background: var(--navy);
    color: #fff;
    border: 1px solid var(--navy);
    border-radius: 0 3px 3px 0;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.search-form button:hover { background: var(--accent); border-color: var(--accent); }

/* === UTILITY === */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

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

/* === PRINT === */
@media print {
    .site-header, .site-footer, .menu-toggle, .pagination, .search-form, .hero-cta, .stats-bar { display: none; }
    .site-hero { padding: 2rem 0; }
    body { font-size: 11pt; color: #000; }
    .entry-title, h1, h2, h3 { color: #000; }
    a { color: #000; text-decoration: underline; }
}
