/* ================================================================
   Kristel Rietesel-Low — Poetry Site
   "Folio" — editorial asymmetric layout. Sticky photo column on
   desktop; full-bleed photo above content on mobile. Cormorant
   Garamond display, Source Serif 4 body. Hairline rules, italic
   eyebrows, generous negative space.
   ================================================================ */

/* --- Reset & Base --- */

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

:root {
  --color-bg: #f4f5f2;
  --color-bg-warm: #eef0ec;
  --color-paper: #faf9f5;
  --color-text: #1a1d1a;
  --color-text-light: #6b7266;
  --color-text-faint: #9aa094;
  --color-accent: #4a5648;
  --color-border: #d4d8d0;
  --color-rule-soft: #e0e3da;
  --color-link: #3d4a3b;
  --color-link-hover: #1a1d1a;

  --font-display: 'Cormorant Garamond', 'Garamond', 'Georgia', serif;
  --font-body: 'Source Serif 4', 'Georgia', serif;

  --content-pad-x: 4rem;
  --content-pad-y: 3rem;
}

html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  /* Intentionally 300 (light). Assumes Retina/HiDPI displays. Prettier than 400. */
  font-weight: 300;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  margin: 0;
  min-height: 100vh;
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-link-hover);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

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

/* --- Typography --- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-text);
}

h1 { font-size: 2.4rem; letter-spacing: -0.005em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

/* ============================================================
   FOLIO — top-level page shell
   ============================================================ */

.folio {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
  align-items: stretch;
  background: var(--color-bg);
}

/* --- Photo column ---
   The cell stretches naturally with the grid row (so secondary pages
   with long content keep a coloured column instead of falling back to
   page bg). Inside, .folio-photo-image is sticky to the viewport top
   so the photo stays visible while the content column scrolls past. */

.folio-photo {
  position: relative;
  width: 100%;
  background: var(--color-bg-warm);
}

.folio-photo-image {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  background-color: var(--color-bg-warm);
  background-size: cover;
  background-position: center 38%;
  background-repeat: no-repeat;
  transition: opacity 200ms ease;
}

/* Soft photo cross-fade on cross-page nav.
   Only applies when JS is present (.js-fade) and the user hasn't
   asked us to skip motion. Default = no JS = photo shows immediately. */
@media (prefers-reduced-motion: no-preference) {
  html.js-fade .folio-photo-image { opacity: 0; }
  html.js-fade.is-ready .folio-photo-image { opacity: 1; }
  html.js-fade.is-leaving .folio-photo-image { opacity: 0; }
}

/* Hairline meeting edge between photo and content column. */
.folio-photo-image::after {
  content: '';
  position: absolute;
  top: 8%;
  bottom: 8%;
  right: 0;
  width: 1px;
  background: rgba(20, 30, 20, 0.18);
  pointer-events: none;
}

/* Empty (no photo) — soft typographic plate so the column doesn't read as broken. */
.folio-photo-image--empty {
  background:
    radial-gradient(ellipse 60% 40% at 30% 30%, rgba(74, 86, 72, 0.06), transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(74, 86, 72, 0.04), transparent 60%),
    var(--color-bg-warm);
}

/* --- Content column --- */

.folio-content {
  display: flex;
  flex-direction: column;
  padding: var(--content-pad-y) var(--content-pad-x);
  min-height: 100vh;
  background: var(--color-bg);
}

/* --- Top bar (mark + nav) --- */

.folio-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4rem;
}

/* When the mark is suppressed (Home/About already show the name in the H1),
   keep the nav right-aligned so it doesn't drift to the left edge. */
.folio-top--no-mark { justify-content: flex-end; }

.folio-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--color-text-light);
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.2s;
}

.folio-mark:hover { color: var(--color-text); }

.folio-nav {
  display: flex;
  gap: 2rem;
}

.folio-nav .nav-link {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text-light);
  text-decoration: none;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.folio-nav .nav-link:hover,
.folio-nav .nav-link.active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/* --- Page region (between top bar and footer) --- */

.folio-page { flex: 1; }

/* --- Title block (every page has one) --- */

.folio-titleblock { margin-top: -1rem; }

.folio-eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1rem;
  color: var(--color-text-light);
  letter-spacing: 0.06em;
  margin-bottom: 1.2rem;
}

.folio-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: -0.005em;
  color: var(--color-text);
  margin-bottom: 1.2rem;
}

.folio-title em {
  display: block;
  font-style: italic;
  font-weight: 300;
  color: var(--color-text-light);
  font-size: 0.4em;
  letter-spacing: 0.04em;
  line-height: 1.4;
  margin-top: 0.7rem;
  max-width: 32ch;
}

/* Quiet title variant — used for section pages (e.g. Publications) where the
   nav already declares the section name. Replaces the eyebrow + huge H1 stack
   with a single contemplative line marked by a short hairline rule above,
   echoing the chapter-opener typography of a print poetry collection. */
.folio-titleblock--quiet { margin-bottom: 1.4rem; }

.folio-quiet-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.75rem, 2.6vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--color-text);
  margin: 0;
  padding-top: 1.6rem;
  position: relative;
}

.folio-quiet-title::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2.4rem;
  height: 1px;
  background: var(--color-text-light);
}

/* --- Section pattern (Latest, Publications, Bio, Links) --- */

.folio-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-rule-soft);
}

.folio-section-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1rem;
  color: var(--color-text-light);
  letter-spacing: 0.08em;
  margin-bottom: 1.6rem;
  text-transform: uppercase;
}

/* --- Foot row --- */

.folio-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--color-rule-soft);
  font-family: var(--font-body);
  font-size: 0.58rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  opacity: 0.75;
}

.folio-foot .build-timestamp {
  font-size: 0.52rem;
  color: var(--color-text-faint);
  letter-spacing: 0.1em;
}

/* ============================================================
   Page-specific content
   ============================================================ */

/* --- Home: latest update entries --- */

.folio-updates .update-entry {
  padding: 1.4rem 0;
  border-top: 1px solid var(--color-rule-soft);
}
.folio-updates .update-entry:first-of-type {
  border-top: none;
  padding-top: 0;
}

.update-date {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

.update-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
}

.update-body p {
  margin-bottom: 1rem;
  line-height: 1.75;
}

/* --- Publications --- */

.folio-publications { padding-top: 1.4rem; }

.poems-year-group {
  margin-bottom: 2.2rem;
}

.poems-year {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--color-text-light);
  letter-spacing: 0.08em;
  margin-bottom: 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-rule-soft);
  text-transform: uppercase;
}

.citation-list { list-style: none; padding: 0; }

.citation-list li {
  padding: 0.4rem 0;
  font-size: 0.92rem;
  line-height: 1.65;
}

.citation-pub { font-style: italic; }

/* Shared link style: hairline border-bottom, never default underline.
   Used by both publication-name links and the "read" affordance. */
a.citation-link {
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: border-color 0.2s, color 0.2s;
}
a.citation-link:hover {
  border-bottom-color: var(--color-accent);
  color: var(--color-link-hover);
}

a.citation-read {
  font-size: 0.72rem;
  font-style: italic;
  letter-spacing: 0.04em;
  margin-left: 0.35em;
  color: var(--color-text-light);
}
a.citation-read:hover { color: var(--color-text); }

.citation-detail { color: var(--color-text-light); }

/* --- About: bio + links --- */

.about-bio { max-width: 56ch; }
.about-bio p { margin-bottom: 1rem; }

/* Optional inline portrait inside the bio prose. Floats to the right on
   desktop with text wrapping around it; full-width above the prose on
   mobile. Aspect ratio is phone-portrait-ish so a head-and-shoulders or
   flower crop centers cleanly. */
.bio-inline-photo {
  float: right;
  width: 200px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  margin: 0.4rem 0 1.2rem 1.6rem;
  border: 1px solid var(--color-rule-soft);
}
@media (max-width: 800px) {
  .bio-inline-photo {
    float: none;
    display: block;
    width: 60%;
    max-width: 240px;
    margin: 0 auto 1.4rem;
  }
}

.links-list { list-style: none; padding: 0; }
.links-list li {
  padding: 0.55rem 0;
  border-top: 1px solid var(--color-rule-soft);
  font-size: 0.92rem;
}
.links-list li:first-child { border-top: none; }
.links-list a { font-weight: 400; }
.link-desc {
  color: var(--color-text-light);
  font-size: 0.82rem;
  margin-left: 0.4rem;
  font-style: italic;
}

/* ============================================================
   Fuzzy search (publications page)
   ============================================================ */

.search-wrap { margin-bottom: 1.4rem; }

.search-hint {
  font-size: 0.82rem;
  color: var(--color-text-light);
  text-align: center;
  padding: 0.7rem 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  cursor: pointer;
}

.search-no-results {
  text-align: center;
  padding: 2rem 0;
  color: var(--color-text-light);
  font-style: italic;
  font-size: 0.9rem;
}

.search-hint kbd {
  display: inline-block;
  padding: 0.1em 0.4em;
  font-family: var(--font-body);
  font-size: 0.72rem;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text-light);
}

.search-bar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-border);
  animation: search-fade-in 0.15s ease-out;
}

@keyframes search-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: var(--color-text);
  background: transparent;
  border: none;
  outline: none;
  padding: 0.25rem 0;
}

.search-input::placeholder { color: var(--color-border); }

.search-hint-dismiss {
  font-size: 0.72rem;
  color: var(--color-border);
  visibility: hidden;
  white-space: nowrap;
}

/* ============================================================
   Responsive — collapse Folio to single column on narrow screens
   ============================================================ */

/* Tablet: tighten the content column padding so titles don't wrap awkwardly. */
@media (max-width: 1100px) {
  :root {
    --content-pad-x: 2.5rem;
    --content-pad-y: 2.5rem;
  }
}

/* Mobile: photo becomes a top hero, content stacks beneath it. */
@media (max-width: 800px) {
  html { font-size: 16px; }

  .folio {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .folio-photo,
  .folio-photo-image {
    position: static;
    height: 48vh;
    min-height: 280px;
  }
  .folio-photo-image::after { display: none; }

  .folio-content {
    padding: 2rem 1.5rem 2.5rem;
    min-height: auto;
  }

  .folio-top {
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .folio-nav { gap: 1.4rem; }

  .folio-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 3rem;
  }
}
