@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* TouchHoverButton.css - Core styles and utilities */

/* ===== CORE PAGE STYLES ===== */

/* Page layout styles */

:root {
  --primary-color: #0d0e14;
  --secondary-color: hsl(345, 60%, 40%);
  --third-color: #2a2b36;
  --accent-color: hsl(345, 55%, 55%);
  --light-color: #d0d0d8;
  --lightmed-color: #8a8a96;
  --dark-color: #13141c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


html,
body {
  width: 100%;
  max-width: 100%;   /* 1200px */
  overflow-x: hidden;
  overflow-y: auto;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  color: var(--light-color);
  background-color: var(--primary-color);
  max-width: 1200px;
  margin: 0 auto;
  padding: 2px;
  -webkit-font-smoothing: antialiased;
}


.header,
header {
  background: linear-gradient(180deg, #16171f 0%, var(--primary-color) 100%);
  color: white;
  text-align: center;
  padding: 1.3rem;
  border-radius: 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}


h1 {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  margin-bottom: .2rem;
  color: #e8e8ec;
}

h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0.1rem 0 1rem;
  color: var(--accent-color);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 1.3rem 0 1rem;
  color: var(--accent-color);
}

h4 {
  font-size: 1.1rem;
  margin: .1rem 0 1rem;
  color: var(--accent-color);
}

p {
  margin-bottom: 1rem;
}

/* Body text links — adapted from ATS article style */
main a {
  color: hsl(345, 45%, 65%);
  font-weight: 600;
  text-decoration: underline;
}
main a:visited {
  color: hsl(345, 30%, 50%);
  font-weight: 600;
  text-decoration: underline;
}
@media (hover: hover) {
  main a:hover {
    color: #d0d0d8;
    transition: color 0.3s ease;
  }
}
main a:active {
  color: #e0c8c8;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  margin: 1rem 0;
  transition: transform 0.3s ease;
}

/* Only scale on devices that support true hover (not touch) */
@media (hover: hover) {
  img:hover {
    transform: scale(1.02);
  }
}

/* Touch feedback via :active instead */
img:active {
  transform: scale(0.98);
}

.decade {
  background-color: #13141c;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 1.2rem 1.4rem 1rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
/* Accent-colored border on themed decade sections */
.decade[class*="decade-theme-"] {
  border: 1px solid var(--decade-accent);
}

.nav-container {
  background-color: var(--dark-color);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 2rem;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  color: var(--lightmed-color);
  background-color: transparent;
}

.toc2 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  color: var(--lightmed-color);
  background-color: transparent;
}

.toc a {
  color: #7a7a8a;
  text-decoration: none;
  padding: 0.15rem 0.55rem;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  background-color: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 0.75rem;
  font-weight: 400;
  transition: color 0.2s ease, border-color 0.2s ease;
}


@media (hover: hover) {
  .toc a:hover {
    color: #c8c8d4;
    border-color: rgba(255,255,255,0.35);
  }
}

/* Touch feedback */
.toc a:active {
  color: #c8c8d4;
  border-color: rgba(255,255,255,0.35);
}


.image-container {
  background-color: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 1rem 1.4rem;
  display: flex;
  justify-content: center;
  margin: .4rem 0;
}

.image-container img {
  max-height: 400px;
  background-color: transparent;
  padding: 0;
  object-fit: contain;
}


footer {
  text-align: center;
  margin-top: 2rem;
  padding: 1.5rem;
  color: #5a5a66;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

/* Photo count card — "+N Photos" tile at end of each gallery */
.photo-count-card {
  background-color: #1a1b24;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}

.photo-count-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.photo-count-num {
  font-size: 4.5rem;
  font-weight: 800;
  color: var(--accent-color);
  line-height: 1;
}

.photo-count-label {
  font-size: 1.5rem;
  font-weight: 600;
  font-style: italic;
  color: var(--accent-color);
}

.photo-card {
  background-color: var(--dark-color);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

@media (hover: hover) {
  .photo-card:hover {
    transform: translateY(-5px);
  }
}

.photo-card:active {
  transform: translateY(-2px);
}

.photo-card img {
  width: 90%;
  height: 140px;
  object-fit: cover;
  margin: 8px auto 0;
  display: block;
  border-radius: 8px;
}

.photo-info {
  padding: 15px;
}

.photo-info p {
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.photo-caption {
  font-style: italic;
  color: var(--lightmed-color);
}


.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  display: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: background-color 0.3s ease;
}

@media (hover: hover) {
  .back-to-top:hover {
    background-color: var(--accent-color);
  }
}

.back-to-top:active {
  background-color: var(--accent-color);
  transform: scale(0.92);
}

/* Custom styles for the button navigation */
#button-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.special-section {
  background-color: #1a1b24;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  border-left: 3px solid var(--accent-color);
}


/* ===== BUTTON BASE — consumes --thb-default-* vars set by theme classes ===== */
.thb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  padding: 0.3rem 0.65rem;
  min-height: 44px;
  border-radius: 5px;
  border: 1px solid var(--thb-default-border, rgba(255,255,255,0.08));
  background-color: var(--thb-default-bg, #1a1b24);
  color: #fff;
  font-weight: 600;
  transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .thb-button:hover {
    background-color: var(--thb-hover-bg, #22232e);
    border-color: var(--thb-hover-border, var(--accent-color));
    color: #fff;
  }
}

.thb-button:active {
  background-color: var(--thb-pressed-bg, #22232e);
  color: #fff;
}

/* Decade nav: alternating two-color tint (matches decade section boxes) */
#button-navigation .thb-button:nth-child(odd)  { background-color: var(--rot-light_red-bg); border-color: var(--rot-light_red); }
#button-navigation .thb-button:nth-child(even) { background-color: var(--rot-red-bg);       border-color: var(--rot-red); }

@media (hover: hover) {
  #button-navigation .thb-button:hover {
    filter: brightness(1.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  }
}
#button-navigation .thb-button:active {
  filter: brightness(0.85);
  transform: translateY(0);
}


/* Make gallery images show pointer cursor */
.photo-card img { cursor: pointer; }

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

/* Decorative inner border frame — tinted by decade accent when set */
.lb-overlay::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 2px solid var(--lb-accent, #515357);
  background-color: rgba(141, 211, 236, 0.08);
  border-radius: 15px;
  pointer-events: none;
  z-index: 0;
}

/* Close button */
.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);
}

/* Decade label above image */
.lb-above {
  color: var(--accent-color);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  z-index: 10;
}

/* Main image — suppress global img:hover scale (clicking the image does nothing) */
.lb-img:hover { transform: none; cursor: default; }
.lb-img {
  opacity: 0;
  transition: opacity 0.35s ease-in;
  max-width: calc(100% - 160px);
  max-height: calc(100vh - 200px);
  display: block;
  margin: 0 auto;
  min-height: 150px;
  min-width: 200px;
  object-fit: contain;
  z-index: 10;
  border-radius: 4px;
}
.lb-img.lb-visible {
  opacity: 1;
}

/* Caption - filename */
.lb-caption {
  color: #999;
  font-size: 0.78rem;
  margin-top: 8px;
  z-index: 10;
  max-width: 80%;
  text-align: center;
  word-break: break-all;
}

/* Counter - e.g. "3 / 12" */
.lb-counter {
  color: #666;
  font-size: 0.75rem;
  margin-top: 4px;
  z-index: 10;
}

/* Prev / Next arrows */
.lb-prev, .lb-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 64px;
  color: hsla(345, 55%, 55%, 0.4);
  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;
  text-decoration: none;
}
.lb-prev { left: 28px; }
.lb-next { right: 28px; }

.lb-prev:hover, .lb-next:hover {
  color: hsla(345, 55%, 55%, 0.85);
  background-color: rgba(255, 255, 255, 0.08);
}

/* Responsive: tighten on small screens */
@media (max-width: 768px) {
  .lb-img {
    max-width: calc(100% - 40px);
    max-height: calc(100vh - 160px);
  }
  .lb-prev, .lb-next {
    font-size: 40px;
    width: 36px;
    padding: 10px 0;
  }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-overlay { padding: 10px; }
  .lb-overlay::before { inset: 10px; }
  .lb-close { top: 16px; right: 18px; font-size: 26px; }
}

