/* ==========================================================================
   Theme: NEWSPAPER
   Classic newspaper/broadsheet style — serious, editorial, and authoritative
   ========================================================================== */

/* --- 1. Variables --- */
:root {
  --text: #1a1a1a;
  --muted: #555555;
  --link: #8b0000;
  --line: #cccccc;
  --bg: #f9f7f2;
  --accent: #8b0000;
  --max: 1020px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e4df;
    --muted: #999999;
    --link: #e57373;
    --line: #3a3530;
    --bg: #1c1a17;
    --accent: #e57373;
  }
}

/* --- 2. Body & Global Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 18px/1.65 Georgia, "Times New Roman", Times, serif;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

/* --- 3. Links --- */
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent);
  text-decoration-thickness: 2px;
}

/* --- 4. Main & Grid Layout --- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
}

.page-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
}

.page-grid > main {
  max-width: 100%;
  margin: 0;
  padding: 1.5rem 0 3.5rem;
  min-width: 0;
}

/* --- 5. Header --- */
.site-header {
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem 1.25rem;
  border-bottom: 3px double var(--line);
  text-align: center;
}

.brand {
  display: inline-block;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  line-height: 1.2;
}

.brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.tagline {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0.4rem 0 0;
  text-align: center;
}

.cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cats a {
  color: var(--text);
  text-decoration: none;
  border: none;
  padding: 0;
  background: none;
}

.cats a:hover,
.cats a.active {
  color: var(--link);
  text-decoration: underline;
}

.cats a:not(:last-child)::after {
  content: "|";
  margin-left: 0.75rem;
  color: var(--line);
  text-decoration: none;
  display: inline-block;
}

/* --- 6. Typography --- */
h1 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 2.2rem;
  line-height: 1.2;
  margin: 1.2rem 0 0.6rem;
  font-weight: 700;
  color: var(--text);
}

h2 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 1.8rem 0 0.6rem;
  font-weight: 700;
  color: var(--text);
}

h3 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.2rem;
  line-height: 1.35;
  margin: 1.4rem 0 0.5rem;
  font-weight: 700;
  color: var(--accent);
}

h4 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.05rem;
  line-height: 1.4;
  margin: 1.2rem 0 0.4rem;
  font-weight: 700;
  color: var(--text);
}

p, ul, ol, blockquote {
  margin: 0 0 1.2rem;
}

ul, ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.4rem;
}

blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  color: var(--muted);
  font-style: italic;
  font-size: 1.05rem;
  background: rgba(0, 0, 0, 0.02);
}

img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  display: block;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
  background: rgba(127, 127, 127, 0.12);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  overflow-x: auto;
  background: rgba(127, 127, 127, 0.08);
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 1.2rem 0;
}

pre code {
  background: none;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

th, td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.8rem;
  text-align: left;
}

th {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.04);
}

/* --- 7. Meta --- */
.meta {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.meta a {
  color: var(--muted);
  text-decoration: none;
}

.meta a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* --- 8. Breadcrumb --- */
.breadcrumb {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 1rem 0 1.2rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--link);
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--muted);
}

/* --- 9. Teaser --- */
.teaser {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
}

.teaser:first-of-type {
  padding-top: 0.5rem;
}

.teaser h2 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.25;
  margin: 0 0 0.35rem;
}

.teaser h2 a {
  color: var(--text);
  text-decoration: none;
}

.teaser h2 a:hover {
  color: var(--link);
  text-decoration: underline;
}

.teaser .meta {
  margin-bottom: 0.4rem;
}

.teaser p:last-child {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.55;
}

/* --- 10. Post --- */
.post {
  margin: 0 0 2rem;
}

.post h1 {
  font-size: 2.2rem;
  line-height: 1.2;
  margin: 0.5rem 0 0.75rem;
}

.post > .meta {
  margin-bottom: 1.8rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

/* --- 11. Tags --- */
.tags {
  margin: 2rem 0 1.5rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.tags::before {
  content: "Tags: ";
  font-weight: 600;
  color: var(--text);
}

.tag {
  display: inline;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.tag:not(:last-child)::after {
  content: ", ";
}

/* --- 12. Related --- */
.related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 3px double var(--line);
}

.related h2 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.15rem;
  margin: 0 0 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.related ul {
  list-style: square;
  padding-left: 1.2rem;
  margin: 0;
}

.related li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.related a {
  color: var(--link);
  text-decoration: none;
}

.related a:hover {
  text-decoration: underline;
}

/* --- 13. Pagination --- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.pagination a {
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}

.pagination a:hover {
  text-decoration: underline;
}

.pagination span {
  color: var(--muted);
}

/* --- 14. Sidebar --- */
.sidebar {
  border-top: 3px solid var(--accent);
  padding-top: 1.2rem;
}

.sidebar-widget {
  margin-bottom: 2rem;
}

.sidebar-widget h3 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}

.sidebar-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-widget li {
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--line);
  font-size: 0.9rem;
}

.sidebar-widget li:last-child {
  border-bottom: none;
}

.sidebar-widget a {
  color: var(--text);
  text-decoration: none;
}

.sidebar-widget a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* --- 15. Footer --- */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 3px double var(--line);
  color: var(--muted);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.8rem;
  text-align: center;
}

/* --- 16. Ad Containers --- */
.ad-container {
  max-width: var(--max);
  margin: 0 auto 1.5rem;
  padding: 0 1.25rem;
  text-align: center !important;
  clear: both;
}

.ad-container:last-child {
  margin-bottom: 0;
}

.ad-body-top {
  margin-top: 1rem;
}

.ad-body-bottom {
  margin-top: 2rem;
}

.ad-footer {
  margin-top: 1rem;
}

/* Force center - works for inline-block, block, iframe, ins */
.ad-container > * {
  display: inline-block !important;
  max-width: 100%;
}

/* Google AdSense specific */
.ad-container ins.adsbygoogle,
.ad-container ins[data-ad-client],
.ad-container .adsbygoogle,
.ad-container iframe[src*="googleads"],
.ad-container iframe[src*="googlesyndication"],
.ad-container iframe[id^="aswift_"],
.ad-container iframe[id^="google_ads_iframe"] {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 100%;
}

/* Adsterra/HPF - hide config object and placeholder until iframe loads */
.ad-container script {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

.ad-container .ad-slot {
  display: none !important;
}

.ad-container .ad-hpf {
  display: none !important;
}

/* Show iframe when loaded */
.ad-container iframe {
  display: block !important;
  margin: 0 auto !important;
}

/* --- 17. Responsive Breakpoints --- */
@media (max-width: 768px) {
  .page-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .sidebar {
    margin-top: 1rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
    line-height: 1.6;
  }

  .brand {
    font-size: 1.6rem;
  }

  .tagline {
    font-size: 0.88rem;
  }

  h1 {
    font-size: 1.65rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  .teaser h2 {
    font-size: 1.2rem;
  }

  .site-header {
    padding: 1.25rem 1rem 1rem;
  }

  main {
    padding: 1rem 1rem 2.5rem;
  }

  .page-grid {
    padding: 0 1rem;
  }
}
