/* --- Baseline fixes to prevent horizontal scroll --- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body{
  margin: 0;
  background: #999;
  color: #fff;
  font-family: "Century Gothic", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow-x: hidden;
}

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

/* Layout container */
.page{
  width: min(1120px, 100% - 24px);
  margin: 0 auto;
  padding: 18px 0 28px;
  text-align: center;
  color: #fff;
}

/* Title block */
.page-top{
  text-align: center;
  padding: 28px 12px 10px;
}

.site-title{
  margin: 0;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: clamp(34px, 5vw, 64px);
}

/* Hero image */
.center-block{
  margin: 18px auto 14px;
}

.hero-image{
  width: 100%;
  max-width: 1120px;
}

/* Navigation */
.nav{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  padding: 18px 8px 22px;
  margin: 0 auto;
  max-width: 1120px;
}

.nav-link{
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(14px, 1.6vw, 20px);
  line-height: 1.2;
  padding: 6px 2px;
  white-space: nowrap;
}

.nav-link:hover{ text-decoration: underline; }

.nav-link.is-current{
  cursor: default;
  opacity: 0.95;
}

/* Gallery */
.gallery{
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  padding-top: 10px;
}

.art-image{
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.caption{
  margin-top: 10px;
  font-size: clamp(14px, 1.6vw, 20px);
}

.caption .title{ font-weight: 700; }

/* Footer */
.footer{ padding-top: 26px; }
.footer-text{ font-size: 14px; opacity: 0.85; }

/* =========================================================
   Sub-Page – Picture Selector Layout
========================================================= */

.chapter-layout{
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  margin-top: 18px;
  text-align: left;
}

.picture-selector{
  background: #ccc;
  padding: 10px;
  overflow-y: auto;
  max-height: 75vh;
}
 
.picture-selector a{
  display: block;
  margin-bottom: 14px;
}

.picture-selector img{
  width: 100%;
  border: none;
}

.chapter-content{
  background: #666;
  padding: 18px 20px;
  color: #fff;
}

.chapter-content h2{
  margin-top: 0;
  font-size: clamp(22px, 3vw, 32px);
}

.chapter-content p{
  font-family: "Book Antiqua", serif;
  line-height: 1.65;
  margin-bottom: 16px;
}

.chapter-content img.inline-left{
  float: left;
  margin: 6px 16px 10px 0;
  width: min(160px, 40vw);
}

.chapter-content::after{
  content: "";
  display: block;
  clear: both;
}

/* Responsive stacking */
@media (max-width: 820px){
  .chapter-layout{
    grid-template-columns: 1fr;
  }

  .picture-selector{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: none;
    justify-content: center;
  }

  .picture-selector a{
    width: 120px;
    margin: 0;
  }
}

@media (max-width: 480px){
  .nav{ gap: 10px 14px; }
  .nav-link{ white-space: normal; }
}
