/*
Theme Name: MothFrenzy
Theme URI: https://example.com/mothfrenzy
Author: Shane
Description: A quiet editorial theme inspired by soft-lit essays, poetry, and marginal notes.
Version: 1.0.0
Text Domain: mothfrenzy
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
*/

:root {
  --mf-bg: #eef2ff;
  --mf-surface: #f5f7ff;
  --mf-surface-strong: #e7ebff;
  --mf-surface-alt: #edf1ff;
  --mf-text: #232942;
  --mf-muted: #5d678b;
  --mf-heading: #1d223d;
  --mf-accent: #d28a4a;
  --mf-accent-soft: rgba(210, 138, 74, 0.12);
  --mf-border: rgba(93, 103, 139, 0.2);
  --mf-shadow: rgba(58, 66, 92, 0.14);
  --mf-glow: rgba(142, 157, 255, 0.18);
  --mf-nav: rgba(244, 246, 255, 0.7);
}

html[data-theme='dark'] {
  --mf-bg: #0f1220;
  --mf-surface: #171b2f;
  --mf-surface-strong: #1d2440;
  --mf-surface-alt: #202843;
  --mf-text: #e9ebff;
  --mf-muted: #b5bddb;
  --mf-heading: #f4ecff;
  --mf-accent: #d9a86c;
  --mf-accent-soft: rgba(217, 168, 108, 0.18);
  --mf-border: rgba(173, 182, 217, 0.2);
  --mf-shadow: rgba(11, 12, 21, 0.45);
  --mf-glow: rgba(121, 140, 255, 0.28);
  --mf-nav: rgba(17, 19, 29, 0.62);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top, rgba(134, 147, 255, 0.2), transparent 35%),
    linear-gradient(180deg, var(--mf-bg) 0%, var(--mf-bg) 100%);
  color: var(--mf-text);
  line-height: 1.6;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
}

/* WordPress core alignment fix */
.alignwide,
.alignfull {
  width: auto;
}

.mothfrenzy-shell {
  min-height: 100vh;
}

.mothfrenzy-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 110px 0 40px;
}

.mothfrenzy-hero {
  position: relative;
  padding: 42px 28px 32px;
  border: 1px solid var(--mf-border);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(125, 140, 255, 0.12), rgba(217, 168, 108, 0.04)),
    var(--mf-surface);
  box-shadow: 0 18px 40px var(--mf-shadow);
  overflow: hidden;
}

.mothfrenzy-hero::before {
  content: '';
  position: absolute;
  inset: auto -35% -35% -12%;
  height: 220px;
  background: radial-gradient(circle, var(--mf-glow), transparent 58%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--mf-accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.22rem;
  text-transform: uppercase;
}

.mothfrenzy-hero h1,
.section-heading h2,
.story-card h3,
.book-copy h3,
.poem-card h3 {
  color: var(--mf-heading);
}

.mothfrenzy-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.5rem, 4vw, 5rem);
  line-height: 0.97;
  letter-spacing: -0.06em;
}

.mothfrenzy-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin-top: 18px;
  font-size: 1.08rem;
  color: var(--mf-muted);
}

.mothfrenzy-section {
  margin-top: 36px;
  padding-top: 20px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 2vw, 2.6rem);
  line-height: 1.1;
}

.card-grid,
.book-list,
.poetry-grid,
.errata-list {
  display: grid;
  gap: 20px;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.story-card,
.book-item,
.poem-card,
.errata-item {
  background: var(--mf-surface);
  border: 1px solid var(--mf-border);
  border-radius: 20px;
  padding: 22px 20px;
  box-shadow: 0 18px 40px var(--mf-shadow);
}

.accent-card {
  background: linear-gradient(180deg, var(--mf-surface) 0%, var(--mf-surface-strong) 100%);
}

.story-meta {
  margin: 0 0 10px;
  color: var(--mf-accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
}

.story-card h3,
.book-copy h3,
.poem-card h3 {
  margin: 0 0 12px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.story-card p,
.book-copy p,
.errata-item p,
.poem-line {
  margin: 0;
  color: var(--mf-muted);
}

.book-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.book-item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.book-cover {
  display: grid;
  place-items: center;
  width: 72px;
  height: 88px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--mf-accent-soft), rgba(129, 144, 255, 0.28));
  color: var(--mf-heading);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  border: 1px solid var(--mf-border);
}

.poetry-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.poem-card {
  background: linear-gradient(180deg, rgba(119, 131, 202, 0.09), var(--mf-surface));
}

.poem-line + .poem-line {
  margin-top: 8px;
}

.errata-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mothfrenzy-footer {
  border-top: 1px solid var(--mf-border);
  background: rgba(12, 15, 24, 0.02);
}

.mothfrenzy-footer p {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
  color: var(--mf-muted);
}

.mothfrenzy-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: transparent;
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.mothfrenzy-nav.is-scrolled {
  background: var(--mf-nav);
  border-bottom: 1px solid var(--mf-border);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.08);
}

.mothfrenzy-nav-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}

.brand-wrap,
.theme-toggle-wrap {
  display: flex;
  align-items: center;
}

.theme-toggle-wrap {
  justify-content: flex-end;
}

.brand,
.theme-toggle,
.nav-link {
  border: none;
  background: transparent;
  color: var(--mf-heading);
}

.brand {
  padding: 0;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  text-align: left;
}

.mothfrenzy-nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--mf-muted);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(158, 167, 255, 0.12);
  color: var(--mf-heading);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(158, 167, 255, 0.12);
  border: 1px solid var(--mf-border);
  transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(158, 167, 255, 0.18);
}

@media (max-width: 820px) {
  .mothfrenzy-nav-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 14px 0 12px;
  }

  .brand-wrap,
  .theme-toggle-wrap {
    justify-content: center;
  }

  .mothfrenzy-page {
    padding-top: 22px;
  }

  .card-grid,
  .book-list,
  .poetry-grid,
  .errata-list {
    grid-template-columns: 1fr;
  }

  .book-item {
    flex-direction: column;
  }
}
