/*
Theme Name: The Old Gazette
Theme URI: https://example.com/the-old-gazette
Author: Grok Theme Studio
Author URI: https://x.ai
Description: A full WordPress theme designed to look and feel like a classic 1800s newspaper. Features multi-column layouts, period typography, ornate headers, drop caps, and a cream parchment aesthetic. Perfect for historical blogs, literary sites, or anyone who loves the romance of the printed page.
Version: 1.0.0
Requires at least: 5.8
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: the-old-gazette
Tags: newspaper, classic, historical, blog, two-columns, custom-menu, featured-images, threaded-comments, translation-ready, custom-logo
*/

/* ==========================================================================
   CSS Variables – Period Palette
   ========================================================================== */
:root {
  --ink: #1a1a1a;
  --ink-light: #333333;
  --parchment: #f4ecd8;
  --parchment-dark: #e8dcc0;
  --border: #2c2c2c;
  --accent: #8b0000; /* deep crimson for mastheads & links */
  --muted: #5c5c5c;
  --rule: #4a4a4a;
  --font-display: "IM Fell English", "Times New Roman", Times, serif;
  --font-body: "Libre Baskerville", "Georgia", "Times New Roman", serif;
  --font-condensed: "Old Standard TT", "Times New Roman", serif;
  --max-width: 1100px;
  --gutter: 1.25rem;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: #d4c9a8;
  background-image:
    radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.04) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

a:hover,
a:focus {
  color: #5c0000;
  border-bottom-color: var(--accent);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.6em;
  color: var(--ink);
}

p {
  margin: 0 0 1em;
}

/* ==========================================================================
   Site Wrapper – The “Page”
   ========================================================================== */
.site-wrapper {
  max-width: var(--max-width);
  margin: 1.5rem auto;
  background: var(--parchment);
  box-shadow:
    0 0 0 1px var(--border),
    0 0 0 8px var(--parchment-dark),
    0 0 0 9px var(--border),
    0 8px 30px rgba(0,0,0,0.25);
  position: relative;
}

.site-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.08) 0%,
    transparent 8%,
    transparent 92%,
    rgba(0,0,0,0.04) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* ==========================================================================
   Header / Masthead
   ========================================================================== */
.site-header {
  position: relative;
  z-index: 2;
  padding: 1.5rem 1.5rem 0;
  text-align: center;
  border-bottom: 3px double var(--border);
}

.masthead-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-condensed);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.masthead-top .date {
  font-style: italic;
}

.site-branding {
  margin: 0.5rem 0 1rem;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1;
}

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

.site-title a:hover {
  color: var(--accent);
  border: none;
}

.site-description {
  font-family: var(--font-condensed);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--muted);
  margin: 0.35rem 0 0;
  letter-spacing: 0.03em;
}

/* Decorative horizontal rules */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
  color: var(--rule);
  font-size: 1.1rem;
}

.ornament::before,
.ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 120px;
}

/* Navigation */
.main-navigation {
  margin-top: 0.5rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.4rem 0;
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
}

.main-navigation a {
  font-family: var(--font-condensed);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  border: none;
  padding: 0.2rem 0;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

/* ==========================================================================
   Layout – Content + Sidebar
   ========================================================================== */
.site-content {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  position: relative;
  z-index: 2;
}

@media (max-width: 860px) {
  .site-content {
    grid-template-columns: 1fr;
  }
}

.content-area {
  padding: 1.5rem 1.75rem 2rem;
  border-right: 1px solid var(--rule);
}

@media (max-width: 860px) {
  .content-area {
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
}

.widget-area {
  padding: 1.5rem 1.25rem 2rem;
  background: rgba(232, 220, 192, 0.45);
}

/* ==========================================================================
   Posts – Newspaper Article Style
   ========================================================================== */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem 1.5rem;
}

@media (max-width: 640px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

/* Featured / lead story spans both columns */
.post-lead {
  grid-column: 1 / -1;
  border-bottom: 2px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 0.5rem;
}

.post-lead .entry-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-align: center;
  margin-bottom: 0.4em;
}

.post-lead .entry-content {
  column-count: 2;
  column-gap: 1.75rem;
  column-rule: 1px solid var(--rule);
}

@media (max-width: 640px) {
  .post-lead .entry-content {
    column-count: 1;
  }
}

.entry {
  position: relative;
}

.entry-header {
  margin-bottom: 0.75rem;
}

.entry-title {
  font-size: 1.35rem;
  margin: 0 0 0.25em;
  line-height: 1.25;
}

.entry-title a {
  color: var(--ink);
  border: none;
}

.entry-title a:hover {
  color: var(--accent);
}

.entry-meta {
  font-family: var(--font-condensed);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.entry-meta a {
  color: var(--muted);
  border: none;
}

.entry-meta a:hover {
  color: var(--accent);
}

.entry-meta .sep {
  margin: 0 0.35em;
  opacity: 0.6;
}

/* Drop cap */
.entry-content > p:first-of-type::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 3.6em;
  line-height: 0.75;
  padding-right: 0.08em;
  padding-top: 0.08em;
  color: var(--ink);
  font-weight: 400;
}

.entry-content {
  font-size: 0.95rem;
}

.entry-content h2,
.entry-content h3 {
  font-size: 1.2rem;
  margin-top: 1.4em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.2em;
}

.entry-content blockquote {
  margin: 1.25em 0;
  padding: 0.75em 1.25em;
  border-left: 3px solid var(--border);
  background: rgba(0,0,0,0.03);
  font-style: italic;
  color: var(--ink-light);
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1em 1.4em;
  padding: 0;
}

.entry-thumbnail {
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
  padding: 3px;
  background: #fff;
}

.entry-thumbnail img {
  width: 100%;
  display: block;
}

.entry-footer {
  margin-top: 1rem;
  padding-top: 0.6rem;
  border-top: 1px dotted var(--rule);
  font-family: var(--font-condensed);
  font-size: 0.75rem;
  color: var(--muted);
}

.read-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--font-condensed);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

/* ==========================================================================
   Single Post / Page
   ========================================================================== */
.single .entry-title,
.page .entry-title {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  text-align: center;
  margin-bottom: 0.3em;
}

.single .entry-meta {
  text-align: center;
  margin-bottom: 1.25rem;
}

.single .entry-content {
  column-count: 2;
  column-gap: 2rem;
  column-rule: 1px solid var(--rule);
  font-size: 1rem;
}

@media (max-width: 700px) {
  .single .entry-content {
    column-count: 1;
  }
}

.page .entry-content {
  max-width: 42em;
  margin: 0 auto;
}

/* ==========================================================================
   Sidebar / Widgets
   ========================================================================== */
.widget {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.widget:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.widget-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-align: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px double var(--border);
  letter-spacing: 0.03em;
}

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

.widget li {
  padding: 0.35em 0;
  border-bottom: 1px dotted rgba(0,0,0,0.12);
  font-size: 0.9rem;
}

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

.widget a {
  color: var(--ink);
  border: none;
}

.widget a:hover {
  color: var(--accent);
}

/* Search form */
.search-form {
  display: flex;
  gap: 0.35rem;
}

.search-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.search-form .search-field {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  background: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
}

.search-form .search-submit {
  padding: 0.4rem 0.85rem;
  background: var(--ink);
  color: var(--parchment);
  border: 1px solid var(--ink);
  font-family: var(--font-condensed);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s;
}

.search-form .search-submit:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ==========================================================================
   Pagination & Navigation
   ========================================================================== */
.posts-navigation,
.post-navigation,
.pagination {
  margin: 2rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-condensed);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.nav-previous a,
.nav-next a,
.page-numbers {
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  background: rgba(255,255,255,0.4);
}

.nav-previous a:hover,
.nav-next a:hover,
.page-numbers:hover,
.page-numbers.current {
  background: var(--ink);
  color: var(--parchment);
  border-color: var(--ink);
}

/* ==========================================================================
   Comments
   ========================================================================== */
.comments-area {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border);
}

.comments-title {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.comment-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.comment {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dotted var(--rule);
}

.comment-author {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.comment-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.comment-content {
  font-size: 0.92rem;
}

.comment-reply-link {
  font-family: var(--font-condensed);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.comment-respond {
  margin-top: 1.5rem;
}

.comment-reply-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.comment-form label {
  display: block;
  font-family: var(--font-condensed);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  background: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.comment-form .submit {
  padding: 0.5rem 1.25rem;
  background: var(--ink);
  color: var(--parchment);
  border: 1px solid var(--ink);
  font-family: var(--font-condensed);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.comment-form .submit:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 2;
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 3px double var(--border);
  text-align: center;
  font-family: var(--font-condensed);
  font-size: 0.8rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  border: none;
}

.site-footer a:hover {
  color: var(--accent);
}

.site-info {
  margin-top: 0.5rem;
}

/* ==========================================================================
   Archive / Search Headers
   ========================================================================== */
.page-header {
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
  text-align: center;
}

.page-title {
  font-size: 1.6rem;
  margin: 0;
}

.archive-description {
  font-style: italic;
  color: var(--muted);
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

/* ==========================================================================
   404
   ========================================================================== */
.error-404 {
  text-align: center;
  padding: 3rem 1rem;
}

.error-404 .page-title {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.error-404 .page-content {
  max-width: 28em;
  margin: 0 auto;
}

/* ==========================================================================
   Utility
   ========================================================================== */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.alignleft {
  float: left;
  margin: 0.3em 1.2em 0.8em 0;
}

.alignright {
  float: right;
  margin: 0.3em 0 0.8em 1.2em;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.wp-caption {
  max-width: 100%;
  border: 1px solid var(--border);
  padding: 4px;
  background: #fff;
  margin-bottom: 1em;
}

.wp-caption-text {
  font-family: var(--font-condensed);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.35rem 0.25rem 0.15rem;
  color: var(--muted);
  font-style: italic;
}

/* Clear floats */
.entry-content::after,
.comment-content::after {
  content: "";
  display: table;
  clear: both;
}

/* ==========================================================================
   Print Styles – True Newspaper Feel
   ========================================================================== */
@media print {
  body {
    background: #fff;
  }
  .site-wrapper {
    box-shadow: none;
    max-width: 100%;
    margin: 0;
  }
  .main-navigation,
  .widget-area,
  .site-footer,
  .posts-navigation,
  .comment-respond {
    display: none;
  }
  .content-area {
    border: none;
    padding: 0;
  }
  .site-content {
    display: block;
  }
}
