/* Novus Website UI Kit — mobile-first responsive styles */
@import url('../../colors_and_type.css');

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg-page); color: var(--fg-2); overflow-x: hidden; }
body { font-family: var(--font-text); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }

/* ============ MOBILE FIRST CONTAINER ============ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}
@media (min-width: 640px) { .container { padding: 0 28px; } }
@media (min-width: 1024px) { .container { padding: 0 48px; } }

img { display: block; max-width: 100%; height: auto; }
button { font-family: var(--font-text); cursor: pointer; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--navy-500); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 200ms var(--ease-novus);
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;  /* Touch target */
  text-align: center;
}
@media (min-width: 768px) { .btn { padding: 14px 26px; } }

.btn-primary { background: var(--navy-700); color: var(--sand-50); border-color: var(--navy-700); }
.btn-primary:hover { background: var(--navy-500); border-color: var(--navy-500); transform: translateY(-1px); box-shadow: var(--shadow-soft); color: var(--sand-50); }
.btn-secondary { background: transparent; color: var(--navy-700); border-color: var(--navy-700); }
.btn-secondary:hover { background: var(--navy-700); color: var(--sand-50); }
.btn-on-dark { background: rgba(255,255,255,0.96); color: var(--navy-900); border-color: transparent; }
.btn-on-dark:hover { background: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--navy-700); padding: 14px 10px; }
.btn-ghost:hover { color: var(--navy-500); text-decoration: underline; text-underline-offset: 4px; }

/* Nav link styling */
.nav-link { white-space: nowrap; }

/* Overline */
.overline {
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-500);
}
@media (min-width: 768px) { .overline { font-size: 12px; letter-spacing: 0.18em; } }

/* Brand all-caps */
.brandline {
  font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; font-size: 11px;
}
@media (min-width: 768px) { .brandline { letter-spacing: 0.24em; font-size: 12px; } }

/* Horizon hairline */
.horizon-rule { height:1px; background: var(--horizon-200); opacity: 0.7; width: 64px; border: 0; margin: 0; }

/* Sun bullet */
.sun-bullet { width: 14px; height: 14px; border-radius: 999px; background: var(--sunset-gradient);
              box-shadow: 0 0 0 5px rgba(252,172,100,0.08); display:inline-block; flex-shrink: 0; }
@media (min-width: 768px) { .sun-bullet { width: 16px; height: 16px; box-shadow: 0 0 0 6px rgba(252,172,100,0.08); } }

/* ============ SECTIONS — responsive padding ============ */
.section { padding: 56px 0; }
.section-tight { padding: 40px 0; }
@media (min-width: 640px) {
  .section { padding: 72px 0; }
  .section-tight { padding: 52px 0; }
}
@media (min-width: 1024px) {
  .section { padding: 96px 0; }
  .section-tight { padding: 64px 0; }
}

/* Cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px;
        transition: all 220ms var(--ease-novus); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

/* ============ FORM FIELDS ============ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-500);
}
.field input, .field select, .field textarea {
  padding: 14px 16px;  /* Larger touch target for mobile */
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;     /* Prevents iOS zoom on focus */
  background: #fff;
  outline: none;
  font-family: inherit;
  color: var(--navy-900);
  transition: border 160ms var(--ease-novus);
  min-height: 48px;
  width: 100%;
}
@media (min-width: 768px) {
  .field input, .field select, .field textarea {
    padding: 12px 14px;
    font-size: 14px;
    min-height: 44px;
  }
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--navy-500); border-width: 1.5px;
}
.field textarea { font-family: inherit; resize: vertical; min-height: 120px; }

/* ============ RESPONSIVE UTILITY CLASSES ============ */
.hide-mobile { display: none; }
@media (min-width: 768px) { .hide-mobile { display: initial; } }

.hide-desktop { display: initial; }
@media (min-width: 768px) { .hide-desktop { display: none; } }

.show-flex-mobile { display: flex; }
@media (min-width: 768px) { .show-flex-mobile { display: none; } }

/* ============ MOBILE GRID OVERRIDES ============ */
@media (max-width: 767px) {
  /* Force single column on mobile for most grids */
  .grid-2-mobile, .grid-3-mobile, .grid-4-mobile {
    grid-template-columns: 1fr !important;
  }
  /* Allow 2 columns where it makes sense */
  .grid-keep-2-mobile {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Reduced gap on mobile */
  .grid-mobile-gap { gap: 12px !important; }
}

/* ============ MOBILE TYPOGRAPHY SCALING ============ */
@media (max-width: 767px) {
  h1, .h1 { font-size: 28px; line-height: 1.15; }
  h2, .h2 { font-size: 22px; line-height: 1.2; }
  h3, .h3 { font-size: 19px; line-height: 1.25; }
  .display-l, .display-xl { font-size: 36px; line-height: 1.05; }
  .display-m { font-size: 32px; }
  .display-s { font-size: 26px; }
}

/* ============ MOBILE OVERFLOW FIX ============ */
@media (max-width: 767px) {
  /* Prevent horizontal scroll caused by big elements */
  section, header, footer, main, div {
    max-width: 100vw;
  }
  /* Reduce extreme padding */
  .section { padding: 48px 0; }
  .section-tight { padding: 32px 0; }
}

/* ============ MOBILE NAVIGATION ============ */
.mobile-menu-trigger {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 0; cursor: pointer;
  color: var(--navy-900);
}
@media (min-width: 1024px) { .mobile-menu-trigger { display: none; } }

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--sand-50);
  display: flex;
  flex-direction: column;
  padding: 80px 24px 40px;
  overflow-y: auto;
  animation: slideDown 280ms var(--ease-novus);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.mobile-menu-overlay a {
  display: block;
  padding: 18px 0;
  font-size: 20px;
  color: var(--navy-900);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.mobile-menu-overlay .menu-cta {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============ TOUCH-OPTIMIZED ============ */
@media (hover: none) {
  /* Disable hover effects on touch devices */
  .card:hover { transform: none; box-shadow: none; }
  .btn-primary:hover { transform: none; box-shadow: none; }
}

/* ============ SAFE AREA INSETS (notched phones) ============ */
@supports (padding: max(0px)) {
  .container {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}

/* ===================================================================
   LUXURY ANIMATIONS — subtle, refined, motion designed for high-end brands
   =================================================================== */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248,141,107,0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(248,141,107,0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-4px); }
}

/* Animation utility classes — applied on load */
.fade-up { animation: fadeInUp 700ms var(--ease-novus) both; }
.fade-in { animation: fadeIn 500ms var(--ease-novus) both; }
.scale-in { animation: scaleIn 500ms var(--ease-novus) both; }
.slide-right { animation: slideInRight 600ms var(--ease-novus) both; }

/* Stagger delays */
.delay-1 { animation-delay: 80ms; }
.delay-2 { animation-delay: 160ms; }
.delay-3 { animation-delay: 240ms; }
.delay-4 { animation-delay: 320ms; }
.delay-5 { animation-delay: 400ms; }
.delay-6 { animation-delay: 480ms; }

/* ============ REFINED HOVER STATES ============ */
.hover-lift {
  transition: transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(15,42,66,0.08), 0 24px 48px rgba(15,42,66,0.06);
}

.hover-glow {
  transition: box-shadow 380ms var(--ease-novus);
}
.hover-glow:hover {
  box-shadow: 0 0 0 4px var(--sun-coral-alpha-20), var(--shadow-soft);
}

.hover-zoom img {
  transition: transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hover-zoom:hover img {
  transform: scale(1.04);
}

/* Underline animation on links */
.link-underline {
  position: relative;
  display: inline-block;
}
.link-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--sun-coral);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 400ms var(--ease-novus);
}
.link-underline:hover::after {
  transform: scaleX(1);
}

/* Button refinements */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 700ms var(--ease-novus);
  pointer-events: none;
}
.btn:hover::before {
  transform: translateX(100%);
}
.btn > * {
  position: relative;
  z-index: 1;
}

/* ============ LUXURY UTILITY CLASSES ============ */
.glass-surface {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.18);
}

.glass-dark {
  background: rgba(10,31,51,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
}

.gold-accent {
  color: var(--gold-luxe);
}

.text-gradient-sunset {
  background: var(--sunset-gradient-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Smooth scroll for whole page */
html { scroll-behavior: smooth; }

/* Selection styling */
::selection {
  background: var(--sun-coral);
  color: #fff;
}

/* Scrollbar */
@media (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: var(--sand-100);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--sand-300);
    border-radius: 999px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--ink-500);
  }
}

/* Page loading indicator */
.page-loading {
  position: fixed;
  inset: 0;
  background: var(--sand-50);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeOut 300ms 800ms forwards;
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; pointer-events: none; }
}

/* Reduce motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Reveal on scroll utility (used by JS) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease-novus), transform 700ms var(--ease-novus);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===================================================================
   MOBILE UX POLISH — Airbnb-grade, friendly & intuitive (added 2026-05)
   =================================================================== */
@media (max-width: 767px) {
  /* Bigger, comfortable tap targets everywhere (Apple HIG / Airbnb ≥ 48px). */
  .btn, button, a.btn, .nav-account-btn, .nav-book-btn {
    min-height: 48px;
  }
  /* Primary CTAs go full-width on mobile so they're easy to hit. */
  .btn-primary, .btn-amber { width: 100%; justify-content: center; }
  /* …unless explicitly inline (nav, cards opt out). */
  .nav-book-btn, .nav-account-btn, .btn-inline, .pp-bookbar .btn { width: auto; }

  /* Property cards: roomy, single-column, photo-forward like Airbnb. */
  .residences-grid, .grid-cards { grid-template-columns: 1fr !important; gap: 18px !important; }

  /* Section rhythm: tighter top/bottom, comfortable side gutters. */
  .section { padding: 40px 0; }
  h1, .h1 { letter-spacing: -0.01em; }

  /* Sticky nav stays compact and thumb-reachable. */
  .nav-row { min-height: 60px; }

  /* Forms: 16px inputs prevent iOS auto-zoom; full-width fields. */
  input, select, textarea { font-size: 16px !important; }

  /* Horizontal scrollers get momentum + hidden bars (chips, filters). */
  .scroll-x { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .scroll-x::-webkit-scrollbar { display: none; }

  /* Modal sheets rise from the bottom like a native sheet. */
  .modal-scrim { align-items: flex-end !important; padding: 0 !important; }
  .modal-sheet { border-radius: 20px 20px 0 0 !important; max-height: 92vh; }
}

/* Disable sticky hover lift on touch (prevents "stuck hover" on tap). */
@media (hover: none) {
  .card:hover, article:hover, .card-clickable:hover { transform: none !important; }
}

/* WCAG AA — visible keyboard focus on all interactive elements (public site). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--horizon-500, #E89B2C);
  outline-offset: 2px;
  border-radius: 6px;
}
