/*
Theme Name: Field Notes
Theme URI: https://github.com/yourusername/fieldnotes-theme
Author: Ryan
Author URI: https://yourdomain.com
Description: A typography-first personal blog theme inspired by long-form editorial writing. Clean two-column layout with a wide main column and narrow sidebar.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fieldnotes
Tags: blog, one-column, two-columns, custom-colors, custom-menu, featured-images, sticky-post, theme-options, translation-ready
*/

/* ─────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --cream: #f9f7f2;
  --ink: #1a1a18;
  --ink-mid: #3d3d38;
  --ink-light: #767670;
  --rule: #d8d5cb;
  --accent: #b84c2e;
  --accent-hover: #952f14;
  --link: #2a5c8a;
  --link-hover: #1a3d5c;
  --serif: 'Lora', Georgia, serif;
  --sans: 'Source Sans 3', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --col-main: 660px;
  --col-side: 220px;
  --col-gap: 52px;
  --max-width: calc(var(--col-main) + var(--col-side) + var(--col-gap) + 80px);
}

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

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }

/* ─────────────────────────────────────────
   SKIP LINK
───────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--accent);
  color: #fff;
  padding: 4px 12px;
  font-family: var(--sans);
  font-size: 14px;
  z-index: 999;
}
.skip-link:focus { left: 0; }

/* ─────────────────────────────────────────
   HEADER
───────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 22px 0 0;
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

.site-brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
}

.site-title a {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s;
}
.site-title a:hover { color: var(--accent); }

.site-description {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--ink-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Primary nav */
.main-navigation {
  border-top: 1px solid var(--rule);
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.main-navigation a {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-mid);
  text-decoration: none;
  padding: 10px 16px 10px 0;
  margin-right: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--ink-mid);
  cursor: pointer;
  padding: 10px 0;
}
.menu-toggle:hover { color: var(--accent); }

/* ─────────────────────────────────────────
   PAGE WRAP / LAYOUT
───────────────────────────────────────── */
.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: var(--col-main) var(--col-side);
  gap: 0 var(--col-gap);
  align-items: start;
}

/* ─────────────────────────────────────────
   MAIN CONTENT AREA
───────────────────────────────────────── */
#main { min-width: 0; }

/* ─────────────────────────────────────────
   ARTICLE / POST
───────────────────────────────────────── */
.post {
  padding: 48px 0 0;
  border-bottom: 1px solid var(--rule);
}
.post:last-of-type { border-bottom: none; }

/* Kicker row: category + rule */
.article-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.cat-link {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.cat-link:hover { color: var(--accent-hover); }

.kicker-rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* Post tagline (custom field: post_tagline) */
.post-tagline {
  font-family: var(--serif);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-light);
  margin-bottom: 8px;
}

/* Entry title */
.entry-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
}
.entry-title a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s;
}
.entry-title a:hover { color: var(--accent); }

/* Entry content */
.entry-content {
  font-size: 1rem;
  color: var(--ink-mid);
}

.entry-content p { margin-bottom: 1.1em; }
.entry-content p:last-child { margin-bottom: 0; }

.entry-content h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin: 32px 0 12px;
}

.entry-content h3 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 10px;
}

.entry-content strong { font-weight: 600; color: var(--ink); }
.entry-content em { font-style: italic; }

.entry-content a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.entry-content a:hover { color: var(--link-hover); }

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.1em 1.4em;
}
.entry-content li { margin-bottom: 0.4em; }

.entry-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  font-style: italic;
  color: var(--ink-light);
}

.entry-content pre,
.entry-content code {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.entry-content pre {
  background: #f0ede6;
  border: 1px solid var(--rule);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 20px 0;
  line-height: 1.6;
}

.entry-content code {
  background: #f0ede6;
  padding: 1px 5px;
  border-radius: 2px;
}

.entry-content pre code {
  background: none;
  padding: 0;
}

.entry-content figure { margin: 24px 0; }
.entry-content figcaption {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--ink-light);
  margin-top: 6px;
  font-style: italic;
}

/* ─────────────────────────────────────────
   CALLOUT CARD (custom block / shortcode)
───────────────────────────────────────── */
.callout-card {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 20px 24px;
  margin: 24px 0;
  background: #fff;
}

.callout-card h4 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}

.callout-card .callout-sub {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--ink-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0;
}

.callout-card dl {
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  margin-top: 10px;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 4px 12px;
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.5;
}

.callout-card dt { font-weight: 600; color: var(--ink); }
.callout-card dd { color: var(--ink-mid); }

/* ─────────────────────────────────────────
   ENTRY META / FOOTER
───────────────────────────────────────── */
.entry-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0 36px;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--ink-light);
}

.entry-footer a {
  color: var(--ink-light);
  text-decoration: none;
}
.entry-footer a:hover { color: var(--accent); }

.post-permalink {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--rule);
  text-decoration: none;
}
.post-permalink:hover { color: var(--accent); }

/* ─────────────────────────────────────────
   SINGLE POST
───────────────────────────────────────── */
.single .post { padding-top: 48px; }

.single .entry-title {
  font-size: 1.9rem;
  margin-bottom: 12px;
}

/* ─────────────────────────────────────────
   PAGINATION
───────────────────────────────────────── */
.posts-pagination,
.post-pagination {
  padding: 36px 0;
  font-family: var(--sans);
  font-size: 0.8rem;
}

.posts-pagination .nav-links,
.post-pagination .nav-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.posts-pagination a,
.post-pagination a {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}
.posts-pagination a:hover,
.post-pagination a:hover { color: var(--accent); }

/* ─────────────────────────────────────────
   COMMENTS
───────────────────────────────────────── */
.comments-area {
  border-top: 1px solid var(--rule);
  padding: 40px 0;
}

.comments-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 24px;
}

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

.comment {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
}

.comment-meta {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-light);
  margin-bottom: 8px;
}

.comment-author { font-weight: 600; color: var(--ink-mid); }

.comment-content p { color: var(--ink-mid); margin-bottom: 0.8em; }

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 8px 12px;
  font-family: var(--sans);
  font-size: 0.85rem;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  margin-bottom: 12px;
  outline: none;
}

.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--accent); }

.comment-form textarea { min-height: 120px; resize: vertical; }

.comment-form .submit {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--cream);
  border: none;
  padding: 10px 24px;
  cursor: pointer;
  transition: background 0.15s;
}
.comment-form .submit:hover { background: var(--accent); }

/* ─────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────── */
#secondary {
  padding-top: 48px;
  font-family: var(--sans);
}

.widget {
  margin-bottom: 36px;
}

.widget-title {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
  margin-bottom: 14px;
}

.widget p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink-mid);
  margin-bottom: 10px;
}

.widget a {
  color: var(--link);
  font-size: 0.82rem;
  text-decoration: none;
}
.widget a:hover { color: var(--accent); text-decoration: underline; }

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

.widget ul li {
  font-size: 0.8rem;
  color: var(--ink-mid);
  padding: 3px 0;
}
.widget ul li a {
  color: var(--ink-mid);
  font-size: 0.8rem;
}
.widget ul li a:hover { color: var(--accent); }

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
.site-footer {
  border-top: 2px solid var(--ink);
  margin-top: 60px;
  background: var(--ink);
  color: var(--cream);
}

.footer-collage {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  font-family: var(--sans);
}

.footer-block h5 {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 10px;
}

.footer-block p {
  font-size: 0.78rem;
  line-height: 1.6;
  color: #a8a59e;
  margin-bottom: 6px;
}

.footer-block p a {
  color: #c8c5be;
  text-decoration: none;
}
.footer-block p a:hover { color: var(--cream); }

.footer-block .footer-stat {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--cream);
  line-height: 1;
  margin-bottom: 4px;
  font-family: var(--serif);
}

.footer-bottom {
  border-top: 1px solid #2e2e2b;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--ink-light);
}

.footer-bottom a {
  color: var(--ink-light);
  text-decoration: none;
}
.footer-bottom a:hover { color: var(--cream); }

/* ─────────────────────────────────────────
   PAGES (About, Archives, etc.)
───────────────────────────────────────── */
.page .entry-title { font-size: 1.8rem; margin-bottom: 24px; }

/* Archives list */
.archive-list { list-style: none; padding: 0; }
.archive-list li {
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
  display: flex;
  gap: 16px;
  align-items: baseline;
}
.archive-list .archive-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-light);
  white-space: nowrap;
  min-width: 90px;
}
.archive-list .archive-title a {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.archive-list .archive-title a:hover { color: var(--accent); }
.archive-list .archive-cat {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 2px;
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 960px) {
  .page-wrap {
    grid-template-columns: 1fr;
  }
  #secondary {
    padding-top: 0;
    border-top: 1px solid var(--rule);
    margin-top: 48px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
  }
  .footer-collage { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  html { font-size: 16px; }
  .header-inner, .page-wrap, .footer-bottom { padding-left: 20px; padding-right: 20px; }
  .footer-collage { grid-template-columns: 1fr; padding-left: 20px; padding-right: 20px; }
  nav a { font-size: 0.72rem; padding-right: 12px; }
  .callout-card dl { grid-template-columns: 1fr; }
  .menu-toggle { display: block; }
  .main-navigation { display: none; }
  .main-navigation.toggled { display: block; }
  .main-navigation ul { flex-direction: column; }
  #secondary { grid-template-columns: 1fr; }
  .entry-title { font-size: 1.3rem; }
  .single .entry-title { font-size: 1.5rem; }
}

/* ─────────────────────────────────────────
   SEARCH FORM
───────────────────────────────────────── */
.search-form {
  display: flex;
  gap: 0;
  margin: 16px 0;
}

.search-field {
  flex: 1;
  padding: 8px 12px;
  font-family: var(--sans);
  font-size: 0.85rem;
  border: 1px solid var(--rule);
  border-right: none;
  background: #fff;
  color: var(--ink);
  outline: none;
  min-width: 0;
}
.search-field:focus { border-color: var(--accent); }

.search-submit {
  padding: 8px 16px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--cream);
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.search-submit:hover { background: var(--accent); border-color: var(--accent); }

/* ─────────────────────────────────────────
   FULL ARCHIVES PAGE (page-archives.php)
───────────────────────────────────────── */
.archive-year-group { margin-bottom: 8px; }

.archive-year-heading {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-light);
  padding: 28px 0 8px;
  border-bottom: 1px solid var(--rule);
}

.archive-list li {
  gap: 20px;
  align-items: baseline;
}

.archive-item-body { flex: 1; min-width: 0; }

.archive-item-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 2px;
}

.archive-tagline {
  font-family: var(--serif);
  font-size: 0.72rem;
  font-style: italic;
  color: var(--ink-light);
}

/* ─────────────────────────────────────────
   STICKY HEADER SCROLLED STATE
───────────────────────────────────────── */
.site-header.scrolled .site-brand {
  margin-bottom: 10px;
}
.site-header.scrolled .site-description {
  display: none;
}

/* ─────────────────────────────────────────
   SCREEN READER TEXT (WP accessibility)
───────────────────────────────────────── */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  clip: auto !important;
  height: auto;
  left: 5px;
  top: 5px;
  width: auto;
  z-index: 100000;
  background: #fff;
  padding: 8px 16px;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink);
}

/* ─────────────────────────────────────────
   WP CORE ALIGNMENT CLASSES
───────────────────────────────────────── */
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.alignwide { margin-left: -40px; margin-right: -40px; }

@media (max-width: 640px) {
  .alignleft, .alignright { float: none; margin: 16px 0; }
  .alignwide { margin-left: 0; margin-right: 0; }
}

/* ─────────────────────────────────────────
   WP CAPTION / GALLERY
───────────────────────────────────────── */
.wp-caption { max-width: 100%; }
.wp-caption-text {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--ink-light);
  font-style: italic;
  margin-top: 6px;
}

.gallery { display: grid; gap: 8px; }
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-item img { width: 100%; height: auto; display: block; }
