:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-alt: #f2ebe1;
  --ink: #231c18;
  --ink-muted: #62564e;
  --accent: #9e3f28;
  --accent-dark: #7d2e1c;
  --border: #e4dad0;
  --radius: 12px;
  --shadow: 0 3px 14px rgba(35, 28, 24, 0.06);
  --max: 1680px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(14px, 2.2vw, 32px);
}

/* Unified Compact Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 246, 240, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 6px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.brand::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 3px;
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 18'%3E%3Crect x='0.75' y='0.75' width='28.5' height='16.5' rx='2' fill='%239e3f28' stroke='%237d2e1c' stroke-width='1.2'/%3E%3Crect x='4' y='4' width='22' height='10' rx='1' fill='none' stroke='%23f5e5dc' stroke-opacity='0.75' stroke-width='1' stroke-dasharray='2 1.5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  box-shadow: 0 1px 3px rgba(35, 28, 24, 0.18);
}
.brand:hover { text-decoration: none; }
.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 0.74rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.nav a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: var(--surface-alt); text-decoration: none; }
.nav a.active { background: var(--accent); color: #ffffff; }

/* Warm Brick Hero Banner */
.hero {
  background-color: #3a1f16;
  background-image:
    linear-gradient(180deg, rgba(28, 16, 12, 0.44) 0%, rgba(26, 14, 10, 0.68) 60%, rgba(19, 10, 8, 0.88) 100%),
    url("/assets/brick-hero.svg");
  background-size: cover, 360px auto;
  background-position: center, center;
  background-repeat: no-repeat, repeat;
  border-bottom: 3px solid var(--accent-dark);
  color: #ffffff;
  padding: 28px 0 26px;
}
.hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
}
.hero-copy { flex: 1 1 500px; }
.hero-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #f4c9a8;
  margin-bottom: 5px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  line-height: 1.18;
  margin: 0 0 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.hero p {
  color: rgba(255, 250, 244, 0.9);
  font-size: 0.97rem;
  margin: 0;
  max-width: 720px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; flex-shrink: 0; }

/* Buttons & Pills */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost {
  background: rgba(255, 250, 244, 0.14);
  color: #ffffff;
  border-color: rgba(255, 250, 244, 0.34);
  backdrop-filter: blur(4px);
}
.btn-ghost:hover { background: rgba(255, 250, 244, 0.24); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-outline:hover { background: var(--surface-alt); }
.btn-sm { padding: 6px 13px; font-size: 0.86rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Tight Sections */
.section { padding: 20px 0; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.section-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  margin: 0;
  color: var(--ink);
}
.section-sub { color: var(--ink-muted); margin: 2px 0 0; font-size: 0.94rem; }

/* Search & Filter Bar */
.feed-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  max-width: 420px;
}
.search-input {
  width: 100%;
  padding: 9px 66px 9px 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2362564e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 13px center no-repeat;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.93rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(158, 63, 40, 0.14);
}
.search-clear {
  position: absolute;
  right: 8px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.search-clear:hover {
  background: var(--border);
  color: var(--ink);
}
.search-summary {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-bottom: 14px;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill:hover { border-color: var(--accent); color: var(--accent-dark); text-decoration: none; }
.pill.active { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.pill-count { font-size: 0.78rem; opacity: 0.8; }

/* Fluid Multi-Column Post Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(35, 28, 24, 0.11);
}
.card-cover {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  background: var(--surface-alt);
}
.card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f5e5dc;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 600;
}
.card-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  line-height: 1.28;
  margin: 0 0 8px;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent-dark); text-decoration: none; }
.card-excerpt {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin: 0 0 12px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--ink-muted);
}

/* Fluid Full-Width Single Post Layout (2-Column Desktop) */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
  padding: 20px 0 36px;
}
.post-main { min-width: 0; }
.post-sidebar {
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.sidebar-box h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  margin: 0 0 10px;
}
.breadcrumb { font-size: 0.88rem; color: var(--ink-muted); margin-bottom: 10px; }
.post-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.8vw, 2.3rem);
  line-height: 1.2;
  margin: 0 0 10px;
}
.post-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.post-cover-wrap {
  margin: 0 0 18px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  max-height: 360px;
  background: var(--surface-alt);
}
.post-cover-wrap img { width: 100%; max-height: 360px; object-fit: cover; }
.post-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(18px, 2.5vw, 32px);
  box-shadow: var(--shadow);
  font-size: 1.02rem;
  line-height: 1.72;
}
.post-content p { margin: 0 0 0.95em; }
.post-content p:last-child { margin-bottom: 0; }
.post-content h2, .post-content h3 {
  font-family: Georgia, "Times New Roman", serif;
  margin: 1.2em 0 0.5em;
}
.post-content figure { margin: 14px 0; text-align: center; }
.post-content img {
  margin: 10px auto;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(35, 28, 24, 0.1);
  max-height: 460px;
  width: auto;
  object-fit: contain;
  cursor: zoom-in;
}

/* Horizontal Multi-Column Photo Grid inside Posts */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin: 18px 0;
  align-items: start;
}
.photo-strip figure {
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
}
.photo-strip img {
  margin: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: none;
  max-height: none;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 32, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.like-btn[aria-pressed="true"] {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Related list in sidebar */
.related-mini {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.related-mini a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
}
.related-mini a:hover { background: var(--surface-alt); text-decoration: none; }

/* Comments */
.comments-section { margin-top: 24px; }
.comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.comment-form textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  margin-bottom: 10px;
}
.comment-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.comment-meta { font-size: 0.84rem; color: var(--ink-muted); margin-bottom: 4px; }

/* Info / Heritage Cards */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.info-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  margin: 0 0 8px;
  font-size: 1.18rem;
}
.info-card p { margin: 0 0 14px; color: var(--ink-muted); font-size: 0.94rem; flex: 1; }
.info-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.status-box {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  color: var(--ink-muted);
}
.load-more-wrap { text-align: center; margin-top: 22px; }

/* Footer */
.site-footer {
  margin-top: 40px;
  padding: 24px 0;
  border-top: 3px solid var(--accent);
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-size: 0.88rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

@media (max-width: 980px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { position: static; }
}
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .brand-sub { display: none; }
  .search-wrap { max-width: 100%; }
  .photo-strip { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
}