:root {
  --bg: #f7f2ea;
  --surface: #fffdf9;
  --ink: #2a211b;
  --muted: #7a6a5c;
  --line: #e6dccd;
  --accent: #8a4b22;
  --accent-dark: #5e3115;
  --gold: #c08a3e;
  --header: #2b1d14;
  --radius: 10px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

/* Header */
.site-header { background: var(--header); color: #f3e7d6; border-bottom: 3px solid var(--gold); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; color: #fff; line-height: 1.2; }
.brand:hover { text-decoration: none; color: #fff; }
.brand-name { font: 700 28px/1.1 var(--serif); letter-spacing: .5px; }
.brand-tag { font-size: 13px; color: var(--gold); text-transform: uppercase; letter-spacing: 1.5px; margin-top: 4px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.main-nav a { color: #f3e7d6; font-size: 15px; font-weight: 600; padding: 4px 0; }
.main-nav a:hover { color: var(--gold); text-decoration: none; }
.search-link { border: 1px solid rgba(243,231,214,.35); border-radius: 999px; padding: 4px 12px !important; }

main.wrap { padding-top: 32px; padding-bottom: 48px; min-height: 60vh; }

/* Hero and archive headers */
.hero { text-align: center; padding: 18px 0 34px; }
.hero h1 { font: 700 clamp(30px, 4.5vw, 46px)/1.15 var(--serif); margin: 0 0 12px; }
.hero p { color: var(--muted); max-width: 680px; margin: 0 auto; font-size: 18px; }
.archive-header { margin-bottom: 28px; }
.archive-header h1, .page-title { font: 700 38px/1.2 var(--serif); margin: 0; }
.archive-header p { color: var(--muted); margin: 6px 0 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.5px; font-size: 12px; color: var(--gold) !important; font-weight: 700; margin: 0 0 4px !important; }

/* Listing */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; align-items: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(60, 35, 15, .12); }
.card-img { display: block; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #5e3115, #c08a3e); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.placeholder { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: rgba(255,255,255,.85); font: 700 64px var(--serif); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card-meta { font-size: 13px; color: var(--muted); }
.card h2 { font: 700 20px/1.3 var(--serif); margin: 4px 0 8px; }
.card h2 a { color: var(--ink); }
.card p { font-size: 15px; color: #4d4036; margin: 0 0 12px; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; background: #f1e6d6; color: var(--accent-dark); padding: 2px 9px; border-radius: 999px; }
a.tag:hover { background: var(--accent); color: #fff; text-decoration: none; }

.sidebar section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.sidebar h3 { font: 700 18px var(--serif); margin: 0 0 10px; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.cat-list li:last-child { border-bottom: 0; }
.cat-list span { color: var(--muted); font-size: 13px; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 36px; font-weight: 600; }
.pagination span { color: var(--muted); font-weight: 400; }

/* Post */
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 820px; margin: 0 auto; padding: 40px clamp(20px, 5vw, 56px); }
.post-header { margin-bottom: 26px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.post-header h1 { font: 700 clamp(28px, 4vw, 40px)/1.2 var(--serif); margin: 10px 0 8px; }
.post-header time { color: var(--muted); font-size: 15px; }
.post-hero { display: block; width: 100%; max-height: 520px; object-fit: cover; border-radius: 6px; margin-bottom: 28px; }
.content { overflow-wrap: break-word; }
.content::after { content: ""; display: block; clear: both; }
.content h2, .content h3, .content h4 { font-family: var(--serif); line-height: 1.3; margin: 1.6em 0 .5em; }
.content h2 { font-size: 26px; color: var(--accent-dark); }
.content h3 { font-size: 21px; }
.content p { margin: 0 0 1.1em; }
.content img { border-radius: 6px; }
.content blockquote { margin: 1.2em 0; padding: 4px 20px; border-left: 4px solid var(--gold); color: #4d4036; font-style: italic; }
.content table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 15px; }
.content td, .content th { border: 1px solid var(--line); padding: 6px 10px; }
.alignleft { float: left; margin: 4px 22px 12px 0; }
.alignright { float: right; margin: 4px 0 12px 22px; }
.aligncenter { display: block; margin: 12px auto; }
.wp-caption { max-width: 100%; margin-top: 4px; margin-bottom: 16px; }
.wp-caption.aligncenter { text-align: center; }
.wp-caption figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
figure.alignnone { margin: 0 0 16px; }
.video { position: relative; aspect-ratio: 16 / 9; margin: 1.2em 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 6px; }
.content iframe { max-width: 100%; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 1.2em 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }

.post-nav { max-width: 820px; margin: 24px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-nav a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; font-family: var(--serif); font-weight: 700; color: var(--ink); }
.post-nav a:hover { border-color: var(--accent); text-decoration: none; }
.post-nav small { display: block; font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.post-nav .next { text-align: right; }

/* Search & 404 */
.search-form { display: flex; gap: 10px; margin: 20px 0; max-width: 640px; }
.search-form input { flex: 1; font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.search-form button, .button { font: 600 15px var(--sans); background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 20px; cursor: pointer; display: inline-block; }
.search-form button:hover, .button:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.results { display: grid; gap: 14px; max-width: 800px; }
.result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.result h2 { font: 700 19px/1.3 var(--serif); margin: 0 0 4px; }
.result p { margin: 4px 0 0; font-size: 15px; color: #4d4036; }
.not-found { text-align: center; padding: 60px 0; }
.not-found h1 { font: 700 40px var(--serif); }

/* Footer */
.site-footer { background: var(--header); color: #b9a58e; font-size: 14px; padding: 22px 0; text-align: center; }
.site-footer p { margin: 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .alignleft, .alignright { float: none; display: block; margin: 12px auto; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
}
