.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glow-effect {
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.15);
}

.site-header {
    isolation: isolate;
    transform: translateZ(0);
    contain: layout paint;
}

.header-heart-icon {
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.group:hover .header-heart-icon {
    filter: drop-shadow(0 0 8px rgba(255, 180, 168, 0.9));
}

#bottom-nav {
    transform: translateZ(0);
}

.timer-card-shell {
    position: relative;
    isolation: isolate;
}

.hero-section #love-timer .timer-card-shell .glass-card {
    box-shadow: none;
}

@media (max-width: 767px) {
    .hero-section #love-timer .timer-card-shell.glow-effect {
        box-shadow: none;
    }

    .hero-section #love-timer .timer-card-shell .glass-card {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.09) 0%,
            rgba(255, 255, 255, 0.04) 100%
        );
    }

    .hero-section--scrolling .hero-scroll-hint .material-symbols-outlined {
        animation-play-state: paused;
    }
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.theme-scrollbar,
.admin-modal-panel__body {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 180, 168, 0.4) rgba(255, 255, 255, 0.05);
}

.theme-scrollbar::-webkit-scrollbar,
.admin-modal-panel__body::-webkit-scrollbar {
    width: 6px;
}

.theme-scrollbar::-webkit-scrollbar-track,
.admin-modal-panel__body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 9999px;
    margin-block: 4px;
}

.admin-modal-panel__body::-webkit-scrollbar-track {
    margin-block: 6px;
}

.theme-scrollbar::-webkit-scrollbar-thumb,
.admin-modal-panel__body::-webkit-scrollbar-thumb {
    background: rgba(255, 180, 168, 0.35);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.theme-scrollbar::-webkit-scrollbar-thumb:hover,
.admin-modal-panel__body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 180, 168, 0.55);
}

.theme-scrollbar::-webkit-scrollbar-button,
.admin-modal-panel__body::-webkit-scrollbar-button {
    display: none;
    height: 0;
    width: 0;
}

input.glass-input,
select.glass-input,
textarea.glass-input,
.glass-input {
    background-color: transparent !important;
    border: 1px solid #722f37 !important;
    color: #e5e2e1 !important;
    color-scheme: dark;
    transition: all 0.3s ease;
}

input.glass-input:focus,
select.glass-input:focus,
textarea.glass-input:focus,
.glass-input:focus {
    border-color: #8b0000 !important;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.2);
    outline: none;
}

select.glass-input {
    background-color: rgba(28, 27, 27, 0.95) !important;
}

select.glass-input option {
    background-color: #1c1b1b;
    color: #e5e2e1;
}

select.glass-input option:checked,
select.glass-input option:hover {
    background-color: #722f37;
    color: #ffffff;
}

input.glass-input::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
}

:root {
    --primary: #ffb4a8;
    --hero-viewport-offset: 80px;
}

@media (min-width: 768px) {
    :root {
        --hero-viewport-offset: 100px;
    }
}

#section-timer,
#section-photos,
#section-pinterest,
#section-calendar {
    scroll-margin-top: 80px;
}

@media (max-width: 767px) {
  .photo-album-header {
    gap: 0.375rem;
  }
}

.hero-section {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: grid;
    min-height: 100svh;
    margin-top: calc(-1 * var(--hero-viewport-offset));
    box-sizing: border-box;
}

.hero-content {
    grid-area: 1 / 1;
    align-self: center;
    justify-self: center;
    width: 100%;
}

.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
        ellipse 80% 60% at 50% 50%,
        rgba(139, 0, 0, 0.22) 0%,
        transparent 70%
    );
}

.hero-section::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4rem;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, #131313);
}

.hero-scroll-hint {
    grid-area: 1 / 1;
    align-self: end;
    justify-self: center;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
    color: #aa8984;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.3s ease, color 0.2s ease;
}

.hero-scroll-hint:hover {
    color: #ffb4a8;
}

.hero-scroll-hint .material-symbols-outlined {
    font-size: 2rem;
    animation: hero-chevron-bounce 1.5s ease-in-out infinite;
}

.hero-scroll-hint--hidden {
    opacity: 0;
    pointer-events: none;
}

.hero-scroll-hint--hidden .material-symbols-outlined {
    animation-play-state: paused;
}

@keyframes hero-chevron-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

@keyframes hero-reveal {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-reveal-item {
    opacity: 0;
    animation: hero-reveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--reveal-delay, 0ms);
}

.section-reveal-item {
    opacity: 0;
}

.section-reveal.is-visible .section-reveal-item {
    animation: hero-reveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--reveal-delay, 0ms);
}

@media (min-width: 768px) {
    @keyframes hero-reveal {
        from {
            opacity: 0;
            transform: translateY(24px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (max-width: 767px) {
    .hero-scroll-hint {
        margin-bottom: 5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-scroll-hint .material-symbols-outlined {
        animation: none;
    }

    .hero-reveal-item {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .section-reveal-item {
        opacity: 1;
        transform: none;
    }

    .section-reveal.is-visible .section-reveal-item {
        animation: none;
    }
}

@media (min-width: 768px) {
    .hero-section::before {
        background: radial-gradient(
            ellipse 70% 55% at 50% 50%,
            rgba(139, 0, 0, 0.15) 0%,
            transparent 68%
        );
    }
}

#bottom-nav button {
    color: rgba(227, 190, 184, 0.85);
}

#bottom-nav button .nav-icon {
    opacity: 0.85;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.nav-active {
    color: var(--primary) !important;
    background: rgba(139, 0, 0, 0.3);
    border-radius: 9999px;
}

#bottom-nav button.nav-active .nav-icon {
    opacity: 1;
}

body[data-page="admin"] {
    min-height: max(884px, 100dvh);
}

@media (min-width: 768px) {
    body[data-page="home"] main,
    body[data-page="admin"] main {
        padding-bottom: 6rem;
    }
}

.swipe-viewport {
    overflow: hidden;
    touch-action: pan-y;
    cursor: grab;
    width: 100%;
}

/* CLS: reserva a altura do carrossel antes do JS popular os cards */
#photo-album {
    min-height: 380px;
}

/* CLS: reserva a altura da grade do calendário (6 linhas) antes do render */
#calendar-grid {
    min-height: calc(6 * 2.25rem + 5 * 4px);
}

.swipe-viewport.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.swipe-viewport.is-dragging .swipe-slide {
    pointer-events: none;
}

.swipe-track {
    display: flex;
}

.swipe-viewport.is-dragging .swipe-track,
.swipe-track.is-animating {
    will-change: transform;
}

.swipe-track.is-animating {
    transition: transform 300ms ease-out;
}

.swipe-slide {
    flex-shrink: 0;
}

.swipe-viewport--lightbox {
    width: 95vw;
    max-width: 95vw;
    margin-inline: auto;
}

.swipe-viewport--lightbox .swipe-track {
    width: auto;
    height: 100%;
}

.swipe-viewport--lightbox .swipe-slide {
    box-sizing: border-box;
}

.swipe-viewport--lightbox .photo-lightbox-slide {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.photo-lightbox-media {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.photo-lightbox-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    pointer-events: none;
}

.photo-lightbox-meta {
    flex-shrink: 0;
    width: 100%;
    max-width: 36rem;
    margin-inline: auto;
    padding-top: 0.75rem;
    padding-bottom: 1rem;
    text-align: center;
}

/* Hide fixed header/nav while photo overlays are open — prevents bleed-through
   on the semi-transparent scrim (especially visible on desktop). */
body:has(#photo-lightbox:not(.hidden)) #bottom-nav,
body:has(#photo-gallery:not(.hidden)) #bottom-nav,
body:has(#photo-lightbox:not(.hidden)) .site-header,
body:has(#photo-gallery:not(.hidden)) .site-header {
    visibility: hidden;
    pointer-events: none;
}

#photo-lightbox:not(.hidden),
#photo-gallery:not(.hidden) {
    background-color: rgba(19, 19, 19, 0.97);
}

/* Calendar day badges */
#calendar-grid,
#admin-calendar-grid {
  overflow: visible;
}

#calendar-grid > div:not(.calendar-tooltip),
#admin-calendar-grid > div:not(.calendar-tooltip) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
}

.calendar-day-cell {
  position: relative;
  min-height: 2.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  padding: 0.125rem;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.calendar-day-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.calendar-day-cell:hover .calendar-day-badge {
  transform: scale(1.12);
  box-shadow: 0 0 16px rgba(255, 180, 168, 0.6);
}

.calendar-day-badge--meeting {
  background-color: rgba(114, 47, 55, 0.45);
  border: 1.5px solid rgba(255, 180, 168, 0.6);
  color: #ffb4a8;
  font-weight: 600;
  box-shadow: 0 0 8px rgba(255, 180, 168, 0.25);
}

.calendar-day-badge--special {
  background-color: rgba(139, 0, 0, 0.65);
  border: 1.5px solid #ffb4a8;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(255, 180, 168, 0.45);
}

.calendar-day-badge--today {
  background-color: rgba(255, 180, 168, 0.15);
  border: 2px solid rgba(255, 180, 168, 0.8);
  color: #ffb4a8;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 180, 168, 0.5);
}

.calendar-day-badge--today-meeting {
  background-color: #722f37;
  border: 2px solid #ffb4a8;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(255, 180, 168, 0.6);
}

.calendar-day-badge--today-special {
  background-color: #8b0000;
  border: 2px solid #ffb4a8;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(255, 180, 168, 0.8);
}

@keyframes calendarPopIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Calendar tooltip (Home) */
.calendar-tooltip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  position: absolute;
  z-index: 40;
  grid-column: 1 / -1;
  width: max-content;
  min-width: 0;
  max-width: 16rem;
  padding: 0.75rem 0.875rem;
  border-radius: 1.25rem;
  background: rgba(19, 19, 19, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 180, 168, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 20px rgba(255, 180, 168, 0.15);
  pointer-events: auto;
  animation: calendarPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.calendar-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.calendar-tooltip-label {
  margin: 0;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #ffb4a8;
  text-align: left;
  opacity: 0.95;
  white-space: nowrap;
}

.calendar-tooltip-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.calendar-tooltip-tag--special {
  background: rgba(255, 180, 168, 0.2);
  color: #ffb4a8;
  border: 1px solid rgba(255, 180, 168, 0.4);
}

.calendar-tooltip-tag--meeting {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e2e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.calendar-tooltip-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
}

.calendar-tooltip-item-text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: #e5e2e1;
  text-align: left;
  word-break: break-word;
}

.calendar-tooltip-item + .calendar-tooltip-item,
.calendar-tooltip-photo-btn + .calendar-tooltip-item,
.calendar-tooltip-photo-btn + .calendar-tooltip-photo-btn {
  margin-top: 0.375rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 180, 168, 0.12);
}

.calendar-tooltip-item + .calendar-tooltip-photo-btn {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

@media (max-width: 767px) {
  .calendar-tooltip {
    left: 0.5rem !important;
    right: 0.5rem !important;
    z-index: 60;
    min-width: 0;
    width: auto !important;
    max-width: none;
    padding: 1rem 1.25rem;
    transform: none !important;
    border-radius: 1.25rem;
  }

  .calendar-tooltip-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .calendar-tooltip-label {
    margin: 0;
    text-align: left;
  }

  .calendar-tooltip-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .calendar-tooltip-item-text {
    font-size: 0.95rem;
    text-align: center;
  }

  .calendar-tooltip-item + .calendar-tooltip-photo-btn {
    margin-top: -0.25rem;
  }
}

.calendar-tooltip-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.calendar-tooltip-photo-btn {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
  margin-top: 0;
  padding: 0;
  border-radius: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.calendar-tooltip-photo-wrapper {
  position: relative;
  width: 100%;
  height: 7.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(255, 180, 168, 0.25);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.calendar-tooltip-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(19, 19, 19, 0.95) 0%, rgba(19, 19, 19, 0.2) 65%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.625rem;
  opacity: 0.9;
  transition: opacity 0.25s ease;
}

.calendar-tooltip-photo-btn:hover .calendar-tooltip-photo-overlay {
  opacity: 1;
}

.calendar-tooltip-photo-btn:hover .calendar-tooltip-thumb {
  transform: scale(1.08);
}

.calendar-tooltip-photo-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.calendar-tooltip-photo-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.calendar-tooltip-photo-link {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffb4a8;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Calendar month picker popover */
.calendar-month-picker-anchor {
  position: relative;
  display: flex;
  justify-content: center;
  flex: 1;
}

.calendar-month-picker-trigger {
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
}

.calendar-month-picker-trigger:focus-visible {
  outline: 2px solid rgba(255, 180, 168, 0.6);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.calendar-month-picker {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  min-width: 17.5rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background-color: #131313;
  border: 1px solid rgba(255, 180, 168, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.calendar-month-picker__year-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 180, 168, 0.12);
}

.calendar-month-picker__year-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color 150ms ease;
}

.calendar-month-picker__year-btn:hover,
.calendar-month-picker__year-btn:focus-visible {
  color: #ffb4a8;
  outline: none;
}

.calendar-month-picker__year-btn:focus-visible {
  outline: 2px solid rgba(255, 180, 168, 0.5);
  outline-offset: 2px;
}

.calendar-month-picker__year {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
}

.calendar-month-picker__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.375rem;
}

.calendar-month-picker__month {
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.5rem 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.calendar-month-picker__month:hover,
.calendar-month-picker__month:focus-visible {
  color: #ffb4a8;
  background: rgba(255, 180, 168, 0.08);
  outline: none;
}

.calendar-month-picker__month--selected {
  color: #ffb4a8;
  background: rgba(255, 180, 168, 0.14);
  border-color: rgba(255, 180, 168, 0.35);
}

.calendar-month-picker__month--today:not(.calendar-month-picker__month--selected) {
  border-color: rgba(255, 180, 168, 0.4);
}



/* Mobile scroll container: isolates scrolling from fixed header/nav */
.site-scroll {
  width: 100%;
}

@media (max-width: 767px) {
  html,
  body[data-page="home"] {
    height: 100%;
  }

  body[data-page="home"] {
    overflow: hidden;
  }

  body[data-page="home"] .site-scroll {
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
}

@media (max-width: 767px) {
  #section-photos,
  #section-calendar {
    content-visibility: auto;
    contain-intrinsic-size: auto 480px;
  }
}

/* Performance: photo thumbnails are fully covered by their <img>, so the
   glass backdrop-filter is never visible yet forces costly GPU compositing
   on every scroll/swipe frame. Dropping it removes the album jank without
   any visual change. */
#photo-album .glass-card,
#photo-gallery-grid .glass-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (max-width: 767px) {
  /* The 97% opaque scrim already hides page content; the extra full-screen
     backdrop-filter only makes open/close and swipe transitions stutter on
     mobile GPUs. */
  #photo-lightbox,
  #photo-gallery {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}
