/* ==========================================================================
   Wedding Invitation Stylesheet
   Preserves original poster aesthetics with responsive layout & accessible hotspot
   ========================================================================== */

:root {
  --bg-color: #f7f4ed;
  --bg-gradient-end: #ede7dc;
  --text-dark: #202b23;
  --accent-green: #254232;
  --accent-gold: #c39d5e;
  --accent-gold-hover: #b0894a;
  --focus-ring: #254232;
  --card-shadow: 0 12px 40px rgba(35, 45, 30, 0.08), 0 2px 8px rgba(35, 45, 30, 0.04);
  --hotspot-hover: rgba(195, 157, 94, 0.12);
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Global Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg-color);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  font-family: var(--font-system);
  color: var(--text-dark);
  background: radial-gradient(circle at 50% 30%, var(--bg-color) 0%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page Container */
.page-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.5rem 1rem;
}

@media (min-width: 1024px) {
  .page-container {
    padding: 2rem 1.5rem;
  }
}

/* Poster Wrapper */
.poster-wrapper {
  position: relative;
  display: block;
  line-height: 0;
  max-width: 100%;
  width: fit-content;
  margin: 0 auto;
  border-radius: 4px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  background-color: #faf7f0;
}

/* Poster Image */
.poster-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(720px, calc(100vw - 2rem));
  max-height: calc(100vh - 3.5rem);
  max-height: calc(100dvh - 3.5rem);
  aspect-ratio: 1024 / 1445;
  object-fit: contain;
  margin: 0 auto;
  border: 0;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 640px) {
  .page-container {
    padding: 0.5rem 0.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  .poster-wrapper {
    box-shadow: 0 4px 20px rgba(35, 45, 30, 0.08);
    border-radius: 3px;
    width: 100%;
    max-width: 480px;
  }

  .poster-image {
    width: 100%;
    max-width: 100%;
    max-height: none;
  }
}

/* Transparent Clickable Venue Hotspot */
.venue-hotspot {
  position: absolute;
  /* Coordinates calculated from 1024 x 1445 reference */
  left: 13.2%;
  top: 56.2%;
  width: 26.4%;
  height: 15.0%;
  background: transparent;
  border: none;
  outline: none;
  display: block;
  cursor: pointer;
  z-index: 10;
  border-radius: 6px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: rgba(195, 157, 94, 0.2);
}

/* Subtle feedback on hover to indicate clickability */
@media (hover: hover) and (pointer: fine) {
  .venue-hotspot:hover {
    background-color: var(--hotspot-hover);
  }
}

/* Accessible focus state for keyboard navigation */
.venue-hotspot:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
  background-color: rgba(195, 157, 94, 0.15);
  box-shadow: 0 0 0 4px rgba(37, 66, 50, 0.3);
}

/* Floating Share Button */
.floating-share-btn {
  position: fixed;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  right: calc(1.25rem + env(safe-area-inset-right, 0px));
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #ffffff;
  background-color: var(--accent-green);
  border: 1px solid rgba(195, 157, 94, 0.5);
  border-radius: 50px;
  box-shadow: 0 6px 20px rgba(37, 66, 50, 0.25), 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.floating-share-btn:hover {
  background-color: #1a3324;
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 66, 50, 0.35), 0 4px 8px rgba(0, 0, 0, 0.12);
}

.floating-share-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(37, 66, 50, 0.2);
}

.floating-share-btn:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

.share-icon {
  flex-shrink: 0;
  stroke: var(--accent-gold);
  transition: stroke 0.2s ease;
}

.floating-share-btn:hover .share-icon {
  stroke: #ffffff;
}

.share-label {
  display: inline;
}

@media (max-width: 480px) {
  .floating-share-btn {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    right: calc(1rem + env(safe-area-inset-right, 0px));
    padding: 0.55rem 0.95rem;
    font-size: 0.825rem;
  }
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: var(--accent-green);
  color: #ffffff;
  padding: 0.75rem 1.4rem;
  border-radius: 8px;
  border: 1px solid var(--accent-gold);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  text-align: center;
  max-width: 90vw;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Accessible Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
