/* ── Blog article typography ── */
.blog-content h2 {
  font-family: 'Libre Caslon Condensed', serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  margin: 2.6rem 0 1.1rem;
}
.blog-content h3 {
  font-family: 'Libre Caslon Condensed', serif;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  line-height: 1.2;
  margin: 2.2rem 0 0.9rem;
}
.blog-content p { margin: 0 0 1.5rem; }
.blog-content a { color: #1a1c1c; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(0,0,0,0.3); transition: text-decoration-color 0.25s ease; }
.blog-content a:hover { text-decoration-color: rgba(0,0,0,0.9); }
.blog-content strong { font-weight: 600; }
.blog-content ul, .blog-content ol { margin: 0 0 1.5rem; padding-left: 1.4rem; }
.blog-content li { margin-bottom: 0.5rem; }
.blog-content ul { list-style: disc; }
.blog-content ol { list-style: decimal; }

.blog-content blockquote {
  margin: 2.2rem 0;
  padding: 0.2rem 0 0.2rem 1.5rem;
  border-left: 2px solid #1a1c1c;
  font-family: 'Libre Caslon Condensed', serif;
  font-style: italic;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.5;
  color: #1a1c1c;
}
.blog-content blockquote p { margin-bottom: 0.6rem; }
.blog-content blockquote p:last-child { margin-bottom: 0; }

.blog-content figure { margin: 2.6rem 0; }

.blog-content .video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 2.6rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.blog-content .video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.blog-content img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}
.blog-content figcaption {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 0.8rem;
  color: #5f5e5e;
  margin-top: 0.7rem;
  text-align: center;
}

.blog-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: #eeeeee;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
.blog-content hr {
  border: none;
  border-top: 1px solid #dcdcdc;
  margin: 2.8rem 0;
}

/* ── Footnotes (markdown-it-footnote) ── */
/* markdown-it-footnote inserts its own <hr> right before .footnotes — hide
   it, since .footnotes already draws its own border-top (having both gives
   two stacked lines). */
.blog-content .footnotes-sep { display: none; }
.blog-content .footnotes {
  margin-top: 3.5rem;
  padding-top: 1.6rem;
  border-top: 1px solid #dcdcdc;
  font-size: 0.85rem;
  color: #5f5e5e;
}
.blog-content .footnotes-title { display: none; }
.blog-content .footnotes ol { padding-left: 1.2rem; }
.blog-content .footnotes li { margin-bottom: 0.6rem; }
.blog-content .footnotes p { margin: 0; display: inline; }
.blog-content .footnote-ref a { text-decoration: none; font-size: 0.75em; position: relative; top: -0.4em; }
.blog-content .footnote-backref { text-decoration: none; margin-left: 0.3em; }

/* ── Language switcher ── */
.lang-switch {
  display: inline-flex;
  gap: 0.4rem;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.lang-switch a, .lang-switch span {
  color: #5f5e5e;
  text-decoration: none;
}
.lang-switch a:hover { color: #1a1c1c; }
.lang-switch .current { color: #1a1c1c; font-weight: 600; }

/* ── Floating side panel: language switch + subscribe ── */
.side-panel {
  position: fixed;
  z-index: 40;
  background: rgba(20,20,20,0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  padding: 1rem 1.2rem;
}
.side-panel .lang-switch {
  display: flex;
  padding-bottom: 0.7rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.side-panel .lang-switch:empty { display: none; padding: 0; margin: 0; border: none; }
.side-panel .lang-switch a, .side-panel .lang-switch span { color: rgba(255,255,255,0.5); }
.side-panel .lang-switch a:hover { color: #fff; }
.side-panel .lang-switch .current { color: #fff; }

.subscribe-label {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.5rem;
}
.subscribe-form { display: flex; gap: 0.4rem; }
.subscribe-form input[type=email] {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 0.8rem;
  background: #fff;
  color: #14140f;
}
.subscribe-form input[type=email]::placeholder { color: rgba(0,0,0,0.4); }
.subscribe-form input[type=email]:focus { outline: none; border-color: rgba(0,0,0,0.4); }
.subscribe-form button {
  flex-shrink: 0;
  width: 32px;
  border-radius: 4px;
  background: #fff;
  color: #14140f;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.subscribe-form button:hover { background: #d8d8d8; }
.subscribe-caption {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  margin-top: 0.55rem;
}
.subscribe-note {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  margin-top: 0.4rem;
  min-height: 1px;
}

.panel-fallback-label {
  display: none;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
}
.panel-toggle {
  display: none;
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
}
.panel-toggle .material-symbols-outlined { font-size: 18px; transition: transform 0.25s ease; }

/* Desktop: floating card, bottom-right corner — always fully expanded */
@media (min-width: 641px) {
  .side-panel {
    right: 1.5rem;
    bottom: 1.5rem;
    width: 230px;
    border-radius: 12px;
  }
}

/* Mobile: full-width bar pinned to the bottom — reachable with a thumb,
   doesn't intrude on the article's reading column like a side card would.
   Starts collapsed (just the language switch, or a "Subscribe" label if
   there's no translation) — tap the chevron to reveal the subscribe form. */
@media (max-width: 640px) {
  .side-panel {
    left: 0;
    right: 0;
    bottom: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    padding: 0.9rem 2.6rem 0.9rem 1.2rem;
    background: #fff;
    border-color: rgba(0,0,0,0.1);
  }
  .side-panel .lang-switch { justify-content: center; border: none; padding: 0; margin: 0; }
  .side-panel .lang-switch a, .side-panel .lang-switch span { color: rgba(0,0,0,0.5); }
  .side-panel .lang-switch a:hover, .side-panel .lang-switch .current { color: #14140f; }
  .lang-switch + .panel-fallback-label { display: none; }
  .panel-fallback-label { display: block; text-align: center; color: rgba(0,0,0,0.7); }
  .panel-toggle { display: block; color: rgba(0,0,0,0.6); }
  .subscribe-label { color: rgba(0,0,0,0.55); }
  .subscribe-caption { color: rgba(0,0,0,0.4); }
  .subscribe-note { color: rgba(0,0,0,0.55); }

  .subscribe-block {
    overflow: hidden;
    max-height: 300px;
    opacity: 1;
    margin-top: 0.9rem;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin-top 0.3s ease;
  }
  .side-panel.collapsed .subscribe-block {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
  }
  .side-panel:not(.collapsed) .panel-toggle .material-symbols-outlined { transform: rotate(180deg); }

  article { padding-bottom: 9rem !important; }
}

/* ── Category filters & badges ── */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.4rem;
}
.blog-filter-btn {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.9rem;
  border: 1px solid #dcdcdc;
  border-radius: 9999px;
  color: #5f5e5e;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.blog-filter-btn:hover { border-color: #1a1c1c; color: #1a1c1c; }
.blog-filter-btn.active { background: #1a1c1c; border-color: #1a1c1c; color: #fff; }

.blog-list-category {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5f5e5e;
}

/* ── More posts (bottom of an article) ── */
.blog-more-posts {
  margin-top: 4.5rem;
  padding-top: 2.6rem;
  border-top: 1px solid #dcdcdc;
}
.blog-more-posts-title {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5f5e5e;
  margin-bottom: 1.4rem;
}
.blog-more-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.blog-more-posts-item { display: block; text-decoration: none; }
.blog-more-posts-thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 0.7rem;
}
.blog-more-posts-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.blog-more-posts-item:hover .blog-more-posts-thumb img { transform: scale(1.05); }
.blog-more-posts-item-title {
  font-family: 'Libre Caslon Condensed', serif;
  font-size: 1rem;
  line-height: 1.25;
  color: #1a1c1c;
}
@media (max-width: 640px) {
  .blog-more-posts-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Blog index / listing ── */
.blog-list-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  padding: 2.4rem 0;
  border-bottom: 1px solid #dcdcdc;
  text-decoration: none;
  align-items: center;
}
.blog-list-item:first-child { padding-top: 0; }
.blog-list-thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius);
}
.blog-list-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.blog-list-item:hover .blog-list-thumb img { transform: scale(1.04); }
.blog-list-title {
  font-family: 'Libre Caslon Condensed', serif;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  line-height: 1.15;
  color: #1a1c1c;
  margin-bottom: 0.6rem;
}
.blog-list-excerpt {
  color: #474747;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}
@media (max-width: 640px) {
  .blog-list-item { grid-template-columns: 1fr; gap: 1rem; }
}
