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

html,
body {
    height: 100%;
}

body {
    background: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    color: #000000;
}

.page-frame {
    min-height: 100vh;
    padding: 1em;
}

/* Rahmen wie auf der Startseite */
.gallery-frame {
    position: relative;
    min-height: calc(100vh - 2em);
    background: #f2f2f2;
    border: 0px solid #000;
    padding: 0rem 0rem 0rem;
    display: flex;
    flex-direction: column;
}

.country-title{
  /* Position bleibt wie bei dir */
  position: absolute;
  top: 2em;
  right: 3em;
  left: auto;
  z-index: 30;
  margin: 0;

  /* RESPONSIVE: Schrift + Kreis + Rand skalieren */
  font-size: clamp(0.65rem, 1.2vw, 1.1rem);
  letter-spacing: clamp(0.06em, 0.25vw, 0.12em);

  --circle-size: clamp(2.2rem, 6vw, 3.2rem);
  width: var(--circle-size);
  height: var(--circle-size);

  border-radius: 50%;
  border: clamp(0.35em, 1.2vw, 0.75em) solid #fff;

  text-transform: uppercase;
  font-weight: 700;
  color: #000;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(2px);

  line-height: 1;
  flex: 0 0 auto;
  white-space: nowrap;

  opacity: 0;
  transform: translateY(-6px) rotate(5deg);
  transition: opacity 450ms ease, transform 450ms ease;
  pointer-events: none;
}

.country-title.is-visible{
  opacity: 1;
  transform: translateY(0) rotate(5deg);     /* Uhrzeigersinn */
}

.country-title.is-fading{
  opacity: 0;
  transform: translateY(-5px) rotate(5deg);  /* Uhrzeigersinn */
}

/* Großes Bild */
.main-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.main-image-wrapper img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    display: block;
    border: 0px solid #ddd;
}

/* Thumbnail-Leiste */
.thumbs-row {
    display: flex;
    align-items: center;
    margin-top: .5rem;
    gap: 1.5rem;
    justify-content: flex-start;
}

/* Nur Platz für ca. 10 Thumbs */
.thumbs-viewport {
    flex: 0 0 auto;
    width: 880px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.thumbs-viewport::-webkit-scrollbar {
    display: none;
}

.thumbs-strip {
    display: flex;
    gap: 0.5rem;
    padding-bottom: 0rem;
}

/* Thumbnail-Buttons */
.thumb {
    background: transparent;
    padding: 0;
    cursor: pointer;
    flex: 0 0 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 0;
    border: 0px solid transparent;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: transform 0.2s ease, filter 0.2s ease;
}

/* Hover/Focus-Effekt */
.thumb:hover img,
.thumb:focus img {
    transform: scale(1.0);
    filter: grayscale(0%);
}

/* Aktiver Thumb */
.thumb.is-active {
    border-color: #000;
}

.thumb.is-active img {
    transform: scale(1.0);
    filter: grayscale(0%);
}

.thumb:focus-visible {
    outline: 0px solid #000;
    outline-offset: 2px;
}

.thumb-scroll {
    border: none;
    background: transparent;
    cursor: pointer;
    width: 60px;
    height: 40px;
    position: relative;
}

.thumb-scroll::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 9px;
    background: #000;
}

.icon-button {
    position: absolute;
    width: 110px;
    height: 110px;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
}

.icon-button span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 9px;
    background: black;
    transform-origin: center;
}

.close-button {
    top: -12px;
    right: -12px;
}

.close-button span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close-button span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.slideshow-toggle {
    bottom: 0em;
    right: 0em;
    width: 55px;   /* halb so breit wie 110 */
    height: 55px;  /* halb so hoch wie 110 */
}

.slideshow-toggle span:first-child {
    transform: translate(-50%, -50%) rotate(0deg);
}

.slideshow-toggle span:last-child {
    transform: translate(-50%, -50%) rotate(90deg);
}

.slideshow-close {
    bottom: 1.5em;
    right: 1.5em;
    width: 55px;
    height: 55px;
}

.slideshow-close span:first-child {
    transform: translate(-50%, -50%) rotate(0deg);
    background: white;
}

.slideshow-close span:last-child {
    transform: translate(-50%, -50%) rotate(0deg);
	    background: white;
}

.slideshow-overlay {
    position: fixed;
    inset: 0;
    padding: 1em;                 /* NEU: Abstand wie .page-frame */
    background: #f2f2f2;          /* 85 % weiß */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9500;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
}


.slideshow-inner {
    width: 100%;
    height: 100%;
    /* margin: 1em;  <-- RAUS DAMIT */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;  /* wenn du den schwarzen Rahmen willst, sonst weg */
}


.legend-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80vw;
    background: white;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2.2rem;
    letter-spacing: 0.1em;
    text-align: center;

    padding: 2rem;
    border: 0px solid #000;
    z-index: 9000;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
    word-break: break-word;
    overflow-wrap: break-word;
}

.legend-overlay.is-visible {
    opacity: 1;
}

/* Quelle aus antarktis.txt ausblenden */
.source-gallery {
    display: none;
}

/* =======================
   Slideshow-Overlay
   ======================= */

.slideshow-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Inhalt der Slideshow: Bild + Caption */
.slideshow-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Bild im Overlay – zentriert und 94vw/95vh */
.slideshow-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;

    opacity: 0;
    transition: opacity 1s ease-in-out; /* 1 Sek. Überblendung */
}

/* Sichtbar-Status für Fade-In */
.slideshow-image.is-visible {
    opacity: 1;
}

.slideshow-title {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: white;
}

.slideshow-caption {
    margin-top: 1rem;
    max-width: 94vw;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
	  color: white;
}


/* =======================
   bis 1024px – Tablets quer / kleine Laptops
   ======================= */
@media (max-width: 1024px) {

  .gallery-frame {
    padding: 1.5rem 1.5rem 2.5rem;
  }

  .main-image-wrapper img {
    max-height: 60vh;
  }

  .legend-overlay {
    width: 80vw;
    max-width: 600px;
    max-height: 90vh;
  }
}

/* =======================
   bis 768px – Tablets hochkant / große Phones
   ======================= */
@media (max-width: 768px) {

  .main-image-wrapper {
    flex: 0 0 auto;
    justify-content: center;
    align-items: center;
    padding-top: 0;
  }

.slideshow-overlay {
    padding: 0.5em;                 /* NEU: Abstand wie .page-frame */ 
}

  .main-image-wrapper img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
  }

  .thumbs-row {
    margin-top: 0.75rem;
  }

  .thumbs-viewport {
    max-width: 100%;
  }

  .legend-overlay {
    width: 90vw;
    max-width: none;
    padding: 1.5rem;
    font-size: 2rem;
    letter-spacing: 0.08em;
  }
}

/* =======================
   bis 428px – große iPhones
   ======================= */
@media (max-width: 428px) {

  .thumb {
    flex: 0 0 60px;
    height: 60px;
  }

.slideshow-overlay {
    padding: 0.5em;                 /* NEU: Abstand wie .page-frame */ 
}

  .page-frame {
    padding: 0.7em;
  }

  .gallery-frame {
    min-height: calc(100vh - 1.5em);
    padding: 0 0 1rem;
  }

  .main-image-wrapper {
    padding-top: 3rem;
  }

  .thumbs-row {
    margin-top: 0.75rem;
  }

  .thumbs-strip {
    gap: 0.25rem;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .icon-button span {
    height: 5px;
  }

  .close-button {
    top: 0;
    right: 0;
  }

  .slideshow-toggle {
    bottom: 0px;
    right: 0px;
 }
  .legend-overlay {
    width: 90vw;
    max-width: none;
    padding: 1rem;
    font-size: 1.8rem;
    letter-spacing: 0.06em;
    max-height: 90vh;
  }

  .slideshow-caption {
    font-size: 0.95rem;
  }
}

/* =======================
   bis 390px – iPhone / viele Androids
   ======================= */
@media (max-width: 390px) {
  .legend-overlay {
    width: 95vw;
    padding: 0.9rem;
    font-size: 1.7rem;
    letter-spacing: 0.05em;
  }
}

/* =======================
   bis 375px – kleinere Geräte / iPhone SE
   ======================= */
@media (max-width: 375px) {
  .legend-overlay {
    width: 100vw;
    padding: 0.75rem;
    font-size: 1.6rem;
    letter-spacing: 0.04em;
  }
}
.country-title{
  line-height: 1;          /* verhindert “höhere” Textbox */
  flex: 0 0 auto;          /* verhindert flex-stretch Effekte */
}
@media (max-width: 428px){
  .country-title{
    top: 1.0em;
    right: 1.0em;
    --circle-size: clamp(1.9rem, 10vw, 2.4rem);
    border-width: clamp(0.28em, 1.8vw, 0.5em);
    font-size: clamp(0.58rem, 3.2vw, 0.8rem);
    letter-spacing: 0.06em;
  }
}

@media (max-width: 375px){
  .country-title{
    top: 0.8em;
    right: 0.8em;
    --circle-size: clamp(1.8rem, 12vw, 2.2rem);
  }
}