/* Blues.Ru — responsive layout */

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

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

/* ── Body base — content pages get side padding and max-width ───
   Homepage body gets .hp class; galleries get .gallery-body. */
body {
  margin: 0 auto;
  padding: 0 1em;
  max-width: 900px;
}
body.hp {
  padding: 0;
  max-width: none;
}
body.gallery-body {
  margin: 0;
  padding: 0;
  max-width: none;
}

/* ── Responsive iframes (YouTube etc.) ─────────────── */
.video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  margin: 1em 0;
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}
iframe { max-width: 100%; }

/* ── Homepage two-column layout ──────────────────── */
.site-wrap {
  display: flex;
  align-items: stretch;
  max-width: 1100px;
  margin: 0 auto;
  border: 1px solid #888;
}

.site-nav {
  width: 340px;
  flex-shrink: 1;
  min-width: 220px;
  padding: 4px 8px;
  border-right: 1px solid #ccc;
  text-align: center;
}

.site-main {
  flex: 1;
  min-width: 0;
  padding: 8px 16px;
}

/* ── Nav logo area ───────────────────────────────── */
.nav-logo {
  display: block;
  text-align: center;
}

.nav-tagline {
  font-size: 1.1em;
  padding: 0 4px 4px;
  text-align: center;
}

/* ── Nav two-column pairs ────────────────────────── */
.nav-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 6px;
  align-items: start;
  text-align: left;
}

/* ── Nav section headers ─────────────────────────── */
.nav-section-hdr {
  display: block;
  background: #003D84;
  color: #fff;
  font-weight: bold;
  padding: 2px 4px;
  margin-top: 3px;
  text-align: left;
}

/* ── Nav links ───────────────────────────────────── */
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.nav-links li {
  padding: 1px 0;
  line-height: 1.4;
}

/* Search form within nav */
.nav-search {
  padding: 3px 0;
  text-align: left;
}
.nav-search form {
  display: flex;
  gap: 3px;
}
.nav-search input[type=text] {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  padding: 2px 3px;
}
.nav-search input[type=submit] {
  font-size: 11px;
  flex-shrink: 0;
}

/* ── Hamburger button (mobile only) ─────────────── */
.hamburger-btn {
  display: none;
  background: #003D84;
  color: #fff;
  border: none;
  padding: 6px 10px;
  font-size: 1em;
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-top: 4px;
}

/* ── Responsive: tablet (iPad) ───────────────────── */
@media (max-width: 900px) {
  .site-wrap { max-width: 100%; }
  .site-nav { width: 270px; text-align: center; }
  .nav-logo { text-align: center; }
  .nav-tagline { text-align: center; }
}

/* ── Responsive: mobile ─────────────────────────── */
@media (max-width: 680px) {
  body { padding: 0 0.6em; }
  body.hp { padding: 0; }

  .site-wrap {
    flex-direction: column;
    border: none;
    border-top: 2px solid #003D84;
  }
  .site-nav {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid #ccc;
    padding: 6px 8px;
    text-align: left;
  }
  .nav-logo { text-align: left; }
  .nav-tagline { text-align: left; }
  .site-main {
    width: 100%;
    padding: 8px 10px;
  }
  .hamburger-btn {
    display: block;
  }
  .nav-collapsible {
    display: none;
  }
  .nav-collapsible.open {
    display: block;
  }
  .nav-links li {
    padding: 3px 0;
  }
  .nav-pair {
    gap: 0 12px;
  }
}

/* ── General content readability ─────────────────── */
p { line-height: 1.55; }

table { max-width: 100%; }
td { vertical-align: top; }

img[align="left"] {
  max-width: 160px;
  margin-right: 8px;
  margin-bottom: 4px;
}

/* ── Header banner images ────────────────────────── */
/* bluesman.gif, news.gif, harps.gif etc.: scale proportionally */
img[src*="bluesman.gif"],
img[src*="news.gif"],
img[src*="harps.gif"],
img[src*="ATBred.gif"] {
  width: 100%;
  max-width: 385px;
  height: auto;
}

/* ── Photo index: responsive gallery cards ───────── */
.photo-index .year-nav {
  white-space: normal;
  line-height: 2;
}

@media (max-width: 680px) {
  .photo-index .gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .photo-index .gallery-card { width: auto; }
  .photo-index .gallery-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
  }
  .no-thumb { width: 100% !important; }
}

@media (min-width: 681px) and (max-width: 900px) {
  .photo-index .gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .photo-index .gallery-card { width: auto; }
  .photo-index .gallery-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
  }
  .no-thumb { width: 100% !important; }
}

/* ── Gallery page thumbnails ─────────────────────── */
@media (max-width: 680px) {
  .gallery-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 0.5rem;
  }
  .gallery-thumb { width: auto; }
  .gallery-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
  }
  .gallery-thumb .thumb-caption { width: 100%; }
}

@media (min-width: 681px) and (max-width: 900px) {
  .gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .gallery-thumb { width: auto; }
  .gallery-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
  }
  .gallery-thumb .thumb-caption { width: 100%; }
}

/* ── Donate block ────────────────────────────────── */
.donate-wrap { text-align: center; margin: 0.5em 0; }
.donate-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 4px;
  max-width: 500px;
  margin: 0 auto;
}
.donate-currency {
  font-size: 1.5em;
  font-weight: bold;
  line-height: 1;
  flex-shrink: 0;
}
.donate-btn { flex-shrink: 0; }
.donate-btn img,
.donate-btn input[type=image] {
  max-width: 200px;
  height: auto;
  display: block;
}
@media (max-width: 480px) {
  .donate-buttons {
    flex-direction: column;
    align-items: center;
  }
}

/* ── News: image inside article body ────────────── */
.news-img {
  float: right;
  max-width: 200px;
  margin: 0 0 8px 12px;
  height: auto;
}
@media (max-width: 480px) {
  .news-img { max-width: 120px; }
}

/* ── News single story ───────────────────────────── */
.story-nav {
  font-size: 0.9em;
  margin: 0.3em 0 0.8em;
}
.story-nav a { color: #4F62B5; }
.story-date { color: #4F62B5; font-style: italic; }

/* ── Article / text pages ────────────────────────── */
body.article-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1em;
}
