/* ============================================================
   The Book Commentary — Editorial Blog
   Modern, SEO-friendly editorial blog styling.
   Fonts: BookerlyContent / Bookerly-BoldItalic / Bookerly-Light
          AmazonEmberContent
   ============================================================ */

/* --- Fonts (drop the proprietary font files into /fonts/blog/) --- */
@font-face {
    font-family: 'BookerlyContent';
    src: url('/fonts/blog/BookerlyContent.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Bookerly-BoldItalic';
    src: url('/fonts/blog/Bookerly-BoldItalic.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Bookerly-Light';
    src: url('/fonts/blog/Bookerly-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'AmazonEmberContent';
    src: url('/fonts/blog/AmazonEmberContent.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* --- Design tokens --- */
:root {
    --blog-yellow: #e3b341;          /* subtle yellow accent */
    --blog-yellow-soft: #f6e6bb;
    --blog-ink: #1a1a1a;
    --blog-ink-soft: #5a5a5a;
    --blog-muted: #8a8a8a;
    --blog-line: #e8e6e1;
    --blog-bg: #ffffff;
    --blog-surface: #faf8f4;
    --blog-width: 800px;
}

/* --- Typography --- */
.blog-title {
    font-family: 'BookerlyContent', Georgia, 'Times New Roman', serif !important;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: rgb(234, 88, 12) !important;
}
.blog-title strong {
    font-family: 'Bookerly-BoldItalic', Georgia, serif !important;
    font-weight: 700;
    font-style: italic;
}
.blog-subtitle {
    font-family: 'AmazonEmberContent', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.blog-meta {
    font-family: 'AmazonEmberContent', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    color: var(--blog-muted);
    font-size: 0.875rem;
    letter-spacing: 0.03em;
}
.blog-body {
    font-family: 'Bookerly-Light', Georgia, 'Times New Roman', serif !important;
    font-weight: 300;
    color: #000000 !important;
    font-size: 18px !important;
    line-height: 28px !important;
    letter-spacing: -0.1px !important;
}

/* --- Yellow accent helpers --- */
.blog-accent-bar {
    height: 3px;
    width: 56px;
    background: linear-gradient(90deg, var(--blog-yellow), var(--blog-yellow-soft));
    border-radius: 999px;
}
.blog-tab {
    font-family: 'AmazonEmberContent', system-ui, sans-serif !important;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--blog-ink-soft);
    border-bottom: 2px solid transparent;
    padding: 0.6rem 0.25rem;
    white-space: nowrap;
    transition: color .15s ease, border-color .15s ease;
}
.blog-tab:hover { color: var(--blog-ink); }
.blog-tab.active {
    color: var(--blog-ink);
    border-bottom-color: var(--blog-yellow);
}

/* --- Article cards --- */
.blog-card {
    background: var(--blog-bg);
    border: 1px solid var(--blog-line);
    border-radius: 14px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
}
.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.25);
}
.blog-card .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--blog-surface); }
.blog-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.blog-card:hover .thumb img { transform: scale(1.04); }

/* Single-column feed rows */
.blog-list { display: flex; flex-direction: column; }
.blog-row {
    border-bottom: 1px solid var(--blog-line);
    padding: 1.75rem 0;
}
.blog-row:last-child { border-bottom: none; }
.blog-row .thumb {
    border-radius: 14px;
    overflow: hidden;
    background: var(--blog-surface);
}
.blog-row .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.blog-row:hover .thumb img { transform: scale(1.03); }
.thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem;
    background:
        radial-gradient(circle at 10% 75%, #e94b2b 0%, transparent 35%),
        radial-gradient(circle at 90% 25%, #f7bf2d 0%, transparent 38%),
        radial-gradient(circle at 50% 50%, #f7efe7 0%, #efe3d8 45%, transparent 70%),
        linear-gradient(135deg, #f4dfd4 0%, #f8efe6 50%, #f4eadb 100%);
}
.blog-card .card-body { padding: 1.25rem 1.35rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.blog-card .card-title { font-family: 'BookerlyContent', Georgia, serif !important; font-size: 1.25rem; line-height: 1.3; }

/* Line-clamp fallback (CDN Tailwind may not include it) */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Single article / reading experience --- */
.blog-reading {
    max-width: var(--blog-width);
    margin: 0 auto;
}
.blog-hero-image {
    border-radius: 16px;
    overflow: hidden;
    background: var(--blog-surface);
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}
.blog-hero-image img {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.blog-prose {
    color: #000000 !important;
    font-size: 18px !important;
    line-height: 28px !important;
    letter-spacing: -0.1px !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

/* Force editorial typography on ALL content descendants so pasted inline
   styles (e.g. Times New Roman / 12pt) can't override it. Rules below
   (headings, blockquote, figcaption, strong) come later in source order
   and still win where they intentionally set font-family / font-style. */
.blog-prose p, .blog-prose div, .blog-prose span, .blog-prose li,
.blog-prose ul, .blog-prose ol, .blog-prose a, .blog-prose em,
.blog-prose i, .blog-prose u, .blog-prose s, .blog-prose b,
.blog-prose strong, .blog-prose blockquote,
.blog-prose table, .blog-prose thead, .blog-prose tbody,
.blog-prose tr, .blog-prose th, .blog-prose td,
.blog-prose code, .blog-prose pre, .blog-prose sub, .blog-prose sup {
    font-family: 'Bookerly-Light', Georgia, 'Times New Roman', serif !important;
    font-size: 18px !important;
    line-height: 28px !important;
    letter-spacing: -0.1px !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}
.blog-prose p { margin: 0 0 0.5em; }
.blog-prose h1, .blog-prose h2, .blog-prose h3,
.blog-prose h4, .blog-prose h5, .blog-prose h6 {
    font-family: 'Bookerly-BoldItalic', Georgia, serif !important;
    font-weight: 700;
    font-style: italic;
    color: var(--blog-ink);
    line-height: 1.25;
    margin: 0;
}
.blog-prose h2 { font-size: 1.55em; }
.blog-prose h3 { font-size: 1.3em; }
.blog-prose h4 { font-size: 1.12em; }
.blog-prose ul, .blog-prose ol { margin: 0 0 1.4em; padding-left: 1.5em; }
.blog-prose li { margin-bottom: 0.45em; }
.blog-prose a { color: #0066cc; text-decoration: underline; text-underline-offset: 3px; }
.blog-prose a:hover { text-decoration-thickness: 2px; }
.blog-prose blockquote {
    margin: 1.8em 0;
    padding: 0.4em 0 0.4em 1.2em;
    border-left: 4px solid var(--blog-yellow);
    font-family: 'Bookerly-BoldItalic', Georgia, serif !important;
    font-style: italic;
    color: var(--blog-ink-soft);
}
.blog-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5em auto;
    display: block;
}
.blog-prose figure { margin: 1.8em 0; }
.blog-prose figcaption {
    font-family: 'AmazonEmberContent', system-ui, sans-serif !important;
    font-size: 0.85rem;
    color: var(--blog-muted);
    text-align: center;
    margin-top: 0.6em;
}
.blog-prose hr { border: none; border-top: 1px solid var(--blog-line); margin: 1em 0; }
.blog-prose strong { font-family: 'BookerlyContent', Georgia, serif !important; font-weight: 700; }

/* Media & Text block image — spacing around the floated image */
.media-text img { margin: 0 24px 12px 0 !important; }

/* Related cards */
.blog-related .blog-card .card-title { font-size: 1.05rem; }

/* Responsive */
@media (max-width: 768px) {
    .blog-body { font-size: 1.06rem; line-height: 1.8; }
    .blog-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .blog-reading { padding-left: 1.25rem; padding-right: 1.25rem; }
}
