/*
  Writing (writing.php): the pieces on the site as polaroids, then everything gathered by thread or by date.
  Builds on read.css (JW, menu, footer, light / dark gradients, the toggle) and writing-nav.css (polaroids).
*/

.wb { display: block; padding-bottom: calc(9vh + .25rem); }
/*
  Into the footer: on the light page the sand needs a little room to turn to blue before the closing words;
  on the dark page the two are already nearly one colour, so the footer can begin sooner.
*/
.wb-page .site-footer { padding-top: calc(9vh + clamp(1.75rem, 4.5vh, 3rem)); }
:root:not([data-theme="light"]) .wb-page .site-footer { padding-top: calc(9vh + clamp(.5rem, 1.5vh, 1.25rem)); }
.wb-page .site-footer { transition: padding-top 900ms var(--ease-soft); }
.wb a { color: inherit; text-decoration: none; }
.wb .ext-mark { width: .62em; height: .62em; margin-left: .2em; vertical-align: .25em; opacity: .7; }
.wb .wn-print a { color: var(--ink); }   /* the polaroids keep their dark ink on the cream card */
/* in the lists, where each entry already says where it lives, the out-arrow would only fall onto a line of its own */
.wb-row__a .ext-mark { display: none; }

/* ---- the page's own heading, the same on every design ---- */
.wb-head { width: min(100% - 2 * var(--gutter), 40rem); margin: 0 auto; padding: clamp(8rem, 22vh, 13rem) 0 clamp(3rem, 8vh, 5rem); text-align: center; }
.wb-crumb { justify-content: center; margin-bottom: clamp(1.4rem, 4vh, 2.4rem); animation: wx-arrive 1400ms var(--ease-soft) both; }
.wb-title { margin: 0; font-family: var(--font-display); font-weight: var(--weight-display); font-size: clamp(3.4rem, 2rem + 6vw, 7.5rem); line-height: .96; letter-spacing: -.02em; animation: wx-arrive 1600ms var(--ease-soft) both; }
.wb-intro { margin: 1.4rem auto 0; max-width: 32rem; font-family: var(--font-display); font-style: italic; font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.55; color: var(--wx-soft); animation: wx-arrive 1600ms var(--ease-soft) 400ms both; }
/* where more lives: between the polaroids and everything, leading into it */
.wb-lead { width: min(100%, 36rem); margin: clamp(5rem, 13vh, 8rem) auto 0; text-align: center; font-family: var(--font-display); font-style: italic; font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.6; color: var(--wx-soft); }
.wb-lead + .wb-all { margin-top: clamp(4.25rem, 11vh, 6.25rem); }
.wb-intro a, .wb-lead a { color: var(--wx-fg); background-image: radial-gradient(closest-side, rgb(var(--wx-drop) / .5), transparent); background-size: 100% .3em; background-repeat: no-repeat; background-position: 50% 100%; }

/* arriving out of a blur as each part comes into view (set by the script) */
/* each part comes out of a blur as it rises into view (as on the essays; set by the script as you scroll) */
.js .wx [data-wx-reveal] { opacity: 0; filter: blur(12px); transition: opacity 700ms var(--ease-soft), filter 900ms var(--ease-soft); }
.js .wx.is-ready [data-wx-reveal] { will-change: opacity, filter; }

.wbd { width: min(100% - 2 * var(--gutter), 64rem); margin: 0 auto; }
.wb-more { margin: clamp(2.5rem, 6vh, 4rem) 0 0; text-align: center; font-family: var(--font-display); font-style: italic; font-size: 1.1rem; color: var(--wx-soft); }
.wb-more a { color: var(--wx-fg); }
.wb-kicker { font-family: var(--font-body); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--wx-soft); }
.wb-drop { display: inline-block; width: 9px; height: 9px; margin-right: .7rem; border-radius: 50%; vertical-align: .2em; background: radial-gradient(circle, currentColor 0%, transparent 72%); box-shadow: 0 0 10px 2px rgb(var(--wx-drop) / .35); }

/* ---- the pieces on the site, as polaroids */
/*
  The featured prints, as on the homepage: one loose row, overlapping a little, each at its own angle and height;
  the one you point at comes to the front. Where they can't all fit (phones), they become a row to swipe through.
*/
.wb-table { display: flex; align-items: flex-start; margin: 0; padding: 0; list-style: none; }
.wb-table__item { position: relative; z-index: var(--z, 1); }
.wb-table__item:hover, .wb-table__item:focus-within { z-index: 5; }
.wb-table__item a { transition: rotate 900ms var(--ease-soft), translate 900ms var(--ease-soft), scale 900ms var(--ease-soft), box-shadow 900ms var(--ease-soft); }
.wb .wn-print__t { font-size: 1.4rem; }
.wb-print__m { display: block; margin-top: .7rem; font-family: var(--font-body); font-size: .72rem; color: #6a7480; }
@media (min-width: 1280px) {   /* where all five fit at a comfortable size */
  .wb-table {
    justify-content: center;
    width: min(100vw - 2 * var(--gutter), 84rem);
    margin-left: 50%;
    transform: translateX(-50%);
  }
  .wb-table__item { flex: 0 1 16.5rem; min-width: 0; margin-top: var(--drop, 0); }
  .wb-table__item + .wb-table__item { margin-left: -.9rem; }   /* just tucked, so no card covers its neighbour's words */
  .wb-table__item a { box-shadow: 0 22px 50px rgb(10 14 18 / .38); }
  .wb-table__item a:hover, .wb-table__item a:focus-visible { rotate: 0deg; translate: 0 -10px; scale: 1.03; }
}
@media (max-width: 1279px) {   /* otherwise, a row to flip through: swipe, drag, the arrows or the dots */
  .wb-table {
    gap: 1.1rem;
    margin: 0 calc(-1 * var(--gutter));
    padding: 1.2rem calc((100vw - min(78vw, 19rem)) / 2) 1.4rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .wb-table::-webkit-scrollbar { display: none; }
  .wb-table__item { flex: 0 0 min(78vw, 19rem); scroll-snap-align: center; }
  .wb-table.is-dragging { scroll-snap-type: none; cursor: grabbing; }
  .wb-table.is-dragging a { pointer-events: none; }
}
@media (max-width: 1279px) and (hover: hover) and (pointer: fine) { .wb-table { cursor: grab; } }

/* the arrows and dots: only while the pieces don't all fit */
.wb-flip { display: none; align-items: center; justify-content: center; gap: 1rem; margin-top: .4rem; }
.wb-shelf.is-scrollable .wb-flip { display: flex; }
.wb-flip__arrow { display: grid; place-items: center; width: 44px; height: 48px; padding: 0; border: 0; background: none; color: var(--wx-fg); cursor: pointer; opacity: .75; transition: opacity 500ms var(--ease-soft), transform 600ms var(--ease-soft); }
.wb-flip__arrow svg { width: 15px; height: 26px; }
.wb-flip__arrow:hover { opacity: 1; }
.wb-flip__arrow[data-wb-prev]:hover { transform: translateX(-3px); }
.wb-flip__arrow[data-wb-next]:hover { transform: translateX(3px); }
.wb-flip__arrow.is-end { opacity: .25; pointer-events: none; }
.wb-flip__dots { display: flex; gap: .65rem; }
.wb-flip__dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: currentColor; color: var(--wx-fg); opacity: .3; cursor: pointer; transition: opacity 400ms var(--ease-soft), transform 400ms var(--ease-soft), box-shadow 400ms var(--ease-soft); }
.wb-flip__dots button:hover { opacity: .65; }
.wb-flip__dots button.is-on { opacity: .95; transform: scale(1.3); box-shadow: 0 0 10px 2px rgb(var(--wx-drop) / .4); }

/* ---- everything, gathered by thread (tags) or by date ---- */
.wb-feat { margin: 0 0 1.6rem; text-align: center; }
.wb-all { width: min(100%, 50rem); margin: clamp(5rem, 13vh, 8rem) auto 0; }
.wb-all__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .6rem 2rem; padding-bottom: 1.2rem; border-bottom: 1px dashed var(--wx-rule); }
.wb-all__h { margin: 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(2rem, 1.5rem + 1.8vw, 2.8rem); line-height: 1.1; }
.wb-modes { margin: 0; font-family: var(--font-display); font-style: italic; font-size: 1.08rem; color: var(--wx-soft); }
.wb-modes__label { margin-right: .6rem; font-family: var(--font-body); font-style: normal; font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; }
.wb-modes__sep { margin: 0 .35rem; opacity: .6; }
.wb-modes button {
  padding: .1rem 0 .3rem; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
  background-image: radial-gradient(closest-side, rgb(var(--wx-drop) / .6), transparent); background-size: 0 .3em; background-repeat: no-repeat; background-position: 50% 100%;
  transition: color 500ms var(--ease-soft), background-size 600ms var(--ease-soft);
}
.wb-modes button:hover { color: var(--wx-fg); }
.wb-modes button[aria-pressed="true"] { color: var(--wx-fg); background-size: 100% .3em; }
.wb-mode { display: none; }
.wb-all[data-mode="threads"] .wb-mode--threads, .wb-all[data-mode="date"] .wb-mode--date { display: block; animation: wx-arrive 900ms var(--ease-soft) both; }
.wb-group { margin-top: clamp(2.4rem, 6vh, 3.4rem); scroll-margin-top: 7rem; }
.wb-group__h { margin: 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.2; }
.wb-group__kind { margin-left: .5rem; font-family: var(--font-body); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--wx-soft); vertical-align: .3em; }
.wb-group__note { margin: .35rem 0 0 1.6rem; font-family: var(--font-display); font-style: italic; font-size: 1rem; color: var(--wx-soft); }
.wb-group.is-lit .wb-group__h { animation: wb-lit 1800ms var(--ease-soft); }
@keyframes wb-lit { 0% { text-shadow: 0 0 0 transparent; } 30% { text-shadow: 0 0 24px rgb(var(--wx-drop) / .6); } 100% { text-shadow: 0 0 0 transparent; } }
.wb-rows { margin: 1rem 0 0 1.6rem; padding: 0; list-style: none; border-top: 1px dashed var(--wx-rule); }
.wb-mode--date .wb-rows { margin-left: 0; }
.wb-row { display: grid; grid-template-columns: 1fr auto auto; column-gap: 1.1rem; align-items: baseline; padding: .75rem 0; border-bottom: 1px dashed var(--wx-rule); }
.wb-row__a { display: grid; min-width: 0; opacity: .82; transition: opacity 400ms var(--ease-soft); }
.wb-row__a:hover, .wb-row.is-here .wb-row__a { opacity: 1; }
.wb-row__a .ext-mark { display: none; }
.wb-row__t { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.3; }
.wb-row.is-here .wb-row__t { font-size: 1.3rem; }
.wb-row__s { margin-top: .1rem; font-family: var(--font-display); font-style: italic; font-size: .95rem; color: var(--wx-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-row__chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .2rem 0; }
/* a piece's threads: words with thin lines between, no outlines (as the booking page's lengths); the word comes up on hover */
.wb-chip {
  padding: .1rem .6rem; border: 0; border-radius: 0; background: none; color: var(--wx-soft); cursor: pointer; box-shadow: -1px 0 0 var(--wx-rule);
  font-family: var(--font-body); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  text-decoration: underline 1px transparent; text-underline-offset: .35em;
  transition: color 400ms var(--ease-soft), text-decoration-color 400ms var(--ease-soft);
}
.wb-chip:first-child { box-shadow: none; }
.wb-row__chips .wb-chip:last-child { padding-right: 0; }
.wb-chip:hover, .wb-chip:focus-visible { color: var(--wx-fg); text-decoration-color: currentColor; }
.wb-row__m { font-family: var(--font-body); font-size: .68rem; color: var(--wx-soft); white-space: nowrap; text-align: right; }
.wb-row__where { opacity: .75; }
.wb-row__here { color: var(--wx-fg); letter-spacing: .14em; text-transform: uppercase; font-size: .62rem; }
.wb-row__here::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: .45rem; border-radius: 50%; vertical-align: .05em; background: radial-gradient(circle, currentColor, transparent 72%); box-shadow: 0 0 8px 2px rgb(var(--wx-drop) / .45); }
@media (max-width: 700px) {
  .wb-row { grid-template-columns: 1fr auto; row-gap: .4rem; }
  .wb-row__chips { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .wb-row__chips .wb-chip:first-child { padding-left: 0; }
  .wb-row__chips .wb-chip:last-child { padding-right: .6rem; }
  .wb-row__m { grid-row: 1; grid-column: 2; }
  .wb-row__s { white-space: normal; }
  .wb-rows, .wb-group__note { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .js .wx [data-wx-reveal] { opacity: 1; filter: none; transition: none; }
  .wb-title, .wb-intro { animation: none; }
}

/* links: a fine line, not the drop of light (that means something hidden, in the opening) */
.wb-intro a, .wb-lead a { background: none; text-decoration: underline 1px; text-underline-offset: .28em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); transition: text-decoration-color 500ms var(--ease-soft); }
.wb-intro a:hover, .wb-lead a:hover { text-decoration-color: color-mix(in srgb, currentColor 80%, transparent); }
.wb-modes button { background: none; text-decoration: underline 1px; text-underline-offset: .32em; text-decoration-color: transparent; transition: color 500ms var(--ease-soft), text-decoration-color 500ms var(--ease-soft); }
.wb-modes button[aria-pressed="true"] { background: none; text-decoration-color: color-mix(in srgb, currentColor 60%, transparent); }

/* ---------- the light page's footer: it stays light, the sand easing through a soft blush into a pale dusk blue,
   with dark words (the dark page keeps its night-blue footer) ---------- */
.wb-page .site-footer { transition: padding-top 900ms var(--ease-soft), color 900ms var(--ease-soft); }
:root[data-theme="light"] .wb-page .site-footer { color: #1f242a; }
:root[data-theme="light"] .wb-page .site-footer::before {
  background: linear-gradient(180deg, #ece3d4 0%, #e9ded2 16%, #e4d6d0 32%, #dcd2d5 48%, #d2cfd9 64%, #c9cdd9 80%, #c2c9d6 100%);
}
:root[data-theme="light"] .wb-page .site-footer__closing { text-shadow: 0 1px 22px rgb(255 250 242 / .55); }
:root[data-theme="light"] .wb-page .site-footer__closing::before { display: none; }
/* the line under the signature: dark, its glow a deeper ink passing through */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  :root[data-theme="light"] .wb-page .site-footer__role {
    background-image: linear-gradient(90deg, rgb(31 36 42 / .72) 0%, rgb(31 36 42 / .72) 38%, #07090c 50%, rgb(31 36 42 / .72) 62%, rgb(31 36 42 / .72) 100%);
    filter: none;
  }
}
:root[data-theme="light"] .wb-page .site-footer__role.is-chars { color: rgb(31 36 42 / .72); background: none; }
:root[data-theme="light"] .wb-page .site-footer__role.is-chars .bt-char { animation-name: wb-role-char-ink; }
@keyframes wb-role-char-ink {
  0%, 22%, 100% { color: rgb(31 36 42 / .72); text-shadow: none; }
  9% { color: #07090c; text-shadow: 0 0 12px rgb(255 255 255 / .55); }
}

/* ---------- the end of the page: the wave at dusk, feathering into the page above and below ---------- */
.wb-shore { position: relative; height: clamp(22rem, 62vw, 92vh); margin-top: clamp(1.5rem, 5vh, 3.5rem); overflow: hidden; pointer-events: none; }
.wb-shore img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 55%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / .12) 8%, rgb(0 0 0 / .45) 16%, rgb(0 0 0 / .82) 24%, #000 32%, #000 62%, rgb(0 0 0 / .8) 72%, rgb(0 0 0 / .42) 83%, rgb(0 0 0 / .12) 93%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / .12) 8%, rgb(0 0 0 / .45) 16%, rgb(0 0 0 / .82) 24%, #000 32%, #000 62%, rgb(0 0 0 / .8) 72%, rgb(0 0 0 / .42) 83%, rgb(0 0 0 / .12) 93%, transparent 100%); }
.js .wb-shore img { opacity: 0; filter: blur(16px); transform: scale(1.03);
  transition: opacity 2200ms var(--ease-soft), filter 2400ms var(--ease-soft), transform 2800ms var(--ease-soft); }
.js .wb-shore.is-in img { opacity: 1; filter: none; transform: none; }
:root[data-theme="light"] .wb-shore.is-in img { opacity: .94; }   /* a touch softer on the light page */
@media (max-width: 700px) { .wb-shore { height: clamp(20rem, 105vw, 75vh); } .wb-shore img { object-position: 42% 55%; } }
@media (prefers-reduced-motion: reduce) { .js .wb-shore img { filter: none; transform: none; transition: opacity 900ms ease; } }

/* ---------- above the signature: John O'Donohue (Benedictus). The footer's line arrives as it comes into view
   (data-reveal); here that starts the build instead, each word out of a blur, resting at each line's end ---------- */
.js .wb-page .site-footer__closing[data-reveal] { opacity: 1; filter: none; transform: none; }
.wb-page .site-footer__closing { max-width: none; text-align: center; text-wrap: wrap; }
.wb-close { display: block; max-width: min(100%, 21em); margin: 0 auto; text-align: center;
  font-size: min(var(--text-closing), 4.6vh, 6.4vw); line-height: 1.25; }   /* every footer's closing size, eased down on shorter and narrower screens so the whole poem fits */
.wb-close__l { display: block; text-wrap: balance; }
.wb-close__by { display: block; margin-top: clamp(.9rem, 2.2vh, 1.5rem); text-align: center; font-size: var(--text-attrib); line-height: 1.3; }   /* as the other quotes */
.wb-close__by cite { font-style: italic; }
.js .wb-close .wb-w, .js .wb-close__by { opacity: 0; }
.js .is-revealed .wb-close .wb-w { opacity: 1; animation: wb-word-in 1500ms var(--ease-soft) backwards; animation-delay: calc(400ms + var(--w) * 120ms + var(--c) * 750ms); }
.js .is-revealed .wb-close__by { opacity: .9; animation: wb-word-in 1600ms var(--ease-soft) backwards; animation-delay: calc(1000ms + var(--w) * 120ms + var(--c) * 750ms); }
@keyframes wb-word-in { from { opacity: 0; filter: blur(14px); } }
@media (prefers-reduced-motion: reduce) { .js .is-revealed .wb-close .wb-w, .js .is-revealed .wb-close__by { animation: none; } }

/* the footer rises over the foot of the shore photograph, its blue coming in over a long eased stretch, so the
   photograph fades into it rather than stopping above a band of plain blue; the closing words rest where the two meet */
:root:not([data-theme="light"]) .wb-page { --wb-rise: clamp(12rem, 24vw, 30rem); }
:root:not([data-theme="light"]) .wb-page .site-footer { margin-top: calc(var(--wb-rise) * -1); padding-top: calc(var(--wb-rise) * .45);
  background: linear-gradient(180deg, rgb(43 62 77 / 0) 0, rgb(43 62 77 / .08) calc(var(--wb-rise) * .14), rgb(43 62 77 / .22) calc(var(--wb-rise) * .28), rgb(43 62 77 / .42) calc(var(--wb-rise) * .44), rgb(43 62 77 / .64) calc(var(--wb-rise) * .6), rgb(42 63 79 / .84) calc(var(--wb-rise) * .78), rgb(42 64 80) var(--wb-rise), rgb(40 63 80) calc(var(--wb-rise) + 8rem), rgb(36 55 70) calc(100% - 10rem), rgb(30 46 59) 100%); }
:root:not([data-theme="light"]) .wb-page .wb { padding-bottom: 0; }
:root:not([data-theme="light"]) .wb-page .wb-shore img {
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / .12) 8%, rgb(0 0 0 / .45) 16%, rgb(0 0 0 / .82) 24%, #000 32%, #000 78%, rgb(0 0 0 / .82) 86%, rgb(0 0 0 / .5) 93%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / .12) 8%, rgb(0 0 0 / .45) 16%, rgb(0 0 0 / .82) 24%, #000 32%, #000 78%, rgb(0 0 0 / .82) 86%, rgb(0 0 0 / .5) 93%, transparent 100%); }
/* the light page alike: its sand rises over the foot of the photograph in a long eased fade, rather than starting as a
   pale band beneath it */
:root[data-theme="light"] .wb-page { --wb-rise: clamp(12rem, 24vw, 30rem); }
:root[data-theme="light"] .wb-page .site-footer { margin-top: calc(var(--wb-rise) * -1); padding-top: calc(var(--wb-rise) * .45); background: none; }
:root[data-theme="light"] .wb-page .wb { padding-bottom: 0; }
:root[data-theme="light"] .wb-page .site-footer::before {
  background: linear-gradient(180deg, rgb(236 227 212 / 0) 0, rgb(236 227 212 / .06) calc(var(--wb-rise) * .14), rgb(236 227 212 / .18) calc(var(--wb-rise) * .28), rgb(236 227 212 / .36) calc(var(--wb-rise) * .44), rgb(234 225 211 / .58) calc(var(--wb-rise) * .6), rgb(232 222 210 / .8) calc(var(--wb-rise) * .78), #e7dbd1 var(--wb-rise), #e2d5d0 calc(var(--wb-rise) + 6rem), #dcd2d5 calc(var(--wb-rise) + 13rem), #d2cfd9 calc(var(--wb-rise) + 20rem), #c9cdd9 calc(100% - 6rem), #c2c9d6 100%); }
:root[data-theme="light"] .wb-page .wb-shore img {
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / .12) 8%, rgb(0 0 0 / .45) 16%, rgb(0 0 0 / .82) 24%, #000 32%, #000 78%, rgb(0 0 0 / .82) 86%, rgb(0 0 0 / .5) 93%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / .12) 8%, rgb(0 0 0 / .45) 16%, rgb(0 0 0 / .82) 24%, #000 32%, #000 78%, rgb(0 0 0 / .82) 86%, rgb(0 0 0 / .5) 93%, transparent 100%); }
