/* Shake-speares Sonnets: one stylesheet for desktop and phone.
   Colours and fonts are set once here; change them and rebuild. */
/* Fonts are served from this site (assets/fonts), not from Google. */
@font-face { font-family: 'IM Fell English'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/im-fell-english-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IM Fell English'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/im-fell-english-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'IM Fell English SC'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/im-fell-english-sc-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/eb-garamond-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/eb-garamond-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/eb-garamond-latin-500-normal.woff2) format('woff2'); }
:root {
  --paper: #F4EEE2;
  --paper-2: #EDE5D4;
  --ink: #1C1A17;
  --muted: #5A5248;
  --rule: #CFC5B3;
  --accent: #7A2418;
  --accent-dark: #4E140C;
  --display: 'IM Fell English', Georgia, serif;
  --caps: 'IM Fell English SC', Georgia, serif;
  --body: 'EB Garamond', Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.55; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--ink); color: var(--paper); padding: 8px 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-head { border-bottom: 1px solid var(--ink); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; min-height: 64px; }
.brand { font-family: var(--caps); font-size: 22px; letter-spacing: .06em; color: var(--ink); text-decoration: none; }
.site-head nav a { display: inline-block; padding: 10px 0; font-family: var(--caps); font-size: 17px; letter-spacing: .05em; color: var(--ink); text-decoration: none; }
.site-head nav a:hover { text-decoration: underline; }

/* Title blocks */
.hero { text-align: center; padding: 72px 0 40px; }
.kicker { margin: 0 0 16px; font-family: var(--caps); font-size: 17px; letter-spacing: .18em; color: var(--accent); }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(46px, 8vw, 92px); line-height: 1; letter-spacing: .02em; }
.hero--vol { padding-bottom: 32px; }
.hero--vol h1 { font-size: clamp(40px, 6vw, 68px); }
.tagline { margin: 20px 0 0; font-family: var(--display); font-style: italic; font-size: clamp(21px, 2.4vw, 26px); }
.rule { margin: 32px auto 0; max-width: 420px; height: 7px; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); }
.sub { margin: 24px 0 0; font-family: var(--caps); font-size: 19px; letter-spacing: .08em; }
.intro { margin: 14px auto 0; max-width: 620px; color: var(--muted); }

/* Volume number strip */
.vol-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0 0 48px; list-style: none; }
.vol-strip a { min-width: 44px; height: 44px; padding: 0 8px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ink); font-family: var(--caps); font-size: 17px; color: var(--ink); text-decoration: none; }
.vol-strip a:hover { background: var(--paper-2); }
.vol-strip a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--paper); }

/* Volume list on the home page */
.section-title { margin: 0 0 32px; padding-top: 40px; border-top: 1px solid var(--ink); text-align: center; font-family: var(--caps); font-weight: 400; font-size: 22px; letter-spacing: .12em; }
.vol-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 32px; margin: 0; padding: 0 0 72px; list-style: none; }
.vol-card { display: block; color: var(--ink); text-decoration: none; }
.vol-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--ink); }
.vol-num { display: block; margin-top: 12px; font-family: var(--display); font-size: 28px; line-height: 1.1; color: var(--accent); }
.vol-range { display: block; font-family: var(--caps); font-size: 16px; letter-spacing: .06em; }
.vol-card:hover .vol-num { text-decoration: underline; }

/* Track cards */
.track { padding: 40px 0 48px; border-top: 1px solid var(--ink); }
.track-grid { display: grid; gap: 20px; grid-template-areas: "media" "head" "info"; }
.track-head { grid-area: head; margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; font-weight: 400; }
.track-head .num { font-family: var(--display); font-size: clamp(40px, 5vw, 54px); line-height: 1; color: var(--accent); }
.track-head .title { font-family: var(--display); font-style: italic; font-size: clamp(21px, 2.4vw, 28px); line-height: 1.2; }
.media { grid-area: media; margin: 0; }
.media img { width: 100%; border: 1px solid var(--ink); }
.video { position: relative; display: block; color: var(--paper); text-decoration: none; }
.video-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; background: rgba(28, 26, 23, .88); font-family: var(--caps); font-size: 16px; letter-spacing: .06em; white-space: nowrap; }
.video-badge svg { width: 22px; height: 22px; fill: currentColor; }
.video:hover .video-badge { background: var(--accent); }
.info { grid-area: info; min-width: 0; display: flex; flex-direction: column; gap: 18px; }

@media (min-width: 860px) {
  .track-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-areas: "head head" "media info"; column-gap: 48px; row-gap: 24px; align-items: start; }
  .track:nth-of-type(even) .track-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "head head" "info media"; }
}

/* Player */
.player { display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 10px; border: 1px solid var(--ink); }
.play { flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--accent); color: var(--paper); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.play:hover { background: var(--accent-dark); }
.play svg, .nowbar svg { width: 20px; height: 20px; }
.i-play { fill: currentColor; }
.i-pause { display: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.is-playing .i-play { display: none; }
.is-playing .i-pause { display: block; }
.scrub { flex: 1; min-width: 0; }
input[type="range"] { display: block; width: 100%; height: 24px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.times { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dl { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.dl:hover { color: var(--accent); }
.dl svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Credits */
.credits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 0; font-size: 16px; }
.credits dt { font-family: var(--caps); font-size: 15px; letter-spacing: .06em; color: var(--muted); }
.credits dd { margin: 0; }
.note { margin: 0; font-size: 16px; color: var(--muted); }

/* The sonnet */
.poem summary { display: inline-flex; align-items: center; min-height: 44px; list-style: none; cursor: pointer; font-family: var(--caps); font-size: 17px; letter-spacing: .06em; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.poem summary::-webkit-details-marker { display: none; }
.poem summary:hover { color: var(--accent-dark); }
.poem .when-open { display: none; }
.poem[open] .when-open { display: inline; }
.poem[open] .when-closed { display: none; }
.poem-text { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--rule); font-family: var(--display); font-size: 20px; line-height: 1.6; }
.poem-text p { margin: 0; }
.poem-text .line { display: block; padding-left: 1.2em; text-indent: -1.2em; }
.poem-text .couplet { margin-left: 2em; }

/* Previous / next volume and footer */
.vol-nav { border-top: 1px solid var(--ink); }
.vol-nav .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; padding-top: 20px; padding-bottom: 20px; }
.vol-nav a { display: inline-block; padding: 10px 0; font-family: var(--caps); font-size: 19px; letter-spacing: .06em; }
.vol-nav .next { margin-left: auto; }
.site-foot { padding: 24px 0 40px; border-top: 1px solid var(--ink); text-align: center; font-size: 15px; color: var(--muted); }
.site-foot p { margin: 4px 0; }

/* Now-playing bar */
.nowbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper); }
.nowbar[hidden] { display: none; }
.nowbar-in { display: flex; align-items: center; gap: 10px; }
.nowbar button { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--paper); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nowbar button:hover { background: rgba(244, 238, 226, .12); }
.nowbar .nb-play { border: 1px solid var(--paper); }
.nb-prev svg, .nb-next svg { fill: currentColor; }
.nb-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nb-label { font-family: var(--caps); font-size: 13px; letter-spacing: .08em; color: var(--rule); }
.nb-title { font-family: var(--display); font-style: italic; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-scrub { flex: 0 1 320px; display: flex; align-items: center; gap: 10px; }
.nowbar input[type="range"] { accent-color: var(--paper); }
.nb-time { min-width: 3.2em; text-align: right; font-size: 14px; color: var(--rule); font-variant-numeric: tabular-nums; }
body.has-nowbar { padding-bottom: 76px; }

/* Phones */
@media (max-width: 600px) {
  body { font-size: 17px; }
  .wrap { padding: 0 18px; }
  .hero { padding: 44px 0 28px; }
  .rule { max-width: 220px; margin-top: 24px; }
  .vol-strip { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 0 -18px; padding: 0 18px 32px; }
  .vol-strip a { flex: none; }
  .track { padding: 28px 0 32px; }
  .poem-text { font-size: 17.5px; }
  .poem-text .couplet { margin-left: 1.2em; }
  .credits { gap: 8px 16px; font-size: 15px; }
}
@media (max-width: 700px) {
  .nb-scrub, .nb-prev { display: none; }
}
@media print {
  .nowbar, .player, .vol-strip, .vol-nav { display: none; }
  .poem-text { display: block; }
}
