/* ============================================
   chévere — theme extracted from itschevere.substack.com
   bg #f7f3ed · brown #5e4432 · skeleton #e8e4df · border #d6d2cd
   headings: Playfair Display · ui: system sans · icons: Lucide
   ============================================ */

:root {
  --bg: #f7f3ed;
  --brown: #5e4432;
  --brown-dark: #4d3829;
  --ink: #3d3830;
  --text: #4e4d4b;
  --gray: #757575;
  --gray-soft: #8e8c88;
  --skeleton: #e8e4df;
  --border: #e8e4df;
  --border-strong: #d6d2cd;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  background: var(--bg);
  font-family: var(--sans);
  color: var(--text);
  min-height: 100%;
}

/* subtle editorial texture on the homepage only */
body.home { background: var(--bg); }

a { text-decoration: none; color: inherit; }
button { background: none; border: none; cursor: pointer; padding: 0; font-family: var(--sans); }

/* ---------- header ---------- */
.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 164px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-logo img {
  width: 296px;
  max-width: 60vw;
  height: auto;
  display: block;
}

.header-actions {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 26px;
}
.header-actions button,
.header-actions a {
  color: #4e4d4b;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  transition: background .15s ease, color .15s ease;
}
.header-actions button:hover,
.header-actions a:hover {
  background: rgba(94, 68, 50, 0.08);
  color: var(--brown);
}
.header-actions svg { width: 21px; height: 21px; }
.header-actions .tiktok-icon { width: 19px; height: 19px; }

/* search backdrop */
body.search-open::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 55;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* search panel */
.search-panel {
  position: absolute;
  left: 50%;
  top: calc(100% + 1px);
  transform: translateX(-50%) translateY(-8px);
  width: min(580px, calc(100vw - 24px));
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  padding: 16px 16px 8px;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .22s ease;
}
.search-panel--open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.search-panel--closing {
  opacity: 0;
  transform: translateX(-50%) translateY(-4px);
  pointer-events: none;
}

/* search bar input row */
.search-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0 4px 0 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-bar-wrap:focus-within {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(94, 68, 50, 0.1);
}
.search-bar-icon {
  flex-shrink: 0;
  color: #b0ada8;
  width: 20px;
  height: 20px;
}
.search-bar-wrap input {
  flex: 1;
  min-width: 0;
  font-family: var(--sans);
  font-size: 16px;
  padding: 13px 10px;
  background: none;
  border: none;
  color: var(--ink);
  outline: none;
}
.search-bar-wrap input::-webkit-input-placeholder { color: #b0ada8; }
.search-bar-wrap input::-moz-placeholder { color: #b0ada8; }
.search-bar-wrap input:-ms-input-placeholder { color: #b0ada8; }

.search-action-btn,
.search-close-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--gray-soft);
  transition: background .12s ease, color .12s ease;
}
.search-action-btn:hover,
.search-close-btn:hover {
  background: rgba(94, 68, 50, 0.08);
  color: var(--brown);
}
.search-action-btn svg,
.search-close-btn svg {
  width: 20px;
  height: 20px;
}

/* results */
.search-results { margin-top: 4px; max-height: 360px; overflow-y: auto; }
.search-hit {
  display: flex;
  flex-direction: column;
  padding: 12px 12px;
  border-radius: 10px;
  transition: background .12s ease;
  text-decoration: none;
}
.search-hit:hover { background: rgba(94, 68, 50, 0.06); }
.search-hit + .search-hit { margin-top: 1px; }
.search-hit-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-soft);
}
.search-hit-title {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin-top: 2px;
  transition: color .15s ease;
}
.search-hit:hover .search-hit-title { color: var(--brown); }
.search-note {
  padding: 18px 12px 10px;
  font-size: 14px;
  color: #5f5c56;
}
.search-panel .search-spinner {
  display: flex;
  justify-content: center;
  padding: 20px 0 10px;
  gap: 5px;
}
.search-panel .search-spinner span {
  width: 7px;
  height: 7px;
  background: var(--brown);
  border-radius: 50%;
  animation: searchBounce 0.6s infinite alternate;
}
.search-panel .search-spinner span:nth-child(2) { animation-delay: 0.15s; }
.search-panel .search-spinner span:nth-child(3) { animation-delay: 0.3s; }
@keyframes searchBounce {
  from { transform: translateY(0); opacity: 0.4; }
  to   { transform: translateY(-8px); opacity: 1; }
}

/* ---------- nav ---------- */
.site-nav {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 44px;
  height: 73px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.site-nav > a,
.site-nav .nav-item > a {
  display: flex;
  align-items: center;
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s ease;
}
.site-nav > a:hover,
.site-nav .nav-item > a:hover { color: #1c1a17; }
.site-nav > a.active,
.site-nav .nav-item > a.active {
  font-weight: 700;
  color: #1c1a17;
  border-bottom-color: #1c1a17;
}

/* nav dropdown */
.nav-item { position: relative; display: flex; }
.nav-item .chev {
  width: 14px;
  height: 14px;
  margin-left: 6px;
  margin-top: 2px;
  transition: transform .15s ease;
}
.nav-item:hover .chev { transform: rotate(180deg); }
.dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 196px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  padding: 10px 0;
  display: none;
  z-index: 50;
}
.nav-item:hover .dropdown,
.nav-item.open .dropdown,
.nav-item:focus-within .dropdown { display: block; }
.dropdown a {
  display: block;
  padding: 10px 24px;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.dropdown a:hover {
  color: var(--brown);
  background: rgba(94, 68, 50, 0.06);
}
.dropdown a:first-child {
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  padding-bottom: 12px;
}

/* ---------- newsletter popup ---------- */
.newsletter-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 12px)) scale(0.96);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.12);
  padding: 36px 36px 38px;
  max-width: min(420px, calc(100vw - 32px));
  width: 100%;
  text-align: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .22s ease;
}
.newsletter-popup--visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.newsletter-popup h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
}
.newsletter-popup p {
  margin-top: 8px;
  font-size: 15px;
  color: #5f5c56;
  line-height: 1.5;
}
.newsletter-popup-signoff {
  margin-top: 14px;
  font-size: 14px;
  color: var(--gray-soft);
  font-style: italic;
}
body.popup-open::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 199;
  animation: fadeIn .2s ease;
}
.newsletter-popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--gray-soft);
  border-radius: 50%;
  transition: background .12s ease, color .12s ease;
}
.newsletter-popup-close:hover {
  background: rgba(94, 68, 50, 0.08);
  color: var(--brown);
}

/* ---------- home layout ---------- */
.home-main {
  display: grid;
  grid-template-columns: 484px minmax(0, 1fr) 484px;
  min-height: calc(100vh - 164px - 73px);
}

.side-col {
  padding: 40px 28px 40px 36px;
}
.side-col.right {
  border-left: 1px solid var(--border);
  padding: 40px 36px 40px 28px;
}
.center-col {
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 115px 48px 80px;
}

/* skeleton placeholders */
.skeleton-block {
  background: var(--skeleton);
  border-radius: 6px;
  width: 100%;
  max-width: 421px;
  height: 271px;
}
.skeleton-line {
  background: var(--skeleton);
  border-radius: 10px;
  height: 21px;
  margin-top: 19px;
}
.skeleton-line.w1 { width: 80%; max-width: 336px; margin-top: 42px; }
.skeleton-line.w2 { width: 90%; max-width: 380px; }
.skeleton-line.w3 { width: 50%; max-width: 211px; }

/* ---------- welcome post ---------- */
.post-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.post-subtitle {
  margin-top: 15px;
  font-size: clamp(17px, 2.5vw, 21px);
  font-weight: 400;
  color: #5f5c56;
}
.post-meta {
  margin-top: 24px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-soft);
  display: flex;
  align-items: center;
  gap: 7px;
}
.post-meta .dot { font-size: 14px; line-height: 1; }

.post-desc {
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.7;
  color: #5f5c56;
  max-width: 520px;
}
.home-buttons {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* ---------- home buttons ---------- */
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 13px 28px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary {
  background: var(--brown);
  color: var(--bg);
  border: 1px solid var(--brown);
}
.btn-primary:hover {
  background: var(--brown-dark);
  border-color: var(--brown-dark);
}
.btn-secondary {
  background: transparent;
  color: var(--brown);
  border: 1px solid var(--brown);
}
.btn-secondary:hover {
  background: var(--brown);
  color: var(--bg);
}

/* ---------- newsletter ---------- */
.newsletter {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 84px 24px 96px;
}
.newsletter h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 36px);
  color: var(--ink);
  margin-top: 12px;
}
.newsletter .newsletter-sub {
  margin-top: 12px;
  font-size: 17px;
  color: #5f5c56;
}
.newsletter form {
  margin-top: 30px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.newsletter input {
  width: min(360px, 100%);
  padding: 13px 16px;
  font-size: 15px;
  font-family: var(--sans);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  outline: none;
}
.newsletter input:focus { border-color: var(--brown); }
.newsletter button {
  padding: 13px 28px;
  background: var(--brown);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background .15s ease;
}
.newsletter button:hover { background: var(--brown-dark); }
.newsletter-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--gray-soft);
}

/* ---------- inner pages (about) ---------- */
.page-main {
  max-width: 700px;
  margin: 0 auto;
  padding: 72px 24px 120px;
  min-height: calc(100vh - 164px - 73px);
}
.page-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 5vw, 38px);
  color: var(--ink);
  margin-bottom: 18px;
}
.page-tagline {
  margin: -6px 0 30px;
  font-size: 18px;
  color: #5f5c56;
}
.page-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
}
.page-body p + p { margin-top: 16px; }
.page-body em { font-style: italic; }
.page-body strong { color: var(--ink); }

/* ---------- blog index ---------- */
.blog-main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 64px 36px 130px;
  min-height: calc(100vh - 164px - 73px);
}
.blog-head { text-align: center; }
.blog-head h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 44px);
  color: var(--ink);
}
.blog-head p {
  margin-top: 12px;
  font-size: 17px;
  color: #5f5c56;
}

.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 34px 0 54px;
}
.cat-pills button {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 9px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.cat-pills button:hover { border-color: var(--brown); color: var(--brown); }
.cat-pills button.active {
  background: var(--brown);
  border-color: var(--brown);
  color: var(--bg);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 52px 40px;
}
.post-card { display: block; }
.post-card.hidden { display: none; }
.post-card .thumb {
  background: var(--skeleton);
  border-radius: 4px;
  aspect-ratio: 3 / 2;
  margin-bottom: 18px;
}
.kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brown);
}
.post-card h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 23px;
  line-height: 1.25;
  color: var(--ink);
  margin-top: 9px;
  transition: color .15s ease;
}
.post-card:hover h2 { color: var(--brown); }
.post-card .dek {
  margin-top: 9px;
  font-size: 15px;
  line-height: 1.55;
  color: #5f5c56;
}
.post-card .date {
  margin-top: 11px;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-soft);
}

.post-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 44px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.post-card.featured .thumb {
  aspect-ratio: 16 / 9;
  margin-bottom: 0;
}
.post-card.featured h2 { font-size: 34px; margin-top: 12px; }
.post-card.featured .dek { font-size: 17px; margin-top: 12px; }

/* blog empty state */
.blog-empty {
  text-align: center;
  padding: 64px 20px 40px;
}
.blog-empty svg {
  width: 30px;
  height: 30px;
  color: var(--brown);
}
.blog-empty h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 27px;
  color: var(--ink);
  margin-top: 16px;
}
.blog-empty p {
  margin-top: 10px;
  font-size: 16px;
  color: #5f5c56;
}

/* ---------- responsive ---------- */
@media (max-width: 1380px) {
  .home-main { grid-template-columns: 340px minmax(0, 1fr) 340px; }
}

@media (max-width: 980px) {
  .home-main { grid-template-columns: 1fr; }
  .side-col { display: none; }
  .center-col { border-left: none; padding: 80px 32px 90px; }
  .header-actions { right: 18px; gap: 12px; }
  .site-nav { gap: 26px; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 30px; }
  .post-card.featured { grid-template-columns: 1fr; gap: 20px; }
  .post-card.featured h2 { font-size: 27px; }
}

@media (max-width: 620px) {
  .site-header { height: 116px; }
  .header-logo img { width: 210px; }
  .header-actions { right: 8px; gap: 2px; }
  .header-actions button,
  .header-actions a { width: 32px; height: 32px; }
  .header-actions svg { width: 19px; height: 19px; }
  .header-actions .tiktok-icon { width: 17px; height: 17px; }
  .search-panel { width: min(480px, calc(100vw - 16px)); padding: 12px 12px 6px; }
  .site-nav { height: 58px; gap: 20px; }
  .site-nav > a,
  .site-nav .nav-item > a { font-size: 15px; }
  .dropdown { min-width: 180px; }
  .dropdown a { padding: 10px 20px; font-size: 14px; }
  .center-col { padding: 60px 24px 70px; }
  .home-main { min-height: calc(100vh - 407px - 58px); }
  .newsletter { padding: 48px 20px 76px; }
  .page-main { padding: 52px 20px 90px; }
  .blog-main { padding: 44px 20px 100px; min-height: calc(100vh - 116px - 58px); }
  .cat-pills { gap: 8px; margin: 26px 0 40px; }
  .cat-pills button { padding: 8px 14px; font-size: 11px; }
  .post-grid { grid-template-columns: 1fr; gap: 40px; }
  .post-card.featured h2 { font-size: 24px; }
}
