/* =========================
   PRESS CAROUSEL — FRONTEND
   ========================= */

html, body {
  margin: 0;
  overflow: hidden;
}

/* Page wrapper: centered column, breathing room top/bottom */
.alexk-press-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
  overflow: hidden;
}

body.admin-bar .alexk-press-page {
  min-height: calc(100svh - var(--wp-admin--admin-bar--height, 32px));
}

/* Carousel box */
.alexk-press-carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(2200px, 100%);
  user-select: none;
  -webkit-user-select: none;
}

/* Slide: stacked pictures for a grouped document */
.alexk-press-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 2rem;
 
}

/* Each picture — constrained width so portrait pages don't stretch wall-to-wall */
.alexk-press-picture {
  display: flex;
  justify-content: center;
  /* Portrait pages (ratio < 1): max ~60% width so they look like a document */
  /* Landscape pages (ratio >= 1): full width */
  /* We handle this via JS-applied data attribute below */
  width: 100%;
   
}

.alexk-press-picture[data-orientation="portrait"] {
  max-width: min(900px, 100%);
}

.alexk-press-picture[data-orientation="landscape"] {
  max-width: 100%;
}

/* Image: fits viewport in both dimensions, centered */
.alexk-press-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100svh - 8rem - 2.25rem); /* subtracts links bar (-36px) */ 
  margin: 0 auto;
  cursor: pointer;

  /* Subtle paper shadow */
  /*box-shadow: 0 2px 20px rgba(0, 0, 0, 0.10), 0 1px 5px rgba(0, 0, 0, 0.07);*/

  /* Force browser to use highest quality resampling */
  image-rendering: auto;
}

body.admin-bar .alexk-press-image {
  max-height: calc(100svh - 11rem - 2.25rem - var(--wp-admin--admin-bar--height, 32px));
}

/* Link bar below the slide */
.alexk-press-link-bar {
  width: 100%;
  text-align: center;
  padding: 1.25rem 0 0;
}

.alexk-press-link {
  display: inline-block;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.75;
  transition: opacity 0.15s ease;
  cursor: pointer;
}

.alexk-press-link:hover {
  opacity: 1;
}

/* Mobile */
@media (max-width: 768px) {
  .alexk-press-page {
    padding: 1.5rem;
  }

  .alexk-press-slide {
    gap: 1rem;
  }

  .alexk-press-picture[data-orientation="portrait"] {
    max-width: 100%;
  }
}

/* Short viewports — tighten padding so image has more room */
@media (max-height: 500px) {
  .alexk-press-page {
    padding: 1.5rem;
  }

  .alexk-press-image {
    max-height: calc(100svh - 3rem - 2.25rem);
  }

  body.admin-bar .alexk-press-image {
    max-height: calc(100svh - 3rem - var(--wp-admin--admin-bar--height, 32px));
  }
}

/* Safari ghost-selection guard */
@supports (-webkit-touch-callout: none) {
  .alexk-press-carousel,
  .alexk-press-carousel picture,
  .alexk-press-carousel img {
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
  }
  .alexk-press-link-bar,
  .alexk-press-link {
    -webkit-user-select: auto;
    user-select: auto;
  }
}