/* Both pages share this stylesheet. */
:root {
    color-scheme: dark;
    --brown: #f3e6d6;
    --border: #a58973;
    --paper: #594033;
    font-family: Helvetica, Arial, sans-serif;
    color: var(--brown);
    background: #291b15;
    line-height: 1.8;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-underline-offset: 0.35em; }
.site-header {
    width: min(100% - 3rem, 1040px);
    margin: auto;
    padding: 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.signature { font-style: italic; font-size: 1.15rem; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
nav a { text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { text-decoration: underline; }
.small-heading { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; }
h1 { font-weight: normal; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.25; }
.letter {
    width: min(100% - 3rem, 620px);
    margin: 3rem auto;
    padding: clamp(1.5rem, 5vw, 3rem);
    border: 1px solid var(--border);
    outline: 1px solid var(--border);
    outline-offset: 7px;
    background: var(--paper);
}
.letter-body { min-height: 15rem; font-size: 1.1rem; overflow-wrap: anywhere; }
.letter-body p { margin: 1.5rem 0; }
.sign-off { font-style: italic; margin-top: 3rem; }
.sign-off span { font-size: 1.6rem; }
.collage-page { width: min(100% - 3rem, 1040px); margin: 3rem auto 5rem; }
.collage-page > h1, .collage-page > .small-heading { text-align: center; }
.collage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    max-width: 780px;
    margin: 3rem auto;
    padding: 2rem 1.5rem;
    align-items: center;
    isolation: isolate;
}
.photo {
    position: relative;
    margin: 0;
    padding: 0.8rem 0.8rem 1rem;
    background: var(--paper);
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px #140d0966;
}
.photo:nth-of-type(4n + 1) { transform: rotate(-4deg); }
.photo:nth-of-type(4n + 2) { transform: rotate(3deg); }
.photo:nth-of-type(4n + 3) { transform: rotate(2deg); }
.photo:nth-of-type(4n) { transform: rotate(-3deg); }
.photo a { display: flex; align-items: center; justify-content: center; min-height: 180px; }
.photo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 240px; object-fit: contain; margin: auto; }
figcaption { text-align: center; font-style: italic; margin-top: 0.75rem; font-size: 0.95rem; }
.handwritten-note { grid-column: 1 / -1; order: 1; text-align: center; font-style: italic; font-size: 1.5rem; padding: 2.5rem 1rem 0; }
a:focus-visible { outline: 2px solid var(--brown); outline-offset: 5px; }
.skip-link { position: absolute; top: -100px; left: 1rem; background: var(--paper); padding: 0.5rem 1rem; z-index: 1; }
.skip-link:focus { top: 0.5rem; }
@media (max-width: 560px) {
    .collage-grid { grid-template-columns: 1fr; max-width: 300px; padding: 1rem; }
    .photo:nth-of-type(n) { margin: 0; transform: rotate(-2deg); }
    .photo:nth-of-type(even) { transform: rotate(2deg); }
    .letter { margin-top: 2rem; }
}

/* Reserve room so the radio never covers the page's last lines. */
body { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.music-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.9rem max(1.5rem, calc((100vw - 1040px) / 2));
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom));
    background: #38261e;
    border-top: 1px solid var(--border);
    box-shadow: 0 -5px 20px #140d0944;
}
.station-name { display: grid; grid-template-columns: auto 1fr; column-gap: 0.65rem; align-items: center; flex-shrink: 0; }
.station-light { width: 7px; height: 7px; background: #cba87e; border-radius: 50%; }
.station-name label { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.station-description { grid-column: 2; font-size: 0.75rem; color: #d5bfaa; }
.music-player audio { display: block; width: 100%; min-width: 0; max-width: 650px; height: 40px; }
@media (max-width: 560px) {
    body { padding-bottom: calc(155px + env(safe-area-inset-bottom)); }
    .music-player { flex-direction: column; align-items: stretch; gap: 0.5rem; padding-inline: 1rem; }
    .station-name { display: flex; flex-wrap: wrap; }
    .station-description { margin-left: auto; }
}

.radio-controls { display: flex; align-items: center; gap: 0.65rem; width: 100%; max-width: 650px; min-width: 0; }
.radio-controls audio { flex: 1; }
.radio-controls button { flex-shrink: 0; border: 1px solid var(--border); background: var(--paper); color: var(--brown); border-radius: 50%; width: 36px; height: 36px; font-size: 1.5rem; cursor: pointer; }
.radio-controls button:disabled { opacity: 0.4; cursor: default; }
.radio-controls button:focus-visible { outline: 2px solid var(--brown); outline-offset: 3px; }
.station-name { max-width: 40%; }
.station-description { overflow-wrap: anywhere; }
@media (max-width: 560px) { .station-name { max-width: 100%; } }
