/*
Theme Name: PlateBird
Theme URI: https://platebird.app
Author: PlateBird
Author URI: https://platebird.app
Description: Calorie tracking that feels like writing a quick note. Official PlateBird landing page theme.
Version: 1.1.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: platebird
*/

/* ═══════════════════════════════════════════
   DESIGN SYSTEM — CSS Variables
   ═══════════════════════════════════════════ */
:root {
  --linen: #FAF6F0;
  --cream: #FFFDF8;
  --ink: #1A1612;
  --ink-soft: #3D3630;
  --ink-muted: #7A7067;
  --ink-faint: #B5ADA4;
  --ink-ghost: #DDD7CF;
  --ink-whisper: #EDE9E3;
  --ember: #E86A33;
  --ember-deep: #c2410c;
  --ember-soft: #FFF0E8;
  --ember-glow: rgba(232,106,51,0.1);
  --sage: #5B7A5E;
  --sky: #4A7DB5;
  --plum: #8B6AAE;
  --shadow-sm: 0 1px 3px rgba(26,22,18,0.06);
  --shadow-md: 0 4px 16px rgba(26,22,18,0.08);
  --serif: 'Instrument Serif', serif;
  --sans: 'Satoshi', sans-serif;
  --app: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px;
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--linen);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}
.apple-icon { width: 15px; height: 15px; display: inline-block; vertical-align: -1px; fill: currentColor; margin-right: 2px; }

/* ═══════════════════════════════════════════
   TYPOGRAPHY SCALE
   ═══════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.03em; }
h2 { font-size: clamp(26px, 3.5vw, 38px); line-height: 1.1; }
h3 { font-size: clamp(20px, 2.5vw, 26px); }
h4 { font-size: 20px; }
h5 { font-size: 18px; }
h6 { font-size: 16px; }
h1 em, h2 em, h3 em { font-style: italic; color: var(--ember); }

p {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink-muted);
  line-height: 1.7;
  margin-bottom: 1.25em;
}
a { color: var(--ember); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--ember-deep); }
ul, ol { margin: 0 0 1.25em 1.5em; color: var(--ink-muted); font-size: 16px; line-height: 1.7; }
li { margin-bottom: 0.35em; }
blockquote {
  border-left: 3px solid var(--ember);
  padding: 20px 28px;
  margin: 0 0 1.5em;
  background: var(--cream);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-family: var(--serif);
  font-size: 19px;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.6;
}
blockquote p { color: var(--ink-soft); font-family: var(--serif); font-size: inherit; }
blockquote p:last-child { margin-bottom: 0; }
img { max-width: 100%; height: auto; border-radius: var(--r-md); }
hr {
  border: none;
  height: 1px;
  background: var(--ink-whisper);
  margin: 2.5em 0;
}
pre, code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 14px;
}
pre {
  background: var(--ink);
  color: #e7e5e4;
  padding: 20px 24px;
  border-radius: var(--r-md);
  overflow-x: auto;
  margin-bottom: 1.5em;
  line-height: 1.6;
}
code {
  background: var(--ember-soft);
  color: var(--ember-deep);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
pre code { background: none; color: inherit; padding: 0; border-radius: 0; }
figure { margin: 0 0 1.5em; }
figcaption { font-size: 13px; color: var(--ink-faint); text-align: center; margin-top: 8px; }
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 15px;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--ink-whisper);
}
th {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════
   BUTTON SYSTEM
   ═══════════════════════════════════════════ */
.btn-dark {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--cream);
  padding: 14px 32px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 700; text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
  box-shadow: var(--shadow-sm); border: none; cursor: pointer; font-family: var(--sans);
}
.btn-dark:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(26,22,18,0.18); color: var(--cream); }
.btn-ember {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ember); color: white;
  padding: 14px 32px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 700; text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 4px 24px rgba(232,106,51,0.3);
  border: none; cursor: pointer; font-family: var(--sans);
}
.btn-ember:hover { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(232,106,51,0.4); color: white; }

/* ═══════════════════════════════════════════
   NAV — Fixed bar
   ═══════════════════════════════════════════ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250,246,240,0.85);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid rgba(26,22,18,0.04);
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 56px);
}
.nav-brand {
  text-decoration: none; color: var(--ink);
  font-family: var(--app); font-size: 16px; font-weight: 700;
  letter-spacing: -0.4px; flex-shrink: 0;
}
.nav-brand:hover { color: var(--ink); }
.nav-dl {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink); color: var(--cream);
  padding: 8px 20px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 13px; text-decoration: none;
  font-family: var(--sans);
  transition: all 0.2s; flex-shrink: 0; white-space: nowrap;
}
.nav-dl:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); color: var(--cream); }
body.single-post .site-nav {
  background: rgba(255,253,248,0.9);
  border-bottom: 1px solid var(--ink-whisper);
}
.nav-left { display: flex; align-items: center; gap: 32px; }
.nav-sep { width: 1px; height: 20px; background: var(--ink-whisper); }
.breadcrumb { font-size: 13px; color: var(--ink-faint); }
.breadcrumb a { color: var(--ink-faint); text-decoration: none; }
.breadcrumb a:hover { color: var(--ember); }
.breadcrumb span { margin: 0 6px; opacity: 0.5; }

/* ═══════════════════════════════════════════
   CONTENT WRAPPER — pages & posts
   ═══════════════════════════════════════════ */
.content-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 120px clamp(20px, 5vw, 56px) 80px;
}
.content-wrapper > *:last-child { margin-bottom: 0; }
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.alignfull { max-width: none; width: 100vw; position: relative; left: 50%; transform: translateX(-50%); }

/* ═══════════════════════════════════════════
   BLOG — Reading progress bar
   ═══════════════════════════════════════════ */
body.single-post { background: var(--cream); }
.progress-track {
  position: fixed; top: 60px; left: 0; right: 0;
  height: 2px; background: var(--ink-whisper);
  z-index: 99;
}
.progress-fill {
  height: 100%; width: 0%;
  background: var(--ember);
  transition: width 0.1s;
}

/* ═══════════════════════════════════════════
   BLOG — Article header (Design 3: Refined)
   ═══════════════════════════════════════════ */
.article-header {
  max-width: 680px;
  margin: 0 auto;
  padding: 108px 24px 0;
  text-align: center;
}
.category-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  background: var(--ink);
  border-radius: 6px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--cream);
  margin-bottom: 24px;
  text-decoration: none;
  transition: all 0.15s;
}
.category-badge:hover { background: var(--ink-soft); color: var(--cream); }
.category-badge .dot {
  width: 5px; height: 5px;
  background: var(--ember);
  border-radius: 50%;
}
.article-title {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 18px;
}
.article-subtitle {
  font-size: 18px;
  color: var(--ink-muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 28px;
}
.meta-row {
  display: flex; align-items: center; justify-content: center;
  gap: 20px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--ink-whisper);
}
.meta-row .meta-item {
  font-size: 13px; color: var(--ink-faint); font-weight: 500;
  display: flex; align-items: center; gap: 5px;
}
.meta-row .meta-item svg {
  width: 14px; height: 14px; opacity: 0.5;
}

/* ═══════════════════════════════════════════
   BLOG — Featured image
   ═══════════════════════════════════════════ */
.featured-image {
  max-width: 900px;
  margin: 40px auto 0;
  padding: 0 24px;
}
.featured-image .img-wrapper {
  border-radius: var(--r-xl);
  overflow: hidden;
}
.featured-image img {
  width: 100%; aspect-ratio: 21/9;
  object-fit: cover; display: block;
  border-radius: 0;
}

/* ═══════════════════════════════════════════
   BLOG — Article content
   ═══════════════════════════════════════════ */
.article-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 0;
}

/* Collapsible TOC */
.toc-box {
  background: var(--linen);
  border: 1px solid var(--ink-whisper);
  border-radius: var(--r-lg);
  margin-bottom: 40px;
  overflow: hidden;
}
.toc-toggle {
  width: 100%;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  background: none; border: none;
  cursor: pointer; font-family: var(--sans);
  font-size: 13px; font-weight: 600;
  color: var(--ink-soft);
}
.toc-toggle svg {
  width: 16px; height: 16px; color: var(--ink-faint);
  transition: transform 0.2s;
}
.toc-box.open .toc-toggle svg { transform: rotate(180deg); }
.toc-items {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease;
}
.toc-box.open .toc-items { max-height: 300px; }
.toc-items ol {
  list-style: none;
  padding: 0 24px 16px;
  counter-reset: toc;
  margin: 0;
}
.toc-items li {
  counter-increment: toc;
  margin-bottom: 8px;
}
.toc-items li a {
  font-size: 14px; color: var(--ink-muted);
  text-decoration: none;
  display: flex; align-items: baseline; gap: 10px;
  transition: color 0.15s;
}
.toc-items li a::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 11px; font-weight: 700;
  color: var(--ink-ghost);
  min-width: 18px;
}
.toc-items li a:hover { color: var(--ember); }
.toc-items li a:hover::before { color: var(--ember); }

/* Entry content prose */
.article-content .entry-content > p:first-child {
  font-size: 19px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.article-content .entry-content p {
  font-size: 16.5px;
  color: var(--ink-muted);
  line-height: 1.78;
  margin-bottom: 1.5em;
}
.article-content .entry-content h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 30px);
  color: var(--ink);
  margin: 3em 0 0.7em;
  letter-spacing: -0.02em;
  line-height: 1.15;
  scroll-margin-top: 80px;
}
.article-content .entry-content h3 {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  margin: 2em 0 0.5em;
  scroll-margin-top: 80px;
}
.article-content .entry-content h4 { margin: 1.8em 0 0.4em; }
.article-content .entry-content [id] { scroll-margin-top: 80px; }

/* Blockquote override for single posts */
.article-content .entry-content blockquote {
  margin: 2.5em -24px;
  padding: 28px 24px 28px 28px;
  background: var(--linen);
  border-left: 4px solid var(--ember);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.article-content .entry-content blockquote p {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.4;
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════
   BLOG — Post footer / nav
   ═══════════════════════════════════════════ */
.post-footer-area {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}
.footer-divider {
  height: 1px;
  background: var(--ink-whisper);
  margin: 48px 0 32px;
}
.tags-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 40px;
}
.tag {
  display: inline-block;
  padding: 5px 12px;
  background: var(--linen);
  border: 1px solid var(--ink-whisper);
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: all 0.15s;
}
.tag:hover {
  background: var(--ember-soft);
  border-color: var(--ember);
  color: var(--ember);
}
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 48px;
}
.post-nav-item {
  padding: 20px 24px;
  background: var(--linen);
  border: 1px solid var(--ink-whisper);
  border-radius: var(--r-lg);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
}
.post-nav-item:hover {
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(26,22,18,0.08);
  transform: translateY(-2px);
}
.post-nav-label {
  font-size: 11px; font-weight: 600;
  color: var(--ink-faint); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
}
.post-nav-title {
  font-family: var(--serif);
  font-size: 16px; color: var(--ink); line-height: 1.3;
}
.post-nav-item.next { text-align: right; }

/* ═══════════════════════════════════════════
   BLOG — Archive / listing cards
   ═══════════════════════════════════════════ */
.archive-header {
  text-align: center;
  margin-bottom: 48px;
}
.archive-header h1 {
  font-size: clamp(32px, 5vw, 46px);
  margin-bottom: 8px;
}
.archive-header p {
  font-size: 17px;
  max-width: 480px;
  margin: 0 auto;
}
.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.post-card {
  background: var(--cream);
  border: 1px solid var(--ink-whisper);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
  text-decoration: none;
  display: block;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.post-card-thumb {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover; display: block;
  border-radius: 0;
}
.post-card-body { padding: 24px; }
.post-card-meta {
  font-size: 12px; font-weight: 500;
  color: var(--ink-faint); margin-bottom: 8px;
  letter-spacing: 0.2px;
}
.post-card-title {
  font-family: var(--serif);
  font-size: 20px; color: var(--ink);
  line-height: 1.25; letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.post-card-excerpt {
  font-size: 14px; color: var(--ink-muted);
  line-height: 1.6; margin-bottom: 0;
}
.post-card-read {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: var(--ember);
  margin-top: 14px;
}
.post-card-read svg { transition: transform 0.15s; }
.post-card:hover .post-card-read svg { transform: translateX(3px); }

body.single-post .site-footer {
  max-width: 680px;
  padding-left: 24px; padding-right: 24px;
  border-top: 1px solid var(--ink-whisper);
  padding-top: 24px;
  margin-top: 0;
}

/* Two-column on wider screens */
@media (min-width: 640px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════ */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 4px;
  margin-top: 48px;
}
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  font-size: 14px; font-weight: 500;
  color: var(--ink-muted);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: all 0.15s;
}
.pagination .page-numbers:hover { background: var(--cream); color: var(--ink); }
.pagination .page-numbers.current {
  background: var(--ink); color: var(--cream); font-weight: 600;
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.site-footer {
  max-width: 1100px; margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px) 32px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--ink-faint);
}
.site-footer a { color: var(--ink-faint); text-decoration: none; }
.site-footer a:hover { color: var(--ink-muted); }
.f-links { display: flex; gap: 20px; }
.f-links .menu { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.f-links .menu li a { color: var(--ink-faint); text-decoration: none; font-size: 12px; }
.f-links .menu li a:hover { color: var(--ink-muted); }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .content-wrapper { padding: 100px 20px 60px; }
  .post-nav { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; gap: 10px; text-align: center; padding-bottom: 24px; }
  /* Single post responsive */
  .article-header { padding-top: 90px; }
  .meta-row { flex-wrap: wrap; gap: 12px; }
  .nav-left .nav-sep, .nav-left .breadcrumb { display: none; }
  .nav-dl { padding: 8px 14px; font-size: 12px; }
  .article-content .entry-content blockquote { margin-left: -24px; margin-right: -24px; border-radius: 0; }
}
