/*
 * ThunderPhotoGallery v1.0
 * Portable, isolated photo gallery and selector styles.
 * Keep this file independent from any website-specific CSS.
 */

:root {
  --thunderphotogallery-blue-page: #0e7dc8;
  --thunderphotogallery-blue-deep: #5f7188;
  --thunderphotogallery-blue-meta: #5f7188;
  --thunderphotogallery-blue-accent: #2f9ae0;
  --thunderphotogallery-blue-thumb: #51b7ff;
  --thunderphotogallery-text: #10263c;
  --thunderphotogallery-muted: #607082;
  --thunderphotogallery-white: #ffffff;
  --thunderphotogallery-radius: 18px;
  --thunderphotogallery-shadow: 0 24px 54px rgba(6, 26, 48, 0.24);
  --thunderphotogallery-panel-height: clamp(480px, 40vw, 620px);
}

* {
  box-sizing: border-box;
}

button {
  font: inherit;
}

.thunderphotogallery-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.thunderphotogallery-shell {
  margin: 0 auto;
  max-width: 1320px;
  padding: 0 28px;
  width: 100%;
}

.thunderphotogallery-hero {
  color: var(--thunderphotogallery-white);
  padding: clamp(48px, 8vw, 92px) 0 clamp(30px, 5vw, 56px);
  text-align: center;
}

.thunderphotogallery-kicker {
  font-size: clamp(13px, 2vw, 15px);
  font-weight: 800;
  letter-spacing: 0.16em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.thunderphotogallery-hero h1 {
  font-size: clamp(28px, 8vw, 96px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 0.95;
  margin: 0;
  white-space: nowrap;
}

.thunderphotogallery-hero-copy {
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(17px, 2.6vw, 24px);
  line-height: 1.4;
  margin: 18px auto 0;
  max-width: 720px;
}

.thunderphotogallery-demo-section {
  padding: 0 0 clamp(58px, 8vw, 100px);
}

.thunderphotogallery-layout {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) clamp(240px, 23%, 280px);
}

.thunderphotogallery-gallery-card,
.thunderphotogallery-category-wrap {
  background: var(--thunderphotogallery-white);
  border: 2px solid var(--thunderphotogallery-blue-deep);
  border-radius: var(--thunderphotogallery-radius);
  box-shadow: var(--thunderphotogallery-shadow);
  height: var(--thunderphotogallery-panel-height);
  overflow: hidden;
}

.thunderphotogallery-gallery-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.thunderphotogallery-wall {
  align-content: flex-start;
  background: var(--thunderphotogallery-blue-meta);
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  padding: 18px;
  scrollbar-color: var(--thunderphotogallery-blue-thumb) rgba(29, 59, 88, 0.16);
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
}

.thunderphotogallery-wall::-webkit-scrollbar,
.thunderphotogallery-category-scroll::-webkit-scrollbar {
  width: 10px;
}

.thunderphotogallery-wall::-webkit-scrollbar-track,
.thunderphotogallery-category-scroll::-webkit-scrollbar-track {
  background: rgba(29, 59, 88, 0.14);
  border-radius: 999px;
}

.thunderphotogallery-wall::-webkit-scrollbar-thumb,
.thunderphotogallery-category-scroll::-webkit-scrollbar-thumb {
  background: var(--thunderphotogallery-blue-thumb);
  border-radius: 999px;
}

.thunderphotogallery-tile {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  background-color: transparent;
  background-image: none;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 0;
  box-shadow: 0 4px 10px rgba(16, 38, 60, 0.08);
  cursor: pointer;
  flex: 0 0 auto;
  height: 80px;
  line-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.thunderphotogallery-tile:hover,
.thunderphotogallery-tile:focus-visible {
  border-color: rgba(47, 154, 224, 0.8);
  box-shadow: 0 6px 14px rgba(16, 38, 60, 0.18);
  outline: none;
  transform: translateY(-1px);
}

.thunderphotogallery-tile img {
  display: block;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  width: 100%;
}

.thunderphotogallery-tile-caption {
  display: none;
}

.thunderphotogallery-empty {
  color: var(--thunderphotogallery-muted);
  font-size: 18px;
  font-weight: 700;
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
}

.thunderphotogallery-category-wrap {
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 2vw, 24px);
}

.thunderphotogallery-list-heading {
  color: var(--thunderphotogallery-text);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 900;
  letter-spacing: 0.18em;
  margin: 0 0 18px;
  text-transform: uppercase;
}

.thunderphotogallery-category-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  padding: 0 8px 0 0;
  scrollbar-color: var(--thunderphotogallery-blue-thumb) rgba(29, 59, 88, 0.16);
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
}

.thunderphotogallery-category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thunderphotogallery-category-item {
  align-items: center;
  background: #f8fbfd;
  border: 1px solid rgba(29, 59, 88, 0.14);
  border-radius: 12px;
  color: var(--thunderphotogallery-text);
  cursor: pointer;
  display: grid;
  gap: 11px;
  grid-template-columns: minmax(82px, 108px) minmax(0, 1fr);
  overflow: hidden;
  padding: 10px;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  width: 100%;
}

.thunderphotogallery-category-item:hover,
.thunderphotogallery-category-item:focus-visible,
.thunderphotogallery-category-item.is-active {
  background: #edf7ff;
  border-color: rgba(47, 154, 224, 0.78);
  box-shadow: inset 0 0 0 1px rgba(47, 154, 224, 0.28);
  outline: none;
}

.thunderphotogallery-category-item img {
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.thunderphotogallery-category-label {
  display: block;
  font-size: clamp(14px, 1.35vw, 18px);
  font-weight: 900;
  line-height: 1.2;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.thunderphotogallery-category-count {
  color: var(--thunderphotogallery-muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.thunderphotogallery-round-btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(14, 24, 36, 0.18);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(8, 15, 24, 0.24);
  color: #111923;
  cursor: pointer;
  display: inline-flex;
  height: 41px;
  justify-content: center;
  padding: 0;
  transition: background 0.18s ease, transform 0.18s ease;
  width: 41px;
}

.thunderphotogallery-round-btn:hover,
.thunderphotogallery-round-btn:focus-visible {
  background: #fff;
  outline: none;
  transform: scale(1.02);
}

.thunderphotogallery-lightbox {
  background: rgba(0, 0, 0, 0.88);
  display: grid;
  inset: 0;
  padding: 24px;
  place-items: center;
  position: fixed;
  z-index: 20;
}

.thunderphotogallery-lightbox.is-hidden {
  display: none;
}

.thunderphotogallery-lightbox-dialog {
  background: var(--thunderphotogallery-blue-meta);
  border: 2px solid var(--thunderphotogallery-blue-deep);
  border-radius: var(--thunderphotogallery-radius);
  box-shadow: 0 24px 74px rgba(0, 0, 0, 0.44);
  max-height: calc(100vh - 48px);
  max-width: min(1180px, calc(100vw - 48px));
  overflow: hidden;
  position: relative;
  width: 100%;
}

.thunderphotogallery-lightbox-figure {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 0;
}

.thunderphotogallery-lightbox-media {
  align-items: center;
  background: #061321;
  display: flex;
  height: min(70vh, 760px);
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.thunderphotogallery-lightbox-backdrop {
  filter: blur(28px) brightness(0.62) saturate(1.05);
  height: 112%;
  inset: -6%;
  object-fit: cover;
  opacity: 0.7;
  position: absolute;
  width: 112%;
}

.thunderphotogallery-lightbox-image {
  display: block;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.thunderphotogallery-lightbox-caption {
  background: var(--thunderphotogallery-blue-meta);
  color: var(--thunderphotogallery-white);
  min-height: 0;
  padding: clamp(6px, 0.8vw, 10px) clamp(14px, 1.6vw, 20px);
}

.thunderphotogallery-lightbox-caption h2 {
  font-size: clamp(13px, 1.18vw, 17px);
  line-height: 1.02;
  margin: 0;
}

.thunderphotogallery-lightbox-caption p {
  color: rgba(232, 240, 248, 0.86);
  font-size: clamp(8px, 0.82vw, 10px);
  line-height: 1.18;
  margin: 3px 0 0;
}

.thunderphotogallery-lightbox-counter {
  color: rgba(232, 240, 248, 0.68) !important;
  font-size: 8px !important;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.thunderphotogallery-lightbox-close {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 3;
}

.thunderphotogallery-lightbox-close span {
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  margin-top: -3px;
}

.thunderphotogallery-lightbox-prev,
.thunderphotogallery-lightbox-next {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  z-index: 3;
}

.thunderphotogallery-lightbox-prev {
  left: 16px;
}

.thunderphotogallery-lightbox-next {
  right: 16px;
}

.thunderphotogallery-lightbox-fullscreen {
  bottom: 16px;
  position: absolute;
  right: 16px;
  z-index: 3;
}

.thunderphotogallery-lightbox-copyright {
  bottom: 26px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  pointer-events: none;
  position: absolute;
  right: 74px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.78);
  z-index: 3;
}

.thunderphotogallery-lightbox-fullscreen span {
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  margin-top: -2px;
}

.thunderphotogallery-lightbox:fullscreen {
  background: #000;
  padding: 0;
}

.thunderphotogallery-lightbox:fullscreen .thunderphotogallery-lightbox-dialog {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 100vh;
  max-height: 100vh;
  max-width: 100vw;
  width: 100vw;
}

.thunderphotogallery-lightbox:fullscreen .thunderphotogallery-lightbox-figure,
.thunderphotogallery-lightbox:fullscreen .thunderphotogallery-lightbox-media {
  height: 100%;
  min-height: 100%;
}

.thunderphotogallery-lightbox:fullscreen .thunderphotogallery-lightbox-media {
  background: #000;
}

.thunderphotogallery-lightbox:fullscreen .thunderphotogallery-lightbox-backdrop {
  display: none;
}

.thunderphotogallery-lightbox:fullscreen .thunderphotogallery-lightbox-image {
  height: 100%;
  max-height: none;
  max-width: none;
  object-fit: contain;
  width: 100%;
}

.thunderphotogallery-lightbox:fullscreen .thunderphotogallery-lightbox-caption {
  background: transparent;
  bottom: 0;
  left: 0;
  max-width: min(720px, calc(100vw - 132px));
  position: absolute;
  right: auto;
  z-index: 2;
}

.thunderphotogallery-lightbox:fullscreen .thunderphotogallery-lightbox-caption h2,
.thunderphotogallery-lightbox:fullscreen .thunderphotogallery-lightbox-caption p {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.86);
}

.thunderphotogallery-lightbox:fullscreen .thunderphotogallery-lightbox-copyright {
  bottom: 26px;
}

@media (max-width: 1000px) {
  .thunderphotogallery-layout {
    grid-template-columns: 1fr;
  }

  .thunderphotogallery-gallery-card,
  .thunderphotogallery-category-wrap {
    height: auto;
    max-height: none;
  }

  .thunderphotogallery-gallery-card {
    min-height: 0;
  }

  .thunderphotogallery-wall {
    height: 620px;
    max-height: 620px;
  }

  .thunderphotogallery-category-scroll {
    overflow: visible;
    padding: 0;
  }

  .thunderphotogallery-category-list {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(7, minmax(72px, 1fr));
    min-width: 0;
    padding: 0 2px 4px;
  }

  .thunderphotogallery-category-item {
    align-content: start;
    align-items: stretch;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 42px minmax(18px, auto);
    height: 82px;
    justify-items: center;
    min-width: 0;
    padding: 8px 7px;
    text-align: center;
    width: 100%;
  }

  .thunderphotogallery-category-item img {
    height: 42px;
    max-width: none;
    width: 100%;
  }

  .thunderphotogallery-category-label {
    align-items: center;
    display: flex;
    font-size: 13px;
    justify-content: center;
    line-height: 1.05;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .thunderphotogallery-category-count {
    display: none;
  }
}

@media (max-width: 620px) {
  .thunderphotogallery-shell {
    padding: 0 16px;
  }

  .thunderphotogallery-layout {
    gap: 18px;
  }

  .thunderphotogallery-gallery-card,
  .thunderphotogallery-category-wrap,
  .thunderphotogallery-lightbox-dialog {
    border-width: 2px;
    border-radius: 14px;
  }

  .thunderphotogallery-category-wrap {
    padding: 12px;
  }

  .thunderphotogallery-list-heading {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .thunderphotogallery-category-list {
    gap: 8px;
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .thunderphotogallery-category-scroll {
    overflow: visible;
  }

  .thunderphotogallery-category-item {
    border-radius: 8px;
    gap: 5px;
    grid-template-rows: 38px minmax(20px, auto);
    height: 78px;
    padding: 6px;
  }

  .thunderphotogallery-category-item img {
    border-radius: 5px;
    height: 38px;
    max-width: none;
  }

  .thunderphotogallery-category-label {
    font-size: 11px;
    letter-spacing: 0;
  }

  .thunderphotogallery-category-count {
    display: none;
  }

  .thunderphotogallery-lightbox-caption {
    padding: 7px 10px;
  }

  .thunderphotogallery-lightbox-copyright {
    bottom: 25px;
    font-size: 10px;
    right: 62px;
  }

  .thunderphotogallery-wall {
    gap: 8px;
    height: 540px;
    max-height: 540px;
    padding: 10px;
  }

  .thunderphotogallery-tile {
    border-radius: 0;
    height: 64px;
  }

  .thunderphotogallery-tile-caption {
    display: none;
  }

  .thunderphotogallery-lightbox {
    padding: 10px;
  }

  .thunderphotogallery-lightbox-dialog {
    max-height: calc(100vh - 20px);
    max-width: calc(100vw - 20px);
  }

  .thunderphotogallery-lightbox-media {
    height: 62vh;
  }

  .thunderphotogallery-round-btn {
    height: 35px;
    width: 35px;
  }
}
