/* ============================================================
   Slowley Farm — Mobile Overrides
   Phone-first refinements applied below 720px. Uses !important
   to beat inline React style props where necessary.
   ============================================================ */

/* === Common reflow utilities === */
@media (max-width: 720px) {

  /* Tighten root sizes a touch on phone */
  :root {
    --fs-hero: clamp(40px, 11vw, 60px);
    --fs-h1:   clamp(30px, 8.5vw, 44px);
    --fs-h2:   clamp(26px, 7vw, 34px);
  }

  /* Kill horizontal scroll once and for all */
  html, body { overflow-x: hidden !important; }
  #app, body > * { max-width: 100vw; }
  img, video, iframe { max-width: 100%; }
  /* Words must NOT be hyphenated/split mid-word in design copy */
  body, h1, h2, h3, h4, p, li, span, a, button, div {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: manual;
    -webkit-hyphens: manual;
  }

  /* ---------- Section paddings: halve them ---------- */
  section {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* Tall sections — pull the 120px down */
  #buttercup, #countryside,
  #gallery, #things-to-do, #finding-us,
  #faq, #contact {
    padding-top: 64px !important;
    padding-bottom: 64px !important;
  }

  /* ---------- Generic: every grid drops to one column ---------- */
  .slf-mobile-grid-1 { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* ---------- NAV ---------- */
  nav.slf-nav {
    padding: 12px 18px !important;
    gap: 12px !important;
  }
  nav.slf-nav .slf-nav-links {
    display: none !important;
  }
  nav.slf-nav .slf-nav-burger {
    display: inline-flex !important;
  }
  /* Mobile drawer */
  .slf-drawer {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(46,42,38,0.5);
    backdrop-filter: blur(4px);
    display: flex; justify-content: flex-end;
  }
  .slf-drawer-panel {
    width: min(86vw, 360px);
    background: var(--cream);
    padding: 28px 24px;
    display: flex; flex-direction: column; gap: 4px;
    box-shadow: -10px 0 40px rgba(0,0,0,0.18);
  }
  .slf-drawer-panel a {
    font-family: var(--font-serif);
    font-size: 22px; padding: 14px 0;
    border-bottom: 1px solid var(--border);
    color: var(--fg);
    text-decoration: none;
  }
  .slf-drawer-panel .slf-btn {
    margin-top: 16px;
  }

  /* ---------- HERO ---------- */
  .slf-hero {
    padding: 0 !important;
    min-height: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #2e2a26 !important;
  }
  .slf-hero video {
    object-fit: cover !important;
    object-position: 25% center !important;
  }
  /* Slightly stronger gradient on phone so text reads */
  .slf-hero > div:nth-of-type(1) {
    background: linear-gradient(to top, rgba(46,42,38,0.85) 0%, rgba(46,42,38,0.40) 45%, rgba(46,42,38,0.18) 100%) !important;
  }
  .slf-hero-meta {
    font-size: 11px !important;
    margin-bottom: 14px !important;
  }
  .slf-hero-title {
    font-size: clamp(40px, 11vw, 60px) !important;
  }
  .slf-hero-sub {
    font-size: 16px !important;
    max-width: 100% !important;
  }
  .slf-hero-ctas {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .slf-hero-ctas .slf-btn,
  .slf-hero-ctas a.slf-btn {
    width: 100% !important;
    padding: 14px 22px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    height: 48px !important;
    box-sizing: border-box !important;
  }
  .slf-hero-scrollcue { display: none !important; }
  /* Pull hero content slightly up because we shortened it */
  .slf-hero > div:nth-of-type(2) {
    padding: 0 24px 48px !important;
  }

  /* ---------- COTTAGE PICKER ---------- */
  .slf-picker-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .slf-picker-card {
    grid-template-rows: auto auto !important;
  }
  .slf-picker-photo {
    aspect-ratio: 4/3 !important;
    height: auto !important;
  }

  /* ---------- HOST NOTE ---------- */
  .slf-hostnote-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    text-align: center;
  }
  .slf-hostnote-photo {
    width: min(60vw, 240px) !important;
    margin: 0 auto !important;
  }

  /* ---------- COTTAGE SECTION ---------- */
  .slf-cottage-header {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    align-items: start !important;
    margin-bottom: 36px !important;
    padding-bottom: 20px !important;
  }
  .slf-cottage-header h2 {
    font-size: clamp(40px, 12vw, 64px) !important;
  }
  .slf-cottage-header .slf-cottage-meta {
    text-align: left !important;
  }
  .slf-cottage-body {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    margin-bottom: 48px !important;
  }
  .slf-cottage-body > * {
    order: unset !important;
  }
  /* Always show photo first regardless of side */
  .slf-cottage-body .slf-cottage-photo {
    order: -1 !important;
  }
  .slf-cottage-amenities {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .slf-cottage-amenities li {
    padding: 14px 14px !important;
    gap: 10px !important;
    align-items: center !important;
  }
  .slf-cottage-amenities li > div:last-child {
    min-width: 0;
  }
  .slf-cottage-amenities li > div:last-child > div:first-child {
    font-size: 14px !important;
    line-height: 1.25 !important;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none !important;
    -webkit-hyphens: none !important;
  }
  .slf-cottage-amenities li > div:last-child > div:last-child {
    font-size: 12px !important;
    line-height: 1.4 !important;
    margin-top: 4px !important;
  }
  .slf-cottage-amenities li > div:first-child {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0 !important;
  }
  .slf-cottage-gallery {
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
    gap: 8px !important;
  }
  .slf-cottage-gallery > div {
    grid-row: auto !important;
    aspect-ratio: 4/3;
  }
  .slf-cottage-cta {
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: left !important;
  }
  .slf-cottage-cta .slf-btn {
    width: 100% !important;
  }

  /* ---------- GALLERY ---------- */
  .slf-gallery-toolbar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }
  .slf-gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-auto-rows: 160px !important;
    gap: 8px !important;
  }
  .slf-gallery-grid figure[data-mobile-hide="true"] {
    display: none;
  }

  /* ---------- THINGS TO DO ---------- */
  .slf-todo-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* ---------- FINDING US ---------- */
  .slf-finding-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .slf-finding-map {
    min-height: 360px !important;
  }
  .slf-finding-travel li {
    padding: 12px 0 !important;
  }

  /* ---------- FAQ ---------- */
  .slf-faq-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* ---------- CONTACT ---------- */
  .slf-contact-grid {
    grid-template-columns: 1fr !important;
    gap: 36px !important;
  }
  .slf-contact-grid .slf-contact-2col {
    grid-template-columns: 1fr !important;
  }
  .slf-contact-cottage {
    flex-wrap: wrap !important;
  }
  .slf-contact-cottage button {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 0;
  }
  .slf-detailrow {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }

  /* ---------- FOOTER ---------- */
  footer.slf-footer {
    padding: 32px 20px !important;
  }
  footer.slf-footer > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
    text-align: left !important;
  }
  footer.slf-footer .slf-footer-links {
    flex-wrap: wrap;
    gap: 14px !important;
  }

  /* ---------- BOOKING MODAL ---------- */
  .slf-modal-overlay {
    padding: 0 !important;
  }
  .slf-modal-shell {
    max-width: 100% !important;
    max-height: 100vh !important;
    height: 100vh !important;
    width: 100vw !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  /* Header: stack the eyebrow + close, hide the long step labels (we have the eyebrow + footer total) */
  .slf-modal-shell > header {
    padding: 14px 18px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }
  .slf-modal-shell > header > .eyebrow {
    flex: 1 1 auto;
    font-size: 11px !important;
    letter-spacing: 0.18em !important;
    line-height: 1.4 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .slf-modal-shell > header > div {
    gap: 8px !important;
    flex-shrink: 0 !important;
  }
  /* Hide the inline step list on phone — too wide */
  .slf-modal-shell > header > div > div {
    display: none !important;
  }
  /* Make the close button tap-friendly */
  .slf-modal-shell > header button[aria-label="Close"] {
    width: 40px !important;
    height: 40px !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: 8px !important;
    font-size: 22px !important;
    color: var(--fg) !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--bg) !important;
  }
  .slf-modal-body {
    padding: 24px 20px !important;
  }
  .slf-modal-cottages {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .slf-modal-months {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .slf-modal-footer {
    padding: 14px 18px !important;
    flex-wrap: wrap;
    gap: 10px !important;
  }
  .slf-modal-footer .slf-modal-total {
    width: 100%;
  }
  .slf-modal-footer > div:last-child {
    width: 100%;
    display: flex;
    gap: 10px;
  }
  .slf-modal-footer > div:last-child > * {
    flex: 1;
  }

  /* ---------- TWEAKS PANEL: hide on mobile ---------- */
  .twk-panel { display: none !important; }
}

/* === Tablet adjustments (721–1024) === */
@media (min-width: 721px) and (max-width: 1024px) {
  .slf-cottage-amenities { grid-template-columns: repeat(2, 1fr) !important; }
  .slf-todo-grid         { grid-template-columns: repeat(2, 1fr) !important; }
  .slf-gallery-grid      { grid-template-columns: repeat(3, 1fr) !important; }
  .slf-finding-grid      { grid-template-columns: 1fr !important; }
  .slf-contact-grid      { grid-template-columns: 1fr !important; }
  .slf-cottage-body      { grid-template-columns: 1fr !important; }
}

/* Always: hide nav burger on desktop */
@media (min-width: 721px) {
  .slf-nav-burger { display: none !important; }
}

/* No-tap-flash on mobile */
* { -webkit-tap-highlight-color: rgba(0,0,0,0); }

/* Image fluid */
img { max-width: 100%; }

/* Iframe fluid by default */
iframe { max-width: 100%; }
