/* libre-media — shared styles for index.html and album.html.
   No web fonts, no CDN: everything this site loads comes from this server. */

:root {
  --bg:        #fbfaf8;
  --bg-sunk:   #f1efeb;
  --surface:   #ffffff;
  --ink:       #1b1a18;
  --ink-soft:  #56534d;
  --ink-faint: #8a857d;
  --line:      #e2ded7;
  --accent:    #9a3412;
  --radius:    10px;
  --measure:   68ch;
  --shadow:    0 1px 2px rgba(27,26,24,.06), 0 8px 24px -12px rgba(27,26,24,.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #14130f;
    --bg-sunk:   #0e0d0b;
    --surface:   #1d1b17;
    --ink:       #f2efe9;
    --ink-soft:  #b3ada2;
    --ink-faint: #837d73;
    --line:      #2e2b25;
    --accent:    #f0904f;
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

/* --- masthead ----------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
  padding: 40px 0 28px;
}
.masthead .kicker {
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.masthead h1 {
  font-size: clamp(28px, 4.5vw, 42px);
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 0;
  font-weight: 650;
}
.masthead .lede {
  color: var(--ink-soft);
  margin: 12px 0 0;
  max-width: var(--measure);
}
.backlink {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 14px;
  text-decoration: none;
  color: var(--ink-soft);
}
.backlink:hover { color: var(--accent); }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--ink-faint);
}
.meta span::before { content: ""; }

/* --- album list --------------------------------------------------------- */

.albums {
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
.album-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.album-card:hover,
.album-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--ink-faint);
}
.album-card .cover {
  aspect-ratio: 3 / 2;
  width: 100%;
  object-fit: cover;
  display: block;
  background: var(--bg-sunk);
}
.album-card .body { padding: 16px 18px 20px; }
.album-card h2 {
  font-size: 17px;
  line-height: 1.3;
  margin: 0 0 6px;
  font-weight: 620;
  letter-spacing: -.01em;
}
.album-card .sub {
  color: var(--ink-faint);
  font-size: 13px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* --- media grid --------------------------------------------------------- */

#gallery {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
#gallery a {
  position: relative;
  display: block;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-sunk);
  aspect-ratio: 1 / 1;
  cursor: zoom-in;
}
#gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease, opacity .3s ease;
}
#gallery a:hover img { transform: scale(1.04); }
#gallery a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Play badge on anything that is not a still image. */
#gallery a[data-kind="video"]::after,
#gallery a[data-kind="youtube"]::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(20,19,15,.62) center/14px 16px no-repeat
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 18"><path d="M2 1l12 8-12 8z" fill="white"/></svg>');
  backdrop-filter: blur(2px);
  pointer-events: none;
}

/* --- states ------------------------------------------------------------- */

.notice {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  padding: 40px 24px;
  text-align: center;
}
.notice code {
  background: var(--bg-sunk);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

footer.site {
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 13px;
  margin-top: 56px;
  padding-top: 22px;
}
footer.site a { color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  #gallery a:hover img { transform: none; }
}
