/* Shared look for every room of lysaweiss.com.
   Edit the copy in shared/ only, then run: sh scripts/sync-shared.sh
   (it copies this file into library/ and gallery/).
   If you change a colour here, change it in public/index.html too. */

:root, [data-style="manor"] {
  --bg: #0c1510; --panel: #16211b; --ink: #efe6cf; --muted: #c9bfa6; --accent: #c9a35a;
  --door: #6e2230; --door-ink: #f3ead3; --line: rgba(201,163,90,.35);
  --light: #f2c46b;
  --pattern: none; --pattern-size: auto;
  --display: Georgia, 'Times New Roman', serif; --body: 'EB Garamond', Georgia, serif; --mono: 'EB Garamond', Georgia, serif;
  --read-size: 21px; --read-lh: 1.65;
  --ornament: "❦";
}
[data-style="highrise"] {
  --bg: #0f1a36; --panel: #16234a; --ink: #f3ecd9; --muted: #b8c0d6; --accent: #f2b84b;
  --door: #1b2a55; --door-ink: #f3ecd9; --line: rgba(242,184,75,.3);
  --light: #ffe1a1;
  --pattern: none; --pattern-size: auto;
  --display: 'Bodoni Moda', Didot, Georgia, serif; --body: 'Lato', 'Helvetica Neue', sans-serif; --mono: 'Lato', 'Helvetica Neue', sans-serif;
  --read-size: 18px; --read-lh: 1.7;
  --ornament: "◆ ◆ ◆";
}
[data-style="villa"] {
  --bg: #f4ecdc; --panel: #e8e6d6; --ink: #33291f; --muted: #5e5245; --accent: #a8492a;
  --door: #4f5f45; --door-ink: #f7f1e3; --line: rgba(168,73,42,.3);
  --light: #fff5da;
  --pattern: none; --pattern-size: auto;
  --display: 'Fraunces', Georgia, serif; --body: 'Nunito', sans-serif; --mono: 'Nunito', sans-serif;
  --read-size: 19px; --read-lh: 1.75;
  --ornament: "✿";
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh; background-color: var(--bg); background-image: var(--pattern); background-size: var(--pattern-size);
  color: var(--ink); font-family: var(--body); transition: background-color .4s ease, color .4s ease;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 40px 24px 64px; display: flex; flex-direction: column; gap: 32px; }
@media (max-width: 560px) { .wrap { padding: 28px 16px 48px; gap: 26px; } }

/* Header: wordmark + style switcher (same as the living room) */
.site-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 20px; }
.brand { font-family: var(--mono); font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  min-height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer; font-size: 14px;
  border: 1px solid var(--accent); background: transparent; color: var(--ink);
}
.pick[aria-pressed="true"] { background: var(--accent); color: var(--bg); }

.back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-family: var(--mono); font-size: 14px; letter-spacing: .06em; color: var(--muted); text-decoration: none;
}
.back:hover { color: var(--accent); }

.eyebrow { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.title { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(40px, 7vw, 72px); line-height: 1.04; text-wrap: balance; }
.rule { width: 96px; height: 4px; border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent); }
.tagline { margin: 0; max-width: 560px; font-size: 20px; line-height: 1.5; color: var(--muted); }
.intro { display: flex; flex-direction: column; gap: 14px; }

/* Filter chips (tags, years) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer; font-size: 14px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.count { margin-left: auto; font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* Previous / next at the end of a story or entry */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pager a {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 10px; text-decoration: none; transition: border-color .2s, transform .2s;
}
.pager a:hover { border-color: var(--accent); transform: translateY(-2px); }
.pager .dir { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pager .name { font-family: var(--display); font-size: 20px; line-height: 1.2; }
.pager .next { grid-column: 2; text-align: right; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }

.empty { padding: 40px 0; color: var(--muted); font-size: 18px; }

footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 20px;
  border-top: 1px solid var(--accent); font-size: 14px; color: var(--muted);
}
footer .sig { font-family: var(--mono); }
footer a { text-decoration: none; }
footer a:hover { color: var(--accent); }

/* Arriving through a door in the living room: the light fades away */
html.arriving body::before {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; background: var(--light);
  animation: arrive .9s ease-out .05s forwards;
}
@keyframes arrive { to { opacity: 0; visibility: hidden; } }

/* Switching styles: a soft crossfade of the whole page (see theme.js) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .6s; animation-timing-function: ease-in-out; }
html.restyling *, html.restyling *::before, html.restyling *::after { transition: none !important; }
.wrap { transition: opacity .22s ease; }
html.fading .wrap { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.stack { display: flex; flex-direction: column; gap: 32px; }
.stack.tight { gap: 18px; }
h2.eyebrow { font-weight: 400; }

[hidden] { display: none !important; }
