/* ============================================
   LoyalNuggets — Article Page Styles
   ============================================ */

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

:root {
  --bg: #faf9f7;
  --bg-elevated: #ffffff;
  --bg-card: #f3f1ee;
  --bg-hover: #e7e5e4;
  --text: #1c1917;
  --text-muted: #57534e;
  --text-dim: #78716c;
  --gold: #d97706;
  --gold-light: #f59e0b;
  --gold-dark: #b45309;
  --border: #e7e5e4;
  --border-hover: #d6d3d1;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Instrument Sans', system-ui, sans-serif;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }

/* --- Top Navigation --- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  background: rgba(250, 249, 247, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topnav__logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.topnav__icon {
  color: var(--gold);
  font-size: 1.2rem;
}

.topnav__links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.topnav__links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.3s;
}

.topnav__links a:hover { color: var(--gold); }

.topnav__menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.topnav__menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s;
}

.topnav__menu-btn.active span:first-child {
  transform: rotate(45deg) translate(4px, 4px);
}

.topnav__menu-btn.active span:last-child {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* --- Mobile Menu Overlay --- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-muted);
  transition: color 0.3s;
}

.mobile-menu a:hover {
  color: var(--gold);
}

/* --- Hero --- */
.article-hero {
  position: relative;
  width: 100%;
  height: 55vh;
  min-height: 360px;
  max-height: 560px;
  overflow: hidden;
}

.article-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 50%);
}

.article-hero__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.article-hero__category {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 0.8rem;
}

.article-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: #fff;
  line-height: 1.15;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.article-hero__meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
}

/* --- Article Content --- */
.article-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.article-content h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

.article-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 2rem 0 0.8rem;
  color: var(--text);
}

.article-content p {
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.article-content ul,
.article-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-muted);
}

.article-content li {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.article-content strong {
  color: var(--text);
  font-weight: 600;
}

.article-content a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:hover {
  color: var(--gold-dark);
}

.article-content blockquote {
  border-left: 3px solid var(--gold);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-muted);
}

/* --- Ad Placeholder --- */
.ad-slot {
  margin: 2.5rem 0;
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.ad-slot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(217, 119, 6, 0.03) 10px,
    rgba(217, 119, 6, 0.03) 20px
  );
}

.ad-slot__label {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--bg-elevated);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.ad-slot__size {
  position: relative;
  z-index: 1;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

/* When real ad is inserted, remove placeholder styling */
.ad-slot ins {
  border: none !important;
  background: none !important;
  min-height: auto !important;
}

.ad-slot ins ~ .ad-slot__label,
.ad-slot ins ~ .ad-slot__size {
  display: none;
}

/* --- After-Hero Ad (mobile only) --- */
.ad-slot-wrapper--after-hero {
  display: block;
  padding: 0 1rem;
}

@media (max-width: 768px) {
  .ad-slot-wrapper--after-hero {
    display: block;
  }
}

/* --- Prev / Next Navigation --- */
.article-nav {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.article-nav__btn {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.2rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.3s var(--ease-out);
  text-decoration: none;
}

.article-nav__btn:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

.article-nav__btn--next {
  text-align: right;
  grid-column: 2;
}

.article-nav__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.article-nav__title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
}

/* --- Disclaimer Footer --- */
.disclaimer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.disclaimer__text {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.7;
}

/* --- Site Footer --- */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.site-footer__links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.site-footer__links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.3s;
}

.site-footer__links a:hover { color: var(--gold); }

.site-footer__copy {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* --- Modal Overlay --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-card);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.3s;
}

.modal__close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.modal h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
}

.modal p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.modal ul {
  margin: 0.5rem 0 1rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal li {
  margin-bottom: 0.3rem;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .topnav__links { display: none; }
  .topnav__menu-btn { display: flex; }

  .article-hero { height: 20vh; min-height: 170px; margin-bottom: 8px; }
  .article-hero__content { padding: 1.5rem; }
  .article-hero__title { font-size: 1.4rem; }

  .article-content { padding: 0rem 1rem 3rem; }
  .article-content h2 { font-size: 1.35rem; }
  .article-content p { font-size: 1rem; }

  .article-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    max-width: 100%;
    margin: 0;
    padding: 0.6rem 0.8rem;
    display: flex;
    gap: 0.6rem;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  }

  .article-nav__btn {
    flex: 1;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    gap: 0;
    align-items: center;
    flex-direction: row;
  }

  .article-nav__btn--next {
    text-align: center;
    grid-column: auto;
    flex-direction: row-reverse;
  }

  .article-nav__title {
    display: none;
  }

  .article-nav__label {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
  }

  /* Add bottom padding so content isn't hidden behind sticky nav */
  .disclaimer {
    padding-bottom: 4.5rem;
  }
  .site-footer {
    padding-bottom: 4.5rem;
  }

  .modal { padding: 1.5rem; }
  .modal h1 { font-size: 1.4rem; }
}
