/*
Theme Name: Fox Bulletin
Theme URI: https://foxbulletin.com
Author: Fox Bulletin
Author URI: https://foxbulletin.com
Description: A responsive, magazine-style news theme for Fox Bulletin with a wide desktop layout, article contents rail, recent-articles sidebar, and dark mode.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: foxbulletin
Tags: blog, one-column, custom-menu, featured-images, translation-ready, full-width-template
*/

/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1a1a18;
  --text-soft: #55534d;
  --text-faint: #8a8781;
  --border: #e8e5dd;
  --accent: #d94f19;
  --accent-soft: #fff0e9;
  --radius: 12px;
  --maxw: 48rem;
  --wide: 82rem;
  --xwide: 90rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Georgia", Charter, serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #131311;
  --surface: #1b1b18;
  --text: #ece9e2;
  --text-soft: #b3afa6;
  --text-faint: #7d7a72;
  --border: #2c2b27;
  --accent: #ff8a5c;
  --accent-soft: #352018;
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
::selection { background: var(--accent); color: #fff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(150%) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-top .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: var(--wide);
}
.brand { font-weight: 700; font-size: 1.35rem; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.custom-logo { max-height: 40px; width: auto; display: block; }

.header-tools { display: flex; align-items: center; gap: 10px; }
.tool-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); cursor: pointer;
  transition: color .2s, border-color .2s;
}
.tool-btn:hover { color: var(--text); border-color: var(--text-faint); }

/* Search drawer */
.header-search { border-top: 1px solid var(--border); }
.header-search .wrap { max-width: var(--wide); padding-top: .75rem; padding-bottom: .75rem; }
.header-search form { display: flex; gap: .5rem; }
.header-search .search-field {
  flex: 1; padding: .7rem 1rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 1rem; font-family: var(--font-sans);
}
.header-search .search-field:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.header-search .search-submit {
  padding: .7rem 1.25rem; border: none; border-radius: 8px; background: var(--accent);
  color: #fff; font-weight: 600; cursor: pointer; font-family: var(--font-sans);
}

/* Category nav bar */
.header-nav { border-top: 1px solid var(--border); }
.header-nav .wrap { max-width: var(--wide); padding: 0 1.5rem; }
.header-nav ul {
  display: flex; list-style: none; margin: 0; padding: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.header-nav ul::-webkit-scrollbar { display: none; }
.header-nav li { flex: 0 0 auto; }
.header-nav a {
  display: block; padding: .8rem 1rem; white-space: nowrap;
  font-family: var(--font-sans); font-size: .9rem; font-weight: 500;
  color: var(--text-soft); border-bottom: 2px solid transparent;
}
.header-nav a:hover { color: var(--accent); text-decoration: none; border-bottom-color: var(--accent); }
.header-nav .current-menu-item > a,
.header-nav .current_page_item > a { color: var(--text); border-bottom-color: var(--accent); }

.theme-toggle {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); cursor: pointer; font-size: 1.05rem;
  transition: color .2s, border-color .2s, transform .2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-faint); transform: rotate(15deg); }
.theme-icon { display: block; }
.theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: block; }

/* ============================================================
   Hero / intro
   ============================================================ */
.hero { padding: 4.5rem 0 2.5rem; text-align: center; }
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.08; letter-spacing: -.03em; margin: 0 0 1rem;
}
.hero p { font-size: 1.15rem; color: var(--text-soft); max-width: 34rem; margin: 0 auto; }

/* ============================================================
   Post list
   ============================================================ */
.posts { padding: 1rem 0 5rem; }
.post-card {
  display: block; padding: 1.75rem 0; border-top: 1px solid var(--border); color: inherit;
}
.post-card:hover { text-decoration: none; }
.post-card:hover .post-card-title { color: var(--accent); }
.post-card-thumb { margin-bottom: 1rem; overflow: hidden; border-radius: var(--radius); }
.post-card-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; transition: transform .4s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.03); }
.post-meta { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--text-faint); margin-bottom: .55rem; }
.tag {
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: .18rem .5rem; border-radius: 999px;
}
.tag:hover { text-decoration: none; opacity: .85; }
.post-card-title {
  font-family: var(--font-serif); font-size: 1.6rem; line-height: 1.2;
  letter-spacing: -.02em; margin: 0 0 .5rem; color: var(--text); transition: color .2s;
}
.post-card-excerpt { color: var(--text-soft); margin: 0; font-size: 1.02rem; }
.featured {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; margin-bottom: .5rem;
}
.featured .post-card { border-top: none; padding: 0; }
.featured .post-card-title { font-size: 2rem; }

/* ============================================================
   Magazine homepage (home.php)
   ============================================================ */
.container { max-width: var(--xwide); margin: 0 auto; padding: 0 1.5rem; }

.home-lead { padding: 2.5rem 0 1rem; }
.lead-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.5rem; align-items: start; }

.c-lead { display: block; color: inherit; }
.c-lead:hover { text-decoration: none; }
.c-lead-thumb { border-radius: 12px; overflow: hidden; margin-bottom: 1.1rem; }
.c-lead-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; transition: transform .5s ease; }
.c-lead:hover .c-lead-thumb img { transform: scale(1.03); }
.c-lead-title {
  font-family: var(--font-serif); font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.14; letter-spacing: -.02em; margin: .55rem 0 .55rem; color: var(--text); transition: color .2s;
}
.c-lead:hover .c-lead-title { color: var(--accent); }
.c-lead-excerpt { color: var(--text-soft); font-size: 1.05rem; line-height: 1.6; margin: 0; }

.lead-side { display: flex; flex-direction: column; }
.c-mini {
  display: grid; grid-template-columns: 92px 1fr; gap: 1rem; align-items: start;
  padding: 1.1rem 0; border-top: 1px solid var(--border); color: inherit;
}
.lead-side .c-mini:first-child { border-top: none; padding-top: 0; }
.c-mini:hover { text-decoration: none; }
.c-mini-thumb { border-radius: 8px; overflow: hidden; }
.c-mini-thumb img { width: 92px; height: 69px; object-fit: cover; display: block; }
.c-mini-title {
  font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.25; margin: .35rem 0 0;
  color: var(--text); transition: color .2s;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.c-mini:hover .c-mini-title { color: var(--accent); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 2.75rem 0 1.5rem; border-bottom: 1px solid var(--border);
}
.section-head h2 {
  font-family: var(--font-sans); font-size: 1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; margin: 0;
  padding-bottom: .6rem; border-bottom: 2px solid var(--accent);
}
.section-head a { font-size: .85rem; color: var(--text-soft); }

.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2.25rem 1.75rem; }
.g-card { display: block; color: inherit; }
.g-card:hover { text-decoration: none; }
.g-card-thumb { border-radius: 10px; overflow: hidden; margin-bottom: .85rem; }
.g-card-thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; transition: transform .5s ease; }
.g-card:hover .g-card-thumb img { transform: scale(1.04); }
.g-card-thumb--empty { aspect-ratio: 16 / 10; background: var(--surface); border: 1px solid var(--border); }
.g-card-title {
  font-family: var(--font-serif); font-size: 1.2rem; line-height: 1.25; letter-spacing: -.01em;
  margin: .4rem 0 .4rem; color: var(--text); transition: color .2s;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.g-card:hover .g-card-title { color: var(--accent); }
.g-card-excerpt {
  color: var(--text-soft); font-size: .95rem; line-height: 1.55; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

@media (max-width: 800px) {
  .lead-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .lead-side { margin-top: .25rem; }
}

/* ============================================================
   Article (single)
   ============================================================ */
.article { padding: 3rem 0 4rem; }
.article-header { margin-bottom: 2.5rem; }
.article-header h1 {
  font-family: var(--font-serif); font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.12; letter-spacing: -.025em; margin: .75rem 0 1rem;
}
.article-lead { font-size: 1.25rem; color: var(--text-soft); line-height: 1.55; }
.article-hero { max-width: var(--wide); margin: 0 auto 2.5rem; padding: 0 1.5rem; }
.article-hero img { width: 100%; border-radius: var(--radius); }
.byline { display: flex; align-items: center; gap: .75rem; margin-top: 1.75rem; font-size: .9rem; color: var(--text-faint); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.avatar + div strong { color: var(--text); font-weight: 600; }

.prose { font-family: var(--font-serif); font-size: 1.22rem; line-height: 1.75; color: var(--text); }
.prose > * { margin-block: 1.4rem; }
.prose h2 { font-size: 1.7rem; letter-spacing: -.02em; margin-top: 2.6rem; line-height: 1.25; }
.prose h3 { font-size: 1.35rem; margin-top: 2rem; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose blockquote {
  border-left: 3px solid var(--accent); margin-inline: 0; padding: .3rem 0 .3rem 1.5rem;
  color: var(--text-soft); font-style: italic;
}
.prose code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--surface); border: 1px solid var(--border);
  padding: .12em .38em; border-radius: 6px;
}
.prose pre {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; overflow-x: auto; font-size: .95rem;
}
.prose pre code { background: none; border: none; padding: 0; }
.prose img { border-radius: var(--radius); margin-block: 2rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-block: .5rem; }
.prose hr { border: none; border-top: 1px solid var(--border); margin-block: 3rem; }
.prose figure { margin-inline: 0; }
.prose figcaption { color: var(--text-faint); font-family: var(--font-sans); font-size: .85rem; line-height: 1.5; margin-top: .55rem; }
.prose .wp-block-table { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.prose table { width: 100%; min-width: 38rem; border-collapse: collapse; font-family: var(--font-sans); font-size: .94rem; line-height: 1.5; }
.prose th, .prose td { padding: .8rem 1rem; text-align: left; vertical-align: top; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.prose th:last-child, .prose td:last-child { border-right: 0; }
.prose tr:last-child td { border-bottom: 0; }
.prose th { background: var(--accent-soft); color: var(--text); font-weight: 700; }
.prose tr:nth-child(even) td { background: color-mix(in srgb, var(--surface) 88%, var(--accent-soft)); }
.prose .wp-block-quote { border-left: 4px solid var(--accent); padding-left: 1.4rem; }
.prose .wp-block-pullquote { padding: 1.5rem 0; border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); text-align: center; }
.prose .wp-block-pullquote blockquote { border: 0; padding: 0; margin: 0; font-size: 1.35em; }
.prose .wp-block-button__link { background: var(--accent); border-radius: 8px; color: #fff; font-family: var(--font-sans); font-weight: 700; padding: .7rem 1.1rem; text-decoration: none; }
.prose .wp-block-embed, .prose .wp-block-video { max-width: 100%; }
.prose iframe { max-width: 100%; }

/* ============================================================
   WordPress core classes
   ============================================================ */
.alignleft { float: left; margin: .3rem 1.5rem 1rem 0; }
.alignright { float: right; margin: .3rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: .85rem; color: var(--text-faint); text-align: center; margin-top: .5rem; font-family: var(--font-sans); }
.sticky .post-card-title::before { content: "★ "; color: var(--accent); }
.wp-block-image img { border-radius: var(--radius); }

/* ============================================================
   Pagination
   ============================================================ */
.pagination { padding: 1rem 0 4rem; }
.pagination .nav-links { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 .5rem;
  border: 1px solid var(--border); border-radius: 8px; color: var(--text-soft); font-size: .95rem;
}
.pagination .page-numbers.current { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination a.page-numbers:hover { border-color: var(--text-faint); text-decoration: none; color: var(--text); }

/* ============================================================
   Reading progress bar
   ============================================================ */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 30; transition: width .1s linear; }

/* ============================================================
   Comments
   ============================================================ */
.comments-area { max-width: var(--maxw); margin: 3rem auto 0; padding: 2rem 1.5rem 0; border-top: 1px solid var(--border); }
.comments-area h2 { font-family: var(--font-serif); }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--border); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: 1px solid var(--border); padding: 3rem 0 2rem; color: var(--text-faint); font-size: .9rem; margin-top: 2rem; }
.site-footer a { color: var(--text-soft); }
.site-footer a:hover { color: var(--text); }
.footer-inner {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 1.5rem 2rem; max-width: var(--wide);
}
.footer-brand { display: flex; flex-direction: column; gap: .25rem; }
.footer-title { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.footer-tagline { color: var(--text-faint); max-width: 18rem; }
.footer-menu-list {
  display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; list-style: none; margin: 0; padding: 0;
  max-width: 26rem; justify-content: center;
}
.footer-menu-list a { font-size: .9rem; }
.footer-social { display: flex; gap: .75rem; align-items: center; }
.footer-social a {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  transition: color .2s, border-color .2s;
}
.footer-social a:hover { color: var(--accent); border-color: var(--text-faint); }
.footer-copy { max-width: var(--wide); margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.footer-privacy { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 500px) {
  .header-nav a { padding-inline: .8rem; }
  .header-nav .wrap { position: relative; }
  .header-nav .wrap::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 2rem; pointer-events: none; background: linear-gradient(to right, transparent, var(--bg)); }
}

/* ============================================================
   Accessibility
   ============================================================ */
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 8px;
  transition: top .2s;
}
.skip-link:focus { top: 8px; text-decoration: none; clip: auto; clip-path: none; width: auto; height: auto; }

/* ============================================================
   Breadcrumbs
   ============================================================ */
.breadcrumbs { margin: 0 0 1.25rem; font-family: var(--font-sans); font-size: .82rem; color: var(--text-faint); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.breadcrumbs li { display: flex; align-items: center; gap: .4rem; }
.breadcrumbs li:not(:last-child)::after { content: "/"; color: var(--text-faint); }
.breadcrumbs a { color: var(--text-soft); }
.breadcrumbs [aria-current="page"] { color: var(--text-faint); }

/* ============================================================
   Byline avatar + featured figure
   ============================================================ */
.byline { align-items: center; }
.byline-avatar { flex: 0 0 auto; }
.byline-avatar img, img.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: block; }
.byline strong a { color: var(--text); }
.byline strong a:hover { color: var(--accent); }

.article-hero { margin: 0 auto 2.5rem; }
.article-hero figcaption {
  max-width: var(--maxw); margin: .6rem auto 0; padding: 0 1.5rem;
  font-family: var(--font-sans); font-size: .85rem; color: var(--text-faint);
}

/* ============================================================
   Tags
   ============================================================ */
.post-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 2.5rem 0 0; font-family: var(--font-sans); }
.post-tags-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-right: .25rem; }
.post-tags a { font-size: .85rem; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); padding: .3rem .7rem; border-radius: 999px; }
.post-tags a:hover { color: var(--accent); border-color: var(--text-faint); text-decoration: none; }

/* ============================================================
   Share row
   ============================================================ */
.share { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin: 2rem 0; padding: 1.1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-family: var(--font-sans); }
.share-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-right: .25rem; }
.share-btn { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); cursor: pointer; transition: color .2s, border-color .2s; }
.share-btn:hover { color: var(--accent); border-color: var(--text-faint); text-decoration: none; }
.copied-note { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: .72rem; padding: .2rem .5rem; border-radius: 6px; white-space: nowrap; }

/* ============================================================
   Author box
   ============================================================ */
.author-box { display: flex; gap: 1.1rem; align-items: flex-start; margin: 2.5rem 0; padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; font-family: var(--font-sans); }
.author-box-avatar { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; overflow: hidden; }
.author-box-avatar img { width: 64px !important; height: 64px !important; aspect-ratio: 1 / 1; border-radius: 50% !important; object-fit: cover; display: block; }
.author-box-eyebrow { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.author-box-name { display: block; font-size: 1.15rem; font-weight: 700; margin: .1rem 0 .5rem; color: var(--text); }
.author-box-bio { margin: 0 0 .6rem; color: var(--text-soft); font-size: .95rem; line-height: 1.6; }
.author-box-link { font-size: .9rem; font-weight: 500; }

/* ============================================================
   Post navigation
   ============================================================ */
.post-navigation { margin: 2.5rem 0; }
.post-navigation .nav-links { display: flex; gap: 1rem; }
.post-navigation .nav-previous, .post-navigation .nav-next { flex: 1; }
.post-navigation .nav-next { text-align: right; }
.post-navigation a { display: block; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: 12px; font-family: var(--font-sans); }
.post-navigation a:hover { border-color: var(--text-faint); text-decoration: none; }
.post-navigation .nav-dir { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: .3rem; }
.post-navigation .nav-label { display: block; font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.3; color: var(--text); }
.post-navigation a:hover .nav-label { color: var(--accent); }

/* ============================================================
   Related
   ============================================================ */
.related { margin: 3rem 0; }
.related-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.75rem 1.25rem; }
.related-grid .g-card-title { font-size: 1.05rem; }
.related-grid .g-card-excerpt { display: none; }

/* ============================================================
   Newsletter / CTA
   ============================================================ */
.cta { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; text-align: center; margin: 3rem 0; font-family: var(--font-sans); }
.cta h3 { font-family: var(--font-serif); font-size: 1.5rem; margin: 0 0 .5rem; }
.cta p { color: var(--text-soft); margin: 0 0 1.25rem; }
.cta-form { display: flex; gap: .5rem; max-width: 24rem; margin: 0 auto; }
.cta-form input { flex: 1; padding: .7rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 1rem; font-family: var(--font-sans); }
.cta-form input:focus { outline: none; border-color: var(--accent); }
.cta-form button { padding: .7rem 1.25rem; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; font-size: 1rem; cursor: pointer; font-family: var(--font-sans); }
.cta-form button:hover { opacity: .9; }
.cta-thanks, .cta-unavailable { margin: 0; color: var(--text-soft); font-weight: 500; }

/* ============================================================
   Comments
   ============================================================ */
.comments-area { max-width: var(--maxw); margin: 3rem auto 0; padding: 2rem 0 0; border-top: 1px solid var(--border); font-family: var(--font-sans); }
.comments-title { font-family: var(--font-serif); font-size: 1.5rem; margin: 0 0 1.5rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ol.children { list-style: none; margin: 0 0 0 1.5rem; padding: 0; }
.comment-body { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.comment-author { display: flex; align-items: center; gap: .6rem; font-size: .95rem; }
.comment-author .avatar { width: 40px; height: 40px; }
.comment-author .fn { font-weight: 600; font-style: normal; color: var(--text); }
.comment-metadata { font-size: .8rem; color: var(--text-faint); margin: .2rem 0 .5rem; }
.comment-metadata a { color: var(--text-faint); }
.comment-content { color: var(--text-soft); line-height: 1.7; }
.comment-content p { margin: .5rem 0; }
.reply { font-size: .85rem; }
.comment-respond { margin-top: 2rem; }
.comment-reply-title { font-family: var(--font-serif); font-size: 1.3rem; }
.comment-form { display: grid; gap: 1rem; margin-top: 1rem; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea {
  width: 100%; padding: .7rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-family: var(--font-sans); font-size: 1rem;
}
.comment-form textarea { min-height: 120px; }
.comment-submit {
  justify-self: start; padding: .7rem 1.4rem; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; font-family: var(--font-sans);
}
.comment-submit:hover { opacity: .9; }

/* ============================================================
   404
   ============================================================ */
.error-404 { text-align: center; padding: 3rem 0 2rem; }
.error-404 .error-code { display: block; font-family: var(--font-serif); font-size: clamp(4rem, 14vw, 7rem); font-weight: 700; color: var(--accent); line-height: 1; letter-spacing: -.03em; }
.error-404 h1 { font-family: var(--font-serif); margin: .5rem 0 1rem; }
.error-404 p { color: var(--text-soft); max-width: 32rem; margin: 0 auto 1.5rem; }
.error-404 .search-form { max-width: 26rem; margin: 0 auto 1rem; }
.error-404 .error-home-link { display: inline-block; margin-bottom: 2.5rem; font-family: var(--font-sans); font-weight: 500; }
.error-404 .section-head, .error-404 .g-grid { text-align: left; }

/* ============================================================
   Footer widgets
   ============================================================ */
.footer-widgets { border-top: 1px solid var(--border); padding: 3rem 0 1rem; }
.footer-widgets-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; max-width: var(--wide); }
.footer-col .widget { margin-bottom: 1.5rem; font-family: var(--font-sans); font-size: .95rem; color: var(--text-soft); }
.widget-title { font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text); margin: 0 0 1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: .4rem 0; }
.footer-col a { color: var(--text-soft); }
.footer-col a:hover { color: var(--accent); }

/* ============================================================
   Generic search form
   ============================================================ */
.search-form { display: flex; gap: .5rem; }
.search-form .search-field { flex: 1; padding: .7rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-family: var(--font-sans); font-size: 1rem; }
.search-form .search-submit { padding: .7rem 1.25rem; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; font-family: var(--font-sans); }

@media (max-width: 600px) {
  .post-navigation .nav-links { flex-direction: column; }
  .post-navigation .nav-next { text-align: left; }
  .author-box { flex-direction: column; }
}

/* ============================================================
   Live search dropdown
   ============================================================ */
.header-search .wrap { position: relative; }
.search-results { position: absolute; left: 1.5rem; right: 1.5rem; top: calc(100% - .1rem); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; z-index: 40; }
.search-results a { display: block; padding: .7rem 1rem; color: var(--text); font-size: .95rem; border-bottom: 1px solid var(--border); }
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--bg); color: var(--accent); text-decoration: none; }
.search-empty { padding: .8rem 1rem; color: var(--text-faint); font-size: .9rem; }

/* ============================================================
   Load more
   ============================================================ */
.load-more-wrap { text-align: center; padding: 1rem 0 4rem; }
.load-more { font-family: var(--font-sans); font-size: .95rem; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border); padding: .8rem 1.8rem; border-radius: 999px; cursor: pointer; transition: border-color .2s, color .2s; }
.load-more:hover { border-color: var(--text-faint); color: var(--accent); }
.load-more[disabled] { opacity: .6; cursor: default; }

/* ============================================================
   Trending strip
   ============================================================ */
.home-trending { padding: 1rem 0; }
.trending-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1.5rem; }
.trending-item { display: flex; gap: .75rem; align-items: baseline; color: inherit; padding: .7rem 0; border-top: 1px solid var(--border); }
.trending-item:hover { text-decoration: none; }
.trending-num { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 700; color: var(--accent); line-height: 1; flex: 0 0 auto; width: 1.4rem; }
.trending-text { display: flex; flex-direction: column; gap: .15rem; }
.trending-cat { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }
.trending-title { font-family: var(--font-serif); font-size: 1rem; line-height: 1.25; color: var(--text); }
.trending-item:hover .trending-title { color: var(--accent); }

/* ============================================================
   Reading tools (single post)
   ============================================================ */
.reading-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0 0 1.75rem; padding: .6rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-family: var(--font-sans); }
.rt-group { display: inline-flex; }
.rt-btn { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-sans); font-size: .85rem; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); padding: .4rem .7rem; border-radius: 8px; cursor: pointer; transition: color .2s, border-color .2s; }
.rt-btn:hover { color: var(--accent); border-color: var(--text-faint); }
.rt-group .rt-btn { border-radius: 0; }
.rt-group .rt-btn:first-child { border-radius: 8px 0 0 8px; }
.rt-group .rt-btn:last-child { border-radius: 0 8px 8px 0; border-left: none; }
.rt-btn.is-active, .rt-save.is-saved { color: var(--accent); border-color: var(--accent); }
.reading-tools .rt-save { margin-left: auto; }

/* ============================================================
   Table of contents
   ============================================================ */
.toc { font-family: var(--font-sans); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; margin: 0 0 2rem; }
.toc summary { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-soft); cursor: pointer; }
.toc ol { margin: .75rem 0 0; padding-left: 1.2rem; }
.toc li { margin: .35rem 0; }
.toc a { color: var(--text-soft); font-size: .95rem; }
.toc a:hover { color: var(--accent); }
.toc .toc-sub { margin-left: 1rem; list-style: circle; }

/* ============================================================
   Saved articles dropdown
   ============================================================ */
.header-tools { position: relative; }
.saved-panel { position: absolute; top: calc(100% + .5rem); right: 0; width: 280px; max-height: 360px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .5rem; z-index: 50; }
.saved-item { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem; border-bottom: 1px solid var(--border); }
.saved-item:last-child { border-bottom: none; }
.saved-item a { font-size: .9rem; color: var(--text); line-height: 1.3; }
.saved-item a:hover { color: var(--accent); }
.saved-remove { border: none; background: none; color: var(--text-faint); font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 0 .2rem; }
.saved-remove:hover { color: var(--accent); }
.saved-empty { padding: .8rem; color: var(--text-faint); font-size: .9rem; margin: 0; text-align: center; }

/* ============================================================
   Back to top
   ============================================================ */
.to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; border: none; cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { opacity: .9; }

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .post-card-thumb img, .g-card-thumb img, .c-lead-thumb img, .c-mini-thumb img { transition: none; }
  .to-top { transition: none; }
}

/* ============================================================
   Wide reading layout, article rails, and responsive navigation
   ============================================================ */
.header-top .wrap { max-width: var(--xwide); height: 68px; gap: 1.25rem; }
.header-top .custom-logo-link, .header-top .brand { flex: 0 0 auto; }
.header-nav { flex: 1 1 auto; min-width: 0; border: 0; }
.header-nav ul { justify-content: flex-end; }
.header-nav a { padding: .7rem .8rem; font-size: .88rem; }
.header-tools { flex: 0 0 auto; }
.header-search .wrap { max-width: var(--xwide); }

.article-intro { max-width: var(--xwide); }
.article-intro .article-header { max-width: none; }
.article-header-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; align-items: end; }
.article-heading-copy { min-width: 0; }
.article-header-actions { align-self: end; padding: 1.15rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.article-header-actions .google-preferred { margin-bottom: .9rem; }
.article-header-actions .share { margin: 0; padding: 0; border: 0; }
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 3rem;
  max-width: var(--xwide);
  margin: 0 auto;
  padding: 0 2rem;
  align-items: start;
}
.article-content { min-width: 0; max-width: 100%; }
.article-content .article-hero { width: min(100%, 52rem); max-width: 52rem; margin: 0 0 2rem; padding: 0; }
.article-content .article-hero figcaption { max-width: none; padding: 0; }
.toc-rail, .recent-rail { position: sticky; top: 6rem; }
.toc-rail:empty { display: none; }
.toc-rail { grid-column: 1 / -1; position: static; }
.toc-rail .toc { max-width: 44rem; margin: 0 0 1.5rem; }
.toc-rail::-webkit-scrollbar { width: 6px; }
.toc-rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.recent-rail { border-left: 1px solid var(--border); padding-left: 1.25rem; }
.google-preferred { display: flex; align-items: center; gap: .65rem; margin: 0 0 2rem; padding: .8rem .9rem; border-radius: 10px; background: #111; color: #fff !important; font-size: .82rem; font-weight: 700; line-height: 1.25; }
.google-preferred:hover { color: #fff !important; opacity: .9; text-decoration: none; }
.google-preferred-g { display: grid; flex: 0 0 1.8rem; width: 1.8rem; height: 1.8rem; place-items: center; border-radius: 50%; background: conic-gradient(#4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0); color: #fff; font-size: 1.15rem; font-weight: 800; }
.recent-rail h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 1rem; }
.recent-rail-list { display: grid; gap: 1rem; }
.recent-rail-item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: .75rem; color: var(--text); align-items: start; }
.recent-rail-item:hover { color: var(--accent); text-decoration: none; }
.recent-rail-item img { width: 72px; height: 56px; object-fit: cover; border-radius: 7px; }
.recent-rail-item strong { display: block; font-family: var(--font-serif); font-size: .98rem; line-height: 1.25; }
.recent-rail-item small { display: block; color: var(--text-faint); font-size: .78rem; margin-top: .25rem; }

.category-post-grid { max-width: var(--xwide); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 1.5rem; }
.category-post-grid + .pagination { grid-column: 1 / -1; }
.category-post-grid .g-card { min-width: 0; }

.site-footer { margin-top: 4rem; padding: 0 0 2rem; }
.footer-inner { padding-top: 3rem; }
.footer-widgets { border-bottom: 1px solid var(--border); border-top: 0; margin-bottom: 2.5rem; }
.footer-widgets + .footer-inner { padding-top: 0; }
.footer-inner, .footer-copy { max-width: var(--xwide); }

@media (max-width: 1199px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 2rem; }
  .article-layout { padding-inline: 1.5rem; }
}
@media (max-width: 1050px) {
  .header-top .wrap { gap: .75rem; }
  .header-nav a { padding-inline: .65rem; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 230px; max-width: 68rem; }
  .article-header-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 1.5rem; }
}
@media (max-width: 760px) {
  .header-top .wrap { min-height: 60px; height: auto; padding-block: .5rem; gap: .6rem; }
  .header-nav { order: 3; flex-basis: 100%; margin-inline: -.2rem; }
  .header-nav ul { justify-content: flex-start; overflow-x: auto; }
  .header-nav a { padding: .45rem .65rem; }
  .article { padding-top: 1.75rem; }
  .article-header-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .article-hero { padding-inline: 1rem; }
  .article-layout { display: flex; flex-direction: column; padding-inline: 1rem; gap: 1.5rem; }
  .toc-rail, .recent-rail { position: static; width: 100%; }
  .recent-rail { border-left: 0; border-top: 1px solid var(--border); padding: 1.5rem 0 0; }
  .recent-rail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 1rem; gap: 1.5rem 1rem; }
}
@media (max-width: 500px) {
  .article-header h1 { font-size: 2rem; }
  .recent-rail-list, .category-post-grid { grid-template-columns: 1fr; }
  .header-tools { gap: .4rem; }
}

/* Large screens use a true three-column reading view. The contents rail stays
   beside the article and scrolls independently when it is longer than the viewport. */
@media (min-width: 1350px) {
  .article-layout {
    grid-template-columns: 230px minmax(0, 1fr) 300px;
    gap: 2rem;
  }
  .toc-rail:not(:empty) {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 6rem;
    align-self: start;
    max-height: calc(100vh - 7.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: .75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }
  .toc-rail .toc { margin: 0; }
  .article-content { grid-column: 2; }
  .recent-rail { grid-column: 3; }
}

/* ============================================================
   Single-column footer structure
   ============================================================ */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-main { display: grid; grid-template-columns: minmax(180px, .85fr) minmax(360px, 1.7fr) minmax(160px, .7fr); gap: 3rem; max-width: var(--xwide); padding-top: 3rem; padding-bottom: 2.5rem; }
.footer-logo .custom-logo { width: auto; max-width: 210px; max-height: 56px; }
.footer-title { display: inline-block; color: var(--text); font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.footer-tagline { margin: .75rem 0 0; max-width: 19rem; line-height: 1.6; }
.footer-categories h2, .footer-connect h2 { margin: 0 0 1rem; color: var(--text); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.footer-categories ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.footer-categories a { color: var(--text-soft); font-size: .93rem; }
.footer-categories a:hover, .footer-email:hover { color: var(--accent); }
.footer-connect { display: flex; flex-direction: column; align-items: flex-start; }
.footer-email { color: var(--text-soft); font-size: .9rem; overflow-wrap: anywhere; }
.footer-connect .footer-social { margin-top: 1rem; }
.footer-copy { max-width: var(--xwide); margin-top: 0; }

@media (max-width: 950px) {
  .footer-main { grid-template-columns: 1fr 1.4fr; gap: 2.25rem; }
  .footer-connect { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .footer-main { grid-template-columns: 1fr; gap: 2rem; padding-top: 2.25rem; }
  .footer-connect { grid-column: auto; }
  .footer-categories ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
