/* =========================================================
   ByteBounce — Newsletter article page styles
   Shared across newsletter/1.html, 2.html, 3.html
   ========================================================= */

:root {
  --accent: #0D868C;
  --accent-dark: #0A6266;
  --ink: #0E2030;
  --cream: #F5EFDC;
  --pad: 20px;
  --max-content: 1180px;
  --max-article: 760px;
}

@media (min-width: 640px) { :root { --pad: 32px; } }
@media (min-width: 1024px) { :root { --pad: 56px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Albert Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.wrap { max-width: var(--max-content); margin: 0 auto; padding: 0 var(--pad); }

/* ---------------- NAV ---------------- */
.nav {
  background: var(--ink); color: var(--cream);
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid rgba(245,239,220,0.08);
}
.nav .wrap { display:flex; align-items:center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.logo { font-family: 'Fraunces', 'Playfair Display', Georgia, serif; font-weight: 900; font-style: italic; font-size: 22px; letter-spacing: -0.02em; color: var(--cream); }
.logo .dot { display:inline-block; width:8px; height:8px; background: var(--accent); border-radius:50%; margin-left:2px; vertical-align: 3px; }
.nav-links { display:none; gap: 28px; list-style: none; padding: 0; margin: 0; }
.nav-links a { font-size: 14px; font-weight: 500; color: rgba(245,239,220,0.85); position: relative; padding: 4px 0; transition: color 0.2s; }
.nav-links a:hover { color: var(--cream); }
.nav-links a::after { content:""; position:absolute; left:0; bottom:-2px; height:2px; width:0; background: var(--accent); transition: width 0.25s ease; }
.nav-links a:hover::after { width: 100%; }
.nav-cta {
  display:none;
  background: var(--accent); color:#fff; border:none;
  padding: 9px 18px; border-radius: 100px;
  font-weight: 800; font-size: 13px;
  transition: background 0.2s, transform 0.15s;
}
.nav-cta:hover { background: var(--accent-dark); transform: translateY(-1px); }
.nav-toggle { background:transparent; border:none; color: var(--cream); padding: 4px; display:flex; align-items:center; }
.nav-toggle svg { width: 26px; height: 26px; }

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-block; }
  .nav-toggle { display: none; }
}

.mobile-menu {
  display: none;
  background: var(--ink);
  border-top: 1px solid rgba(245,239,220,0.08);
  padding: 12px var(--pad) 18px;
}
.mobile-menu.open { display: block; }
.mobile-menu ul { list-style: none; padding: 0; margin: 0; display:flex; flex-direction: column; gap: 4px; }
.mobile-menu a { display:block; padding: 10px 0; font-size: 16px; color: rgba(245,239,220,0.9); border-bottom: 1px dashed rgba(245,239,220,0.12); }
.mobile-menu .mob-cta { display:block; margin-top: 14px; text-align:center; background: var(--accent); color:#fff; padding: 12px; border-radius: 100px; font-weight: 800; font-size: 14px; border: none; width: 100%; }

/* ---------------- ARTICLE ---------------- */
.article {
  background: var(--cream);
  padding: 32px 0 64px;
  min-height: 80vh;
}
@media (min-width: 768px) { .article { padding: 48px 0 80px; } }

.article-wrap {
  max-width: var(--max-article);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  padding: 8px 16px 8px 12px;
  border: 1.5px solid var(--accent);
  border-radius: 100px;
  margin-bottom: 28px;
  transition: background 0.2s, color 0.2s;
}
.back-btn:hover { background: var(--accent); color: #fff; }
.back-btn svg { width: 16px; height: 16px; }

.article-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 22px;
  box-shadow: 0 8px 28px -12px rgba(0,0,0,0.18);
  border: 1.5px solid var(--ink);
  position: relative;
}
@media (min-width: 768px) {
  .article-card { padding: 40px 44px 48px; }
}

.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(14,32,48,0.6);
  margin-bottom: 14px;
}
.article-meta .tag {
  background: var(--accent); color: #fff;
  padding: 4px 10px; border-radius: 100px;
  font-size: 10px; letter-spacing: 0.08em;
  font-weight: 800;
}
.article-meta .dot-sep { opacity: 0.4; }

.article-card h1 {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05; letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 14px;
  text-wrap: balance;
}

.article-card .lede {
  font-family: 'Fraunces', serif;
  font-style: italic; font-weight: 400;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.5;
  color: rgba(14,32,48,0.7);
  margin: 0 0 28px;
  max-width: 60ch;
}

.cover-wrap {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 6px 24px -8px rgba(0,0,0,0.2);
}
.cover-wrap img {
  width: 100%;
  height: clamp(220px, 32vw, 380px);
  object-fit: cover;
}

/* ---------------- ARTICLE BODY ---------------- */
.article-body {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(14,32,48,0.88);
}
@media (min-width: 768px) { .article-body { font-size: 17px; line-height: 1.75; } }

.article-body h2 {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.2; letter-spacing: -0.02em;
  color: var(--ink);
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1.5px dashed rgba(14,32,48,0.15);
}
.article-body h2:first-child { margin-top: 8px; }

.article-body p { margin: 0 0 16px; }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--accent-dark); }

.article-body ul {
  list-style: none; padding: 0; margin: 0 0 16px;
}
.article-body ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
}
.article-body ul li::before {
  content: ""; position: absolute; left: 0; top: 12px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.article-body .highlight-box {
  background: rgba(13,134,140,0.06);
  border-left: 4px solid var(--accent);
  padding: 16px 18px;
  border-radius: 0 12px 12px 0;
  margin: 22px 0;
}
.article-body .highlight-box p:last-child { margin-bottom: 0; }

/* ---------------- END-OF-ARTICLE CTA ---------------- */
.end-cta {
  margin-top: 48px;
  padding: 28px 24px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.end-cta::before {
  content:""; position:absolute; inset:0;
  background-image: radial-gradient(rgba(245,239,220,0.06) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
}
.end-cta > * { position: relative; z-index: 2; }
.end-cta-stamp {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent); color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase;
  transform: rotate(-2deg); border-radius: 4px;
  margin-bottom: 14px;
}
.end-cta h3 {
  font-family: 'Fraunces', serif; font-weight: 900;
  font-size: clamp(22px, 2.4vw, 30px);
  margin: 0 0 8px; letter-spacing: -0.02em;
}
.end-cta p {
  font-size: 14px; opacity: 0.78; margin: 0 0 18px;
  max-width: 40ch; margin-left: auto; margin-right: auto;
}
.end-cta form {
  display: flex; gap: 6px; padding: 5px;
  background: var(--cream); border-radius: 100px;
  max-width: 420px; margin: 0 auto;
}
.end-cta input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  padding: 0 14px;
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
}
.end-cta button {
  background: var(--accent); color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 100px;
  font-weight: 800; font-size: 13px;
  white-space: nowrap;
  transition: background 0.2s;
}
.end-cta button:hover { background: var(--accent-dark); }

/* ---------------- NEXT / PREV ---------------- */
.nav-prev-next {
  margin-top: 32px;
}
.next-card {
  display: block;
  background: #fff;
  border: 1.5px dashed rgba(14,32,48,0.25);
  border-radius: 14px;
  padding: 18px 22px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.next-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(0,0,0,0.18);
}
.next-card .np-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}
.next-card .np-title {
  display: block;
  font-family: 'Fraunces', serif; font-weight: 700;
  font-size: 17px; line-height: 1.3;
  color: var(--ink);
}

/* ---------------- FOOTER ---------------- */
.footer { background: var(--ink); color: var(--cream); padding: 36px 0 32px; }
.footer .wrap { display:flex; flex-direction: column; gap: 24px; }
.footer-top {
  display:flex; flex-direction: column; gap: 18px;
  justify-content: space-between; align-items: flex-start;
}
@media (min-width: 768px) {
  .footer-top { flex-direction: row; align-items: center; }
}
.footer .tag { font-size: 13px; opacity: 0.6; margin-top: 8px; max-width: 280px; line-height: 1.5; }
.footer .links { display:flex; gap: 18px; font-size: 13px; flex-wrap: wrap; }
.footer .links a { color: var(--cream); opacity: 0.7; transition: opacity 0.2s; padding: 4px 0; }
.footer .links a:hover { opacity: 1; }
.footer .socials { display:flex; gap: 10px; }
.footer .social-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  border: 1px solid rgba(245,239,220,0.35);
  background: transparent;
  transition: background 0.2s, border-color 0.2s;
}
.footer .social-btn:hover { background: rgba(245,239,220,0.08); border-color: var(--accent); }
.footer .social-btn svg { width: 16px; height: 16px; }
.footer .legal {
  padding-top: 18px;
  border-top: 1px solid rgba(245,239,220,0.12);
  font-size: 12px; opacity: 0.5;
  font-family: 'Fraunces', serif; font-style: italic;
  display:flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ---------------- MODAL ---------------- */
.modal-overlay {
  display:none; position:fixed; inset:0;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  z-index: 100; align-items:center; justify-content:center; padding: 1rem;
}
.modal-overlay.active { display:flex; }
.modal-box {
  background: var(--cream); border-radius: 18px; padding: 28px;
  width: 100%; max-width: 480px; position:relative;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.4);
}
.modal-box h2 {
  font-family: 'Fraunces', serif; font-weight: 900;
  font-size: 24px; margin: 0 0 16px; text-align: center; letter-spacing: -0.02em;
}
.modal-close {
  position:absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: none;
  display:flex; align-items:center; justify-content:center;
  font-size: 18px; color: rgba(14,32,48,0.6);
  transition: background 0.2s;
}
.modal-close:hover { background: rgba(14,32,48,0.08); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
