/* =========================================================
   Responsive mobile + tablet
   All sections of styles.css that need to flex go here so
   the base styles file stays simple and desktop-first.
   ========================================================= */

/* ---------- Burger button + drawer (hidden on desktop) ---------- */
.ws-nav__burger {
  display: none;
  background: transparent; border: none; cursor: pointer;
  width: 44px; height: 44px; padding: 0;
  position: relative;
  z-index: 60;
}
.ws-nav__burger span {
  display: block;
  width: 22px; height: 1.5px; background: var(--ws-gold);
  margin: 6px auto;
  transition: transform var(--ws-dur) var(--ws-ease),
              opacity var(--ws-dur) var(--ws-ease);
}
.ws-nav__burger.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.ws-nav__burger.is-open span:nth-child(2) { opacity: 0; }
.ws-nav__burger.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.ws-nav__drawer {
  position: fixed; inset: 0;
  width: 100vw;
  overflow: hidden;
  background: rgba(5, 15, 34, 0.6);
  z-index: 49;
  opacity: 0; pointer-events: none;
  transition: opacity var(--ws-dur) var(--ws-ease);
}
.ws-nav__drawer.is-open { opacity: 1; pointer-events: auto; }
.ws-nav__drawer-inner {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(360px, 88vw);
  box-sizing: border-box;
  background: var(--ws-navy);
  border-left: 1px solid var(--ws-rule-navy);
  padding: 100px 28px 28px;
  display: flex; flex-direction: column; gap: 6px;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform var(--ws-dur-slow) var(--ws-ease-out);
}
.ws-nav__drawer.is-open .ws-nav__drawer-inner {
  transform: translateX(0);
  visibility: visible;
}
.ws-nav__drawer-link {
  background: transparent; border: none;
  text-align: left;
  padding: 16px 0;
  font-family: var(--ws-sans);
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ws-white-text);
  font-weight: 500;
  border-bottom: 1px solid var(--ws-rule-navy);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--ws-dur) var(--ws-ease);
}
.ws-nav__drawer-link.is-active,
.ws-nav__drawer-link:hover { color: var(--ws-gold); }

/* ---------- Tablet (≤1024px) ---------- */
@media (max-width: 1024px) {
  :root {
    --ws-nav-h: 72px;
    --ws-gutter: 24px;
  }
  .ws-container { padding: 0 24px; }
  .ws-section { padding: 72px 0; }

  /* Stack two-column layouts */
  .ws-twocol { grid-template-columns: 1fr; gap: 48px; }
  .ws-occasion-grid { grid-template-columns: 1fr; }
  .ws-occasion-card {
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
  }
  .ws-doorstep-gallery__item { flex-basis: min(29vw, 190px); }

  /* 4-col → 2-col */
  .ws-benefits { grid-template-columns: 1fr 1fr; gap: 32px 0; }
  .ws-benefit { padding: 0 20px; }
  .ws-benefit:nth-child(2n) { border-right: none; }

  /* 3-col rooms → 2-col */
  .ws-rooms { grid-template-columns: 1fr 1fr; }
  .ws-book-info-grid { grid-template-columns: 1fr 1fr; }
  .ws-contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 42px;
  }
  .ws-contact-grid > :last-child {
    grid-column: 1 / -1;
  }

  /* Gallery: 3-col → 2-col */
  .ws-gallery-grid { grid-template-columns: 1fr 1fr; }

  /* Things to enjoy: 5-col → 2-col */
  .ws-things-grid { grid-template-columns: 1fr 1fr; gap: 32px 0; }
  .ws-thing { padding: 0 20px; }
  .ws-thing:nth-child(2n) { border-right: none; }

  /* Nearby places: 6-col → 3-col */
  .ws-nearby { grid-template-columns: repeat(3, 1fr); }
  .ws-nearby__item .img { width: min(100%, 170px); }

  /* Photo strip 5 → 3 */
  .ws-photo-strip { grid-template-columns: repeat(3, 1fr); }
  .ws-photo-strip > :nth-child(n+4) { display: none; }

  /* Footer: 4-col → 2-col */
  .ws-footer__cols { grid-template-columns: 1fr 1fr; gap: 32px 40px; }
  .ws-book-reservation .ws-container {
    padding-left: 24px;
    padding-right: 24px;
  }
  .ws-booking-card {
    padding: 28px 22px 24px;
  }
  .ws-booking-card .field-row--primary,
  .ws-booking-card .field-row--contact {
    grid-template-columns: 1fr 1fr;
  }
  .ws-book-planning,
  .ws-guide-layout {
    grid-template-columns: 1fr;
  }
  .ws-book-planning__links {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .ws-guide-card {
    position: static;
  }
}

/* ---------- Mobile (≤640px) ---------- */
@media (max-width: 640px) {
  :root {
    --ws-nav-h: 64px;
    --ws-gutter: 18px;
    --ws-fs-hero: clamp(36px, 11vw, 52px);
    --ws-fs-h1: clamp(28px, 8vw, 40px);
    --ws-fs-h2: clamp(24px, 7vw, 32px);
  }
  .ws-container { padding: 0 18px; }
  .ws-section { padding: 56px 0; }

  /* ----- Nav ----- */
  .ws-nav__inner { padding: 0 18px; }
  .ws-nav__links--desktop,
  .ws-nav__cta--desktop { display: none; }
  .ws-nav__burger { display: block; }
  .ws-nav__logo img { height: 40px !important; }
  .ws-nav__mobile-tagline {
    display: block;
    flex: 1 1 auto;
    max-width: 190px;
    margin: 0 12px;
    font-family: var(--ws-serif);
    font-style: italic;
    font-size: clamp(15px, 4vw, 17px);
    line-height: 1.08;
    color: var(--ws-gold);
    text-align: center;
  }

  /* ----- Hero ----- */
  .ws-hero { grid-template-columns: 1fr; min-height: auto; }
  .ws-hero--split { display: flex; flex-direction: column; }
  .ws-hero__bg { position: relative !important; left: 0 !important; right: 0 !important;
                 width: 100%; height: 220px; }
  .ws-hero--full .ws-hero__bg { position: absolute; height: 100%; }
  .ws-hero__copy { padding: 34px 18px 18px !important; max-width: 100% !important; }
  .ws-hero--full .ws-hero__copy { padding: 100px 18px 80px !important; }
  .ws-home-hero {
    align-items: start;
    min-height: auto;
  }
  .ws-home-hero .ws-hero__copy {
    padding-top: 68px !important;
    padding-bottom: 48px !important;
  }
  .ws-home-hero .ws-hero__eyebrow {
    margin-bottom: 16px;
  }
  .ws-home-hero .ws-hero__title {
    margin-bottom: 6px;
  }
  .ws-home-hero__sub {
    display: none;
  }
  .ws-home-hero .ws-hero__body {
    margin-bottom: 28px;
  }
  .ws-home-hero .ws-hero__cta {
    gap: 14px;
  }
  .ws-home-about {
    padding-top: 41px;
  }
  .ws-listowel-preview-photo {
    background-position: center 52%;
  }
  .ws-hero__cta { flex-direction: column; align-items: stretch; }
  .ws-hero__cta .ws-btn { width: 100%; justify-content: center; }
  .ws-hero__title { font-size: var(--ws-fs-hero); line-height: 1.05; }
  .ws-hero__body {
    margin-bottom: 20px;
  }
  .ws-hero__copy > .ws-hero__body:last-child {
    margin-bottom: 0;
  }
  .ws-hero__title--one-line {
    white-space: normal;
    text-wrap: balance;
  }
  .ws-hero__body--one-line {
    white-space: normal;
    text-wrap: pretty;
  }
  .ws-contact-hero {
    min-height: auto;
  }
  .ws-contact-hero .ws-hero__bg {
    height: 170px;
  }
  .ws-contact-hero .ws-hero__copy {
    padding-top: 30px !important;
    padding-bottom: 18px !important;
  }
  .ws-contact-hero .ws-hero__title {
    font-size: clamp(38px, 12vw, 48px);
  }
  .ws-contact-hero .ws-hero__body {
    font-size: 15px;
    line-height: 1.6;
  }
  .ws-listowel-hero .ws-hero__bg {
    height: 300px;
    background-position: center 52%;
  }
  .ws-house-hero .ws-hero__bg {
    height: 300px;
    background-position: center 58%;
  }
  .ws-book-page-hero {
    min-height: 260px;
    display: block;
  }
  .ws-book-page-hero .ws-hero__bg {
    position: absolute !important;
    inset: 0 !important;
    height: 100%;
  }
  .ws-book-page-hero .ws-hero__copy {
    position: relative;
    padding: 62px 18px 60px !important;
  }
  .ws-book-reservation {
    padding-bottom: 0;
  }
  .ws-book-reservation .ws-container {
    padding-left: 18px;
    padding-right: 18px;
  }
  .ws-book-reservation__panel {
    margin-top: -54px;
  }
  .ws-book-hero {
    display: flex;
    flex-direction: column;
    min-height: auto;
  }
  .ws-book-hero .ws-hero__bg {
    position: relative !important;
    inset: auto !important;
    width: 100%;
    height: 300px;
    order: 1;
  }
  .ws-book-hero .ws-hero__copy {
    order: 2;
    padding-bottom: 28px !important;
  }
  .ws-book-hero > div:last-child {
    order: 3;
    width: 100%;
    padding: 0 18px 56px;
    box-sizing: border-box;
  }

  /* ----- Section openers ----- */
  .ws-opener__title { font-size: clamp(26px, 7.5vw, 36px); }

  /* ----- Grids → single column ----- */
  .ws-benefits { grid-template-columns: 1fr; gap: 36px; }
  .ws-benefit { border-right: none !important; padding: 0 12px; }
  .ws-rooms { grid-template-columns: 1fr; gap: 20px; }
  .ws-gallery-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ws-gallery-filters {
    justify-content: flex-start;
    flex-wrap: nowrap;
    margin-left: -18px;
    margin-right: -18px;
    padding: 0 18px 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .ws-gallery-filters::-webkit-scrollbar { display: none; }
  .ws-room-nav {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 12px;
    justify-items: start;
  }
  .ws-room-nav .ws-btn {
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
  }
  .ws-photo-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ws-photo-strip > :nth-child(4) { display: block; }
  .ws-photo-strip > :nth-child(n+5) { display: none; }
  .ws-occasion-grid { gap: 18px; }
  .ws-occasion-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .ws-occasion-card__image {
    min-height: 240px;
    aspect-ratio: 4 / 3;
  }
  .ws-occasion-card__copy {
    padding: 26px 22px 24px;
  }
  .ws-occasion-card h3 {
    font-size: 30px;
  }
  .ws-doorstep-gallery__controls { justify-content: flex-start; }
  .ws-doorstep-gallery__item { flex-basis: 44vw; }
  .ws-things-grid { grid-template-columns: 1fr; gap: 36px; }
  .ws-thing { border-right: none !important; padding: 0 12px; }
  .ws-nearby { grid-template-columns: 1fr 1fr; gap: 16px; }
  .ws-nearby__item .img { width: min(100%, 158px); }
  .ws-book-info-grid { grid-template-columns: 1fr; }

  /* ----- Booking widget ----- */
  .ws-booking-card {
    width: 100%;
    padding: 28px 20px 22px;
  }
  .ws-booking-card__head {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }
  .ws-booking-card__availability {
    text-align: left;
  }
  .ws-booking-card h3 { font-size: 13px; }
  .ws-booking-card .field-row,
  .ws-booking-card .field-row--primary,
  .ws-booking-card .field-row--contact {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .ws-booking-card .field-row--primary:has(.ws-date-field.is-open) {
    margin-bottom: 10px;
  }
  .ws-booking-card__actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .ws-date-backdrop {
    background: rgba(5, 15, 34, 0.48);
  }
  .ws-date-popover,
  .ws-booking-card .field-row--primary .field:nth-child(2) .ws-date-popover {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    top: auto;
    z-index: 90;
    transform: none;
    width: auto;
    max-height: min(76vh, 560px);
    overflow: auto;
    padding: 18px;
    border-radius: 8px 8px 4px 4px;
  }
  .ws-date-month { font-size: 12px; }
  .ws-date-weekdays,
  .ws-date-grid { gap: 5px; }
  .ws-book-planning {
    grid-template-columns: 1fr;
    padding: 24px 22px;
  }
  .ws-book-planning__links {
    grid-template-columns: 1fr;
  }
  .ws-guide-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .ws-guide-section {
    padding: 28px 24px;
  }
  .ws-guide-section h2 {
    font-size: 28px;
  }
  .ws-guide-card {
    position: static;
    padding: 28px 24px;
  }

  /* ----- Book page: stack hero + widget ----- */
  /* The BookPage hero uses inline grid w/ 2 cols + absolute bg. Stack it. */

  /* ----- Footer ----- */
  .ws-footer { padding-top: 48px; }
  .ws-footer__cols { grid-template-columns: 1fr 1fr; gap: 30px 24px; padding-bottom: 32px; }
  .ws-footer__cols > :nth-child(1) { grid-column: 1 / -1; order: 1; }
  .ws-footer__cols > :nth-child(2) { order: 2; }
  .ws-footer__cols > :nth-child(4) { order: 3; }
  .ws-footer__cols > :nth-child(3) { grid-column: 1 / -1; order: 4; }
  .ws-footer__cols > :nth-child(5) { grid-column: 1 / -1; order: 5; }
  .ws-footer__brand img { max-width: 200px; }
  .ws-footer__bottom {
    flex-direction: column; gap: 12px; align-items: flex-start;
    padding: 18px 0;
  }

  /* ----- CTA strip ----- */
  .ws-cta-strip { padding: 44px 0; }
  .ws-cta-strip__inner { flex-direction: column; align-items: flex-start; gap: 24px; }
  .ws-cta-strip__icon { display: none; }
  .ws-cta-strip__actions { flex-direction: column; align-items: stretch; width: 100%; gap: 14px; }
  .ws-cta-strip__actions .ws-btn { width: 100%; justify-content: center; }
  .ws-cta-strip__title { font-size: 28px; }

  /* ----- Filters (Gallery) ----- */
  .ws-gallery-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 4px;
    padding: 0 18px 8px;
  }
  .ws-filter-pill { padding: 8px 14px; font-size: 10px; }

  /* ----- House overview icons ----- */
  .ws-overview-icons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 28px;
  }

  /* ----- Buttons ----- */
  .ws-btn { padding: 14px 22px; font-size: 12px; }

  /* ----- Modals ----- */
  .ws-modal { padding: 0; align-items: stretch; }
  .ws-modal__card {
    grid-template-columns: 1fr;
    max-height: 100vh; max-width: 100vw;
    border-radius: 0;
    overflow-y: auto;
  }
  .ws-modal__photo-wrap { width: 100%; height: auto; aspect-ratio: 4 / 3; }
  .ws-modal__photo-wrap--nearby { aspect-ratio: 9 / 16; max-height: 72vh; }
  .ws-modal__photo { min-height: 0; max-height: none; object-fit: cover; }
  .ws-modal__body { padding: 32px 22px 40px; }
  .ws-modal__title { font-size: 28px; }
  .ws-modal__amenities { grid-template-columns: 1fr; }

  /* ----- Gallery viewer ----- */
  .ws-viewer { padding: 60px 12px; }
  .ws-viewer__stage { max-width: 100vw; }
  .ws-viewer__arrow {
    width: 40px; height: 40px;
  }
  .ws-viewer__arrow--prev { left: 8px; }
  .ws-viewer__arrow--next { right: 8px; }
  .ws-viewer__close { top: 12px; right: 12px; }

  /* ----- Contact page ----- */
  .ws-contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .ws-contact-grid > :last-child {
    grid-column: auto;
  }
  .ws-map-embed {
    min-height: 320px;
  }
  .ws-section .ws-container > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  /* ----- Hide decorative photo column on book page on mobile ----- */
  /* The 3-up row on Book page (About / Need Help / Door photo); door tile gets hidden,
     About + Need Help stack. */

  /* ----- Toast ----- */
  .ws-toast { left: 16px; right: 16px; bottom: 16px; }
}

@media (max-width: 640px) and (orientation: portrait) {
  .ws-hero__bg {
    height: 96px;
  }
  .ws-contact-hero .ws-hero__bg {
    height: 88px;
  }
  .ws-listowel-hero .ws-hero__bg {
    height: 150px;
  }
  .ws-house-hero .ws-hero__bg {
    height: 150px;
    background-position: center 58%;
  }
}

/* ---------- Very small phones (≤380px) ---------- */
@media (max-width: 380px) {
  .ws-gallery-grid { grid-template-columns: 1fr; }
  .ws-nearby { grid-template-columns: 1fr; }
  .ws-nearby__item .img { width: min(100%, 180px); }
  .ws-photo-strip { grid-template-columns: 1fr 1fr; }
  .ws-photo-strip > :nth-child(n+5) { display: none; }
}
