/* ==========================================================
   gallery-base.css  --  NEWWEB global base stylesheet
   Shared by all gallery folders (gallery003, gallery_japan, etc.)

   Appearance is driven by CSS custom properties that
   gallery-engine.js sets from each gallery's config.js.
   Fallback values here are neutral defaults.
   ========================================================== */

/* ----------------------------------------------------------
   CSS CUSTOM PROPERTY DEFAULTS
   gallery-engine.js overrides these from the GALLERY config.
---------------------------------------------------------- */
:root {
  --bg-color:      #1a1a1a;
  --wrapper-width: 807px;
  --preview-width: 482px;
  --accent-color:  #7f7f7f;
  --hover-color:   #a1a1a1;
  --text-color:    #b3b3b3;
  --border-color:  #787878;
  --thumb-bg:      #949494;
  --thumb-size:    160px;
}

/* GLOBAL */
* {
  margin: 0;
  padding: 0;
}
body {
  text-align: center;
  margin: 0;
  padding: 110px 0 110px;   /* leaves room for 90px accent strips top + bottom */
  background-color: var(--bg-color);
}
img {
  border: 0;
}

/* TYPOGRAPHY */
/* body excluded here -- its background is set explicitly above via var(--bg-color) */
h1, h2, h3, h4, h5, h6, p, a {
  background-color: inherit;
  color: var(--text-color);
  font-size: 12px;
  font-family: helvetica, arial, tahoma, verdana, sans-serif;
}
body {
  color: var(--text-color);
  font-size: 12px;
  font-family: helvetica, arial, tahoma, verdana, sans-serif;
}

/* LINKS -- no underline by default across all gallery pages */
a, a:link, a:visited, a:hover, a:active {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* MISC */
.clear {
  clear: both;
}

/* BORDERS -- color driven by --border-color */
.borderTopLeft {
  border-top:  1px solid var(--border-color);
  border-left: 1px solid var(--border-color);
}
.borderBottomRight {
  border-right:  1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.borderRight {
  border-right: 1px solid var(--border-color);
}
.borderRightDotted {
  border-right: 1px dotted var(--border-color);
}
.borderBottom {
  border-bottom: 1px solid var(--border-color);
}

/* SITE WRAPPER */
#wrapper_large, #wrapper_thumb {
  text-align: left;
  width: var(--wrapper-width);
  margin: 0 auto;
  padding-left: 10px;
  padding-right: 10px;
  position: relative;   /* establishes stacking context above accent strips */
  z-index: 1;
}

/* ACCENT IMAGE */
#gallery-accent {
  text-align: center;
  margin: 8px 0;
}
#gallery-accent img {
  max-width: 100%;
  display: inline-block;
}

/* SITE TITLE */
#sitetitle {
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent-color);
}
#sitetitle h1 {
  background-color: inherit;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 0.12em;
  color: var(--accent-color);
  text-shadow: 0 0 18px var(--accent-color);
}

/* COLLECTION HEADER */
#collectionHeader {
  margin-bottom: 15px;
}
#collectionHeader h1 {
  font-size: 14px;
  color: var(--text-color);
}
#collectionHeader p {
  line-height: 16px;
  margin-top: 5px;
}

/* STAGE */
#stage, #stage2, #index {
  float: left;
  position: relative;
  margin: 0;
}
#stage, #stage2 {
  padding-bottom: 10px;
  border-bottom: 1px dotted var(--accent-color);
}

/* PREVIEW FULL (detail page) */
#previewFull {
  float: left;
  position: relative;
  color: inherit;
  background-color: var(--bg-color);
  width: var(--preview-width);
}
#previewFull .padding {
  padding-top: 15px;
}
.preview {
  position: relative;
}

/* THUMBNAIL GRID */
.thumbnail {
  float: left;
  position: relative;
  color: inherit;
  background-color: var(--thumb-bg);
  width: var(--thumb-size);
  height: var(--thumb-size);
  box-sizing: border-box;
  padding: 6px;
  overflow: hidden;   /* safety net -- nothing bleeds outside the cell */
}
.selectedThumbnail, .thumbnail:hover {
  color: inherit;
  background-color: var(--hover-color);
}
.emptyThumbnail {
  float: left;
  color: inherit;
  background-color: var(--thumb-bg);
  width: var(--thumb-size);
  height: var(--thumb-size);
  box-sizing: border-box;
}

/* The anchor wraps the img -- make it fill the padded cell and center its content */
.thumbnail a {
  display: flex;
  align-items: center;       /* vertical center */
  justify-content: center;   /* horizontal center */
  width: 100%;
  height: 100%;
}

/* img constrained using calc() directly against the CSS var -- avoids unreliable
   percentage-height resolution across grid-item -> anchor -> img chain */
.thumb {
  display: block;
  max-width:  calc(var(--thumb-size) * 0.75);   /* 75% of cell -- breathing room on all sides */
  max-height: calc(var(--thumb-size) * 0.75);
  width: auto;
  height: auto;
}
.itemNumber {
  z-index: 0;
  position: absolute;
  top: 2px;
  left: 2px;
  background-color: inherit;
  color: var(--thumb-bg);
  font-size: 40px;
  font-weight: bold;
  letter-spacing: -1px;
}

/* ZOOM-RESILIENT GRID -- always exactly --columns columns */
#index {
  display: grid !important;
  grid-template-columns: repeat(3, var(--thumb-size)) !important;
  float: none !important;
}
#index .clear {
  display: none !important;
}

/* PAGINATION */
.pagination {
  float: right;
  margin-bottom: 10px;
  padding: 0;
}
.pagination ul {
  margin: 0;
  padding: 0;
}
.pagination li {
  float: left;
  list-style: none;
  padding: 5px;
}
.pagination .previous {
  font-weight: bold;
  margin-left: 25px;
}
.pagination .next {
  font-weight: bold;
}
.pagination .current {
  border: solid 1px var(--accent-color);
}

/* CONTACT */
#contact {
  margin-bottom: 10px;
  padding: 5px 0;
}

/* TEXT COLOR HELPER */
.textColor {
  color: var(--text-color);
}

/* DETAIL / VIEW PAGE */
#detailTitle {
  margin: 10px 0 0 0;
  float: left;
  clear: both;
  text-align: center;
  width: 100%;
}
.detailNav {
  width: 100%;
  float: left;
  clear: both;
  text-align: center;
}
.detailNav ul {
  margin: 10px auto;
  text-align: center;
}
.detailNav ul li {
  display: inline;
  text-align: center;
  list-style: none;
  padding: 5px;
}
#detailImage {
  text-align: center;
  width: 100%;
}
#detailCaption {
  margin: 10px;
  text-align: center;
  color: var(--text-color);
}
.detailText {
  color: var(--text-color);
  background-color: inherit;
}

/* DROP SHADOW (path relative to NEWWEB/gallery-base.css) */
.dropShadow {
  background: url(misc/shadow.png) right bottom no-repeat;
  display: block;
  float: left;
  margin: 13px -10px -10px 10px;
  position: relative;
}
.dropShadow:before, .dropShadow:after {
  background: inherit;
  content: " ";
  display: block;
  height: 10px;
  width: 10px;
}
.dropShadow:before {
  background-position: right top;
  margin: -10px 0 0 auto;
  position: absolute;
  right: 0;
  top: 0;
}
.dropShadow:after {
  background-position: left bottom;
  margin: -13px 0 0 -10px;
}
.dropShadow .inner {
  display: block;
  left: -10px;
  margin: 0;
  overflow: hidden;
  position: relative;
  top: -13px;
}

/* ==========================================================
   ACCENT STRIPS -- repeating image fixed at top + bottom of viewport
   JS injects #accent-strip-top and #accent-strip-bottom with
   background-image set from the gallery's accentImage config.
   ========================================================== */

.accent-strip {
  position: fixed;
  left: 0;
  width: 100%;
  height: 90px;
  background-repeat: repeat-x;
  background-size: auto 90px;
  background-position: center;
  z-index: 0;              /* behind page content */
  pointer-events: none;   /* strips don't block clicks on content */
}


/* ==========================================================
   LIGHTBOX -- overlay with prev/next arrows + keyboard nav
   Arrow color uses --accent-color from the gallery config.
   ========================================================== */

.lb-overlay {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.92);
  padding: 22px;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* inner frame border */
.lb-overlay::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  pointer-events: none;
  z-index: 0;
}

.lb-close {
  position: absolute;
  top: 30px; right: 38px;
  color: #aaa;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  z-index: 50;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 6px;
}
.lb-close:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.lb-img {
  opacity: 0;
  transition: opacity 0.3s ease-in;
  max-width: calc(100% - 160px);
  max-height: calc(100vh - 180px);
  display: block;
  margin: 0 auto;
  object-fit: contain;
  z-index: 10;
  border-radius: 3px;
}
.lb-img.lb-visible { opacity: 1; }

.lb-caption {
  color: #999;
  font-size: 0.78rem;
  margin-top: 8px;
  z-index: 10;
  text-align: center;
  max-width: 80%;
}
.lb-counter {
  color: #666;
  font-size: 0.75rem;
  margin-top: 4px;
  z-index: 10;
}

/* prev / next arrows -- fixed to left and right edges of lightbox overlay */
.lb-prev, .lb-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 64px;
  color: var(--accent-color, rgba(255, 255, 255, 0.4));
  opacity: 0.5;
  user-select: none;
  width: 60px;
  padding: 14px 0;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  z-index: 50;
}
.lb-prev { left: 22px; }
.lb-next { right: 22px; }
.lb-prev:hover, .lb-next:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.12);
}
.lb-prev.lb-hidden, .lb-next.lb-hidden { display: none; }


/* ==========================================================
   GALLERY NAV  --  back-to-TOC pill, fixed top-left
   Collapses to a camera-icon circle at rest; expands on hover
   to reveal a "← galleries" label.
   ========================================================== */

#gallery-nav-home {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 9000;
  display: flex;
  align-items: center;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 0;
  max-width: 32px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  transition: max-width 0.35s ease, background 0.2s;
  white-space: nowrap;
}
#gallery-nav-home:hover {
  max-width: 160px;
  background: rgba(255, 255, 255, 0.15);
}

/* icon circle -- fixed 32x32, always visible */
#gallery-nav-home .gnav-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#gallery-nav-home .gnav-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #aaa;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  transition: stroke 0.2s;
}
#gallery-nav-home:hover .gnav-icon svg {
  stroke: #fff;
}

/* label -- hidden at rest, fades in after pill opens */
#gallery-nav-home .gnav-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #ccc;
  padding-right: 12px;
  opacity: 0;
  transition: opacity 0.15s 0.18s;
}
#gallery-nav-home:hover .gnav-label {
  opacity: 1;
}

/* light theme inversion */
#gallery-nav-home.gnav-light {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.18);
}
#gallery-nav-home.gnav-light:hover {
  background: rgba(0, 0, 0, 0.14);
}
#gallery-nav-home.gnav-light .gnav-icon svg {
  stroke: #555;
}
#gallery-nav-home.gnav-light:hover .gnav-icon svg {
  stroke: #111;
}
#gallery-nav-home.gnav-light .gnav-label {
  color: #444;
}
