/* =============================================================
   Julie's Garden — STRUCTURE & COMPONENTS
   Reads every color/font/size from theme.css. Edit the theme,
   not this file, to reskin.
   ============================================================= */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--color-accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--color-accent); }

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

/* ---- Page shell: sidebar + main ------------------------------ */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100dvh;
}

@media (min-width: 60rem) {
  .layout { grid-template-columns: var(--sidebar-w) 1fr; }
}

/* ---- Sidebar -------------------------------------------------- */
.sidebar {
  background: var(--color-sidebar);
  color: var(--color-sidebar-ink);
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 60rem) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
  }
}

.masthead__eyebrow {
  font-size: var(--step--1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-sidebar-mut);
  margin: 0 0 0.35rem;
}
.masthead__title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: var(--step-2);
  line-height: 1.05;
  margin: 0;
  color: var(--color-sidebar-ink);
}
.masthead__tagline {
  font-size: var(--step--1);
  color: var(--color-sidebar-mut);
  margin: 0.6rem 0 0;
  max-width: 22ch;
}

/* Posts list */
.posts__header {
  font-size: var(--step--1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-sidebar-mut);
  margin: 0 0 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(231,239,231,.16);
}
.posts__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }

.posts__link {
  display: block;
  position: relative;
  padding: 0.55rem 0.75rem 0.55rem 1rem;
  border-radius: var(--radius);
  color: var(--color-sidebar-ink);
  text-decoration: none;
  transition: background-color .18s ease;
}
.posts__link:hover { background: rgba(231,239,231,.08); color: var(--color-sidebar-ink); }
.posts__date {
  display: block;
  font-size: 0.72rem;
  color: var(--color-sidebar-mut);
  letter-spacing: 0.02em;
}
.posts__title {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.3;
  margin-top: 0.1rem;
}

/* Active entry gets the "stem" accent — a small growing mark */
.posts__item[aria-current="page"] .posts__link { background: rgba(231,239,231,.10); }
.posts__item[aria-current="page"] .posts__link::before {
  content: "";
  position: absolute;
  left: 0; top: 0.7rem; bottom: 0.7rem;
  width: 3px;
  border-radius: 3px;
  background: var(--color-accent);
}

.sidebar__foot {
  margin-top: auto;
  font-size: var(--step--1);
  color: var(--color-sidebar-mut);
}

/* ---- Main area ------------------------------------------------ */
.main { padding: var(--pad); }

.entry {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: calc(var(--radius) * 2);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 0.8rem + 3.5vw, 4rem);
  max-width: 74rem;
  margin: 0 auto;
}

.entry__eyebrow {
  font-size: var(--step--1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.entry__eyebrow .sprig { color: var(--color-accent); }

.entry__title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: var(--step-3);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 1.4rem;
  max-width: 20ch;
}

.entry__rule {
  border: 0;
  border-top: 1px solid var(--color-line);
  margin: 0 0 2rem;
}

/* ---- Content grid: mix text + images as paragraphs ----------- */
.entry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  align-items: start;
}

@media (min-width: 48rem) {
  .entry-grid { grid-template-columns: repeat(6, 1fr); }
}

/* Every block is full width by default; modifiers below reposition
   it on the 6-col grid at >= 48rem. On mobile everything stacks. */
.block { grid-column: 1 / -1; }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.1rem; }
.prose p:last-child { margin-bottom: 0; }

/* Drop cap opens an entry like a journal page */
.prose--lead > p:first-child::first-letter {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 3.4em;
  line-height: 0.8;
  float: left;
  padding: 0.08em 0.12em 0 0;
  color: var(--color-accent-ink);
}

@media (min-width: 48rem) {
  .block--half      { grid-column: span 3; }
  .block--two-third { grid-column: span 4; }
  .block--third     { grid-column: span 2; }
  .prose.block--half, .prose.block--two-third { max-width: none; }
}

/* Figures */
.figure { margin: 0; }
.figure img,
.figure .ph {
  width: 100%;
  height: auto;        /* preserve aspect ratio; overrides the img height attr */
  border-radius: var(--radius);
  border: 1px solid var(--color-line);
}
.figure img { display: block; object-fit: contain; }
.figure figcaption {
  font-size: var(--step--1);
  color: var(--color-muted);
  margin-top: 0.55rem;
  padding-left: 0.1rem;
}
.figure--bleed { grid-column: 1 / -1; }

/* Placeholder tile (until real photos are pulled from Drive) */
.ph {
  aspect-ratio: 3 / 2;
  display: grid;
  place-items: center;
  gap: 0.5rem;
  background:
    radial-gradient(120% 120% at 20% 0%, #dfe7dc 0%, #cdd8c8 60%, #c3d0be 100%);
  color: #5f7264;
}
.ph--tall { aspect-ratio: 3 / 4; }
.ph__label {
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Pull quote */
.pullquote {
  grid-column: 1 / -1;
  margin: 0.5rem auto;
  max-width: 40ch;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: var(--step-2);
  line-height: 1.25;
  color: var(--color-ink);
}
.pullquote::before { content: "“"; color: var(--color-accent); }
.pullquote::after  { content: "”"; color: var(--color-accent); }

.entry__foot {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-line);
  font-size: var(--step--1);
  color: var(--color-muted);
}

/* ---- Motion: one quiet page-load reveal ---------------------- */
@media (prefers-reduced-motion: no-preference) {
  .entry { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
  }
}
