/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  overflow: hidden;
  background: #fecdca70;
  color: #fff;
  height: 100vh;
  width: 100vw;
}

/* Story container */
.story-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #fecdca70;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Stories wrapper */
.stories-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Individual story item */
.story-item {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-item.active {
  opacity: 1;
  pointer-events: auto;
}

/* Story content container - 9:16 aspect ratio */
.story-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1080px;
  max-height: 1920px;
  aspect-ratio: 9 / 16;
  background: #fecdca70;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Prevent text selection during pause gesture */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Story Progress Bars */
.story-progress-container {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 1000;
  pointer-events: auto;
}

.story-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s ease;
}

.story-progress-bar:hover {
  background: rgba(255, 255, 255, 0.5);
}

.story-progress-fill {
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.9);
  transition: width 0.1s linear;
  border-radius: 2px;
}

.story-progress-bar.active .story-progress-fill {
  background: rgba(255, 255, 255, 1);
}

/* Mobile: if viewport not 9:16, cover viewport and center */
@media (max-width: 768px) {
  .story-content {
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
  }
}

/* Desktop: maintain 9:16 with max 1080x1920 */
@media (min-width: 769px) {
  .story-content {
    width: min(56.25vh, 1080px);
    height: min(100vh, 1920px);
  }
}

/* Story content elements */
/* .story-content img,
.story-content video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
} */

/* Font faces */
@font-face {
  font-family: "Nyght Serif";
  src: url("./assets/fonts/NyghtSerif-LightItalic.woff2") format("woff2");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Fanwood Text";
  src: url("./assets/fonts/Fanwood-TextItalic.woff2") format("woff2");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

/* Story container (inner container inside .story-content) */
.story-content .story-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8e9dd;
  color: #000;
  font-family: "Tenor Sans", sans-serif;
  overflow: hidden;
}

.background-image {
  width: 80%;
  aspect-ratio: 9 / 14;
  background-image: url("./assets/images/background.png");
  background-size: 750%;
  background-position: 50.4% 46%;
  background-repeat: no-repeat;
  border-radius: 50% 50% 0 0 / 35%;
  opacity: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.story-text-content {
  text-align: center;
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: auto;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

.story-names {
  font-size: 1.75rem;
  margin-bottom: 20px;
  text-transform: uppercase;
  /* Allow text selection */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.story-invitation {
  font-size: 1rem;
  /* Allow text selection */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.story-invitation::before {
  content: "";
  display: block;
  width: 75px;
  height: 1px;
  border-bottom: 1px solid #000;
  margin: 0 auto;
  margin-bottom: 15px;
}

.story-invitation::after {
  content: "";
  display: block;
  width: 75px;
  height: 1px;
  border-bottom: 1px solid #000;
  margin: 0 auto;
  margin-top: 18px;
}

.date-strip {
  position: absolute;
  left: 0;
  top: 0;
  width: 50px;
  height: 100%;
  background: #f8e9dd;
  z-index: 10;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  display: none; /* Completely hide until animation starts */
}

.date-marquee {
  position: absolute;
  left: 0;
  width: 50px;
  font-family: "Tenor Sans", sans-serif;
  font-size: 1rem;
  color: #000;
  text-align: center;
  white-space: nowrap;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  line-height: 1.5;
  transform: rotate(180deg); /* Flip text 180 degrees */
}

.date-marquee-item {
  position: absolute;
  left: 0;
  width: 44px;
  display: block;
  font-size: 1.5rem;
  font-family: "Nyght Serif", serif;
  font-weight: 300;
  font-style: italic;
  text-align: center;
}

.date-text-1,
.date-text-2,
.date-text-3,
.date-text-4,
.date-text-5 {
  position: absolute;
  margin: 0;
  padding: 0;
  color: #385c36;
  z-index: 15;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  display: none; /* Completely hide until animation starts */
  /* Allow text selection */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.date-text-1 {
  font-size: 1.25rem;
  font-family: "Fanwood Text", serif;
  font-weight: normal;
  font-style: italic;
  text-align: center;
}

.date-text-2 {
  font-size: 2.5rem;
  font-family: "Nyght Serif", serif;
  font-weight: 300;
  font-style: italic;
  text-align: center;
}

.date-text-3 {
  font-size: 0.75rem;
  font-family: "Tenor Sans", sans-serif;
  font-weight: normal;
  font-style: normal;
  text-align: center;
}

.date-text-4 {
  font-size: 2rem;
  font-family: "Tenor Sans", sans-serif;
  font-weight: normal;
  font-style: normal;
  text-align: center;
}

.date-text-4::before {
  content: "Saturday";
  margin-right: 1.5rem;
  font-family: "Fanwood Text", serif;
  font-weight: normal;
  font-style: italic;
  font-size: 1rem;
  width: 100px;
  display: inline-block;
  vertical-align: middle;
  transform: translateY(-3px);
  border-bottom: 1px solid #385c36;
  border-top: 1px solid #385c36;
  padding: 1rem 0;
}

.date-text-4::after {
  content: "11 a.m. onwards";
  margin-left: 1.5rem;
  font-family: "Fanwood Text", serif;
  font-weight: normal;
  font-style: italic;
  font-size: 1rem;
  width: 100px;
  display: inline-block;
  vertical-align: middle;
  transform: translateY(-3px);
  border-bottom: 1px solid #385c36;
  border-top: 1px solid #385c36;
  padding: 1rem 0;
}

.date-text-5 {
  font-size: 0.75rem;
  font-family: "Tenor Sans", sans-serif;
  font-weight: normal;
  font-style: normal;
  text-align: center;
}

.coaster-container {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  transform: translateY(100vh);
  opacity: 0;
  container: coaster-container / inline-size;
}

.coaster-container::before {
  content: "At";
  font-family: "Tenor Sans", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1.5rem;
  color: #704444;
  text-transform: uppercase;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-45%, -50cqi) translateY(-35px);
}

.coaster-front,
.coaster-back {
  position: absolute;
  width: 80%;
  display: block;
  left: 50%;
  top: 50%;
  /* Prevent image selection */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

.coaster-front {
  transform: translate(-50%, -50%) rotateY(90deg);
}

.coaster-back {
  transform: translate(-50%, -50%) rotateY(-90deg);
}

.details-header,
.outfits-header {
  font-size: 12rem;
  font-family: "Nyght Serif", serif;
  font-weight: 300;
  font-style: italic;
  text-align: center;
  writing-mode: vertical-rl;
  color: #385c36aa;
  transform: rotate(180deg);
  opacity: 0;
  visibility: hidden;
  display: none;
  position: relative;
}

.outfits-header {
  color: #704444aa;
}

.details-header::before,
.outfits-header::before {
  content: "";
  display: block;
  width: 1px;
  height: 100px;
  border-right: 1.5px solid #385c36aa;
  margin-bottom: 10px;
  position: absolute;
  left: 40%;
  top: 105%;
}

.outfits-header::before {
  border-right: 1.5px solid #704444aa;
}

.details-header::after,
.outfits-header::after {
  content: "";
  display: block;
  width: 1px;
  height: 100px;
  border-right: 1.25px solid #385c36aa;
  margin-bottom: 10px;
  position: absolute;
  left: 40%;
  top: -20%;
}

.outfits-header::after {
  border-right: 1.25px solid #704444aa;
}

.details-content,
.outfits-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  position: absolute;
  height: 100%;
  display: none;
  opacity: 0;
  visibility: hidden;
}

.details-item-text,
.outfits-item-text,
.outfits-outro-text {
  font-size: 1.1rem;
  font-family: "Fanwood Text", serif;
  font-weight: normal;
  font-style: italic;
  text-align: center;
  color: #385c36;
  /* Allow text selection on text elements */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.outfits-item-text {
  color: #704444;
}

.outfits-type,
.details-date {
  font-size: 1.25rem;
  /* Allow text selection */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.outfits-description,
.outfits-outro-text {
  color: #704444aa;
  max-width: 350px;
  /* Allow text selection */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.details-item-heading,
.outfits-item-heading,
.outfits-outro-heading {
  font-size: 1.75rem;
  font-family: "Nyght Serif", serif;
  font-weight: 300;
  font-style: italic;
  text-align: center;
  margin-top: 2.5rem;
  /* Allow text selection */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.outfits-outro {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transform: translateY(200px);
  opacity: 0;
}

.location-link {
  color: #385c36;
  text-decoration: underline;
  text-decoration-color: #385c36;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(56, 92, 54, 0.3);
}

.location-link:hover {
  opacity: 0.7;
}

.location-link:active {
  opacity: 0.5;
}

.pinterest-link {
  color: #704444;
  text-decoration: underline;
  text-decoration-color: #704444;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(112, 68, 68, 0.3);
}

.pinterest-link:hover {
  opacity: 0.7;
}

.pinterest-link:active {
  opacity: 0.5;
}

/* Play Button */
.play-button {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, opacity 0.3s ease;
  pointer-events: auto;
}

.play-button:hover {
  transform: translateX(-50%) scale(1.1);
}

.play-button:active {
  transform: translateX(-50%) scale(0.95);
}

.play-button.hidden {
  opacity: 0;
  pointer-events: none;
}

.play-button svg {
  display: block;
  /* filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2)); */
}

.closing-container {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transform: translateY(200px);
  opacity: 0;
}

.closing-text {
  font-size: 1.25rem;
  font-family: "Fanwood Text", serif;
  font-weight: normal;
  font-style: italic;
  text-align: center;
  color: #704444;
}

.closing-text::before {
  content: "";
  background-image: url("./assets/images/heart.png");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 75%;
  display: block;
  width: 75%;
  height: 250px;
  margin: 0 auto;
}
