/* =============================================================
   WvH Hospitality · The Steward · the paper stack (11.11.26)

   Chapter Five's inquiries are filed as folded slips in two
   trays: Practical Matters, then House Lore. Each slip is a
   native <details name="steward-slip">. Closed, it shows its
   file number, the question and the short answer. Opened, it
   unfolds the whole entry in place. All of it works without
   steward-stack.js.

   Linked from steward.html only, after styles.css. Colours and
   type come from the tokens in styles.css. Nothing here goes
   below the 11px type floor.
   ============================================================= */

/* ---------- The stack: the index label and note above the trays ---------- */
.paper-stack {
  margin: 40px 0 0;
}
.stack-label {
  display: table;              /* shrink to the words and sit centred; wraps on a narrow screen */
  max-width: 100%;
  margin: 0 auto 12px;
  padding: 3px 12px;
  background: var(--paper-bright);
  border: 1px solid var(--gold-deep);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-align: center;
  color: var(--oxblood);
}
.stack-note {
  max-width: 560px;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.6;
  text-align: center;
  color: var(--ink-muted);
}

/* ---------- A tray: kicker, name, then the slips lying in it ---------- */
.tray {
  margin: 44px 0 0;
}
.tray + .tray {
  margin-top: 60px;
}
.tray-head {
  margin: 0 0 16px;
  text-align: center;
}
.tray-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--oxblood);
}
.tray-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(24px, 3.4vw, 30px);
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--ink);
}
/* the tray itself: a shallow recess, a shade deeper than the page */
.tray-slips {
  padding: 30px 20px 18px;
  background:
    linear-gradient(180deg, rgba(80, 50, 15, 0.12) 0, rgba(80, 50, 15, 0) 16px),
    rgba(217, 201, 168, 0.5);
  border: 1px solid rgba(143, 112, 48, 0.6);
  box-shadow: inset 0 0 26px rgba(140, 95, 35, 0.1);
}

/* ---------- A slip ---------- */
.slip {
  position: relative;
  margin: 0 0 20px;            /* room for the next slip's tab, which rides half above its top edge */
  background: var(--paper-bright);
  border: 1px solid var(--gold-deep);
  /* folded: the under-half shows as a second edge; then a soft shadow, so the slips read as a stack */
  box-shadow:
    0 3px 0 -1px var(--paper-bright),
    0 3px 0 0 rgba(143, 112, 48, 0.7),
    0 9px 14px -9px rgba(40, 22, 6, 0.42);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  scroll-margin-top: 28px;
}
.tray-slips > .slip:last-child {
  margin-bottom: 12px;
}
/* nobody squares a stack of paper perfectly */
.slip:nth-of-type(odd)  { transform: rotate(-0.35deg); }
.slip:nth-of-type(even) { transform: rotate(0.35deg); }
/* a slip straightens when it is hovered, focused or open */
.slip:hover,
.slip:focus-within,
.slip[open] {
  transform: none;
}
.slip:hover {
  box-shadow:
    0 3px 0 -1px var(--paper-bright),
    0 3px 0 0 rgba(143, 112, 48, 0.7),
    0 14px 20px -11px rgba(40, 22, 6, 0.5);
}
/* unfolded: one sheet, lifted clear of the stack */
.slip[open] {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55),
    0 16px 26px -16px rgba(40, 22, 6, 0.5);
}

/* ---------- The face of a slip: file number, question, short answer, cue ---------- */
.slip > summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-areas:
    "question cue"
    "answer   cue";
  column-gap: 28px;
  row-gap: 6px;
  align-items: center;
  padding: 24px 24px 18px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.slip > summary::-webkit-details-marker { display: none; }
.slip > summary::marker { content: ""; }

/* the file number: a small tab riding the top edge, like an index card */
.slip-tab {
  position: absolute;
  top: -12px;                  /* 23px tall, so it sits half above the slip's top edge, on whole pixels */
  left: 18px;
  padding: 4px 7px 4px 11px;   /* the letter-spacing leaves air after the last character */
  background: var(--paper-bright);
  border: 1px solid var(--gold-deep);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--oxblood);
}
.slip-question {
  grid-area: question;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.03em;
  line-height: 1.22;
  text-transform: uppercase;
  color: var(--ink);
  overflow-wrap: break-word;
  scroll-margin-top: 53px;   /* the older #file-201 to #file-206 anchors live on these headings; lands the slip where its own id would */
}
.slip-answer {
  grid-area: answer;
  display: block;            /* its own line even where a summary cannot be a grid */
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.42;
  color: var(--ink-muted);
  overflow-wrap: break-word;
}
/* the cue. The second content line hides the word from screen readers, which already announce
   the slip as collapsed or expanded; browsers that do not know that syntax keep the first line. */
.slip > summary::after {
  grid-area: cue;
  display: block;
  justify-self: end;
  min-width: 118px;            /* room for the longer cue, so the text beside it does not re-wrap on opening */
  margin-right: -0.24em;
  content: "Unfold";
  content: "Unfold" / "";
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
  color: var(--gold-ink);
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.18s ease;
}
.slip[open] > summary::after {
  content: "Fold it away";
  content: "Fold it away" / "";
}
.slip > summary:hover::after,
.slip[open] > summary::after {
  color: var(--oxblood);
}
/* the crease where the slip was folded */
.slip[open] > summary {
  border-bottom: 1px dashed rgba(143, 112, 48, 0.55);
}
/* keyboard focus: plain to see */
.slip > summary:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 3px;
  background-color: rgba(201, 162, 76, 0.16);
}

/* ---------- Unfolded: the entry itself ---------- */
.slip-body {
  padding: 18px 18px 20px;
}
.slip[open] > .slip-body {
  animation: slip-unfold 0.32s ease-out both;
}
@keyframes slip-unfold {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}
/* the full journal entries arrive as they were; only the gap that used to separate them goes */
.slip-body > .dispatch-entry {
  margin: 0;
}
/* the short entries (the council questions and the eight added 11.11.26): a file line, then the answer */
.slip-note {
  max-width: 700px;
  padding: 2px 6px 4px;
}
.slip-note > p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}
.slip-note > p + p {
  margin-top: 12px;
}
.slip-note > .slip-fileno {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--oxblood);
}
.slip-note > .slip-fileno + p {
  margin-top: 0;
}

/* ---------- Inside tray one: the council questions get a divider of their own ---------- */
.tray-subkicker {
  margin: 36px 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  text-align: center;
  color: var(--oxblood);
}

/* ---------- Tablets: a little less tray ---------- */
@media (max-width: 760px) {
  .tray-slips { padding: 28px 12px 10px; }
  .slip-body { padding: 14px 12px 16px; }
}

/* ---------- Phones: the cue drops under the text and the entry takes the full width ---------- */
@media (max-width: 560px) {
  .paper-stack { margin-top: 32px; }
  .stack-label { letter-spacing: 0.2em; }
  .tray { margin-top: 36px; }
  .tray + .tray { margin-top: 48px; }
  .tray-kicker,
  .tray-subkicker { letter-spacing: 0.24em; }
  .tray-slips {
    padding: 22px 0 2px;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .slip > summary {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "question"
      "answer"
      "cue";
    padding: 22px 16px 14px;
  }
  .slip > summary::after {
    justify-self: start;
    min-width: 0;
    margin: 6px 0 0;
    text-align: left;
  }
  .slip { margin-bottom: 18px; }
  .slip-tab { left: 12px; }
  .slip-question { font-size: 17px; }
  .slip-answer { font-size: 16px; }
  .slip-body { padding: 0 0 12px; }
  .slip-body > .dispatch-entry { border-left: 0; border-right: 0; }
  .slip-note { padding: 14px 16px 4px; }
}

/* ---------- Reduced motion: the paper holds still ---------- */
@media (prefers-reduced-motion: reduce) {
  .slip,
  .slip > summary::after { transition: none; }
  .slip[open] > .slip-body { animation: none; }
}

/* ---------- The entries keep their own pens ----------
   styles.css gives each journal entry its handwriting, ink, paper aging and stamp tilt by its position
   inside .dispatch-archive (nth-of-type). The entries now sit one to a slip, so those rules no longer
   find them. The block between the two markers below is the same set of rules, copied from styles.css
   and keyed to each entry's id instead (file-1 was the first entry on the old page, file-13 the last),
   so every entry looks as it did. If those rules change in styles.css, change them here too. */
/* stack:pens:start */
#file-2 .transmission-header,
#file-4 .transmission-header,
#file-6 .transmission-header,
#file-8 .transmission-header,
#file-10 .transmission-header,
#file-12 .transmission-header {
  filter: contrast(1.04) saturate(0.88) hue-rotate(-3deg);
}
#file-3 .transmission-header,
#file-6 .transmission-header,
#file-9 .transmission-header,
#file-12 .transmission-header {
  background-position: -8px 4px, 12px -2px, -4px 8px, 6px -6px, 0 0, 4px 4px, 0 0, 0 0, 0 0, 0 0;
}
#file-1 .transmission-header,
#file-5 .transmission-header,
#file-9 .transmission-header,
#file-13 .transmission-header {
  filter: contrast(1.0) saturate(0.94) brightness(0.97);
}
#file-2 .transmission-header::before,
#file-7 .transmission-header::before,
#file-12 .transmission-header::before {
  /* Some cards get a coffee-ring stain instead of the standard foxing */
  content: "";
  position: absolute;
  top: 38%;
  right: 8%;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(110, 70, 25, 0.18);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(1px);
  z-index: 0;
}
#file-4 .meta-value,
#file-10 .meta-value {
  filter: url(#fountain-blot) contrast(1.08) saturate(0.96);
  text-shadow:
    0.4px 0.3px 0 currentColor,
    0 0 1.2px currentColor,
    0.5px 0.4px 2px rgba(184, 38, 45, 0.25);
}
#file-2 .meta-value,
#file-8 .meta-value {
  filter: url(#fountain-blot) contrast(1.06) saturate(0.95);
  text-shadow:
    0.4px 0.3px 0 currentColor,
    0 0 1.0px currentColor,
    0.5px 0.4px 1.6px rgba(28, 58, 122, 0.28);
}
#file-1 .meta-value,
#file-7 .meta-value,
#file-13 .meta-value {
  font-family: 'Homemade Apple', 'Caveat', cursive;
  font-size: 13px;
  color: #1a0f06;
}
#file-2 .meta-value,
#file-8 .meta-value {
  font-family: 'Caveat', 'Bradley Hand', cursive;
  font-weight: 700;
  font-size: 22px;
  color: #1c3a7a;
}
#file-3 .meta-value,
#file-9 .meta-value {
  font-family: 'Architects Daughter', 'Caveat', cursive;
  font-size: 16px;
  color: #1a0f06;
}
#file-4 .meta-value,
#file-10 .meta-value {
  font-family: 'Reenie Beanie', 'Caveat', cursive;
  font-size: 24px;
  color: #b8262d;
  line-height: 1;
}
#file-5 .meta-value,
#file-11 .meta-value {
  font-family: 'Indie Flower', 'Caveat', cursive;
  font-size: 18px;
  color: #1c3a7a;
}
#file-6 .meta-value,
#file-12 .meta-value {
  font-family: 'Kalam', 'Caveat', cursive;
  font-weight: 400;
  font-size: 18px;
  color: #1a0f06;
}
@media (max-width: 560px) {
  #file-1 .meta-value,
  #file-7 .meta-value,
  #file-13 .meta-value { font-size: 12px; }
  #file-2 .meta-value,
  #file-8 .meta-value { font-size: 18px; }
  #file-3 .meta-value,
  #file-9 .meta-value { font-size: 14px; }
  #file-4 .meta-value,
  #file-10 .meta-value { font-size: 19px; }
  #file-5 .meta-value,
  #file-11 .meta-value { font-size: 15px; }
  #file-6 .meta-value,
  #file-12 .meta-value { font-size: 15px; }
}
#file-1 .routing-stamps .stamp { --entry-tilt:  0deg; }
#file-2 .routing-stamps .stamp { --entry-tilt:  6deg; }
#file-3 .routing-stamps .stamp { --entry-tilt: -4deg; }
#file-4 .routing-stamps .stamp { --entry-tilt:  9deg; }
#file-5 .routing-stamps .stamp { --entry-tilt: -7deg; }
#file-6 .routing-stamps .stamp { --entry-tilt:  3deg; }
#file-7 .routing-stamps .stamp { --entry-tilt: -2deg; }
#file-8 .routing-stamps .stamp { --entry-tilt:  5deg; }
#file-9 .routing-stamps .stamp { --entry-tilt: -10deg; }
#file-10 .routing-stamps .stamp { --entry-tilt:  4deg; }
#file-11 .routing-stamps .stamp { --entry-tilt: -5deg; }
#file-12 .routing-stamps .stamp { --entry-tilt:  8deg; }
/* stack:pens:end */
