/*
Theme Name: She Wrote It Down
Theme URI: https://shewroteitdown.com
Author: Anonymous
Author URI: https://shewroteitdown.com
Description: A dark, raw, literary WordPress theme for anonymous short fiction. Built for stories that bleed. Minimal, immersive, confessional.
Version: 3.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: she-wrote-it-down
Tags: blog, one-column, custom-menu, custom-logo, featured-images, dark, literary
*/

/* ========================================
   VARIABLES & RESET
   ======================================== */
:root {
  --bg: #F5F0EB;
  --bg-warm: #EDE7E0;
  --bg-subtle: #E8E1D9;
  --surface: #E8E1D9;
  --border: #D9D0C7;
  --border-light: #E2DBD3;
  --muted: #B8AFA5;
  --dim: #8A7F73;
  --mid: #6B6159;
  --text: #3A332C;
  --text-light: #4A433B;
  --heading: #1A1714;
  --accent: #9B2C2C;
  --accent-hover: #7C2323;
  --accent-glow: rgba(155, 44, 44, 0.1);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

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

/* Scrollbar - proper width, styled */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-warm); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; border: 2px solid var(--bg-warm); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
html { scrollbar-width: thin; scrollbar-color: var(--border) var(--bg-warm); }

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.85;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ========================================
   GRAIN OVERLAY
   ======================================== */
body::after {
  content: '';
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999; opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes lineGrow {
  from { width: 0; }
  to { width: 60px; }
}
@keyframes pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.55; }
}

.fade-up { animation: fadeUp 0.8s ease both; }
.fade-in { animation: fadeIn 0.6s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ========================================
   LAYOUT
   ======================================== */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-content {
  flex: 1;
}
.container {
  max-width: 800px;
  margin-left: 50px;
  padding: 0 30px;
}
.container--narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 30px;
}

/* ========================================
   HEADER
   ======================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 28px 40px;
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(to bottom, rgba(245,240,235,0.98) 70%, rgba(245,240,235,0));
  transition: all 0.5s ease;
}
.site-header.scrolled {
  background: rgba(245,240,235,0.98);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  padding: 20px 40px;
}
.site-logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--heading);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.3s;
}
.site-logo:hover { color: var(--accent); }

.main-nav { display: flex; gap: 32px; align-items: center; }
.main-nav a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mid);
  background: none;
  border: none;
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
  padding-bottom: 2px;
}
.main-nav a::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.main-nav a:hover { color: var(--heading); }
.main-nav a:hover::after { width: 100%; }

.main-nav .nav-membership {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 10px 24px;
  background: var(--accent);
  color: #F5F0EB;
  text-decoration: none;
  border: none;
  transition: all 0.3s ease;
}
.main-nav .nav-membership:hover {
  background: var(--accent-hover);
}
.main-nav .nav-membership::after { display: none; }

.nav-hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 32px; height: 20px; position: relative;
  flex-direction: column; justify-content: space-between;
}
.nav-hamburger span {
  display: block; width: 100%; height: 2px;
  background: var(--heading); transition: all 0.3s ease;
}

/* ========================================
   MENU OVERLAY
   ======================================== */
.menu-overlay {
  display: none;
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(245,240,235,0.98);
  z-index: 100;
  flex-direction: column; justify-content: center; align-items: center; gap: 40px;
  backdrop-filter: blur(20px);
}
.menu-overlay.open { display: flex; animation: fadeIn 0.3s ease; }
.menu-overlay__close {
  position: absolute; top: 32px; right: 40px;
  background: none; border: none;
  color: var(--mid); font-size: 13px;
  font-family: var(--font-mono); letter-spacing: 3px;
  cursor: pointer; transition: color 0.3s;
  text-transform: uppercase;
}
.menu-overlay__close:hover { color: var(--heading); }
.menu-overlay__link {
  font-family: var(--font-display);
  font-size: 52px; color: var(--muted);
  background: none; border: none;
  transition: all 0.4s ease;
  display: block; text-decoration: none;
  font-weight: 400;
}
.menu-overlay__link:hover {
  color: var(--heading);
  transform: translateX(16px);
}
.menu-overlay__cta {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 3px;
  text-transform: uppercase;
  padding: 16px 40px;
  background: var(--accent);
  color: #F5F0EB;
  text-decoration: none;
  transition: background 0.3s;
  display: inline-block;
}
.menu-overlay__cta:hover { background: var(--accent-hover); }

/* RESPONSIVE NAV */
@media (max-width: 768px) {
  .main-nav a:not(.nav-membership),
  .main-nav .nav-membership { display: none; }
  .nav-hamburger { display: flex; }
  .site-header { padding: 20px 24px; }
  .menu-overlay__link { font-size: 38px; }
}

/* ========================================
   HERO (Front Page)
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 0 30px;
  position: relative;
}
.hero__line {
  position: absolute; left: 30px; top: 15%; width: 1px; height: 70%;
  background: linear-gradient(to bottom, transparent, var(--muted), transparent);
}
.hero__content {
  max-width: 700px; margin-left: 50px;
}
.hero__label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 5px;
  color: var(--accent); text-transform: uppercase; margin-bottom: 30px;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 80px);
  font-weight: 400; line-height: 1.05;
  color: var(--heading); margin-bottom: 30px;
}
.hero__title em { font-style: italic; color: var(--accent); }
.hero__rule {
  width: 70px; height: 2px; background: var(--accent);
  margin-bottom: 36px;
  animation: lineGrow 1s ease 0.8s both;
}
.hero__subtitle {
  font-size: 20px; line-height: 1.8; color: var(--mid);
  max-width: 520px; font-weight: 300; font-style: italic;
  font-family: var(--font-display);
}
.hero__scroll {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: pulse 3s ease infinite;
}
.hero__scroll span {
  font-family: var(--font-mono); font-size: 8px; letter-spacing: 3px; color: var(--dim);
}
.hero__scroll-line { width: 1px; height: 30px; background: var(--dim); }

/* ========================================
   STORY CARDS (Index / Archive)
   ======================================== */
.stories-feed { padding: 80px 0 120px; }
.stories-feed__label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 5px;
  color: var(--mid); text-transform: uppercase; margin-bottom: 60px;
}

.story-card {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  transition: transform 0.5s cubic-bezier(0.23,1,0.32,1);
}
.story-card:hover { transform: translateX(8px); }
.story-card:hover .story-card__num { color: var(--accent); }
.story-card:hover .story-card__title { color: var(--heading); }
.story-card:hover .story-card__rule { width: 40px; background: var(--accent); }

.story-card__num {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--dim); letter-spacing: 2px; padding-top: 8px;
  transition: color 0.4s; flex-shrink: 0;
}
.story-card__body { flex: 1; }
.story-card__meta {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
}
.story-card__cat {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 3px; color: var(--accent);
  text-transform: uppercase;
}
.story-card__time {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px; color: var(--dim);
}
.story-card__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 500; color: var(--heading);
  line-height: 1.25; margin-bottom: 14px;
  transition: color 0.4s;
}
.story-card__excerpt {
  font-size: 17px; line-height: 1.75; color: var(--mid);
  font-weight: 300; font-style: italic;
}
.story-card__rule {
  width: 20px; height: 1px; background: var(--dim);
  margin-top: 16px; transition: all 0.5s ease;
}

.archive-link {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 60px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 3px;
  color: var(--mid); text-transform: uppercase;
  transition: color 0.3s;
}
.archive-link:hover { color: var(--heading); }

/* ========================================
   PULLQUOTE
   ======================================== */
.pullquote {
  padding: 100px 30px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.pullquote__text {
  max-width: 600px; margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 300; line-height: 1.4;
  color: var(--heading); font-style: italic;
}
.pullquote__text em { color: var(--accent); }
.pullquote__rule {
  width: 40px; height: 1px; background: var(--accent);
  margin: 30px auto 0;
}

/* ========================================
   SINGLE STORY
   ======================================== */
.single-story { padding: 120px 0 100px; }

.story-header__cat {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 4px;
  color: var(--accent); margin-bottom: 8px; text-transform: uppercase;
}
.story-header__num {
  font-family: var(--font-mono); font-size: 48px;
  color: var(--surface); font-weight: 700; line-height: 1; margin-bottom: 12px;
}
.story-header__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 400; line-height: 1.15;
  color: var(--heading); margin-bottom: 24px;
}
.story-header__meta {
  display: flex; gap: 20px;
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 2px; color: var(--dim);
}
.story-divider {
  width: 60px; height: 1px; background: var(--accent); margin: 40px 0;
}

/* Story Body */
.story-body p {
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.85; color: var(--text);
  margin-bottom: 32px; font-weight: 300;
}
.story-body p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.6em; float: left;
  line-height: 0.78; padding-right: 10px; padding-top: 8px;
  color: var(--accent); font-weight: 500;
}
.story-body blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 24px; margin: 40px 0;
  font-style: italic; color: var(--mid);
}

/* Story End */
.story-end {
  display: flex; align-items: center; gap: 16px; margin-top: 60px;
}
.story-end__line { width: 40px; height: 1px; background: var(--muted); }
.story-end__text {
  font-family: var(--font-mono); font-size: 8px; letter-spacing: 4px; color: var(--dim);
}

/* Story Navigation */
.story-nav {
  margin-top: 80px; padding-top: 40px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
}
.story-nav__item { transition: opacity 0.3s; }
.story-nav__item:hover { opacity: 0.7; }
.story-nav__item--next { text-align: right; margin-left: auto; }
.story-nav__label {
  font-family: var(--font-mono); font-size: 8px; letter-spacing: 3px;
  color: var(--dim); margin-bottom: 8px;
}
.story-nav__title {
  font-family: var(--font-display); font-size: 18px; color: var(--mid);
}

/* ========================================
   ARCHIVE PAGE
   ======================================== */
.archive-header { padding: 120px 0 0; }
.archive-header__title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400; color: var(--heading); margin-bottom: 16px;
}
.archive-header__sub {
  font-size: 16px; color: var(--mid); font-style: italic;
  font-weight: 300; margin-bottom: 50px;
}

/* Category Filters */
.category-filters {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 50px;
  list-style: none;
}
.category-filters a {
  display: inline-block;
  border: 1px solid var(--muted);
  color: var(--mid); padding: 6px 16px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 2px;
  text-transform: uppercase; transition: all 0.3s;
}
.category-filters a:hover,
.category-filters a.active {
  border-color: var(--accent); color: var(--text-light);
  background: var(--accent-glow);
}

/* ========================================
   PAGE (About etc)
   ======================================== */
.page-content { padding: 120px 0 100px; }
.page-content__label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 5px;
  color: var(--accent); text-transform: uppercase; margin-bottom: 30px;
}
.page-content__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 400; color: var(--heading); line-height: 1.15; margin-bottom: 40px;
}
.page-content__title em { font-style: italic; color: var(--mid); }
.page-content__rule { width: 60px; height: 1px; background: var(--accent); margin-bottom: 40px; }
.page-content__body p {
  font-size: 19px; line-height: 1.85; color: var(--text);
  font-weight: 300; margin-bottom: 28px;
}

/* ========================================
   BACK BUTTON
   ======================================== */
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--mid);
  background: none; border: none; margin-bottom: 50px;
  transition: color 0.3s;
}
.back-btn:hover { color: var(--heading); }

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  padding: 60px 30px; text-align: center;
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 3px; color: var(--muted);
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
  margin-top: 60px; display: flex; gap: 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px;
}
.pagination a, .pagination span {
  color: var(--mid); padding: 8px 14px;
  border: 1px solid var(--muted); transition: all 0.3s;
}
.pagination a:hover, .pagination .current {
  border-color: var(--accent); color: var(--text-light);
  background: var(--accent-glow);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .container { margin-left: 0; }
  .hero__content { margin-left: 20px; }
  .hero__line { left: 15px; }
  .story-card { gap: 14px; padding: 30px 0; }
  .story-nav { flex-direction: column; gap: 30px; }
  .story-nav__item--next { text-align: left; margin-left: 0; }
  .feed { margin-left: 0; padding: 60px 20px 80px; }
  .archive-header { padding: 100px 0 0; }
  .container--narrow { padding: 0 20px; }
  .single-story { padding: 100px 0 80px; }
}
