/* ============================================================
   SANCTUARY — styles.css
   Shared stylesheet for all pages
   ============================================================ */

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

/* === CUSTOM PROPERTIES === */
:root {
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  --color-bg:        #FAF8F5;
  --color-bg-warm:   #F0EAE0;
  --color-text:      #1A1816;
  --color-text-muted:#6B6158;
  --color-accent:    #8C7A63;
  --color-border:    #DDD5C8;
  --color-border-lt: #EDE8E1;

  --max-width:    1100px;
  --read-width:   680px;
  --nav-height:   72px;

  --sp-xs:  0.5rem;
  --sp-sm:  1rem;
  --sp-md:  2rem;
  --sp-lg:  3.5rem;
  --sp-xl:  6rem;
  --sp-2xl: 10rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: transparent;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === PERSISTENT FIXED BACKGROUND IMAGE === */
/* Sits behind every page. Hero sections are transparent so this shows through.
   Page content has background: var(--color-bg) and scrolls up over the image. */
body::before {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background-image: url('assets/hero-image.png');
  background-size: cover;
  background-position: center 18%;
}

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

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

ul {
  list-style: none;
}

/* === SKIP LINK === */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-sm);
  background: var(--color-text);
  color: var(--color-bg);
  padding: 0.5rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  z-index: 9999;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: var(--sp-sm);
}

/* === NAVIGATION === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.nav-container {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-md);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.3125rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--color-text);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
}

.nav-links a.nav-cta {
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 0.5rem 1.25rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-links a.nav-cta:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background-color: var(--color-text);
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* === LAYOUT CONTAINERS === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-md);
}

main {
  min-height: calc(100vh - var(--nav-height));
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 300;
}

h2 {
  font-size: clamp(1.625rem, 3vw, 2.375rem);
  font-weight: 400;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 400;
}

p {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--color-text);
}

/* === HERO SECTIONS (Home + all interior pages) === */
/* Transparent so the fixed body::before image shows through.
   Overlay dims the image gently; content scrolls up over it. */

.home-hero,
.page-hero {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.home-hero,
.page-hero {
  height: 70vh;
  min-height: 480px;
}

.hero-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(16, 11, 7, 0.25);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-content h1 {
  font-size: clamp(2.25rem, 5.5vw, 4.5rem);
  font-weight: 300;
  font-style: italic;
  color: rgba(255, 252, 248, 0.96);
  max-width: 820px;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.22);
}

/* Subtitle line in hero (e.g. Reflections page) */
.hero-subtitle {
  margin-top: 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
  color: rgba(255, 252, 248, 0.78);
  letter-spacing: 0.02em;
}

/* === PAGE BODY (scrolling content beneath hero) === */
/* Solid warm background scrolls up over the fixed hero image */
.page-body {
  background-color: var(--color-bg);
  position: relative;
  z-index: 1;
}

.home-body {
  background-color: var(--color-bg);
  position: relative;
  z-index: 1;
  padding-top: var(--sp-xl);
  padding-bottom: var(--sp-2xl);
}

.home-body .prose {
  max-width: var(--read-width);
}

.home-body .prose p {
  margin-bottom: 1.5rem;
}

.home-body .prose p:last-of-type {
  margin-bottom: 0;
}

/* .page-header removed — replaced by .page-hero + .hero-content */

/* === PAGE BODY SPACING === */
.page-body > .container {
  padding-top: var(--sp-xl);
  padding-bottom: var(--sp-2xl);
}

/* === ABOUT PAGE === */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 5rem;
  align-items: start;
}

.about-text p {
  margin-bottom: 1.5rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.text-divider {
  width: 40px;
  height: 1px;
  background-color: var(--color-border);
  margin: 2.5rem 0;
}

.about-image-col {
  position: sticky;
  top: calc(var(--nav-height) + var(--sp-lg));
}

.image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  background-color: var(--color-bg-warm);
  border: 1px solid var(--color-border-lt);
}

/* actual img tag when the user adds their photo */
.about-image-col img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

/* === THE WORK PAGE === */
.work-content {
  max-width: var(--read-width);
}

.work-content p {
  margin-bottom: 2.5rem;
  line-height: 1.35;
}

.work-content p:last-of-type {
  margin-bottom: 0;
}

.work-content .cta-wrapper {
  margin-top: 5rem;
}

.anchor-line {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem;
  font-style: italic;
  color: #3a3530;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.anchor-block {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.final-block {
  margin-top: 3.5rem;
}

.threshold {
  margin: 3rem 0;
}

.threshold-line {
  display: block;
  width: 3rem;
  height: 1px;
  background-color: #c5b9af;
}

.cta-section {
  margin-top: 4rem;
  margin-bottom: 2rem;
}

/* === REFLECTIONS PAGE === */
/* Reduced top padding for reflections — grid starts immediately, 6rem felt cavernous */
.container--narrow-top {
  padding-top: 3rem;
}

.reflections-content {
}

.reflections-intro {
  font-size: 1.0625rem;
  font-weight: 300;
  color: var(--color-text-muted);
  font-style: italic;
  max-width: var(--read-width);
  margin-bottom: var(--sp-xl);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  list-style: none;
}

.article-card {
  padding: var(--sp-lg) var(--sp-md) var(--sp-md) 0;
  border-right: 1px solid var(--color-border);
}

.article-card:last-child {
  border-right: none;
  padding-right: 0;
}

.article-card:not(:first-child) {
  padding-left: var(--sp-md);
}

.article-card .card-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.article-card h3 {
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.875rem;
}

.article-card p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--sp-sm);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.025em;
  color: var(--color-accent);
  transition: gap 0.2s ease;
}

.read-more:hover {
  gap: 0.625rem;
}

.substack-callout {
  margin-top: 2.5rem;
  padding-top: 0;
  max-width: var(--read-width);
}

.substack-callout p {
  margin-bottom: var(--sp-lg);
  color: var(--color-text-muted);
  font-style: italic;
}

/* === BOOK PAGE === */
.book-content {
  max-width: var(--read-width);
}

.book-content p {
  margin-bottom: 1.5rem;
}

.book-content p:last-of-type {
  margin-bottom: 0;
}

/* === SHARED PROSE === */
.section-rule {
  width: 40px;
  height: 1px;
  background-color: var(--color-accent);
  margin: 2.5rem 0;
}

.cta-wrapper {
  margin-top: var(--sp-xl);
}

/* === BUTTONS === */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 0.9375rem 2.25rem;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* === FOOTER (parallax image) === */
/* Own background-attachment: fixed so the image stays anchored to the
   viewport as the page scrolls — same image, same room as the hero */
.site-footer {
  position: relative;
  z-index: 1;
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('assets/hero-image.png');
  background-size: cover;
  background-position: center 18%;
  background-attachment: fixed;
}

.footer-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(16, 11, 7, 0.30);
  z-index: 0;
}

.footer-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--sp-xl) var(--sp-md);
}

.footer-name {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.06em;
  color: rgba(255, 252, 248, 0.95);
  margin-bottom: 0.75rem;
}

.footer-tagline {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 300;
  font-style: italic;
  color: rgba(255, 252, 248, 0.78);
  line-height: 1.7;
  margin-bottom: var(--sp-sm);
}

.footer-email {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 300;
  letter-spacing: 0.025em;
  color: rgba(255, 252, 248, 0.55);
}

.footer-email a {
  color: rgba(255, 252, 248, 0.55);
  transition: color 0.2s ease;
}

.footer-email a:hover {
  color: rgba(255, 252, 248, 0.90);
}

/* === FOCUS STATES === */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* === FADE-IN ANIMATIONS === */
@media (prefers-reduced-motion: no-preference) {
  .fade-in {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }

  .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* === RESPONSIVE — TABLET === */
@media (max-width: 900px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: var(--sp-lg);
  }

  .about-image-col {
    position: static;
    max-width: 280px;
  }

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

  .article-card {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: var(--sp-lg) 0;
  }

  .article-card:not(:first-child) {
    padding-left: 0;
  }
}

/* === RESPONSIVE — MOBILE === */
@media (max-width: 768px) {
  :root {
    --sp-xl:  4rem;
    --sp-2xl: 6rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0 var(--sp-md);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.875rem 0;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--color-border-lt);
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  .nav-links a.nav-cta {
    border: none;
    border-bottom: none;
    padding: 0.875rem 0;
  }

  .home-hero,
  .page-hero {
    height: 60vh;
    min-height: 380px;
  }
}

@media (max-width: 480px) {
  :root {
    --sp-md:  1.5rem;
    --sp-lg:  3rem;
  }
}
