/* ============================================================
   wahwah.blog — "Ancient Civilization Artifacts" Theme
   styles.css
   
   Design System:
   - Museum Theme (default): Clean white/cream, dark ink accents
   - Journal Theme (alt):    Warm sepia, aged paper feel
   
   Typography:
   - Headings: Playfair Display (serif)
   - Body:    Inter (sans-serif)
   ============================================================ */

/* -------------------------------------------------------
   0. IMPORTS & CUSTOM PROPERTIES
   ------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* ---- Museum Theme (Light) ---- */
  --bg-primary:       #FDFBF7;
  --bg-secondary:     #F5F0E8;
  --bg-card:          #FFFDF8;
  --bg-nav:           rgba(253, 251, 247, 0.92);
  --bg-hero:          #FAF6EE;

  --text-primary:     #2C1810;
  --text-secondary:   #5C4A3A;
  --text-muted:       #8B7A6B;
  --text-accent:      #7A5C3E;

  --border-color:     #E0D5C5;
  --border-light:     #EDE6DA;

  --accent-warm:      #A0845C;
  --accent-gold:      #C4A265;
  --accent-deep:      #6B4226;
  --accent-terracotta:#B8705A;

  --shadow-sm:        0 1px 3px rgba(44, 24, 16, 0.06);
  --shadow-md:        0 4px 12px rgba(44, 24, 16, 0.08);
  --shadow-lg:        0 8px 30px rgba(44, 24, 16, 0.10);
  --shadow-card:      0 2px 8px rgba(44, 24, 16, 0.06),
                      0 8px 24px rgba(44, 24, 16, 0.04);
  --shadow-card-hover:0 6px 20px rgba(44, 24, 16, 0.12),
                      0 16px 40px rgba(44, 24, 16, 0.08);

  --radius-sm:        6px;
  --radius-md:        12px;
  --radius-lg:        18px;
  --radius-card:      14px;

  --font-heading:     'Playfair Display', 'Georgia', serif;
  --font-body:        'Inter', 'Segoe UI', sans-serif;

  --transition-fast:  0.2s ease;
  --transition-base:  0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:  0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --max-width:        1200px;
  --nav-height:       72px;
}

/* ---- Journal Theme (Sepia / Warm) ---- */
[data-theme="journal"] {
  --bg-primary:       #F0E6D3;
  --bg-secondary:     #E8DABD;
  --bg-card:          #F5EBDA;
  --bg-nav:           rgba(240, 230, 211, 0.94);
  --bg-hero:          #ECE0CC;

  --text-primary:     #3B2410;
  --text-secondary:   #5E4430;
  --text-muted:       #85705A;
  --text-accent:      #8B6840;

  --border-color:     #D4C4A8;
  --border-light:     #DDD0B8;

  --accent-warm:      #9A7848;
  --accent-gold:      #B89550;
  --accent-deep:      #5A3518;
  --accent-terracotta:#A86048;

  --shadow-sm:        0 1px 3px rgba(59, 36, 16, 0.08);
  --shadow-md:        0 4px 12px rgba(59, 36, 16, 0.10);
  --shadow-lg:        0 8px 30px rgba(59, 36, 16, 0.14);
  --shadow-card:      0 2px 8px rgba(59, 36, 16, 0.08),
                      0 8px 24px rgba(59, 36, 16, 0.06);
  --shadow-card-hover:0 6px 20px rgba(59, 36, 16, 0.16),
                      0 16px 40px rgba(59, 36, 16, 0.10);
}


/* -------------------------------------------------------
   1. RESET & BASE
   ------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.7;
  transition: background-color var(--transition-slow),
              color var(--transition-slow);
  overflow-x: hidden;
}

/* Subtle paper texture overlay on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.018;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(139, 109, 71, 0.15) 2px,
      rgba(139, 109, 71, 0.15) 3px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(139, 109, 71, 0.1) 3px,
      rgba(139, 109, 71, 0.1) 4px
    );
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  transition: color var(--transition-slow);
}

p {
  color: var(--text-secondary);
  transition: color var(--transition-slow);
}

::selection {
  background: var(--accent-gold);
  color: #fff;
}


/* -------------------------------------------------------
   2. NAVIGATION
   ------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  transition: background var(--transition-slow),
              border-color var(--transition-slow),
              box-shadow var(--transition-base);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.navbar__logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  position: relative;
  transition: color var(--transition-slow);
}

.navbar__logo::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-warm), var(--accent-gold), transparent);
  border-radius: 1px;
}

/* Nav links */
.navbar__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: relative;
  padding: 0.25rem 0;
  transition: color var(--transition-fast);
}

.navbar__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-warm);
  border-radius: 1px;
  transition: width var(--transition-base), left var(--transition-base);
}

.navbar__link:hover {
  color: var(--accent-deep);
}

.navbar__link:hover::after,
.navbar__link.active::after {
  width: 100%;
  left: 0;
}

.navbar__link.active {
  color: var(--accent-deep);
  font-weight: 600;
}

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--accent-warm);
  border-color: var(--accent-warm);
  transform: rotate(15deg);
  box-shadow: var(--shadow-md);
}

.theme-toggle:hover .theme-toggle__icon {
  color: #fff;
}

.theme-toggle__icon {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: color var(--transition-fast), transform var(--transition-base);
}

.theme-toggle:active .theme-toggle__icon {
  transform: scale(0.85);
}

/* Mobile menu toggle */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.navbar__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.navbar__hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.navbar__hamburger.active span:nth-child(2) {
  opacity: 0;
}

.navbar__hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}


/* -------------------------------------------------------
   3. HERO SECTION
   ------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 4rem) 2rem 4rem;
  background: var(--bg-hero);
  overflow: hidden;
  transition: background var(--transition-slow);
}

/* Decorative sundial / radial motif behind hero text */
.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  opacity: 0.04;
  background:
    repeating-conic-gradient(
      from 0deg,
      var(--accent-warm) 0deg 15deg,
      transparent 15deg 30deg
    );
  animation: slowRotate 120s linear infinite;
  pointer-events: none;
}

/* Concentric ring motif */
.hero::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 500px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid var(--border-color);
  opacity: 0.3;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 40px transparent,
    inset 0 0 0 42px var(--border-color),
    inset 0 0 0 90px transparent,
    inset 0 0 0 92px var(--border-color),
    inset 0 0 0 150px transparent,
    inset 0 0 0 152px var(--border-color);
  transition: border-color var(--transition-slow),
              box-shadow var(--transition-slow);
}

@keyframes slowRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

/* Small ornamental divider above tagline */
.hero__ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

.hero__ornament span {
  width: 40px;
  height: 1px;
  background: var(--accent-warm);
}

.hero__ornament svg {
  width: 18px;
  height: 18px;
  color: var(--accent-warm);
}

.hero__tagline {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 1.25rem;
  transition: color var(--transition-slow);
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero__title em {
  font-style: italic;
  color: var(--accent-warm);
}

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--accent-deep);
  color: #FDF8F0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.hero__cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.hero__cta:hover {
  background: var(--accent-warm);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.hero__cta:hover::before {
  opacity: 1;
}

.hero__cta:hover .hero__cta-arrow {
  transform: translateX(4px);
}

.hero__cta-arrow {
  transition: transform var(--transition-base);
  font-size: 1.1rem;
}

/* Decorative bottom wave/border for hero */
.hero__border {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  overflow: hidden;
}

.hero__border::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: -5%;
  right: -5%;
  height: 100%;
  background: var(--bg-primary);
  border-radius: 50% 50% 0 0;
  transition: background var(--transition-slow);
}


/* -------------------------------------------------------
   4. SECTION HEADERS
   ------------------------------------------------------- */
.section {
  padding: 5rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section__label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 0.75rem;
  display: block;
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.section__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
}

.section__divider span {
  width: 50px;
  height: 1px;
  background: var(--border-color);
  transition: background var(--transition-slow);
}

.section__divider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-warm);
  transition: background var(--transition-slow);
}


/* -------------------------------------------------------
   5. ARTICLE CARDS GRID
   ------------------------------------------------------- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base),
              background var(--transition-slow);
  cursor: pointer;
}

/* Parchment texture overlay on cards */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  border-radius: var(--radius-card);
  background:
    radial-gradient(ellipse at 20% 50%, rgba(160, 132, 92, 0.3), transparent 70%),
    radial-gradient(ellipse at 80% 20%, rgba(160, 132, 92, 0.2), transparent 60%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--accent-gold);
}

/* Card Image */
.card__image-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card__image {
  transform: scale(1.05);
}

/* Category badge on image */
.card__category {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #FDF8F0;
  background: rgba(44, 24, 16, 0.7);
  backdrop-filter: blur(8px);
  padding: 5px 12px;
  border-radius: 20px;
}

/* Card Body */
.card__body {
  position: relative;
  z-index: 2;
  padding: 1.5rem;
}

.card__date {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card__date svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.card__title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  transition: color var(--transition-fast);
}

.card:hover .card__title {
  color: var(--accent-deep);
}

.card__excerpt {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-warm);
  letter-spacing: 0.04em;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast), gap var(--transition-base);
}

.card__cta:hover {
  color: var(--accent-deep);
  gap: 12px;
}

.card__cta-arrow {
  transition: transform var(--transition-base);
  font-size: 1rem;
}


/* -------------------------------------------------------
   6. FEATURED QUOTE / INTERLUDE SECTION
   ------------------------------------------------------- */
.interlude {
  padding: 5rem 2rem;
  background: var(--bg-secondary);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: background var(--transition-slow);
}

.interlude::before {
  content: '\201C';
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 10rem;
  color: var(--border-color);
  line-height: 1;
  pointer-events: none;
  transition: color var(--transition-slow);
}

.interlude__content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.interlude__quote {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.interlude__attribution {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.interlude__attribution::before {
  content: '— ';
}


/* -------------------------------------------------------
   7. FOOTER
   ------------------------------------------------------- */
.footer {
  padding: 3rem 2rem 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  transition: background var(--transition-slow),
              border-color var(--transition-slow);
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Classic-themed icons row */
.footer__icons {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer__icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-muted);
  transition: all var(--transition-base);
}

.footer__icon-link:hover {
  background: var(--accent-warm);
  border-color: var(--accent-warm);
  color: #FDF8F0;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.footer__icon-link svg {
  width: 20px;
  height: 20px;
}

/* Divider */
.footer__divider {
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

/* Copyright */
.footer__copy {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.02em;
  transition: color var(--transition-slow);
}

.footer__copy strong {
  font-weight: 600;
  color: var(--text-secondary);
}


/* -------------------------------------------------------
   8. SCROLL REVEAL ANIMATIONS
   ------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered card animations */
.card.reveal:nth-child(1) { transition-delay: 0.05s; }
.card.reveal:nth-child(2) { transition-delay: 0.12s; }
.card.reveal:nth-child(3) { transition-delay: 0.19s; }
.card.reveal:nth-child(4) { transition-delay: 0.26s; }
.card.reveal:nth-child(5) { transition-delay: 0.33s; }
.card.reveal:nth-child(6) { transition-delay: 0.40s; }

/* Hero entrance */
.hero__content {
  animation: heroFadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

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


/* -------------------------------------------------------
   9. MOBILE NAVIGATION
   ------------------------------------------------------- */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.4);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.mobile-nav-overlay.active {
  opacity: 1;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--bg-primary);
  border-left: 1px solid var(--border-light);
  z-index: 999;
  padding: 6rem 2rem 2rem;
  transition: right var(--transition-base),
              background var(--transition-slow);
  box-shadow: var(--shadow-lg);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav__link {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-primary);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
  transition: color var(--transition-fast),
              padding-left var(--transition-base);
}

.mobile-nav__link:hover {
  color: var(--accent-warm);
  padding-left: 0.5rem;
}

.mobile-nav__theme-toggle {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.8rem 0;
  background: none;
  border: none;
  font-family: var(--font-body);
}

.mobile-nav__theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--accent-warm);
}


/* -------------------------------------------------------
   10. RESPONSIVE BREAKPOINTS
   ------------------------------------------------------- */

/* Tablets & below */
@media (max-width: 900px) {
  .navbar__links {
    display: none;
  }

  .navbar__hamburger {
    display: flex;
  }

  .mobile-nav-overlay,
  .mobile-nav {
    display: block;
  }

  .articles-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .hero {
    min-height: 70vh;
    padding: calc(var(--nav-height) + 3rem) 1.5rem 3rem;
  }

  .hero::before {
    width: 400px;
    height: 400px;
  }

  .hero::after {
    width: 350px;
    height: 350px;
  }

  .section {
    padding: 3.5rem 1.5rem;
  }
}

/* Phones */
@media (max-width: 600px) {
  :root {
    --nav-height: 60px;
  }

  .navbar__inner {
    padding: 0 1.25rem;
  }

  .navbar__logo {
    font-size: 1.3rem;
  }

  .hero {
    min-height: 65vh;
    padding: calc(var(--nav-height) + 2rem) 1.25rem 2.5rem;
  }

  .hero__title {
    font-size: 2.2rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .hero__cta {
    padding: 12px 24px;
    font-size: 0.82rem;
  }

  .hero::before {
    width: 280px;
    height: 280px;
  }

  .hero::after {
    width: 240px;
    height: 240px;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .card__image-wrapper {
    height: 180px;
  }

  .card__body {
    padding: 1.25rem;
  }

  .card__title {
    font-size: 1.15rem;
  }

  .section {
    padding: 3rem 1.25rem;
  }

  .section__title {
    font-size: 1.8rem;
  }

  .interlude {
    padding: 3.5rem 1.25rem;
  }

  .interlude::before {
    font-size: 6rem;
    top: 0.5rem;
  }

  .footer__inner {
    gap: 1.5rem;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .hero__title {
    font-size: 1.85rem;
  }

  .card__image-wrapper {
    height: 160px;
  }
}


/* -------------------------------------------------------
   11. UTILITY & ACCESSIBILITY
   ------------------------------------------------------- */
.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;
}

/* Focus styles for keyboard nav */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* -------------------------------------------------------
   12. ISLAMIC GOLDEN AGE — DECORATIVE ELEMENTS
   Geometric patterns, arabesque borders, and Moorish
   arch motifs inspired by Al-Andalus & Baghdad.
   ------------------------------------------------------- */

/* ---- Islamic Geometric Border Band ----
   A horizontal band of CSS-only 8-pointed star / 
   interlocking geometric pattern used as a section
   separator between major content areas. */
.islamic-border {
  position: relative;
  width: 100%;
  height: 48px;
  overflow: hidden;
  background: var(--bg-secondary);
  transition: background var(--transition-slow);
}

.islamic-border__inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SVG-based inline geometric repeat pattern */
.islamic-border__pattern {
  width: 100%;
  height: 100%;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='48' viewBox='0 0 60 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23A0845C' stroke-width='1'%3E%3Cpath d='M30 4 L38 12 L30 20 L22 12 Z'/%3E%3Cpath d='M30 28 L38 36 L30 44 L22 36 Z'/%3E%3Cpath d='M6 16 L14 24 L6 32 L-2 24 Z'/%3E%3Cpath d='M54 16 L62 24 L54 32 L46 24 Z'/%3E%3Cpath d='M18 12 L18 20 M42 12 L42 20 M18 28 L18 36 M42 28 L42 36'/%3E%3Cpath d='M22 12 L38 12 M22 36 L38 36'/%3E%3Cpath d='M14 24 L22 20 M38 20 L46 24 M14 24 L22 28 M38 28 L46 24'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  background-size: 60px 48px;
  transition: opacity var(--transition-slow);
}

[data-theme="journal"] .islamic-border__pattern {
  opacity: 0.2;
}

/* Central medallion on the border */
.islamic-border__medallion {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--accent-gold);
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background var(--transition-slow),
              border-color var(--transition-slow);
}

.islamic-border__medallion svg {
  width: 16px;
  height: 16px;
  color: var(--accent-gold);
}

/* ---- Arabesque Section Divider ----
   Ornamental divider with Islamic floral scroll motif */
.arabesque-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 1.5rem 0;
}

.arabesque-divider__line {
  width: 80px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-gold),
    var(--accent-warm),
    var(--accent-gold),
    transparent
  );
  transition: background var(--transition-slow);
}

.arabesque-divider__star {
  width: 24px;
  height: 24px;
  position: relative;
}

/* CSS-only 8-pointed star */
.arabesque-divider__star::before,
.arabesque-divider__star::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--accent-gold);
  transform: translate(-50%, -50%);
  transition: border-color var(--transition-slow);
}

.arabesque-divider__star::before {
  /* First square */
}

.arabesque-divider__star::after {
  /* Second square rotated 45° */
  transform: translate(-50%, -50%) rotate(45deg);
}

/* ---- Moorish Horseshoe Arch Section ----
   Decorative arch motif used for the "Notes" section */
.arch-section {
  position: relative;
  padding: 5rem 2rem;
  background: var(--bg-secondary);
  overflow: hidden;
  transition: background var(--transition-slow);
}

.arch-section__bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
  opacity: 0.04;
}

/* CSS Horseshoe arch shape */
.arch-section__arch {
  width: 300px;
  height: 400px;
  border: 2px solid var(--accent-warm);
  border-radius: 150px 150px 0 0;
  position: relative;
  margin-top: 3rem;
  transition: border-color var(--transition-slow);
}

.arch-section__arch::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 0;
  border: 1.5px solid var(--accent-gold);
  border-radius: 130px 130px 0 0;
  transition: border-color var(--transition-slow);
}

.arch-section__arch::after {
  content: '';
  position: absolute;
  top: 44px;
  left: 44px;
  right: 44px;
  bottom: 0;
  border: 1px solid var(--border-color);
  border-radius: 106px 106px 0 0;
  transition: border-color var(--transition-slow);
}

.arch-section__content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ---- Geometric Pattern Canvas ----
   Fullscreen canvas for animated Islamic star tessellation */
.geometric-canvas-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.geometric-canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---- Card Image Fallbacks ----
   CSS gradient backgrounds for cards that don't have
   generated images (House of Wisdom, Al-Andalus) */
.card__image--house-of-wisdom {
  background:
    radial-gradient(ellipse at 30% 40%,
      rgba(196, 162, 101, 0.4), transparent 60%),
    radial-gradient(ellipse at 70% 60%,
      rgba(43, 67, 110, 0.3), transparent 50%),
    linear-gradient(135deg,
      #3B2A1A 0%,
      #5C4230 20%,
      #7A5C3E 40%,
      #4A3520 60%,
      #2C1810 80%,
      #1A0F08 100%);
  /* Simulate bookshelves with repeating gradient */
  background-size: 100% 100%, 100% 100%, 100% 100%;
}

.card__image--andalus {
  background:
    radial-gradient(ellipse at 50% 30%,
      rgba(196, 162, 101, 0.5), transparent 50%),
    radial-gradient(ellipse at 30% 70%,
      rgba(88, 145, 130, 0.3), transparent 50%),
    linear-gradient(180deg,
      #C4A265 0%,
      #B89550 15%,
      #A08658 30%,
      #7A6B50 50%,
      #5C5040 70%,
      #3B3020 100%);
}

/* ---- Golden Age Feature Banner ----
   Horizontal info strip with geometric pattern accents */
.golden-age-banner {
  position: relative;
  padding: 3rem 2rem;
  background: var(--accent-deep);
  color: #FDF8F0;
  text-align: center;
  overflow: hidden;
}

.golden-age-banner::before,
.golden-age-banner::after {
  content: '';
  position: absolute;
  top: 0;
  width: 200px;
  height: 100%;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23C4A265' stroke-width='0.8'%3E%3Crect x='8' y='8' width='24' height='24'/%3E%3Crect x='8' y='8' width='24' height='24' transform='rotate(45 20 20)'/%3E%3Ccircle cx='20' cy='20' r='6'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 40px 40px;
}

.golden-age-banner::before {
  left: 0;
}

.golden-age-banner::after {
  right: 0;
}

.golden-age-banner__content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.golden-age-banner__title {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
  color: #FDF8F0;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.golden-age-banner__text {
  font-size: 0.92rem;
  color: rgba(253, 248, 240, 0.75);
  line-height: 1.7;
}

/* ---- Responsive adjustments for Islamic elements ---- */
@media (max-width: 600px) {
  .islamic-border {
    height: 36px;
  }

  .arch-section__arch {
    width: 200px;
    height: 280px;
    border-radius: 100px 100px 0 0;
  }

  .arch-section__arch::before {
    border-radius: 80px 80px 0 0;
  }

  .arch-section__arch::after {
    border-radius: 56px 56px 0 0;
  }

  .golden-age-banner {
    padding: 2rem 1.25rem;
  }

  .arabesque-divider__line {
    width: 50px;
  }
}


/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-warm);
}
