/* PartingHand.
 *
 * Transcribed from the visual direction in docs/partinghand-eng-design.md 7.1.
 * The feel is a printed book rather than an application: warm paper, brown ink
 * rather than black, one narrow column, generous leading, no chrome. That suits
 * the subject, and it suits an audience that skews older -- a 40rem measure at
 * this size is easier to read, not merely quieter.
 *
 * Fonts are served from this origin. The design forbids a third-party CDN, and
 * a memorial page should not tell anybody's servers who is reading it.
 */

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/ebgaramond-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/ebgaramond-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Sorts Mill Goudy";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/sortsmillgoudy-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Sorts Mill Goudy";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/sortsmillgoudy-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #f3ecdd;
  --paper-deep: #e9e0cb;
  --ink: #2b241c;
  --ink-soft: #6a5e4b;
  --oxblood: #7c2b25;
  --oxblood-deep: #5c1f1b;
  --rule: rgba(43, 36, 28, 0.18);
  --measure: 40rem;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ul, ol, li, figure, form { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

/* One column, everywhere. There is no layout to speak of, which is why this
 * needs no media queries: the measure caps it on a wide screen and the padding
 * holds it off the edges on a narrow one. */
header, main, footer { max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem; }
main { padding-bottom: 4rem; }

header {
  padding-top: 2rem;
  padding-bottom: 1.5rem;
  font-family: "Sorts Mill Goudy", Georgia, serif;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}
header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.25rem; }
.wordmark { color: var(--ink); text-decoration: none; }
.wordmark:hover { text-decoration: underline; }

header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 0.95rem;
  margin-left: auto;
}
header nav a { color: var(--oxblood); }

/* A form button that has to sit among links without shouting. */
.linkish {
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  color: var(--oxblood);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.linkish:hover { background: none; color: var(--oxblood-deep); }

footer {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  padding-bottom: 3rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
footer a { margin-right: 1.25rem; }

h1, h2, h3 {
  font-family: "Sorts Mill Goudy", Georgia, serif;
  font-weight: 400;
  line-height: 1.18;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.35rem, 4vw, 1.6rem); margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }

p { margin-bottom: 1rem; }
a { color: var(--oxblood); }
a:hover { color: var(--oxblood-deep); }

/* Focus must be obvious, not tasteful. Somebody navigating by keyboard needs to
 * see where they are without hunting for a faint outline. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--oxblood);
  outline-offset: 2px;
}

/* A keyboard user should not have to tab through the header to reach the page. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper-deep);
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  z-index: 10;
}
.skip-link:focus { left: 0; }

/* --- forms --- */
label { display: block; font-weight: 600; margin-bottom: 0.15rem; }
.hint { display: block; color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0.35rem; }

input[type="text"], input[type="email"], input[type="url"],
input[type="search"], input[type="date"], select, textarea {
  font: inherit;
  color: inherit;
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem 0.65rem;
  background: #fffdf7;
  border: 1px solid var(--rule);
  border-radius: 2px;
}
textarea { max-width: 100%; }

/* Generous targets: this audience includes people whose hands are not steady. */
button, input[type="submit"] {
  font: inherit;
  color: var(--paper);
  background: var(--oxblood);
  border: 1px solid var(--oxblood-deep);
  border-radius: 2px;
  padding: 0.6rem 1.2rem;
  min-height: 2.75rem;
  cursor: pointer;
}
button:hover { background: var(--oxblood-deep); }
button[disabled] { background: var(--ink-soft); border-color: var(--ink-soft); cursor: default; opacity: 0.65; }

form p { margin-bottom: 1.25rem; }
form.inline { display: inline; }
form.inline button { margin-right: 0.35rem; }

/* --- notices --- */
.notice, .error {
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border-left: 4px solid var(--oxblood);
  background: var(--paper-deep);
}
.error { border-left-color: var(--oxblood-deep); font-weight: 600; }
span.error { display: block; border: 0; background: none; padding: 0.25rem 0 0; color: var(--oxblood-deep); }

/* --- song and singer lists --- */
.song-list { list-style: decimal; padding-left: 2.25rem; margin-bottom: 1.5rem; }
.song-list li {
  margin-bottom: 0.4rem;
  padding: 0.35rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.song-name { flex: 1 1 14rem; }

/* Controls sit on the row rather than in a second list below it. They are the
 * keyboard and no-JavaScript route, so they are always present -- dragging is
 * the addition, not the other way round. */
.row-controls { display: flex; gap: 0.25rem; flex: 0 0 auto; }

.icon-button {
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 0;
  width: 2.5rem;
  height: 2.5rem;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-button svg { width: 1.15rem; height: 1.15rem; fill: currentColor; }
.icon-button:hover { background: var(--paper-deep); color: var(--ink); border-color: var(--ink-soft); }
.icon-button.remove:hover { color: var(--oxblood-deep); border-color: var(--oxblood); }
.icon-button[disabled] { background: none; border-color: var(--rule); color: var(--rule); opacity: 1; }

/* Announced by a screen reader, invisible on screen. An icon alone tells
 * somebody using one nothing at all. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- photograph --- */
.photo-field { margin-bottom: 1.75rem; }

/* The whole picture is the control, so there is something obvious to press.
 * A bare "Choose file" button is easy to miss on a page of text boxes. */
.photo-picker {
  display: inline-block;
  cursor: pointer;
  font-weight: 400;
  text-align: center;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.5rem;
  background: #fffdf7;
}
.photo-picker img { display: block; width: 220px; height: 220px; object-fit: cover; border-radius: 2px; }
.photo-picker:hover { border-color: var(--oxblood); }
.photo-picker:hover .photo-action { color: var(--oxblood-deep); }
.photo-action { display: block; margin-top: 0.5rem; color: var(--oxblood); font-size: 0.95rem; }

/* The input is visually hidden but still focusable, so the outline has to
 * appear on the picture instead. */
.photo-field:focus-within .photo-picker { outline: 3px solid var(--oxblood); outline-offset: 2px; }

.photo-remove { font-weight: 400; margin-top: 0.75rem; }
.photo-remove input { width: auto; margin-right: 0.4rem; }

/* --- call to action --- */
.cta-row { margin-top: 1.75rem; }
.cta {
  display: inline-block;
  background: var(--oxblood);
  color: var(--paper);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--oxblood-deep);
  border-radius: 2px;
  font-size: 1.05rem;
  min-height: 2.75rem;
}
.cta:hover { background: var(--oxblood-deep); color: var(--paper); }
.song-list.draggable li { cursor: grab; }
.song-list li.dragging { opacity: 0.5; background: var(--paper-deep); }
.drag-handle { color: var(--ink-soft); margin-right: 0.4rem; }
.ref { font-weight: 600; margin-right: 0.4rem; }
.tune { margin-right: 0.4rem; }
.book, .missing { color: var(--ink-soft); font-size: 0.95rem; }
.missing { font-style: italic; }

.results, .singers, .song-controls { list-style: none; }
.results li, .singers li, .song-controls li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.singers li { padding: 1.25rem 0; }
.bio { color: var(--ink-soft); }

img { max-width: 100%; height: auto; border-radius: 2px; }

/* --- memorial --- */
.in-memoriam {
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--oxblood);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.death-date { color: var(--ink-soft); margin-top: -0.5rem; }
.memorial {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-left: 0.5rem;
}
.report { margin-top: 2.5rem; font-size: 0.95rem; }

/* --- long-form pages --- */
.legal h2 { margin-top: 2rem; }
.legal p, .legal li { max-width: 100%; }
.legal ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.updated { color: var(--ink-soft); font-size: 0.95rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* The feedback form in the footer. Closed by default with <details>, so it is
   present on every page without competing with the page itself -- and with no
   JavaScript, which keeps script-src 'self' intact. */
.feedback { margin: 1rem 0; }
.feedback summary { cursor: pointer; color: var(--ink-soft); }
.feedback textarea { max-width: 32rem; }
.feedback button { margin-top: 0.5rem; }
