/**
 * Polaroid Review Gallery Stylesheet
 *
 * Scoped stylesheet for the hanging polaroid review gallery widget.
 * Based on design-inputs/15-polaroid-review-gallery.html.
 *
 * @package Universal_Elementor_Engine\Widgets\Polaroid_Gallery
 */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;1,9..144,500&family=Manrope:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* Elementor container breakout helpers */
.elementor-widget-uwe-polaroid-gallery,
.elementor-widget-uwe-polaroid-gallery .elementor-widget-container {
  overflow: visible !important;
}

/* ============================================================
   GLOBAL POLAROID SECTION
   ============================================================ */

.pol-section {
  --pol-ink: #0a2540;
  --pol-ink-soft: #5b6b7d;
  --pol-paper: #ffffff;
  --pol-bg: #f5f8fc;
  --pol-line: #cfd8e3;

  /* Brand palette */
  --pol-blue: #0064c1;
  --pol-blue-deep: #00478a;
  --pol-orange: #f8753a;
  --pol-orange-deep: #d95f28;

  --pol-font-display: 'Fraunces', 'Georgia', serif;
  --pol-font-body: 'Manrope', -apple-system, sans-serif;
  --pol-font-mono: 'Space Mono', monospace;

  position: relative;
  background: var(--pol-bg);
  color: var(--pol-ink);
  font-family: var(--pol-font-body);
  padding: clamp(60px, 8vw, 110px) 0 90px;
  overflow: hidden;
  box-sizing: border-box;
}

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

.pol-section img {
  max-width: 100%;
  display: block;
}

/* ============================================================
   WIDTH & HEIGHT VARIATIONS (Full-Screen Edge-to-Edge Breakout)
   ============================================================ */

/* Full Screen Edge-to-Edge 100vw Breakout (Default, Full & Viewport) */
.uwe-widget--polaroid-gallery,
.pol-section,
.pol-section.pol-width-full,
.pol-section.pol-width-viewport {
  width: 100vw !important;
  position: relative !important;
  left: 50% !important;
  right: 50% !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
  overflow-x: clip;
}

/* Explicit Boxed Container Mode (when chosen in Elementor) */
.pol-section.pol-width-boxed,
.pol-section.pol-width-container {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  left: auto !important;
  right: auto !important;
}

/* Height Variations */
.pol-section.pol-height-viewport {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pol-section.pol-height-custom,
.pol-section.pol-height-min {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================================================
   CONTAINER & HEADER
   ============================================================ */

.pol-wrap {
  max-width: var(--pol-container-max-width, 1200px);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 40px);
  width: 100%;
  box-sizing: border-box;
}

.pol-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 8px;
}

.pol-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--pol-font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pol-blue);
}

.pol-eyebrow::before,
.pol-eyebrow::after {
  content: "";
  width: 16px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.pol-title {
  font-family: var(--pol-font-display);
  font-weight: 500;
  font-size: clamp(28px, 3.8vw, 42px);
  margin-top: 14px;
  margin-bottom: 0;
  letter-spacing: -0.01em;
  color: var(--pol-ink);
}

.pol-title em,
.pol-title span {
  font-style: italic;
  color: var(--pol-orange-deep);
  font-weight: 500;
}

.pol-sub {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--pol-ink-soft);
}

/* ============================================================
   HANGING STRING LINE
   ============================================================ */

.pol-line {
  height: 3px;
  margin: 70px auto 0;
  max-width: 1120px;
  background:
    repeating-linear-gradient(90deg, var(--pol-line) 0 10px, transparent 10px 14px);
  border-radius: 3px;
  position: relative;
}

.pol-line::before,
.pol-line::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--pol-ink-soft);
  box-shadow: 0 2px 4px rgba(10, 37, 64, 0.3);
}

.pol-line::before {
  left: -4px;
}

.pol-line::after {
  right: -4px;
}

/* ============================================================
   POLAROID STRING GRID
   ============================================================ */

.pol-string {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 8px;
  margin-top: -3px;
}

/* ============================================================
   POLAROID CARD
   ============================================================ */

.pol-card {
  width: clamp(190px, 22vw, 236px);
  margin: 34px 10px 0;
  background: var(--pol-paper);
  padding: 14px 14px 18px;
  border-radius: 3px;
  box-shadow: 0 18px 32px -14px rgba(10, 37, 64, 0.32);
  position: relative;
  transform-origin: top center;
  transform: rotate(calc(var(--tilt, 0) * 1deg));
  animation: pol-sway 6.5s ease-in-out infinite;
  animation-delay: calc(var(--delay, 0) * 1s);
  transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s;
}

.pol-card:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.045);
  box-shadow: 0 28px 46px -16px rgba(10, 37, 64, 0.4);
  z-index: 5;
  animation-play-state: paused;
}

.pol-sway-disabled .pol-card {
  animation: none !important;
}

@keyframes pol-sway {
  0%, 100% {
    transform: rotate(calc(var(--tilt, 0) * 1deg));
  }
  50% {
    transform: rotate(calc(var(--tilt, 0) * -0.55deg));
  }
}

/* ============================================================
   PIN / CLOTHESPIN
   ============================================================ */

.pol-pin {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%) rotate(calc(var(--tilt, 0) * -1deg));
  width: 11px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--pol-orange), var(--pol-orange-deep));
  box-shadow: 0 3px 6px rgba(10, 37, 64, 0.3);
  z-index: 2;
}

.pol-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 26px;
  background: var(--pol-ink-soft);
  opacity: 0.55;
  transform: translateX(-50%);
}

/* ============================================================
   PHOTO & STAMP
   ============================================================ */

.pol-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--pol-bg);
  border-radius: 2px;
}

.pol-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
  transition: transform 0.5s ease;
}

.pol-card:hover .pol-photo img {
  transform: scale(1.03);
}

.pol-stamp {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-family: var(--pol-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.92);
  color: var(--pol-ink);
  padding: 4px 9px;
  border-radius: 100px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   CAPTION (Handwritten Sentiment)
   ============================================================ */

.pol-caption {
  padding-top: 14px;
  text-align: center;
}

.pol-stars {
  display: block;
  color: var(--pol-orange);
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.pol-quote {
  font-family: var(--pol-font-display);
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--pol-ink);
  margin: 0 0 10px;
}

.pol-name {
  display: block;
  font-family: var(--pol-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--pol-ink-soft);
}

/* ============================================================
   RESPONSIVE & ACCESSIBILITY
   ============================================================ */

@media (max-width: 900px) {
  .pol-line {
    display: none;
  }

  .pol-string {
    gap: 0;
  }

  .pol-card {
    margin-top: 26px;
  }
}

@media (max-width: 560px) {
  .pol-card {
    width: 78vw;
    max-width: 290px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pol-card {
    animation: none !important;
    transition: none !important;
  }

  .pol-photo img {
    transition: none !important;
  }
}
