/* ══════════════════════════════════════════════════════════════
   Mosverde Theme — Modernized
   Custom Pelican theme for bertilak.ca/imaginarium
   Brand: dark green #224b12 · light green #88b787
   Fonts: Inter (body) · Work Sans (headings)
   ══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
    --green-dark: #224b12;
    --green-light: #88b787;
    --green-dark-rgb: 34, 75, 18;
    --green-light-rgb: 136, 183, 135;
    --bg-page: #f3f3f3;
    --bg-card: #ffffff;
    --text-body: #333;
    --text-muted: #666;
    --text-light: #888;
    --border-light: #eef2ed;
    --border-mid: #e0eae0;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Work Sans', 'Inter', system-ui, sans-serif;
    --radius: 6px;
    --shadow-card: 0 2px 10px rgba(0,0,0,0.04);
    --max-width: 1170px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-body);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
}

/* ── Links ─────────────────────────────────────────────────── */
a { color: var(--green-dark); text-decoration: none; transition: color 0.2s; }
a:hover, a:focus { color: var(--green-light); }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); color: var(--green-dark); font-weight: 500; line-height: 1.3; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

/* ── Layout ────────────────────────────────────────────────── */
.wrapper { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.wrapper-wide { max-width: 100%; padding: 0 30px; }

/* ══════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════ */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    position: relative;
}

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

.site-title-menu {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--green-dark);
}

.site-title-menu a { color: var(--green-dark); }

/* ── Navigation ────────────────────────────────────────────── */
.main-nav ul {
    display: flex;
    flex-direction: row;
    list-style: none;
    gap: 25px;
}

.main-nav li a {
    color: var(--green-dark);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.main-nav li a:hover,
.main-nav li.active a {
    color: var(--green-light);
    border-bottom-color: var(--green-light);
}

/* ── Hamburger Toggle ──────────────────────────────────────── */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    cursor: pointer;
    padding: 6px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--green-dark);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════════════════════════════
   BRANDING / SITE TITLE
   ══════════════════════════════════════════════════════════════ */
.branding {
    text-align: center;
    padding: 35px 20px 20px;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 300;
    margin: 0 0 6px;
}

.site-title a { color: var(--green-dark); text-decoration: none; }

.site-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 300;
}

/* ══════════════════════════════════════════════════════════════
   CONTENT GRID (2 columns: main + sidebar)
   ══════════════════════════════════════════════════════════════ */
.content-area {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 40px;
    max-width: var(--max-width);
    margin: 0 auto 50px;
    padding: 0 20px;
}

.content-main { min-width: 0; }
.content-sidebar { min-width: 0; }

/* ══════════════════════════════════════════════════════════════
   ARTICLE CARDS (index / category / tag pages)
   ══════════════════════════════════════════════════════════════ */
.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    align-items: start;
}

/* ── Card Hover ────────────────────────────────────────────── */
.hentry {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 30px;
    transition: box-shadow 0.25s, transform 0.25s;
    opacity: 0;
    transform: translateY(24px);
}

.hentry.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, box-shadow 0.25s, transform 0.25s;
}

.hentry:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
    transform: translateY(-2px);
}

.hentry + .hentry { margin-top: 0; }  /* grid gap handles spacing */

/* ── Post Thumbnail ────────────────────────────────────────── */
.post-thumbnail-container {
    margin-bottom: 18px;
    border-radius: var(--radius);
    overflow: hidden;
}

.post-thumbnail-container img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
}

/* ── Entry Header ──────────────────────────────────────────── */
.entry-header { margin-bottom: 14px; }

.entry-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 8px;
}

.entry-category a { color: var(--green-light); }

.entry-title {
    font-size: 1.4rem;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.entry-title a { color: var(--green-dark); }

.entry-meta {
    font-size: 0.8rem;
    color: var(--green-light);
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.entry-meta a { color: var(--green-light); }

/* ── Entry Summary ─────────────────────────────────────────── */
.entry-summary {
    margin-bottom: 18px;
    color: var(--text-body);
}

/* ── Continue Reading ──────────────────────────────────────── */
.continue-reading-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--green-dark);
    color: #fff;
    padding: 8px 18px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius);
    transition: background-color 0.25s;
}

.continue-reading-link:hover { background-color: var(--green-light); color: #fff; }

/* ══════════════════════════════════════════════════════════════
   SINGLE ARTICLE PAGE
   ══════════════════════════════════════════════════════════════ */
.single-article .entry-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.single-article .entry-title {
    font-size: 1.9rem;
    line-height: 1.25;
    margin: 10px 0 15px;
}

.single-article .entry-content { line-height: 1.85; color: #222; }

.single-article .entry-content h2 { margin-top: 2em; margin-bottom: 0.5em; }
.single-article .entry-content h3 { margin-top: 1.5em; margin-bottom: 0.5em; }
.single-article .entry-content img { max-width: 100%; height: auto; border-radius: var(--radius); }

.single-article .entry-content code {
    background: #f5f8f5;
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 0.875em;
}

.single-article .entry-content pre {
    background: #f5f8f5;
    border: 1px solid var(--border-mid);
    border-radius: var(--radius);
    padding: 15px;
    overflow-x: auto;
    font-size: 0.875em;
    line-height: 1.5;
}

.single-article .entry-content pre code { border: none; padding: 0; background: none; }

.single-article .entry-content blockquote {
    border-left: 4px solid var(--green-light);
    margin: 1.5em 0;
    padding: 10px 20px;
    background: #f5f8f5;
    color: #444;
    font-style: italic;
}

.single-article .entry-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* ══════════════════════════════════════════════════════════════
   PAGE (About, Privacy, etc.)
   ══════════════════════════════════════════════════════════════ */
.single-page .entry-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.page-lead {
    font-size: 1.025rem;
    color: #555;
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 25px;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.widget {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 22px;
    margin-bottom: 25px;
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--green-light);
    color: var(--green-dark);
}

.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: 7px 0; border-bottom: 1px solid #f6f8f5; font-size: 0.875rem; }
.widget ul li:last-child { border-bottom: none; padding-bottom: 0; }
.widget ul li a { color: var(--text-body); }
.widget ul li a:hover { color: var(--green-light); }

/* ── Search ────────────────────────────────────────────────── */
.stork-input {
    width: 100%;
    border: 1px solid #cdcdcd;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.875rem;
    font-family: var(--font-body);
}

.stork-input:focus {
    border-color: var(--green-dark);
    box-shadow: 0 0 5px rgba(var(--green-dark-rgb), 0.2);
    outline: none;
}

.stork-output { margin-top: 10px; max-height: 300px; overflow-y: auto; }

/* ── Tag Cloud ─────────────────────────────────────────────── */
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-cloud-link {
    font-size: 0.8rem;
    background-color: #f0f4f0;
    color: var(--green-dark);
    padding: 4px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border-mid);
    transition: all 0.2s;
}

.tag-cloud-link:hover { background-color: var(--green-dark); color: #fff; border-color: var(--green-dark); }

/* ══════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════ */
.pagination { margin: 20px 0 40px; }

.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.page-numbers {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--green-dark);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.page-numbers.current,
.page-numbers:hover { background-color: var(--green-dark); color: #fff; border-color: var(--green-dark); }

.page-numbers.prev,
.page-numbers.next { width: auto; padding: 0 14px; }

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */
.site-footer {
    background-color: #222226;
    color: #aaa;
    padding: 45px 20px;
    margin-top: 60px;
    border-top: 4px solid var(--green-dark);
    text-align: center;
}

.site-quote {
    margin-bottom: 25px;
    font-size: 1.05rem;
    font-weight: 300;
}

.quote-author {
    font-size: 0.85rem;
    color: var(--green-light);
    display: block;
    margin-top: 5px;
}

.site-copyright { font-size: 0.8rem; }
.site-copyright a { color: var(--green-light); }
.site-copyright a:hover { color: #fff; }

/* ══════════════════════════════════════════════════════════════
   SEARCH PAGE
   ══════════════════════════════════════════════════════════════ */
.search-heading {
    font-family: var(--font-heading);
    color: var(--green-dark);
    margin-bottom: 20px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
    .content-area { grid-template-columns: 1fr; }
    .article-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .nav-toggle { display: flex; }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        z-index: 999;
        border-top: 2px solid var(--green-light);
    }

    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; padding: 10px 0; }
    .main-nav li a { display: block; padding: 12px 20px; border-bottom: none; }

    .site-header { position: relative; }

    .site-title { font-size: 1.6rem; }

    .single-article .entry-title { font-size: 1.5rem; }

    .article-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .wrapper { padding: 0 16px; }
    .wrapper-wide { padding: 0 16px; }
    .site-header-inner { padding: 12px 16px; }
    .content-area { padding: 0 16px; gap: 25px; }
    .branding { padding: 25px 16px 15px; }
    .site-title { font-size: 1.35rem; }
    .hentry { padding: 20px; }
    .single-article .entry-title { font-size: 1.3rem; }
}
