/* R4XN Blog — WixBlog-inspired clean white layout */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

:root {
  --bg: #ffffff;
  --ink: #161616;
  --mute: #6b6b6b;
  --line: #e8e8e8;
  --soft: #f5f5f5;
  --wrap: 1180px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html, body.blog-body {
  min-height: 100%;
}
body.blog-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -100%; z-index: 100;
  background: #000; color: #fff; padding: .55rem .9rem; border-radius: 6px;
}
.skip-link:focus { top: 1rem; }

/* ——— Header ——— */
.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky; top: 0; z-index: 50;
}
.site-header__bar {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: .85rem 1.25rem;
  display: flex; align-items: center; gap: 1.25rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em;
  flex-shrink: 0;
}
.brand img { width: 26px; height: 26px; }
.brand-thin { font-weight: 500; margin-left: .15rem; }

.site-nav {
  display: none;
  align-items: center;
  gap: .15rem;
  flex: 1;
  min-width: 0;
}
.site-nav__link, .nav-dd__btn {
  appearance: none; border: 0; background: transparent;
  font: inherit; font-size: .9rem; font-weight: 600;
  color: var(--ink); text-decoration: none;
  padding: .45rem .7rem; border-radius: 8px;
  cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .35rem;
}
.site-nav__link:hover, .nav-dd__btn:hover { background: var(--soft); }
.site-nav__link.is-active { background: var(--soft); }
.nav-dd { position: static; }
.nav-dd__btn[aria-expanded="true"] { background: var(--soft); }
.nav-dd__btn svg { opacity: .55; transition: transform .2s ease; }
.nav-dd__btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-dd__panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0,0,0,.08);
  z-index: 60;
  max-height: min(78vh, 34rem);
  overflow-y: auto;
  animation: navDdIn .22s ease;
}
.nav-dd__panel[hidden] { display: none !important; }
@keyframes navDdIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.nav-dd__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.15rem 1.25rem 1.45rem;
}
.nav-dd__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.nav-dd__eyebrow {
  margin: 0;
  font-size: .72rem; font-weight: 700; color: var(--mute);
  letter-spacing: .07em; text-transform: uppercase;
}
.nav-dd__lede {
  margin: .2rem 0 0;
  font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em;
}
.nav-dd__all {
  font-size: .86rem; font-weight: 600; text-decoration: none;
  color: var(--ink); white-space: nowrap;
  border-bottom: 1px solid var(--ink); padding-bottom: 1px;
}
.nav-dd__all:hover { opacity: .65; }
.nav-dd__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
@media (min-width: 720px) {
  .nav-dd__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
}
@media (min-width: 1020px) {
  .nav-dd__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
}

.nav-topic {
  display: flex; flex-direction: column; gap: .55rem;
  text-decoration: none; color: var(--ink);
  min-width: 0; border-radius: 10px;
  transition: transform .2s ease, background .2s ease;
}
.nav-topic:hover { transform: translateY(-2px); }
.nav-topic:focus-visible { outline-offset: 4px; }
.nav-topic__media {
  display: block; border-radius: 8px; overflow: hidden;
  background: var(--soft); aspect-ratio: 16 / 10;
  position: relative;
}
.nav-topic__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.nav-topic:hover .nav-topic__media img { transform: scale(1.04); }
.nav-topic__media.is-empty {
  background:
    linear-gradient(135deg, rgba(22,22,22,.04), rgba(22,22,22,.1)),
    repeating-linear-gradient(
      -24deg,
      transparent,
      transparent 10px,
      rgba(22,22,22,.03) 10px,
      rgba(22,22,22,.03) 11px
    );
}
.nav-topic__media.is-empty::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.55), transparent 55%);
}
.nav-topic__body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.nav-topic__name {
  font-size: .92rem; font-weight: 700; letter-spacing: -.015em;
  line-height: 1.3;
}
.nav-topic__desc {
  font-size: .78rem; color: var(--mute); font-weight: 500; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.nav-topic--compact {
  flex-direction: row; align-items: center; gap: .7rem;
  padding: .35rem 0; transform: none;
}
.nav-topic--compact:hover { transform: none; background: transparent; }
.nav-topic--compact .nav-topic__media {
  width: 3.4rem; flex-shrink: 0; aspect-ratio: 1; border-radius: 7px;
}
.nav-topic--compact .nav-topic__name { font-size: .9rem; font-weight: 600; }

body.has-nav-dd::before {
  content: "";
  position: fixed; inset: 0; top: 0;
  background: rgba(0,0,0,.08);
  z-index: 40;
  pointer-events: none;
}

.site-header__right {
  display: flex; align-items: center; gap: .55rem;
  margin-left: auto; flex-shrink: 0;
}
.btn-outline, .btn-solid {
  display: none; align-items: center; justify-content: center;
  text-decoration: none; font-size: .82rem; font-weight: 600;
  padding: .55rem 1rem; border-radius: 999px; white-space: nowrap;
  font-family: inherit; cursor: pointer;
}
.btn-outline { border: 1px solid var(--ink); background: #fff; color: var(--ink); }
.btn-outline:hover { background: var(--soft); }
.btn-solid { border: 1px solid var(--ink); background: var(--ink); color: #fff; }
.btn-solid:hover { background: #000; }
.btn-solid:disabled { opacity: .6; cursor: wait; }
.nav-toggle {
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px; cursor: pointer;
}
.nav-toggle span { width: 15px; height: 2px; background: var(--ink); display: block; }

.nav-search {
  display: none; align-items: center; gap: .4rem;
  border: 1px solid var(--line); border-radius: 999px;
  padding: .4rem .85rem; min-width: 10rem; max-width: 14rem;
  background: #fff;
}
.nav-search i { color: var(--mute); font-size: .8rem; }
.nav-search input {
  border: 0; outline: 0; font: inherit; font-size: .88rem; width: 100%;
  background: transparent; color: var(--ink);
}
.nav-search input::placeholder { color: var(--mute); }

.mobile-nav {
  border-top: 1px solid var(--line); padding: .5rem 1.25rem 1rem;
  display: flex; flex-direction: column;
}
.mobile-nav > a {
  text-decoration: none; padding: .7rem 0; font-weight: 500;
  border-bottom: 1px solid var(--soft);
}
.mobile-nav__label {
  margin: .85rem 0 .45rem;
  font-size: .7rem; font-weight: 700; color: var(--mute);
  letter-spacing: .06em; text-transform: uppercase;
}
.mobile-nav__topics {
  display: flex; flex-direction: column;
  gap: .15rem;
  margin: 0 0 .55rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--soft);
}
.mobile-nav[hidden] { display: none !important; }

@media (min-width: 900px) {
  .site-nav { display: flex; }
  .nav-search { display: flex; }
  .btn-outline, .btn-solid { display: inline-flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* ——— Main ——— */
.site-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.section-label {
  margin: 0 0 .5rem;
  font-size: .75rem; font-weight: 600; color: var(--mute);
  letter-spacing: .04em; text-transform: uppercase;
}
.page-header { margin-bottom: 2rem; max-width: 40rem; }
.page-title {
  margin: 0; font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800; letter-spacing: -.03em; line-height: 1.15;
}
.page-dek { margin: .65rem 0 0; color: var(--mute); font-size: 1rem; }

/* Hero latest */
.hero-latest {
  display: grid; gap: 1.5rem;
  padding: .5rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.25rem;
  align-items: center;
}
.hero-latest__copy { max-width: 34rem; }
.hero-latest__title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.85rem, 4.2vw, 3.15rem);
  font-weight: 800; letter-spacing: -.035em; line-height: 1.12;
}
.hero-latest__title a { text-decoration: none; }
.hero-latest__title a:hover { text-decoration: underline; text-underline-offset: 5px; }
.hero-latest__more {
  display: inline-block;
  font-size: .95rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: 4px;
}
.hero-latest__more:hover { opacity: .7; }
.hero-latest__media {
  display: block; border-radius: 4px; overflow: hidden; background: var(--soft);
}
.hero-latest__media img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
}
.hero-latest__placeholder {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #ececec, #d8d8d8);
}

@media (min-width: 860px) {
  .hero-latest {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    padding: 1.25rem 0 3rem;
  }
  .hero-latest__media img, .hero-latest__placeholder {
    aspect-ratio: 5/4; min-height: 280px;
  }
}

/* Post grid */
.posts-grid {
  display: grid;
  gap: 1.75rem 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 800px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .posts-grid { grid-template-columns: repeat(4, 1fr); gap: 2rem 1.35rem; }
}

.post-card { display: flex; flex-direction: column; gap: .55rem; }
.post-card__media {
  display: block; border-radius: 4px; overflow: hidden; background: var(--soft);
}
.post-card__media img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover;
  transition: transform .35s ease;
}
.post-card:hover .post-card__media img { transform: scale(1.03); }
.post-card__placeholder {
  aspect-ratio: 16/10; background: linear-gradient(145deg, #efefef, #dadada);
}
.post-card__meta {
  font-size: .78rem; color: var(--mute); font-weight: 500;
}
.post-card__title {
  margin: 0;
  font-size: 1.02rem; font-weight: 700; line-height: 1.35; letter-spacing: -.015em;
}
.post-card__title a { text-decoration: none; }
.post-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.empty-state {
  padding: 2rem; color: var(--mute); border: 1px dashed var(--line); border-radius: 8px;
}

/* Pagination */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.pager__pages {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .3rem;
  flex: 1;
}
.pager__btn, .pager__num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.4rem; min-height: 2.4rem;
  padding: .4rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: .88rem; font-weight: 600;
}
.pager__btn:hover, .pager__num:hover { background: var(--soft); }
.pager__btn.is-disabled {
  opacity: .35; cursor: not-allowed; pointer-events: none;
}
.pager__num.is-current {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.pager__gap {
  padding: 0 .2rem; color: var(--mute); font-weight: 600;
}

.channel-pills {
  display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.75rem;
}
.channel-pills a {
  text-decoration: none; font-size: .82rem; font-weight: 500;
  padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px;
}
.channel-pills a:hover { background: var(--soft); }

.search-form {
  display: flex; gap: .5rem; margin-bottom: 1.75rem; max-width: 28rem;
}
.search-form input {
  flex: 1; border: 1px solid var(--line); border-radius: 8px;
  padding: .7rem .9rem; font: inherit;
}
.search-form button {
  border: 0; border-radius: 8px; padding: 0 1.1rem;
  background: var(--ink); color: #fff; font-weight: 600; cursor: pointer;
}

/* Article */
.article-shell { max-width: 42rem; margin: 0 auto; }
.crumbs {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  font-size: .8rem; color: var(--mute); margin-bottom: 1.25rem;
}
.crumbs a { text-decoration: none; color: var(--mute); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.article-title {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 3.8vw, 2.75rem);
  font-weight: 800; letter-spacing: -.03em; line-height: 1.15;
}
.byline {
  margin: 0 0 1.5rem; display: flex; flex-wrap: wrap; gap: .65rem;
  font-size: .88rem; color: var(--mute); font-weight: 500;
}
.byline a { color: var(--ink); text-decoration: none; font-weight: 600; }
.byline a:hover { text-decoration: underline; }
.article-cover {
  margin: 0 0 2rem; border-radius: 6px; overflow: hidden; background: var(--soft);
}
.article-cover img { width: 100%; }
.article-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 2rem; }
.article-tags a {
  text-decoration: none; font-size: .78rem; font-weight: 600;
  padding: .35rem .7rem; background: var(--soft); border-radius: 999px;
}
.related-block { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.related-block .posts-grid { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .related-block .posts-grid { grid-template-columns: 1fr 1fr; }
}

.prose-content {
  color: #2a2a2a; font-size: 1.08rem; line-height: 1.75;
}
.prose-content h2, .prose-content h3 {
  color: var(--ink); font-weight: 750; letter-spacing: -.02em;
  margin: 2rem 0 .7rem; line-height: 1.25;
}
.prose-content h2 { font-size: 1.4rem; }
.prose-content h3 { font-size: 1.15rem; }
.prose-content p, .prose-content ul, .prose-content ol { margin: 0 0 1.15rem; }
.prose-content a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.prose-content img { border-radius: 6px; margin: 1.4rem 0; }
.prose-content blockquote {
  margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--ink);
  color: var(--mute); font-style: italic;
}
.prose-content pre {
  background: #111; color: #eee; padding: 1rem; border-radius: 8px;
  overflow-x: auto; font-size: .85rem;
}
.prose-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }

/* Footer */
.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 2.5rem 1.25rem;
  background: #fff;
}
.site-footer__inner {
  max-width: var(--wrap); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  align-items: center; justify-content: space-between;
}
.site-footer__brand { margin: 0; font-weight: 800; font-size: 1rem; }
.site-footer__copy { margin: 0; font-size: .82rem; color: var(--mute); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-footer__links a {
  font-size: .85rem; font-weight: 500; text-decoration: none; color: var(--ink);
}
.site-footer__links a:hover { text-decoration: underline; }
.footer-subscribe,
.mobile-nav__subscribe {
  appearance: none; border: 0; background: transparent; padding: 0;
  font: inherit; font-size: .85rem; font-weight: 500; color: var(--ink);
  cursor: pointer; text-align: left;
}
.footer-subscribe:hover,
.mobile-nav__subscribe:hover { text-decoration: underline; }
.mobile-nav__subscribe {
  display: block; width: 100%;
  padding: .85rem 0; font-size: 1.05rem; font-weight: 600;
  border-bottom: 1px solid var(--line);
}

/* Newsletter modal */
body.has-subscribe-modal { overflow: hidden; }
.subscribe-modal[hidden] { display: none !important; }
.subscribe-modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 1.25rem;
}
.subscribe-modal__backdrop {
  position: absolute; inset: 0; background: rgba(22,22,22,.45);
}
.subscribe-modal__dialog {
  position: relative; z-index: 1;
  width: min(420px, 100%);
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 1.75rem 1.5rem 1.35rem;
  box-shadow: 0 18px 50px rgba(0,0,0,.14);
}
.subscribe-modal__close {
  position: absolute; top: .65rem; right: .75rem;
  width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: transparent; font-size: 1.5rem; line-height: 1;
  color: var(--mute); cursor: pointer;
}
.subscribe-modal__close:hover { color: var(--ink); background: var(--soft); }
.subscribe-modal__eyebrow {
  margin: 0 0 .35rem; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--mute);
}
.subscribe-modal__dialog h2 {
  margin: 0 0 .5rem; font-size: 1.35rem; letter-spacing: -.02em; line-height: 1.2;
}
.subscribe-modal__lead {
  margin: 0 0 1.15rem; font-size: .92rem; color: var(--mute);
}
.subscribe-form {
  display: grid; gap: .65rem;
}
.subscribe-form input[type="email"] {
  width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 .9rem; font: inherit; font-size: .95rem; background: #fff; color: var(--ink);
}
.subscribe-form input[type="email"]:focus {
  outline: 2px solid #000; outline-offset: 1px;
}
.subscribe-form .btn-solid {
  display: inline-flex; width: 100%; height: 46px; border-radius: 10px;
}
.subscribe-hp {
  position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0;
}
.subscribe-msg { margin: .85rem 0 0; font-size: .88rem; font-weight: 600; }
.subscribe-msg.is-ok { color: #0f7a45; }
.subscribe-msg.is-error { color: #b42318; }
.subscribe-modal__rss {
  margin: 1rem 0 0; font-size: .8rem; color: var(--mute);
}
.subscribe-modal__rss a { color: var(--ink); font-weight: 600; }

:focus-visible { outline: 2px solid #000; outline-offset: 3px; }
