/* ==========================================================================
   Native Smooth Scroll (no jQuery needed)
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

/* Offset for fixed header - applies to all anchor targets */
section[id] {
  scroll-margin-top: 100px;
}

/* ==========================================================================
   Bootstrap 5 Override - Use Theme CSS Variables
   ========================================================================== */

:root {
  /* Body styles */
  --bs-body-font-family: 'Source Sans Pro', 'Verdana', 'Helvetica', sans-serif;
  --bs-body-font-size: 1rem;
  --bs-body-font-weight: 400;
  --bs-body-line-height: 1.7;
  --bs-body-color: #5a5c5e;
  --bs-body-bg: #ffffff;

  /* Link styles - use theme color */
  --bs-link-decoration: none;

  /* Border radius */
  --bs-border-radius: 0.25rem;
  --bs-border-radius-lg: 0.3rem;
}

/* Override Bootstrap 5 primary button colors - use theme variable */
.btn-primary {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  filter: brightness(0.85);
  color: #fff !important;
}

.btn-outline-primary {
  color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  background-color: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
}

.bg-primary {
  background-color: var(--color-primary) !important;
}

.text-primary {
  color: var(--color-primary) !important;
}

.border-primary {
  border-color: var(--color-primary) !important;
}

/* Secondary background - use theme variable */
.bg-secondary {
  background-color: var(--color-secondary) !important;
}

/* Restore body styles */
body {
  font-family: 'Source Sans Pro', 'Verdana', 'Helvetica', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  color: #5a5c5e;
  background-color: #ffffff;
}

/* Links - use theme variable */
a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary);
  filter: brightness(0.8);
}

/* Cards */
.card {
  border-radius: 0.25rem;
  overflow: hidden;
}

/* Form controls - use theme variable for focus */
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(226, 93, 93, 0.25);
}

.form-check-input:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Bootstrap 4 backward compatibility */
.form-group {
  margin-bottom: 1rem;
}

/* ==========================================================================
   Original site.css styles
   ========================================================================== */

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Focus visible only for keyboard navigation, not mouse clicks */
.btn:focus-visible, .btn-link.nav-link:focus-visible, .form-control:focus-visible, .form-check-input:focus-visible {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Remove focus ring on mouse click */
.btn:focus:not(:focus-visible) {
  box-shadow: none;
  outline: none;
}

html {
  position: relative;
  min-height: 100%;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ==========================================================================
   Hero Section - Text Readability
   ========================================================================== */

.gradient-overlay .lead {
  font-size: 1.5rem;
  font-weight: 500;
  color: #ffffff !important;
  letter-spacing: 0.5px;
}

@media (min-width: 768px) {
  .gradient-overlay .lead {
    font-size: 1.75rem;
  }
}

/* ==========================================================================
   Event Cards - Venue Styling
   ========================================================================== */

.event-location {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.venue-name {
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
}

.venue-address {
  font-size: 0.85rem;
  line-height: 1.4;
}

.event-location .btn {
  margin-top: 0.5rem;
}

/* Event cards tablet optimization - side by side, equal height */
@media (min-width: 768px) and (max-width: 991px) {
  /* Hide the couple image column on tablet */
  #wedding .display-state {
    display: none !important;
  }

  /* Force the row to stretch columns equally */
  #wedding > .container > .row:nth-child(2) {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
  }

  /* Make columns flex containers that stretch */
  #wedding > .container > .row:nth-child(2) > .col-md-6:not(.display-state) {
    display: flex !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }

  /* Force cards to fill the column height - the card has both .card and .card-body classes */
  #wedding .card.card-body {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 1.5rem 1.25rem !important;
  }

  /* Icon styling */
  #wedding .card.card-body .icon-round {
    margin-bottom: 1rem !important;
    width: 55px;
    height: 55px;
    flex-shrink: 0;
  }

  #wedding .card.card-body .icon-round svg {
    width: 26px;
    height: 26px;
  }

  /* Event content wrapper - takes remaining space and pushes location to bottom */
  #wedding .card.card-body .event-content {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* Title and time - don't grow */
  #wedding .card.card-body h5 {
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  #wedding .card.card-body h6:not(.venue-name) {
    margin-bottom: 1rem !important;
    font-size: 0.9rem;
    flex-shrink: 0;
  }

  /* Location section - pushed to bottom */
  #wedding .card.card-body .event-location {
    margin-top: auto !important;
    flex-shrink: 0;
  }

  .venue-name {
    font-size: 1rem;
  }

  .venue-address {
    font-size: 0.8rem;
  }

  #wedding .event-location .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  /* Remove bottom margin from first card column on tablet */
  #wedding > .container > .row:nth-child(2) > .col-md-6.mb-4 {
    margin-bottom: 0 !important;
  }
}

/* Event cards mobile optimization - full width stacked */
@media (max-width: 767px) {
  #wedding .container {
    padding-bottom: 2rem !important;
  }

  /* Section header compact */
  #wedding .text-center.mb-5.pb-5 {
    margin-bottom: 2rem !important;
    padding-bottom: 0 !important;
  }

  #wedding .text-center.mt-5.pt-5 {
    margin-top: 2rem !important;
    padding-top: 0 !important;
  }

  /* Full width cards */
  #wedding .row > [class*="col-md-6"]:not(.display-state) {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 1rem;
  }

  #wedding .row > [class*="col-md-6"]:last-child {
    margin-bottom: 0;
  }

  /* Card styling - vertical centered layout */
  #wedding .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
  }

  #wedding .card-body .icon-round {
    margin-bottom: 1.25rem !important;
    width: 64px;
    height: 64px;
  }

  #wedding .card-body .icon-round svg {
    width: 30px;
    height: 30px;
  }

  /* Event content wrapper */
  #wedding .event-content {
    width: 100%;
    text-align: center;
  }

  #wedding .card-body h5 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem !important;
  }

  #wedding .card-body h6:not(.venue-name) {
    margin-bottom: 1.25rem !important;
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.8;
  }

  /* Location section with subtle separator */
  #wedding .event-location {
    width: 100%;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(128, 128, 128, 0.15);
    flex-direction: column;
    align-items: center;
  }

  /* White card border */
  #wedding .card-body:not(.bg-primary) .event-location {
    border-top-color: rgba(0, 0, 0, 0.08);
  }

  /* Primary card border */
  #wedding .card-body.bg-primary .event-location,
  #wedding .bg-primary .event-location {
    border-top-color: rgba(255, 255, 255, 0.2);
  }

  #wedding .venue-name {
    font-size: 1.05rem;
    text-align: center;
  }

  #wedding .venue-address {
    font-size: 0.9rem;
    margin-bottom: 1rem !important;
    text-align: center;
  }

  #wedding .event-location .btn {
    margin-top: 0.25rem;
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
  }
}

/* ==========================================================================
   Our Story Section - Premium
   ========================================================================== */

.story-heart-image {
  max-width: 250px;
  margin: 0 auto;
}

.story-timeline {
  list-style: none;
  padding: 0;
  position: relative;
  max-width: 600px;
  width: 100%;
}

.story-timeline::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--color-primary);
}

.story-timeline li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 30px;
  position: relative;
}

.story-timeline li:last-child {
  margin-bottom: 0;
}

.story-icon {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  flex-shrink: 0;
}

.story-icon .icon-svg {
  width: 28px;
  height: 28px;
  color: white;
}

.story-content {
  margin-left: 20px;
  padding-top: 10px;
}

@media (max-width: 576px) {
  .story-timeline::before {
    left: 25px;
  }

  .story-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
  }

  .story-icon .icon-svg {
    width: 22px;
    height: 22px;
  }

  .story-content {
    margin-left: 15px;
  }
}

/* ==========================================================================
   Best Friends / Testimoni Section - Premium
   ========================================================================== */

.friends-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.friend-item {
  flex: 0 0 calc(50% - 1rem);
  max-width: calc(50% - 1rem);
  text-align: center;
}

/* Griglia dinamica in base al numero di testimoni */
/* 1 colonna */
.friends-grid-1 .friend-item {
  flex: 0 0 100%;
  max-width: 250px;
}

/* 2 colonne */
@media (min-width: 576px) {
  .friends-grid-2 .friend-item {
    flex: 0 0 calc(50% - 1rem);
    max-width: calc(50% - 1rem);
  }
}

/* 3 colonne */
@media (min-width: 768px) {
  .friends-grid-3 .friend-item {
    flex: 0 0 calc(33.333% - 1.5rem);
    max-width: calc(33.333% - 1.5rem);
  }
}

/* 4 colonne */
@media (min-width: 768px) {
  .friends-grid-4 .friend-item {
    flex: 0 0 calc(33.333% - 1.5rem);
    max-width: calc(33.333% - 1.5rem);
  }
}

@media (min-width: 992px) {
  .friends-grid-4 .friend-item {
    flex: 0 0 calc(25% - 1.5rem);
    max-width: calc(25% - 1.5rem);
  }
}

.friend-heart-image {
  max-width: 180px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

/* Heart shape using CSS clip-path (better Android support) */
.heart-container {
  width: 100%;
  aspect-ratio: 607 / 532;
  clip-path: url(#heart-clip);
  -webkit-clip-path: url(#heart-clip);
  overflow: hidden;
  position: relative;
}

.heart-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Fallback avatar with initials */
.heart-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}

.heart-initials {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 576px) {
  .friend-heart-image {
    max-width: 140px;
  }

  .heart-initials {
    font-size: 2rem;
  }
}

/* Hover Fun Fact Tooltip */
.friend-item.has-funfact {
  cursor: pointer;
  position: relative;
}

.friend-funfact {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--color-primary);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  width: max-content;
  max-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.friend-funfact::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--color-primary);
}

.friend-item.has-funfact:hover .friend-funfact {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 576px) {
  .friend-funfact {
    max-width: 180px;
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
  }
}

blockquote.blockquote {
  font-size: 1.1rem;
  border-left: 3px solid var(--color-primary);
  padding-left: 20px;
}

blockquote .blockquote-footer {
  color: var(--color-primary);
}

/* ==========================================================================
   Demo Banner
   ========================================================================== */

.demo-banner {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile: More vertical padding for better touch experience */
@media (max-width: 991px) {
  .demo-banner {
    padding: 12px 16px;
  }

  body:has(.demo-banner) .header {
    margin-top: 52px;
  }
}

/* Desktop: Offset header below the fixed banner */
@media (min-width: 992px) {
  body:has(.demo-banner) .header {
    margin-top: 0;
    top: 40px;
  }

  body:has(.demo-banner) .header.switched-header {
    top: 40px;
  }
}

/* ==========================================================================
   Music Player
   ========================================================================== */

.music-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.music-toggle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.music-toggle:active {
  transform: scale(0.95);
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .music-player {
    display: none;
  }
}

/* ==========================================================================
   Mobile Navigation Menu - Improved Touch Targets
   ========================================================================== */
@media (max-width: 991px) {
  /* Mobile menu dropdown styling */
  .header .nav-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-top: 0.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.75rem;
  }

  .header .navbar-nav {
    padding: 0.25rem 0;
  }

  /* Larger touch targets for mobile - minimum 48px (Google Material Design guideline) */
  .header .header-navbar-nav .nav-link {
    color: #333 !important;
    padding: 0.875rem 1rem !important;
    min-height: 48px;
    display: flex;
    align-items: center;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
    /* Prevent text selection on tap */
    -webkit-user-select: none;
    user-select: none;
    /* Improve tap response on Android */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
  }

  .header .header-navbar-nav .nav-link:hover,
  .header .header-navbar-nav .nav-link:active {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--color-primary) !important;
  }

  /* Hamburger button - larger touch target */
  .header .btn-navbar-toggler {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}