/* =========================
   masonry.css (clean)
   - ohne Zählwerk / ohne .intro-count
   - Intro-Orbit wie auf index (Overlay + Kreis + rotierender Punkt)
   - Masonry + Close-Button + Bottom-Menu + Next500 Button
   ========================= */

:root{
  --frame-bg: #f2f2f2;
  --page-bg: #ffffff;
  --text: #111;
  --accent: #b92f25;

  /* Orbit-Stroke wie auf index */
  --orbit-stroke: clamp(6px, 1.2vw, 14px);
}

*,
*::before,
*::after{
  box-sizing: border-box;
}

html,
body{
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--page-bg);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar{
  width: 0;
  height: 0;
}

/* =========================
   Layout Container
   ========================= */
.inner{
  position: relative;
  margin: 1em;
  background: var(--frame-bg);
  padding: 6.5rem 0 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page{
  margin: 0 auto;
  width: 100%;
}

/* =========================
   Bottom Menu
   ========================= */
.bottom-menu{
  position: absolute;
  right: 2rem;
  bottom: 1.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.0823em;
  font-weight: 700;
}

.bottom-menu a{
  color: #000;
  text-decoration: none;
  margin-left: 0.75rem;
}

.bottom-menu a:first-child{ margin-left: 0; }

.bottom-menu span{
  margin-left: 0.75rem;
}

.bottom-menu a:hover,
.bottom-menu a:focus{
  color: #000;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

@media (max-width: 600px){
  .bottom-menu{
    right: 1em;
    bottom: 1em;
    font-size: 0.75rem;
  }

  .bottom-menu a,
  .bottom-menu span{
    margin: 0 0.7rem;
  }
}

@media (max-width: 468px){
  .bottom-menu{
    left: 50%;
    right: auto;
    bottom: 1.5rem;
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.8rem;
  }

  .bottom-menu a,
  .bottom-menu span{
    margin: 0 0.7rem;
  }
}

/* =========================
   Close Button (X)
   ========================= */
.close-button{
  position: absolute;
  top: -12px;
  right: -12px;
  width: 110px;
  height: 110px;
  text-decoration: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

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

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

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

@media (max-width: 428px){
  .close-button{
    width: 40px;
    height: 40px;
    top: 0em;
    right: 0em;
  }

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

  .inner{ padding: 3.5rem 0 0; }
}

@media (min-width: 368px) and (max-width: 767px){
  .inner{ padding: 5rem 0 0; }
}

/* =========================
   Masonry Grid
   ========================= */
.masonry-grid{
  -webkit-column-count: 5;
  column-count: 5;
  -webkit-column-gap: 0.4em;
  column-gap: 0.4em;
  width: 100%;
  margin-top: 0;
  margin-bottom: 4.5rem;
}

@media (max-width: 1600px){
  .masonry-grid{
    -webkit-column-count: 4;
    column-count: 4;
  }
}

@media (max-width: 900px){
  .masonry-grid{
    -webkit-column-count: 3;
    column-count: 3;
  }
}

@media (max-width: 600px){
  .masonry-grid{
    -webkit-column-count: 2;
    column-count: 2;
  }
}

@media (max-width: 468px){
  .masonry-grid{
    -webkit-column-count: 2;
    column-count: 2;
  }
}

.masonry-item{
  display: inline-block;
  width: 100%;
  margin: 0 0 0.2em 0;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.masonry-item img{
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  object-fit: contain;
  transition: opacity 0.25s ease;

}

.masonry-item:hover img{
  opacity: 0.85;
}

.masonry-item::after{
  content: attr(title);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(255, 255, 255, 0.7);
  color: #000;
  font-size: clamp(0.8rem, 1vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.0823em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.5em;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.masonry-item:hover::after{
  opacity: 1;
}

/* =========================
   Intro Orbit Overlay (ohne Text)
   ========================= */
.intro-orbit-overlay{
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.intro-orbit-overlay.is-hidden{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-orbit-wrapper{
  width: 15vw;
  max-width: 260px;
  min-width: 120px;
  aspect-ratio: 1 / 1;
  position: relative;
}

.intro-orbit-circle{
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-sizing: border-box;
  border: var(--orbit-stroke) solid #000;
  position: relative;
  cursor: default;
}

.intro-orbit-rotator{
  position: absolute;
  inset: 0;
  animation: intro-orbit-rotate 1.2s linear infinite;
  transform-origin: 50% 50%;
}

.intro-orbit-dot{
  position: absolute;
  top: 50%;
  left: 129%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  width: 3vw;
  height: 3vw;
  min-width: 18px;
  min-height: 18px;
  max-width: 50px;
  max-height: 50px;
}

@keyframes intro-orbit-rotate{
  to{ transform: rotate(360deg); }
}

/* Mobile Orbit stroke wie index-Feeling */
@media (max-width: 480px){
  .intro-orbit-circle{
    border: 2.6vw solid #000;
  }
}

/* =========================
   Next 500 Button
   ========================= */
.next500{
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.next500:hover{
  background: #000;
  filter: brightness(1.05);
}

.next500.is-visible{
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.next500-icon{
  position: relative;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid #fff;
  border-right-color: transparent;
  display: inline-block;
}

.next500-icon::after{
  content: "";
  position: absolute;
  top: -3px;
  right: -2px;
  width: 0;
  height: 0;
  border-left: 6px solid #fff;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transform: rotate(16deg);
}

.next500.is-loading .next500-icon{
  animation: next500spin 0.8s linear infinite;
}

@keyframes next500spin{
  to{ transform: rotate(360deg); }
}
.masonry-item {
    position: relative;
}

.img-number {
    position: absolute;
    bottom: 0.4rem;
    left: 0.4rem;
    font-size: 0.9rem;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.masonry-item:hover .img-number {
    opacity: 1;
}