/* Bone Idol - single mobile-first stylesheet.
   Breakpoints: 640px (tablet), 1024px (desktop), 1400px (large monitor). */

:root {
  /* The original site's colours: yellow (#FFFF00) text and links on
     aubergine (#330033), with the logo/bone buttons' cream (#ffffd7). */
  --paper:  #330033;
  --card:   #441a44;
  --ink:    #ffff00;
  --muted:  #d9d27a;
  --rule:   #5e2d5e;

  --accent:        #330033;   /* header - same as the page, as the original */
  --accent-ink:    #ffffd7;   /* hamburger icon - bone cream, like the logo */
  --accent-bright: #ffffff;   /* hover / focus */
  --lightbox:      #1a001a;

  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px -10px rgba(0, 0, 0, .6);

  --measure: 68ch;
  --wide: 1100px;

  --step--1: clamp(.82rem, .8rem + .1vw, .9rem);
  --step-0:  clamp(1rem, .96rem + .2vw, 1.1rem);
  --step-1:  clamp(1.15rem, 1.05rem + .4vw, 1.4rem);
  --step-2:  clamp(1.4rem, 1.2rem + .8vw, 1.9rem);
  --step-3:  clamp(1.9rem, 1.5rem + 1.6vw, 2.75rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
}

h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0 0 .5rem; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1rem; }

a { color: var(--ink); text-underline-offset: 2px; }
a:hover { color: var(--accent-bright); }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

img { max-width: 100%; height: auto; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.1rem; }

/* ---- Header & nav ---- */

.topbar {
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom: 1px solid var(--rule);
}

.topbar-row {
  max-width: var(--wide);
  margin: 0 auto;
  padding: .9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand { display: block; line-height: 0; }
/* The original logo, traced to SVG so it scales: fills the phone header
   beside the hamburger, capped at its original 460px on big screens. */
.brand img { display: block; width: clamp(160px, 55vw, 460px); height: auto; }

.nav-toggle {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nav-toggle-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 2rem; height: 2rem;
  cursor: pointer;
}
.nav-toggle-label span {
  display: block;
  height: 2px;
  background: var(--accent-ink);
  border-radius: 1px;
}
.nav-toggle:focus-visible + .nav-toggle-label {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.site-nav {
  display: none;
  background: var(--accent);
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.1rem 1rem;
}
.nav-toggle:checked ~ .site-nav { display: block; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav > ul > li { border-top: 1px solid rgba(255, 255, 255, .15); }
.site-nav > ul > li:first-child { border-top: 0; }

.site-nav a, .site-nav span.section-label {
  display: block;
  padding: .6rem 0;
  color: var(--ink);   /* all menu text in the original yellow */
  text-decoration: none;
}
.site-nav span.section-label {
  color: var(--ink);
  font-size: var(--step--1);
  letter-spacing: .04em;
  text-transform: uppercase;
  padding-bottom: .2rem;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--accent-bright); }
.site-nav ul ul { padding-left: 1rem; }

/* ---- Main content ---- */

main { padding: 1.5rem 0 3rem; }
main .wrap { max-width: var(--wide); }

article { max-width: var(--measure); }
article img { display: block; margin: .5rem 0; }
article::after { content: ""; display: table; clear: both; }
/* Legacy content photos (band member pages) carry align="left|right" plus an
   hspace gap that `article img`'s margin overrides, leaving text butted up
   against the photo. Frame them in bone cream; stack centred on phones,
   float with a real gutter from tablet up. */
article img[align="left"], article img[align="right"] {
  float: none;
  max-width: min(80%, 300px);
  margin: .5rem auto 1.25rem;
  padding: 6px;
  background: var(--card);
  border: 2px solid var(--accent-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* Galleries use the full content width for the grid; only their intro text
   keeps the reading measure. */
article.wide { max-width: none; }
article.wide > p { max-width: var(--measure); }

footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2.5rem;
  font-size: var(--step--1);
  color: var(--muted);
}
footer .wrap { max-width: var(--wide); }

/* ---- Gigs table ---- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}
th, td {
  text-align: left;
  padding: .6rem .5rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
thead th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---- Sounds ---- */

.track-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.track-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.track-list audio { width: 100%; margin-top: .5rem; }

.song-list { columns: 1; margin: 0; padding-left: 1.2rem; }

/* ---- Galleries ---- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .6rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.gallery-item {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  margin: 0; /* override `article img`'s content-image margin */
  transition: transform .2s ease;
}
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.05); }

.gallery-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.gallery-card {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.gallery-card .gallery-cover {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.gallery-card .gallery-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
}
.gallery-card .gallery-card-body { padding: .75rem .9rem; }
.gallery-card h3 { font-size: var(--step-0); margin: 0 0 .25rem; }
.gallery-card p { margin: 0; color: var(--muted); font-size: var(--step--1); }

/* ---- Lightbox ---- */

dialog.lightbox {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: var(--lightbox);
  max-width: 92vw;
  max-height: 92vh;
}
dialog.lightbox::backdrop { background: rgba(20, 15, 20, .85); }
.lightbox-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
}
.lightbox-image {
  max-width: 84vw;
  max-height: 76vh;
  object-fit: contain;
  display: block;
}
.lightbox-caption {
  color: #fff;
  text-align: center;
  font-size: var(--step--1);
  margin: .5rem 0 0;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 0;
  border-radius: 999px;
  width: 2.25rem; height: 2.25rem;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255, 255, 255, .25); }
.lightbox-close { top: .6rem; right: .6rem; }
.lightbox-prev { left: .6rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: .6rem; top: 50%; transform: translateY(-50%); }

/* ---- Tablet and up ---- */

@media (min-width: 641px) {
  .nav-toggle, .nav-toggle-label { display: none; }

  /* Same centred column and side padding as .topbar-row, so the menu lines
     up under the logo at every width. */
  .site-nav {
    display: block;
    background: transparent;
    padding: 0 1.1rem;
  }
  .site-nav > ul { display: flex; flex-wrap: wrap; gap: 0 1.75rem; align-items: baseline; }
  .site-nav > ul > li { border-top: 0; position: relative; }
  .site-nav a, .site-nav span.section-label { padding: 1rem 0; }
  /* Top-level section headings match the links' size so the row sits level;
     yellow plus a caret marks them as dropdowns rather than links. */
  .site-nav > ul > li > span.section-label {
    font-size: inherit;
    letter-spacing: 0;
    text-transform: none;
    cursor: default;
  }
  /* Drawn caret (not a ▾ glyph) so it doesn't depend on the font. */
  .site-nav > ul > li > span.section-label::after {
    content: "";
    display: inline-block;
    margin-left: .4em;
    border: .3em solid transparent;
    border-top-color: currentColor;
    border-bottom: 0;
    vertical-align: .2em;
  }

  .site-nav ul ul {
    display: none;
    position: absolute;
    top: 100%; left: 0;
    min-width: 12rem;
    background: var(--card);   /* lighter than the page so the panel reads as one */
    border: 1px solid var(--rule);
    padding: .4rem 0;
    box-shadow: var(--shadow);
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 10;
  }
  .site-nav li:hover > ul, .site-nav li:focus-within > ul { display: block; }
  .site-nav ul ul li { padding: 0 1rem; border-top: 0; }
  .site-nav ul ul a, .site-nav ul ul span.section-label { padding: .5rem 0; }

  .topbar-row { padding: 1.1rem 1.1rem 0; }

  article img[align="left"], article img[align="right"] { max-width: min(40%, 300px); }
  article img[align="left"]  { float: left;  margin: .35rem 1.75rem 1rem 0; }
  article img[align="right"] { float: right; margin: .35rem 0 1rem 1.75rem; }

}

/* ---- Desktop ---- */

@media (min-width: 1024px) {
  .wrap, .topbar-row, main .wrap, .site-nav, footer .wrap { padding-left: 2.5rem; padding-right: 2.5rem; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
}

/* ---- Large monitors: stop growing, let margins take the rest ---- */

@media (min-width: 1400px) {
  .wrap, .topbar-row, main .wrap, .site-nav, footer .wrap { padding-left: 0; padding-right: 0; }
}
