/* ============================================================
   Modanomics Theme — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=DM+Sans:wght@300;400;500&display=swap');

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

:root {
  --black: #0e0e0e;
  --white: #f9f7f4;
  --cream: #f2ede6;
  --accent: #b5936a;
  --muted: #9a9189;
  --border: #e2ddd6;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--white);
  color: var(--black);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
}

/* ── Custom Cursor ── */
.cursor {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--black);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, width 0.2s ease, height 0.2s ease, background 0.2s ease;
}
.cursor-ring {
  position: fixed;
  width: 32px; height: 32px;
  border: 1px solid var(--black);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, width 0.3s ease, height 0.3s ease, opacity 0.3s;
  opacity: 0.4;
}
@media (pointer: coarse) {
  body { cursor: auto; }
  .cursor, .cursor-ring { display: none; }
}
@media (pointer: fine) {
  body { cursor: none; }
}

/* ── Navigation ── */
#site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  animation: fadeDown 0.6s ease both;
}

nav.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 72px;
}

.site-logo {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--black);
}
.site-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 72px;
}

.nav-links > li {
  display: flex;
  align-items: center;
  height: 72px;
  list-style: none;
}

.nav-links > li > a {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
  line-height: 1;
  padding: 0;
}
.nav-links > li > a:hover { color: var(--black); }

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.nav-dropdown-btn:hover,
.nav-dropdown:focus-within .nav-dropdown-btn { color: var(--black); }

.nav-dropdown-caret {
  font-size: 9px;
  opacity: 0.65;
  letter-spacing: 0;
  line-height: 1;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 0;
  min-width: 240px;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  box-shadow: 0 16px 48px rgba(14, 14, 14, 0.08);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.nav-dropdown-menu a {
  display: block;
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-menu a:hover {
  color: var(--black);
  background: var(--cream);
}

.nav-cta {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
  background: var(--black);
  padding: 10px 22px;
  border-radius: 2px;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--accent); color: var(--white); }

.nav-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 0 0 auto;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--black);
  flex-shrink: 0;
}
.nav-menu-toggle:hover { background: var(--cream); }

.nav-menu-toggle-bars {
  display: block;
  position: relative;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 1px;
  transition: background 0.2s ease;
}
.nav-menu-toggle-bars::before,
.nav-menu-toggle-bars::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 1px;
  transition: transform 0.2s ease;
}
.nav-menu-toggle-bars::before { top: -7px; }
.nav-menu-toggle-bars::after { top: 7px; }

nav.nav-is-open .nav-menu-toggle-bars { background: transparent; }
nav.nav-is-open .nav-menu-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
nav.nav-is-open .nav-menu-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop { display: none; }
.nav-backdrop.nav-backdrop-visible {
  display: block;
  position: fixed;
  top: 72px; left: 0; right: 0; bottom: 0;
  background: rgba(14, 14, 14, 0.45);
  z-index: 99;
}

/* ── Site Content Offset ── */
.site-content { margin-top: 72px; }

/* ── Scroll Margin ── */
#topics, #latest, .topic-pill[id] { scroll-margin-top: 88px; }

/* ── Hero ── */
.hero {
  padding: 100px 48px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.8s 0.2s ease both;
}

.hero-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(44px, 6vw, 80px);
  font-weight: 300;
  line-height: 1.05;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc {
  font-size: 15px;
  color: var(--muted);
  max-width: 420px;
  margin-bottom: 40px;
  line-height: 1.8;
}

.hero-actions { display: flex; gap: 16px; align-items: center; }

.btn-primary {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white);
  background: var(--black);
  padding: 14px 32px;
  border-radius: 2px;
  transition: background 0.2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--accent); color: var(--white); }

.btn-ghost {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  display: flex; align-items: center; gap: 8px;
  transition: color 0.2s;
}
.btn-ghost:hover { color: var(--black); }
.btn-ghost::after { content: '→'; transition: transform 0.2s; }
.btn-ghost:hover::after { transform: translateX(4px); }

/* Hero Featured Card */
.hero-card {
  background: var(--cream);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.25s ease;
}
.hero-card:hover { transform: translateY(-4px); }

.hero-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #e8dfd3 0%, #d4c8ba 50%, #c9b9a6 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.hero-card-img::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 20px,
    rgba(255,255,255,0.08) 20px,
    rgba(255,255,255,0.08) 21px
  );
}
.hero-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-card-img-label {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 400;
  color: rgba(255,255,255,0.88);
  text-shadow: 0 2px 10px rgba(0,0,0,0.18);
  letter-spacing: 0.05em;
  position: relative;
}
.hero-card-img.has-image .hero-card-img-label { display: none; }

.hero-card-body { padding: 28px 32px 32px; }

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 3px 10px;
  margin-bottom: 14px;
}

.hero-card-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 10px;
}

.hero-card-meta {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ── Topics Strip ── */
.topics-strip-wrapper {
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.topics-strip {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.topics-strip::-webkit-scrollbar { display: none; }

.topic-pill {
  flex-shrink: 0;
  padding: 24px 40px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.topic-pill:first-child { border-left: 1px solid var(--border); }
.topic-pill:hover { background: var(--cream); }

.topic-pill-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--black);
}

.topic-pill-count {
  font-size: 11px;
  color: var(--accent);
}

/* ── Latest Articles ── */
.latest-articles {
  padding: 72px 48px 80px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.latest-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
}

.latest-header-text { max-width: 520px; }

.latest-eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.latest-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--black);
}

.latest-all {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}
.latest-all:hover { color: var(--black); }

.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 32px;
}

.latest-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}
.latest-card:hover { transform: translateY(-4px); }
.latest-card:hover .latest-card-title { color: var(--accent); }

.latest-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #e8dfd3, #c9b9a6);
}
.latest-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.latest-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 18px,
    rgba(255,255,255,0.07) 18px,
    rgba(255,255,255,0.07) 19px
  );
  pointer-events: none;
}

/* Placeholder gradient colors for cards without images */
.latest-card:nth-child(3n+1) .latest-card-img { background: linear-gradient(135deg, #e8dfd3, #c9b9a6); }
.latest-card:nth-child(3n+2) .latest-card-img { background: linear-gradient(135deg, #c5cdd4, #9aaab8); }
.latest-card:nth-child(3n+3) .latest-card-img { background: linear-gradient(135deg, #d4cac5, #bfafa8); }

.latest-card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.latest-card-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.latest-card-meta {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ── Newsletter ── */
.newsletter-section {
  background: var(--black);
  color: var(--white);
  padding: 80px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.newsletter-eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.newsletter-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: 16px;
}
.newsletter-title em { font-style: italic; color: var(--accent); }

.newsletter-desc {
  font-size: 14px;
  color: rgba(249,247,244,0.5);
  line-height: 1.8;
}

.newsletter-form {
  display: flex; flex-direction: column; gap: 14px;
}

.newsletter-input {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 2px;
  padding: 16px 20px;
  color: var(--white);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.newsletter-input::placeholder { color: rgba(255,255,255,0.3); }
.newsletter-input:focus { border-color: var(--accent); }

.newsletter-btn {
  background: var(--accent);
  border: none;
  border-radius: 2px;
  padding: 16px 32px;
  color: var(--white);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s;
  align-self: flex-start;
}
.newsletter-btn:hover { opacity: 0.85; }

.newsletter-note {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
}

/* ── Footer ── */
.site-footer {
  padding: 48px 48px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 48px;
  border-top: 1px solid var(--border);
}

.footer-brand {
  display: flex; flex-direction: column; gap: 12px;
}

.footer-logo {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  text-decoration: none;
  color: var(--black);
}
.footer-logo span { color: var(--accent); }

.footer-tagline {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 240px;
}

.footer-col-title {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.footer-links {
  list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}
.footer-links a {
  font-size: 14px;
  color: var(--black);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  padding: 20px 48px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}

.footer-copy {
  font-size: 12px;
  color: var(--muted);
}

.footer-social { display: flex; gap: 20px; }
.footer-social a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}
.footer-social a:hover { color: var(--black); }

/* ── Single Post ── */
.post-header {
  padding: 80px 48px 48px;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.post-header .tag { margin-bottom: 24px; }

.post-title {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: 24px;
}

.post-meta {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.post-featured-image {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.post-content {
  max-width: 720px;
  margin: 64px auto;
  padding: 0 48px;
}

.post-content h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 400;
  margin: 48px 0 20px;
}

.post-content h3 {
  font-family: var(--serif);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 400;
  margin: 36px 0 16px;
}

.post-content p {
  margin-bottom: 24px;
  font-size: 16px;
  line-height: 1.85;
  color: #2a2a2a;
}

.post-content a { color: var(--accent); text-decoration: underline; }
.post-content a:hover { opacity: 0.8; }

.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 28px;
  margin: 40px 0;
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  color: var(--muted);
  line-height: 1.6;
}

.post-content ul, .post-content ol {
  margin: 0 0 24px 24px;
}
.post-content li { margin-bottom: 8px; font-size: 16px; line-height: 1.8; }

.post-content img {
  width: 100%;
  border-radius: 4px;
  margin: 32px 0;
}

/* ── Archive / Category ── */
.archive-header {
  padding: 80px 48px 48px;
  border-bottom: 1px solid var(--border);
}

.archive-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.archive-title {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 300;
  line-height: 1.05;
}

.archive-grid {
  padding: 72px 48px 80px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 32px;
}

/* ── Accent Line ── */
.accent-line {
  width: 40px; height: 1px;
  background: var(--accent);
  margin-bottom: 32px;
}

/* ── Animations ── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  nav.site-nav { padding: 0 24px; }
  .nav-menu-toggle { display: inline-flex; }

  .nav-links {
    position: fixed;
    top: 72px; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: 100%;
    height: auto;
    min-height: calc(100dvh - 72px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 32px;
    margin: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(14, 14, 14, 0.12);
    overflow-y: auto;
    z-index: 101;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  }

  nav.nav-is-open .nav-links {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links > li { height: auto; min-height: 0; border-bottom: 1px solid var(--border); }
  .nav-links > li > a { padding: 16px 24px; font-size: 13px; }

  .nav-dropdown { flex-direction: column; align-items: stretch; }
  .nav-dropdown-btn {
    padding: 16px 24px;
    width: 100%;
    justify-content: space-between;
    cursor: pointer;
  }

  .nav-dropdown-menu {
    position: static;
    opacity: 1; visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    min-width: 0;
    padding: 0 0 4px;
  }
  .nav-dropdown-menu a { padding: 14px 24px 14px 40px; }

  .hero { grid-template-columns: 1fr; padding: 60px 24px 48px; }
  .latest-articles { padding: 56px 24px 60px; }
  .latest-grid { grid-template-columns: 1fr; }
  .newsletter-section { grid-template-columns: 1fr; padding: 60px 24px; }
  .site-footer { grid-template-columns: 1fr; padding: 40px 24px; }
  .footer-bottom { padding: 20px 24px; flex-direction: column; gap: 12px; }
  .archive-header { padding: 60px 24px 40px; }
  .archive-grid { padding: 48px 24px 60px; grid-template-columns: 1fr; }
  .post-header { padding: 60px 24px 36px; }
  .post-content { padding: 0 24px; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .latest-grid { grid-template-columns: repeat(2, 1fr); }
  .archive-grid { grid-template-columns: repeat(2, 1fr); }
}
