/* ========================================
   Teratak Nipah Homestay - Custom Styles
   ======================================== */

/* Base */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* Skip to content (a11y) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 8px 16px;
  background: #1B5E20;
  color: #fff;
  border-radius: 0 0 8px 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* Text shadow utility */
.text-shadow-hero {
  text-shadow: 0 2px 16px rgba(0,0,0,0.35);
}

.text-shadow-hero-sm {
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

.text-shadow-hero-md {
  text-shadow: 0 1px 12px rgba(0,0,0,0.4);
}

/* Hero parallax */
.hero-bg {
  background-image:
    linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, rgba(27,94,32,0.55) 40%, rgba(245,240,225,0.95) 100%),
    url('../images/hero-property.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

@media (max-width: 768px) {
  .hero-bg {
    background-attachment: scroll;
  }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Gallery hover */
.gallery-item {
  cursor: pointer;
}

.gallery-item img {
  transition: transform 0.4s ease-out;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Lightbox */
#lightbox {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

#lightbox.active {
  display: flex;
  opacity: 1;
}

#lightbox-img {
  transition: opacity 0.2s ease-out;
}

/* Nav transition */
.nav-scrolled {
  background-color: rgba(245, 240, 225, 0.97) !important;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
}

.nav-scrolled .nav-inner {
  height: 3.5rem;
}

@media (min-width: 768px) {
  .nav-scrolled .nav-inner {
    height: 3.75rem;
  }
}

.nav-scrolled .nav-link {
  color: #1B5E20 !important;
}

.nav-scrolled .nav-logo-text {
  color: #1B5E20 !important;
}

.nav-scrolled #menu-btn {
  color: #3E2723 !important;
}

/* Active nav link */
.nav-link-active {
  color: #fbbf24 !important;
  position: relative;
}

.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: #fbbf24;
  border-radius: 1px;
}

.nav-scrolled .nav-link-active {
  color: #1B5E20 !important;
}

.nav-scrolled .nav-link-active::after {
  background: #1B5E20;
}

/* ========== Floating Card Effect ========== */

/* Float animation keyframes */
@keyframes floating-card {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes ripple-effect {
  0% {
    transform: scale(0);
    opacity: 0.5;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* Shared floating card base */
.floating-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.4s ease-out, box-shadow 0.4s ease-out;
  transform-style: preserve-3d;
  will-change: transform;
  animation: floating-card 5s ease-in-out infinite;
}

.floating-card:hover {
  box-shadow: 0 20px 40px rgba(27, 94, 32, 0.10), 0 8px 16px rgba(62, 39, 35, 0.06);
}

/* Ripple on click */
.floating-card .ripple {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(27, 94, 32, 0.15);
  pointer-events: none;
  animation: ripple-effect 0.6s ease-out forwards;
}

/* Amenity card hover */
.amenity-card {
  transition: transform 0.4s ease-out, box-shadow 0.4s ease-out;
}

.amenity-card:hover {
  box-shadow: 0 20px 40px rgba(27, 94, 32, 0.10), 0 8px 16px rgba(62, 39, 35, 0.06);
}

/* Testimonial card */
.testimonial-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.4s ease-out, box-shadow 0.4s ease-out;
  transform-style: preserve-3d;
  will-change: transform;
}

.testimonial-card .ripple {
  background: rgba(255, 255, 255, 0.2);
}

/* Gallery items get floating too */
.gallery-item.floating-card {
  animation-duration: 6s;
}

/* Stagger the float animations so cards don't all bob in sync */
.floating-card:nth-child(2) { animation-delay: -0.8s; }
.floating-card:nth-child(3) { animation-delay: -1.6s; }
.floating-card:nth-child(4) { animation-delay: -2.4s; }
.floating-card:nth-child(5) { animation-delay: -3.2s; }
.floating-card:nth-child(6) { animation-delay: -4.0s; }

/* Disable float animation on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .floating-card {
    animation: none;
  }
}

/* Scrolling testimonial columns */
@keyframes scroll-up {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.testimonials-scroll {
  animation: scroll-up 35s linear infinite;
}

.testimonials-column:hover .testimonials-scroll {
  animation-play-state: paused;
}

.testimonials-mask {
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
}

/* CTA pulse */
@keyframes gentle-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(217, 119, 6, 0); }
}

.cta-pulse {
  animation: gentle-pulse 3s ease-in-out infinite;
}

/* Star rating */
.star-filled {
  color: #f59e0b;
}

/* Grain texture overlay */
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Blurred stagger text animation */
@keyframes blur-in {
  0% {
    opacity: 0;
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    filter: blur(0px);
  }
}

.stagger-char {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  animation: blur-in 0.3s ease-out forwards;
}

/* Mobile menu */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
}

.mobile-menu.open {
  transform: translateX(0);
}

/* Social icon buttons */
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(212, 196, 168, 0.5);
  background: white;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.social-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.social-btn svg {
  width: 20px;
  height: 20px;
}

/* Gallery hover overlay */
.gallery-item {
  position: relative;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(27, 94, 32, 0.35) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease-out;
  border-radius: inherit;
  pointer-events: none;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* Button press feedback */
.btn-press {
  transition: transform 0.2s ease, box-shadow 0.3s ease, background-color 0.2s ease;
}

.btn-press:hover {
  transform: translateY(-2px);
}

.btn-press:active {
  transform: translateY(0) scale(0.98);
}

/* Focus-visible ring */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Section wave divider */
.section-divider-wave {
  position: relative;
}

.section-divider-wave::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: inherit;
  clip-path: ellipse(55% 100% at 50% 100%);
  z-index: 1;
}

/* Amenity feature card with left accent */
.amenity-accent {
  border-left: 3px solid #1B5E20;
  transition: transform 0.4s ease-out, box-shadow 0.4s ease-out, border-color 0.3s ease;
}

.amenity-accent:hover {
  border-left-color: #d97706;
}

