:root {
  --red: #b3261e;
  --red-dark: #8c1d17;
  --ink: #1f1f22;
  --text: #3a3a3f;
  --muted: #6e6e75;
  --line: #e6e4e1;
  --paper: #ffffff;
  --paper-2: #f7f5f2;
  --max: 1180px;
  --read: 720px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--paper); line-height: 1.6; font-size: 16px; }
img { max-width: 100%; height: auto; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
h1, h2, h3, h4, h5 { font-family: "Literata", Georgia, serif; color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--red); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; color: #fff; }

/* Header */
.site-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { color: #fff; text-decoration: none; font-family: "Literata", Georgia, serif; font-weight: 600; font-size: 24px; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; }
.brand:hover { color: #fff; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(179,38,30,.3); }
.nav-toggle { display: none; background: none; border: 1px solid #4a4a50; border-radius: 4px; padding: 8px 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav a { display: block; padding: 8px 14px; color: #e9e9ec; text-decoration: none; font-weight: 500; font-size: 15px; border-radius: 4px; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: rgba(255,255,255,.08); color: #fff; }
.main-nav a.ext::after { content: " \2197"; font-size: 12px; opacity: .8; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); border-top: 1px solid #333; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 8px 16px 16px; }
}

/* Hero (home) */
.hero { background: var(--paper-2); border-bottom: 1px solid var(--line); }
.hero .banner { display: block; width: 100%; height: auto; aspect-ratio: 1495 / 483; object-fit: cover; background: #ddd; }
.hero .intro { padding: 34px 0 38px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4.4vw, 46px); margin: 0 0 6px; }
.hero p { margin: 0; font-size: 18px; color: var(--muted); max-width: 640px; }
@media (max-width: 700px) { .hero .intro { grid-template-columns: 1fr; } }

.btn { display: inline-block; background: var(--red); color: #fff; text-decoration: none; padding: 11px 22px; border-radius: 4px; font-weight: 600; font-size: 15px; border: 0; cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--red-dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--red); color: var(--red); background: transparent; }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding: 44px 16px 64px; }
.layout > * { min-width: 0; }
@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 40px; } }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: clamp(28px, 3.6vw, 40px); margin: 0; }
.page-head p { color: var(--muted); margin: 6px 0 0; }

/* Post cards */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-decoration: none; color: var(--text); transition: box-shadow .2s ease, transform .2s ease; }
.card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.08); transform: translateY(-2px); color: var(--text); }
.card .thumb { aspect-ratio: 3 / 2; background: var(--paper-2) center / cover no-repeat; display: block; width: 100%; object-fit: cover; }
.card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card .cat { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--red); margin: 0 0 6px; }
.card h2 { font-size: 21px; margin: 0 0 8px; }
.card time { font-size: 14px; color: var(--muted); }
.card p { margin: 10px 0 0; font-size: 15px; color: var(--muted); }
.card[hidden] { display: none; }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }
.load-more { text-align: center; margin-top: 30px; }

/* Single post */
.post-meta { font-size: 14px; color: var(--muted); margin: 0 0 4px; }
.post-meta a { color: var(--red); text-decoration: none; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.post-title { font-size: clamp(30px, 4.2vw, 44px); margin: 0 0 6px; }
.post-date { color: var(--muted); margin: 0 0 30px; }
.entry { font-family: "Literata", Georgia, serif; font-size: 18.5px; line-height: 1.75; color: #2d2d31; max-width: var(--read); }
.entry p { margin: 0 0 1.1em; }
.entry h2, .entry h3, .entry h4, .entry h5 { margin-top: 1.4em; }
.entry ul, .entry ol { padding-left: 24px; margin: 0 0 1.1em; }
.entry blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--red); color: #4d4d52; font-style: italic; }
.entry a { word-break: break-word; }
.entry hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.entry img { border-radius: 4px; display: block; }
.entry figure { margin: 1.6em 0; font-family: "Inter", system-ui, sans-serif; }
.entry figure img { margin: 0 auto; }
.entry figcaption { font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 8px; text-align: center; }
.entry .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.entry .alignright { float: right; margin: .3em 0 1em 1.6em; max-width: 45%; }
.entry .alignleft { float: left; margin: .3em 1.6em 1em 0; max-width: 45%; }
.entry .alignright figcaption, .entry .alignleft figcaption { text-align: left; }
.entry::after { content: ""; display: table; clear: both; }
@media (max-width: 560px) { .entry .alignright, .entry .alignleft { float: none; max-width: 100%; margin: 1.4em 0; } }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); max-width: var(--read); }
.post-nav a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); }
.post-nav a:hover { border-color: var(--red); }
.post-nav small { display: block; color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.post-nav .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { grid-column: 1; text-align: left; } }

/* Sidebar */
.sidebar .widget { margin-bottom: 34px; }
.sidebar h3 { font-family: "Inter", system-ui, sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--red); display: inline-block; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.sidebar li a { color: var(--ink); text-decoration: none; }
.sidebar li a:hover, .sidebar li a[aria-current="page"] { color: var(--red); }
.sidebar li small { display: block; color: var(--muted); font-size: 13px; }
.sidebar .count { float: right; color: var(--muted); font-size: 13px; }
.search-form { display: flex; gap: 8px; }
.search-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #d6d3cf; border-radius: 4px; font: inherit; font-size: 15px; }
.search-form input:focus { outline: 2px solid #f0b7b2; border-color: var(--red); }
.search-form button { padding: 10px 14px; }

/* Search results */
.results { list-style: none; padding: 0; margin: 0; }
.results li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.results a { font-family: "Literata", Georgia, serif; font-size: 21px; font-weight: 600; color: var(--ink); text-decoration: none; }
.results a:hover { color: var(--red); }
.results time { display: block; color: var(--muted); font-size: 14px; margin: 2px 0 6px; }
.results p { margin: 0; color: var(--text); }
.results mark { background: #fde2df; color: inherit; padding: 0 2px; border-radius: 2px; }

/* Contact */
form label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px; color: var(--ink); }
form .req { color: var(--red); }
.contact-form input, .contact-form textarea { width: 100%; padding: 12px; border: 1px solid #d6d3cf; border-radius: 4px; font: inherit; font-size: 16px; margin-bottom: 18px; background: var(--paper); }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid #f0b7b2; border-color: var(--red); }
.contact-form textarea { min-height: 170px; resize: vertical; }
.form-note { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

/* Footer */
.site-footer { background: var(--ink); color: #b9b9c0; padding: 30px 0; font-size: 14.5px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.site-footer a { color: #e9e9ec; text-decoration: none; margin-right: 18px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
