/*
Theme Name: Masthead
Theme URI: https://example.com/masthead
Author: Built with Claude
Author URI: https://example.com
Description: A bold editorial magazine theme for blogs and publications. Features a striking masthead, an asymmetric featured-story layout, category eyebrows, and a clean reading experience. Fully responsive and widget-ready.
Version: 1.0.0
Requires at least: 5.5
Tested up to: 6.5
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: masthead
Tags: blog, news, magazine, two-columns, right-sidebar, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ============================================================
   Design tokens
   Palette: warm paper + ink, with an editorial cobalt accent
   Type: Fraunces (display serif) + Inter (body/UI)
   ============================================================ */
:root {
  --paper: #ffffff;
  --paper-2: #f2f4f7;
  --ink: #16151a;
  --ink-soft: #33313a;
  --muted: #6b6e76;
  --accent: #2b3ad6;
  --accent-ink: #1e2ba3;
  --hairline: #e6e8ec;
  --hairline-strong: #16151a;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --measure: 68ch;
  --wrap: 1180px;
  --gap: 2.4rem;
  --radius: 2px;
}

/* ============================================================
   Reset-ish base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1.2em; }

/* Accessibility */
.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 !important; word-wrap: normal !important;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; color: var(--paper); }

a:focus-visible, button:focus-visible, input:focus-visible, .menu a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   Layout wrap
   ============================================================ */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }

.site-content { padding: 3rem 0 4rem; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 3.5rem;
}
.layout--full { grid-template-columns: minmax(0, 1fr); }

/* ============================================================
   Masthead / header  (the signature element)
   ============================================================ */
.site-header {
  background: var(--paper);
  border-top: 6px solid var(--hairline-strong);
}
.masthead {
  text-align: center;
  padding: 1.8rem 0 1.2rem;
}
.site-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1;
}
.site-title a { color: var(--ink); }
.site-title a:hover { color: var(--ink); text-decoration: none; }
.custom-logo { margin: 0 auto; }
.site-description {
  font-family: var(--body);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.7rem 0 0;
}

/* Primary nav */
.primary-nav {
  border-top: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
}
.primary-nav .menu {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}
.primary-nav .menu > li { position: relative; }
.primary-nav .menu a {
  display: block;
  padding: 0.9rem 1.2rem;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.primary-nav .menu a:hover,
.primary-nav .current-menu-item > a {
  color: var(--accent);
  text-decoration: none;
}
/* Submenus */
.primary-nav .sub-menu {
  list-style: none; margin: 0; padding: 0.4rem 0;
  position: absolute; top: 100%; left: 0; z-index: 50;
  min-width: 200px;
  background: var(--ink);
  display: none;
}
.primary-nav .menu li:hover > .sub-menu,
.primary-nav .menu li:focus-within > .sub-menu { display: block; }
.primary-nav .sub-menu a { color: var(--paper); text-transform: none; letter-spacing: 0.02em; font-weight: 500; }
.primary-nav .sub-menu a:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* Menu toggle (mobile) */
.menu-toggle {
  display: none;
  margin: 0.8rem auto;
  background: var(--ink); color: var(--paper);
  border: 0; padding: 0.6rem 1.1rem;
  font-family: var(--body); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; border-radius: var(--radius);
}

/* ============================================================
   Eyebrow / category tag
   ============================================================ */
.eyebrow {
  display: inline-block;
  font-family: var(--body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.eyebrow a { color: var(--accent); }
.eyebrow a:hover { color: var(--accent-ink); text-decoration: none; }

/* ============================================================
   Featured lead story (home)
   ============================================================ */
.lead {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--gap);
  align-items: center;
  padding-bottom: 2.6rem;
  margin-bottom: 2.6rem;
  border-bottom: 1px solid var(--hairline);
}
.lead__media { overflow: hidden; }
.lead__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .5s ease; }
.lead__media a:hover img { transform: scale(1.03); }
.lead__title {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.06;
  margin: 0.2rem 0 0.6rem;
}
.lead__title a { color: var(--ink); }
.lead__title a:hover { color: var(--accent); text-decoration: none; }
.lead__excerpt { color: var(--ink-soft); font-size: 1.12rem; }

/* Section heading */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid var(--hairline-strong);
  padding-bottom: 0.6rem; margin-bottom: 1.8rem;
}
.section-head h2 {
  font-size: 1.1rem; letter-spacing: 0.02em; margin: 0;
  text-transform: uppercase; font-family: var(--body); font-weight: 800;
}
.section-head .more { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

/* ============================================================
   Post grid + cards
   ============================================================ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.6rem 2.4rem;
}
.card { display: flex; flex-direction: column; }
.card__media { overflow: hidden; margin-bottom: 1rem; }
.card__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .5s ease; }
.card__media a:hover img { transform: scale(1.04); }
.card__title { font-size: 1.4rem; line-height: 1.14; margin: 0.1rem 0 0.5rem; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--accent); text-decoration: none; }
.card__excerpt { color: var(--muted); font-size: 0.98rem; margin-bottom: 0.8rem; }

/* Meta line */
.meta {
  font-family: var(--body);
  font-size: 0.76rem; letter-spacing: 0.04em;
  color: var(--muted); text-transform: uppercase;
}
.meta a { color: var(--muted); }
.meta a:hover { color: var(--accent); text-decoration: none; }
.meta .sep { margin: 0 0.5rem; opacity: 0.5; }

/* ============================================================
   Single post / pages
   ============================================================ */
.entry-header { margin-bottom: 1.8rem; }
.entry-header .entry-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.05;
  max-width: 20ch;
}
.single .entry-header .entry-title,
.page .entry-header .entry-title { max-width: none; }
.entry-hero { margin: 1.8rem 0; }
.entry-hero img { width: 100%; max-height: 520px; object-fit: cover; }

.entry-content { font-size: 1.15rem; line-height: 1.75; max-width: var(--measure); }
.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote,
.entry-content h2,
.entry-content h3,
.entry-content figure { max-width: var(--measure); }
.entry-content h2 { font-size: 1.8rem; margin: 2rem 0 0.8rem; }
.entry-content h3 { font-size: 1.4rem; margin: 1.6rem 0 0.6rem; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry-content img { margin: 1.5rem 0; }
.entry-content blockquote {
  margin: 1.8rem 0;
  padding: 0.4rem 0 0.4rem 1.6rem;
  border-left: 3px solid var(--accent);
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1.35;
  font-style: italic;
  color: var(--ink-soft);
}
.entry-content blockquote p { margin-bottom: 0.4rem; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }
.entry-content li { margin-bottom: 0.4rem; }
.entry-content code {
  background: var(--paper-2); padding: 0.15em 0.4em; border-radius: var(--radius);
  font-size: 0.9em;
}
.entry-content pre {
  background: var(--ink); color: #f5f5f5; padding: 1.2rem; overflow-x: auto;
  border-radius: var(--radius); max-width: var(--measure); font-size: 0.92rem;
}
.entry-content pre code { background: none; padding: 0; }

.entry-footer {
  margin-top: 2.4rem; padding-top: 1.4rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.85rem;
}
.entry-footer .tags a {
  display: inline-block; margin: 0 0.4rem 0.4rem 0;
  padding: 0.25rem 0.7rem; background: var(--paper-2);
  color: var(--ink-soft); font-size: 0.78rem; border-radius: 100px;
}
.entry-footer .tags a:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* WP alignment + captions */
.alignleft { float: left; margin: 0.4rem 1.6rem 1rem 0; }
.alignright { float: right; margin: 0.4rem 0 1rem 1.6rem; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, .wp-element-caption {
  font-size: 0.82rem; color: var(--muted); font-style: italic;
  text-align: center; margin-top: 0.4rem;
}
.sticky .card__title::before,
.sticky .entry-title::before {
  content: "★ "; color: var(--accent);
}

/* ============================================================
   Sidebar / widgets
   ============================================================ */
.sidebar .widget { margin-bottom: 2.4rem; }
.widget-title {
  font-family: var(--body);
  font-size: 0.85rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-bottom: 2px solid var(--hairline-strong);
  padding-bottom: 0.5rem; margin-bottom: 1rem;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 0.5rem 0; border-bottom: 1px solid var(--hairline); font-size: 0.95rem; }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--ink-soft); }
.sidebar a:hover { color: var(--accent); text-decoration: none; }
.widget select { width: 100%; padding: 0.5rem; font-family: var(--body); }

/* Search form */
.search-form { display: flex; gap: 0.5rem; }
.search-form .search-field {
  flex: 1; padding: 0.6rem 0.8rem; border: 1px solid var(--hairline-strong);
  background: var(--paper); font-family: var(--body); border-radius: var(--radius);
}
.search-form .search-submit {
  background: var(--ink); color: var(--paper); border: 0; padding: 0 1rem;
  font-family: var(--body); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.78rem; cursor: pointer; border-radius: var(--radius);
}
.search-form .search-submit:hover { background: var(--accent); }

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  margin-top: 3rem; padding-top: 1.6rem;
  border-top: 2px solid var(--hairline-strong);
  display: flex; justify-content: center; gap: 0.4rem; flex-wrap: wrap;
}
.pagination .page-numbers {
  display: inline-block; min-width: 2.6rem; text-align: center;
  padding: 0.5rem 0.7rem; border: 1px solid var(--hairline-strong);
  color: var(--ink); font-weight: 600; font-size: 0.9rem; border-radius: var(--radius);
}
.pagination .page-numbers.current { background: var(--ink); color: var(--paper); }
.pagination a.page-numbers:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.4rem; }
.post-nav a { font-family: var(--display); font-size: 1.05rem; color: var(--ink); }
.post-nav .nav-subtitle { display: block; font-family: var(--body); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.2rem; }

/* ============================================================
   Comments
   ============================================================ */
.comments-area { margin-top: 3rem; max-width: var(--measure); }
.comments-title, .comment-reply-title { font-size: 1.5rem; margin-bottom: 1.4rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ol { list-style: none; }
.comment-body { padding: 1.2rem 0; border-bottom: 1px solid var(--hairline); }
.comment-author { font-weight: 600; }
.comment-author .avatar { border-radius: 50%; margin-right: 0.6rem; vertical-align: middle; }
.comment-metadata { font-size: 0.78rem; color: var(--muted); }
.comment-respond { margin-top: 2rem; }
.comment-form label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%; padding: 0.6rem 0.8rem; margin-bottom: 1rem;
  border: 1px solid var(--hairline-strong); background: var(--paper);
  font-family: var(--body); border-radius: var(--radius);
}
.comment-form .submit,
.form-submit .submit {
  background: var(--ink); color: var(--paper); border: 0;
  padding: 0.7rem 1.6rem; font-family: var(--body); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; border-radius: var(--radius);
}
.comment-form .submit:hover, .form-submit .submit:hover { background: var(--accent); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  margin-top: 4rem;
  padding: 3rem 0 2rem;
}
.site-footer a { color: var(--paper); }
.site-footer a:hover { color: #fff; }
.footer-widgets {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem;
  padding-bottom: 2.4rem; border-bottom: 1px solid rgba(255,255,255,0.15);
}
.site-footer .widget-title { border-color: rgba(255,255,255,0.3); color: var(--paper); }
.site-footer .sidebar li,
.site-footer li { border-color: rgba(255,255,255,0.12); }
.site-footer .widget a { color: rgba(255,255,255,0.8); }
.site-info {
  padding-top: 1.6rem; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  font-size: 0.82rem; color: rgba(255,255,255,0.7);
}
.footer-brand { font-family: var(--display); font-size: 1.4rem; color: var(--paper); }

/* ============================================================
   Archive header
   ============================================================ */
.archive-header { margin-bottom: 2.4rem; padding-bottom: 1.2rem; border-bottom: 2px solid var(--hairline-strong); }
.archive-title { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.archive-title .label { color: var(--muted); font-size: 0.5em; display: block; letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--body); font-weight: 700; margin-bottom: 0.3rem; }
.archive-description { color: var(--muted); max-width: var(--measure); }

/* No results */
.no-results { padding: 2rem 0; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0,1fr); }
  .sidebar { border-top: 2px solid var(--hairline-strong); padding-top: 2rem; }
  .lead { grid-template-columns: minmax(0,1fr); }
  .lead__media { order: -1; }
  .footer-widgets { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .post-grid { grid-template-columns: minmax(0,1fr); }
  .footer-widgets { grid-template-columns: 1fr; }
  .menu-toggle { display: block; }
  .primary-nav .menu {
    display: none; flex-direction: column;
  }
  .primary-nav.is-open .menu { display: flex; }
  .primary-nav .menu a { text-align: center; border-top: 1px solid var(--hairline); }
  .primary-nav .sub-menu { position: static; display: block; background: transparent; }
  .primary-nav .sub-menu a { color: var(--muted); }
  .site-info { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
