/* Broadside - single mobile-first stylesheet (structure ported from boneidol).
   Breakpoints: 640px (tablet), 1024px (desktop), 1400px (large monitor). */

:root {
  /* The original site's colours (httpdocs/Styles/gecko.css): white Verdana
     on black, yellow h1/h3/quotes, green h2, light-blue definition terms. */
  --paper:  #000000;
  --card:   #161616;
  --ink:    #ffffff;
  --muted:  #b8b8b8;
  --rule:   #333333;
  --yellow: #ffff00;
  --green:  #33ff33;
  --blue:   #99ccff;

  --accent:        #000000;   /* header - same as the page, as the original */
  --accent-ink:    #ffff00;   /* hamburger icon - logo yellow */
  --accent-bright: #33ff33;   /* hover / focus */
  --lightbox:      #0a0a0a;

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

  --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.3rem, 1.15rem + .6vw, 1.7rem);
  --step-3:  clamp(1.6rem, 1.35rem + 1.1vw, 2.2rem);
}

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

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

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

p { margin: 0 0 1rem; }

a { color: var(--yellow); 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; }

/* The home page's dictionary-definition opener. */
dl { margin: 0 0 .5rem; }
dt { font-size: var(--step-1); font-weight: bold; color: var(--blue); padding-bottom: .4rem; }
dd { margin: 0 0 .1rem 1.5rem; }
q { color: var(--yellow); }

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

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

/* Transparent (the page is the same black) so the logo's shot spray below
   can show through it. */
.topbar {
  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 460px on big screens. */
.brand img { display: block; width: clamp(180px, 62vw, 460px); height: auto; }

/* The original page background, httpdocs/Images/peppershot.gif, was the logo
   plus a spray of white "shot" specks around and below it. spray.svg is just
   the specks (740x400 GIF pixels); it is pinned to the logo and scales with
   it, so phones get a smaller spray rather than a 740px image. The logo
   occupies the GIF box (24.5, 12.5) 688x93, so the offsets and sizes are
   those numbers as percentages of the logo. */
.brand { position: relative; }
.brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -3.56%;           /* 24.5 / 688 */
  top: -13.44%;           /* 12.5 / 93 */
  width: 107.56%;         /* 740 / 688 */
  height: 430.11%;        /* 400 / 93 */
  background: url("../spray.svg") 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}

.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;
  flex-shrink: 0;
  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; }

/* White bold menu text, as the original's cannon-button labels. */
.site-nav a, .site-nav span.section-label {
  display: block;
  padding: .6rem 0;
  color: var(--ink);
  font-weight: bold;
  text-decoration: none;
}
.site-nav span.section-label {
  color: var(--yellow);
  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(--yellow); }
.site-nav ul ul { padding-left: 1rem; }
.site-nav ul ul a { font-weight: normal; }

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

main { padding: 1.75rem 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 images carry align="left|right" (the home page's cannon
   sign-off). Plain floats - no frame, unlike boneidol's member photos. */
article img[align="right"] { float: right; margin: .5rem 0 .5rem 1rem; }
article img[align="left"]  { float: left;  margin: .5rem 1rem .5rem 0; }
/* Listing pages use the full content width; intro text keeps the measure. */
article.wide { max-width: none; }
article.wide > p, article.wide > .intro { max-width: var(--measure); }
.intro { margin-bottom: 1.25rem; }

footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2.5rem;
  font-size: var(--step--1);
  color: var(--muted);
}
footer a { color: var(--muted); }
footer a:hover { color: var(--yellow); }
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(--yellow); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.gig-date { white-space: nowrap; color: var(--yellow); }

/* Phones: each gig becomes a stacked card - three columns of long legacy
   prose don't fit 320px. */
@media (max-width: 640px) {
  .gig-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .gig-table, .gig-table tbody, .gig-table tr, .gig-table td { display: block; width: 100%; }
  .gig-table tr { padding: .75rem 0; border-bottom: 1px solid var(--rule); }
  .gig-table td { border: 0; padding: .1rem 0; }
  .gig-table td:nth-child(2) { font-weight: bold; }
}

/* ---- News ---- */

.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.news-list li:first-child { padding-top: 0; }
.news-list time {
  display: block;
  color: var(--green);
  font-size: var(--step--1);
  font-weight: bold;
  margin-bottom: .3rem;
}

/* ---- 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 p { margin-bottom: .4rem; }
.track-list audio { width: 100%; margin-top: .5rem; }

/* ---- 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: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.gallery-card:hover { border-color: var(--yellow); color: inherit; }
.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(0, 0, 0, .88); }
.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 1rem 1rem;
}
.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;
     a caret marks them as dropdowns rather than links. */
  .site-nav > ul > li > span.section-label {
    color: var(--ink);
    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: var(--yellow);
    border-bottom: 0;
    vertical-align: .2em;
  }
  .site-nav > ul > li:hover > span.section-label,
  .site-nav > ul > li:focus-within > span.section-label { color: var(--yellow); }

  .site-nav ul ul {
    display: none;
    position: absolute;
    top: 100%; left: 0;
    min-width: 12rem;
    background: var(--card);
    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; }
}

/* ---- 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; }
}
