/*
Theme Name: Pseudocyst Notebook
Theme URI: https://pseudocystblog.com/
Author: ChatGPT for Pseudocyst
Author URI: https://pseudocystblog.com/
Description: A crisp, witty, editorial WordPress theme for a clinical, family sport, chess and board-game blog. Designed for readability, long-form posts, and dryly amused dispatches from Somerset and beyond.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pseudocyst-notebook
Tags: blog, custom-logo, featured-images, threaded-comments, wide-blocks, accessibility-ready
*/

:root {
  --pc-bg: #fbf7ef;
  --pc-paper: #fffdf8;
  --pc-ink: #18212b;
  --pc-muted: #5c6470;
  --pc-line: #e6dccb;
  --pc-accent: #9b3d2f;
  --pc-accent-dark: #6f281f;
  --pc-blue: #263c63;
  --pc-green: #55745a;
  --pc-shadow: 0 16px 40px rgba(24, 33, 43, 0.10);
  --pc-radius: 22px;
  --pc-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pc-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at top left, rgba(155,61,47,.12), transparent 32rem), var(--pc-bg);
  color: var(--pc-ink);
  font-family: var(--pc-sans);
  font-size: 18px;
  line-height: 1.72;
}

a { color: var(--pc-accent-dark); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover, a:focus { color: var(--pc-blue); }
img { max-width: 100%; height: auto; }

.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;
}
.screen-reader-text:focus {
  background: #fff; border-radius: 6px; clip: auto; clip-path: none; color: var(--pc-ink);
  height: auto; left: 1rem; padding: .75rem 1rem; top: 1rem; width: auto; z-index: 99999;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(251, 247, 239, .88);
  border-bottom: 1px solid rgba(230, 220, 203, .8);
}
.header-inner, .container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 0;
}
.site-branding { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.custom-logo { border-radius: 12px; max-height: 54px; width: auto; }
.site-title { margin: 0; font-family: var(--pc-serif); font-size: clamp(1.25rem, 2vw, 1.75rem); line-height: 1.1; }
.site-title a { color: var(--pc-ink); text-decoration: none; }
.site-description { margin: .15rem 0 0; color: var(--pc-muted); font-size: .88rem; line-height: 1.3; }

.menu-toggle { display: none; }
.primary-menu { display: flex; align-items: center; gap: .35rem; list-style: none; padding: 0; margin: 0; }
.primary-menu a {
  display: block;
  border-radius: 999px;
  color: var(--pc-ink);
  font-size: .95rem;
  font-weight: 700;
  padding: .45rem .8rem;
  text-decoration: none;
}
.primary-menu a:hover, .primary-menu a:focus { background: #fff; box-shadow: 0 1px 0 var(--pc-line); }

.hero {
  padding: clamp(3rem, 8vw, 6.5rem) 0 2rem;
}
.hero-card {
  background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,253,248,.95));
  border: 1px solid var(--pc-line);
  border-radius: calc(var(--pc-radius) + 10px);
  box-shadow: var(--pc-shadow);
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3rem);
}
.kicker {
  color: var(--pc-accent);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .12em;
  margin: 0 0 .75rem;
  text-transform: uppercase;
}
.hero h1, .page-title, .entry-title {
  font-family: var(--pc-serif);
  line-height: 1.08;
  margin: 0 0 1rem;
}
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.8rem); max-width: 13ch; }
.hero p { color: var(--pc-muted); font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.35rem; }
.button, .wp-block-button__link, input[type="submit"] {
  border: 0;
  border-radius: 999px;
  background: var(--pc-accent);
  color: #fff !important;
  cursor: pointer;
  display: inline-flex;
  font-weight: 850;
  padding: .75rem 1.05rem;
  text-decoration: none;
}
.button.secondary { background: #fff; color: var(--pc-ink) !important; border: 1px solid var(--pc-line); }
.button:hover, .button:focus, input[type="submit"]:hover { background: var(--pc-accent-dark); }
.button.secondary:hover { background: #f7efe4; }
.hero-panel {
  align-self: stretch;
  background: var(--pc-blue);
  border-radius: var(--pc-radius);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}
.hero-panel:after {
  content: "♟︎";
  font-size: 14rem;
  opacity: .08;
  position: absolute;
  right: -1.5rem;
  bottom: -3.5rem;
}
.hero-panel strong { display: block; font-family: var(--pc-serif); font-size: 1.8rem; line-height: 1.15; }
.hero-panel span { color: rgba(255,255,255,.75); display: block; font-size: .95rem; margin-top: .5rem; }
.category-pills { display: flex; flex-wrap: wrap; gap: .5rem; position: relative; z-index: 1; }
.category-pills a { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; color: #fff; font-size: .82rem; padding: .35rem .6rem; text-decoration: none; }

.section-title {
  align-items: baseline;
  border-top: 1px solid var(--pc-line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1.2rem;
  padding-top: 1.2rem;
}
.section-title h2 { font-family: var(--pc-serif); font-size: clamp(1.6rem, 3vw, 2.4rem); margin: 0; }
.section-title p { color: var(--pc-muted); font-size: .95rem; margin: 0; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.post-card, .content-card, .sidebar .widget {
  background: var(--pc-paper);
  border: 1px solid var(--pc-line);
  border-radius: var(--pc-radius);
  box-shadow: 0 10px 24px rgba(24,33,43,.06);
}
.post-card { display: flex; flex-direction: column; overflow: hidden; }
.post-card .thumb { aspect-ratio: 16 / 9; background: #eee2d2; overflow: hidden; }
.post-card .thumb img { height: 100%; object-fit: cover; width: 100%; }
.post-card-body { padding: 1rem; }
.post-card .entry-title { font-size: 1.45rem; margin-bottom: .45rem; }
.post-card .entry-title a { color: var(--pc-ink); text-decoration: none; }
.entry-meta, .entry-footer { color: var(--pc-muted); font-size: .85rem; }
.excerpt { color: var(--pc-muted); font-size: .98rem; margin: .6rem 0 0; }
.read-more { font-weight: 850; }

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
  margin: 2rem auto 3rem;
}
.content-card { padding: clamp(1.25rem, 3vw, 2.4rem); }
.entry-content { font-family: var(--pc-serif); font-size: 1.1rem; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2, .entry-content h3 { font-family: var(--pc-serif); line-height: 1.18; margin-top: 2rem; }
.entry-content blockquote {
  border-left: 4px solid var(--pc-accent);
  color: var(--pc-muted);
  margin: 1.5rem 0;
  padding-left: 1rem;
}
.entry-content code { background: #f0e5d6; border-radius: 5px; padding: .1rem .25rem; }
.wp-caption, .aligncenter { max-width: 100%; }
.alignwide { width: min(1120px, 100%); }
.alignfull { margin-left: calc(50% - 50vw); width: 100vw; }

.sidebar { display: flex; flex-direction: column; gap: 1rem; }
.sidebar .widget { padding: 1rem; }
.sidebar h2, .sidebar h3 { font-family: var(--pc-serif); margin-top: 0; }
.sidebar ul { margin: 0; padding-left: 1.1rem; }

.pagination, .post-navigation, .comments-area { margin-top: 1.5rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; }
.page-numbers, .nav-links a { background: #fff; border: 1px solid var(--pc-line); border-radius: 999px; padding: .45rem .8rem; text-decoration: none; }
.current { background: var(--pc-blue); color: #fff; }

.site-footer {
  background: #151d27;
  color: rgba(255,255,255,.82);
  margin-top: 3rem;
  padding: 2.5rem 0;
}
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.site-footer a { color: #fff; }
.site-footer h2, .site-footer h3 { color: #fff; font-family: var(--pc-serif); margin-top: 0; }
.disclaimer { border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.68); font-size: .88rem; margin-top: 1.5rem; padding-top: 1rem; }

input, textarea, select {
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  font: inherit;
  padding: .65rem .75rem;
  width: 100%;
}
label { display: block; font-weight: 800; margin: .75rem 0 .25rem; }

@media (max-width: 860px) {
  .menu-toggle { background: #fff; border: 1px solid var(--pc-line); border-radius: 999px; display: inline-flex; font-weight: 800; padding: .45rem .75rem; }
  .main-navigation.toggled .primary-menu { display: flex; }
  .primary-menu {
    background: var(--pc-paper);
    border: 1px solid var(--pc-line);
    border-radius: 16px;
    box-shadow: var(--pc-shadow);
    display: none;
    flex-direction: column;
    gap: .1rem;
    padding: .45rem;
    position: absolute;
    right: 1rem;
    top: 72px;
    width: min(280px, calc(100vw - 2rem));
  }
  .primary-menu a { width: 100%; }
  .hero-card, .main-layout, .footer-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .section-title { align-items: flex-start; flex-direction: column; }
  body { font-size: 16px; }
}

@media (min-width: 861px) and (max-width: 1080px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
