/* ========================================
   V4 Magazine Article Styles
   ======================================== */

/* ── Layout ── */
.site-main {
    margin-top: 0;
    padding-top: 0;
}

/* ── Entry Title ── */
.entry-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.75rem;
    line-height: 1.25;
    color: #1a1a1a;
    margin: 0 0 0.5rem;
}
@media (min-width: 768px) {
    .entry-title { font-size: 2.25rem; }
}

/* ── Single Article Header ── */
.article-header-v5 {
    margin: 0 auto 2rem;
    padding: 1.5rem 0 1.75rem;
    border-bottom: 1px solid #e7e1d9;
}

.article-header-v5__eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.article-header-v5__category,
.article-header-v5__date {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.article-header-v5__category {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: #f4eee7;
    color: #2f4f50;
    text-decoration: none;
    font-weight: 700;
}

.article-header-v5__date {
    color: #8b7b6d;
    font-weight: 600;
}

.article-header-v5__title {
    font-size: clamp(2.2rem, 4vw, 4.2rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    max-width: 100%;
    text-wrap: balance;
}

.article-header-v5__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.article-header-v5__author {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    color: #1a1a1a;
    text-decoration: none;
}

.article-header-v5__author-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(135deg, #e3d5c5, #c9b19b);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(47, 79, 80, 0.14);
}

.article-header-v5__author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-header-v5__author-fallback {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.article-header-v5__author-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.article-header-v5__author-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8b7b6d;
}

.article-header-v5__author-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
}

.article-header-v5__stats {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 999px;
    background: #f8f6f2;
    color: #5f5a54;
}

.article-header-v5__stat {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.article-header-v5__share {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.article-header-v5__share-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8b7b6d;
    margin-right: 0.35rem;
}

.article-header-v5__share-link {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1px solid #dfd6cc;
    background: #fff;
    color: #2f4f50;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.article-header-v5__share-link:hover {
    transform: translateY(-1px);
    border-color: #2f4f50;
    color: #fff;
    background: #2f4f50;
}

.article-header-v5__share-copy {
    appearance: none;
    cursor: pointer;
    position: relative;
}

.article-header-v5__share-copy.is-copied {
    background: #2f4f50;
    border-color: #2f4f50;
    color: #fff;
}

.article-header-v5__share-copy.is-copied::after {
    content: "OK";
    position: absolute;
    inset: auto auto -1.55rem 50%;
    transform: translateX(-50%);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #2f4f50;
}

@media (max-width: 767px) {
    .article-header-v5 {
        padding-bottom: 1.4rem;
    }

    .article-header-v5__title {
        max-width: 100%;
        margin-bottom: 1.2rem;
        text-wrap: pretty;
    }

    .article-header-v5__meta {
        align-items: flex-start;
    }

    .article-header-v5__share {
        margin-left: 0;
        justify-content: flex-start;
    }
}

/* ── Entry Meta ── */
.entry-meta {
    font-size: 0.875rem;
    color: #888888;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e5e5;
}
.entry-meta a { color: #2F4F50; text-decoration: none; }
.entry-meta a:hover { color: #e88b00; }

/* ── Featured Image / Hero ── */
.customThumb {
    height: 45vh;
    min-height: 280px;
    max-height: 500px;
    display: block;
    background-size: cover;
    background-position: center;
    border-radius: 0 0 1rem 1rem;
}
@media (min-width: 768px) {
    .customThumb { border-radius: 0 0 1.5rem 1.5rem; }
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 0.75rem;
    display: block;
}

/* ── Article Content (Prose) ── */
.entry-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #1a1a1a;
    max-width: 48rem;
}

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

.entry-content h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    margin: 2rem 0 0.75rem;
    color: #1a1a1a;
}
.entry-content h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.25rem;
    margin: 1.75rem 0 0.5rem;
    color: #1a1a1a;
}

.entry-content a {
    color: #2F4F50;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: #2F4F5040;
    transition: color 0.2s, text-decoration-color 0.2s;
}
.entry-content a:hover {
    color: #e88b00;
    text-decoration-color: #e88b00;
}

.entry-content strong { font-weight: 700; }

.entry-content ul, .entry-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}
.entry-content li {
    margin-bottom: 0.4rem;
}
.entry-content ul { list-style-type: disc; }
.entry-content ol { list-style-type: decimal; }

.entry-content blockquote {
    border-left: 3px solid #e88b00;
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: #f8f9fa;
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: #4a4a4a;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* ── Tables ── */
.entry-content table,
table.table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
}
.entry-content table caption,
table.table caption {
    font-weight: 700;
    caption-side: top;
    text-align: left;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: #1a1a1a;
}
.entry-content th,
table.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    font-weight: 700;
    background: #f8f9fa;
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid #e5e5e5;
}
.entry-content td,
table.table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #e5e5e5;
    vertical-align: middle;
}
.entry-content tbody tr:hover,
table.table tbody tr:hover {
    background: #f8f9fa;
}

/* ── Gutenberg Block Overrides ── */
.wp-block-image { margin: 1.5rem 0; }
.wp-block-image img { border-radius: 0.75rem; }
.wp-block-image figcaption {
    font-size: 0.8rem;
    color: #888;
    text-align: center;
    margin-top: 0.5rem;
}

.wp-block-quote {
    border-left: 3px solid #e88b00;
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: #f8f9fa;
    border-radius: 0 0.5rem 0.5rem 0;
}

/* ── Archive Card Grid ── */
.archive-card-thumb {
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 0.75rem 0.75rem 0 0;
}

/* ── Footer ── */
.entry-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
    font-size: 0.8rem;
    color: #888;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}
.entry-footer a { color: #2F4F50; text-decoration: none; }
.entry-footer a:hover { color: #e88b00; }

/* ── Article Tag Pills ── */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.article-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-muted, #6b7280);
    background: var(--surface-raised, #f9fafb);
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.article-tag:hover {
    color: var(--brand, #e88b00);
    border-color: var(--brand, #e88b00);
    background: #fff7ed;
}

/* ── Page Numbers (Pagination) ── */
.page-numbers {
    word-break: normal;
    display: inline-flex;
    gap: 0.25rem;
}
.page-numbers a, .page-numbers span {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    text-decoration: none;
    color: #1a1a1a;
    background: #f8f9fa;
    transition: background 0.2s;
}
.page-numbers a:hover { background: #e5e5e5; }
.page-numbers .current { background: #2F4F50; color: white; }

/* ── Author/Date Meta Line ── */
.entry-meta .posted-on,
.entry-meta .byline,
.entry-meta .cat-links {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 1rem;
}
.entry-meta .posted-on i,
.entry-meta .byline i,
.entry-meta .cat-links i {
    color: #bbb;
    font-size: 0.8rem;
}
.entry-meta .cat-links {
    display: inline-block;
    background: #f8f9fa;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
    border: 1px solid #e5e5e5;
    font-size: 0.8rem;
    font-weight: 500;
    color: #2F4F50;
}
.entry-meta .cat-links:hover {
    background: #2F4F50;
    color: white;
    border-color: #2F4F50;
}
.entry-meta .cat-links a {
    color: inherit;
}
/* Hide duplicate byline (camera icon) */
.entry-meta .byline:last-of-type { display: none; }

/* ── Easy Table of Contents (V4 override) ── */
div#ez-toc-container {
    background: #f8f9fa !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 0.75rem !important;
    padding: 1.25rem 1.5rem !important;
    margin: 1.5rem 0 !important;
    box-shadow: none !important;
    width: 100% !important;
}
div#ez-toc-container .ez-toc-title {
    font-family: 'DM Serif Display', serif !important;
    font-size: 1.15rem !important;
    font-weight: 400 !important;
    color: #1a1a1a !important;
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 2px solid #e88b00 !important;
}
div#ez-toc-container nav ul {
    padding-left: 0 !important;
}
div#ez-toc-container nav ul li {
    font-size: 0.9rem !important;
    font-weight: 400 !important;
    padding: 0.3rem 0 !important;
    line-height: 1.5 !important;
    list-style: none !important;
}
div#ez-toc-container nav ul li a {
    color: #2F4F50 !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}
div#ez-toc-container nav ul li a:hover {
    color: #e88b00 !important;
}
div#ez-toc-container nav ul li a::before {
    color: #e88b00 !important;
    font-weight: 600 !important;
}
div#ez-toc-container nav ul ul {
    padding-left: 1.25rem !important;
}
div#ez-toc-container nav ul ul li {
    font-size: 0.85rem !important;
}
/* Toggle button style */
div#ez-toc-container .ez-toc-title-toggle a {
    color: #888 !important;
}

/* ── Archive Listing — excerpt link fix ── */
article .entry-content a[href] {
    text-decoration: none;
}
article:not(.single) .entry-content a:hover {
    text-decoration: none;
    color: #2F4F50;
}
/* Fix orange underline on archive cards */
.card-lift a {
    text-decoration: none !important;
}

/* ── Banner placeholders — hidden by default ── */
.banner-placeholder { display: none; }

/* ── Responsive ── */
@media only screen and (max-width: 767px) {
    .entry-content { font-size: 1rem; line-height: 1.75; }
    .entry-title { font-size: 1.5rem; }
    .customThumb { height: 35vh; min-height: 200px; }

    .entry-meta .posted-on,
    .entry-meta .byline,
    .entry-meta .cat-links {
        display: block;
        margin-bottom: 0.35rem;
    }
}
