/* condo-booking — minimal custom styles on top of PicoCSS */

/* ===== Brand palette (from logo) ===== */
:root {
  --brand-teal:      #2da6bc;   /* turtle shell / wave teal */
  --brand-teal-dark: #1e8a9e;   /* hover / active */
  --brand-navy:      #1e3a5f;   /* logo wordmark */
  --sand-50:         #fdfaf5;   /* page background */
  --sand-100:        #f7f0e0;   /* card / section tint */
  --sand-200:        #e8d9c0;   /* borders, dividers */
  --brand-amber:     #f59e0b;   /* pins, hero badge */
  --color-error:     #b03030;   /* error flash */
  --color-success-bg:#e6f7f9;   /* success flash bg */
}

/* ===== Accessibility ===== */
:focus-visible {
  outline: 2px solid var(--brand-teal);
  outline-offset: 3px;
  border-radius: 3px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 1rem; top: 1rem;
  width: auto; height: auto;
  z-index: 9999;
  background: var(--brand-navy);
  color: #fff;
  padding: .4rem .9rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}

/* ===== Reusable component classes ===== */
/* Section heading — replaces repeated inline border-bottom style */
.section-heading {
  border-bottom: 2px solid var(--brand-teal);
  padding-bottom: .5rem;
  margin-bottom: 1.5rem;
  font-size: 1.35rem;
}
/* Property card chrome — replaces repeated inline box-shadow/border style */
.prop-card {
  background: var(--pico-card-background-color);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
  border: 1px solid var(--pico-muted-border-color);
}

/* Override PicoCSS light-theme primary to brand teal */
[data-theme="light"],
:root:not([data-theme="dark"]) {
  --pico-primary:            var(--brand-teal);
  --pico-primary-hover:      var(--brand-teal-dark);
  --pico-primary-focus:      rgba(45, 166, 188, 0.25);
  --pico-primary-inverse:    #ffffff;
  --pico-background-color:   var(--sand-50);
  --pico-card-background-color: #ffffff;
}

.flashes { margin: 1rem 0; }
.flash { padding: 0.75rem 1rem; border-radius: 0.4rem; margin-bottom: 0.5rem; }
.flash-ok    { background: var(--color-success-bg); border-left: 4px solid var(--brand-teal); }
.flash-error { background: #fbeaea; border-left: 4px solid var(--color-error); }

/* Photo grid — public + admin */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; height: 180px; object-fit: cover; border-radius: 0.4rem; box-shadow: 0 2px 4px rgba(0,0,0,0.06); }
.photo-grid figcaption { font-size: 0.85rem; color: var(--pico-muted-color); margin-top: 0.25rem; }

/* Gorgeous Photo Collage Layout (Airbnb-style) */
.collage-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.5rem;
  border-radius: 12px;
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.collage-hero img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}
.collage-thumbs {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 0.5rem;
}
.collage-thumb img {
  width: 100%;
  height: 196px;
  object-fit: cover;
  display: block;
}
@media (max-width: 768px) {
  .collage-container {
    grid-template-columns: 1fr;
  }
  .collage-thumbs {
    display: none;
  }
  .collage-hero img {
    height: 250px;
  }
}
.more-photos {
  border: none !important;
  text-align: center;
  margin-top: -1rem;
  margin-bottom: 2rem;
}
.more-photos summary {
  display: inline-block;
  background-color: var(--pico-secondary-hover-background);
  color: var(--pico-secondary-inverse);
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  list-style: none; /* Hide standard detail arrow */
}
.more-photos summary::-webkit-details-marker {
  display: none;
}

/* Admin photo card drag-and-drop */
.photo-card { position: relative; cursor: default; }
.photo-card.dragging { opacity: 0.4; }
.drag-handle {
  position: absolute; top: 4px; left: 4px;
  background: rgba(0,0,0,.45); color: #fff;
  border-radius: 4px; padding: 2px 5px;
  cursor: grab; font-size: 1rem; line-height: 1;
  user-select: none;
}
.hero-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--brand-amber); color: #fff;
  border-radius: 4px; padding: 2px 6px;
  font-size: 0.75rem; font-weight: 600;
}

/* Amenities list — public landing */
.amenities-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem 1.5rem;
  margin: 1rem 0 2rem;
}
.amenities-grid li::before { content: none; }
.amenities-grid li p { display: inline; margin: 0; }

/* FAQ details/summary */
details { border-bottom: 1px solid var(--pico-muted-border-color); padding: 0.5rem 0; }
details summary { cursor: pointer; font-weight: 600; padding: 0.25rem 0; }
details p { margin: 0.5rem 0 0.25rem 0; color: var(--pico-muted-color); }
details > p { animation: faq-open .2s ease; }
details + details { margin-top: .25rem; }
@keyframes faq-open {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* Premium Split Layout */
.split-layout {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 2.5rem;
  margin-top: 2.5rem;
  margin-bottom: 4rem;
}
.sidebar-sticky {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-self: start;
}
@media (max-width: 992px) {
  .split-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .sidebar-sticky {
    position: static;
    order: -1; /* Show booking CTA before description on tablets/phones */
  }
}

/* Rotating Hero Carousel */
/* ===== Premium Embla Carousel (Airbnb + Apple style) ===== */
.embla {
  position: relative;
  width: 100%;
  margin: 1.5rem 0;
}
.embla__viewport {
  position: relative;
  width: 100%;
  height: 480px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.embla__container {
  display: flex;
  height: 100%;
  border-radius: 12px;
}
.embla__slide {
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
  will-change: opacity;
}
.embla__slide:first-child,
.embla__slide.is-selected {
  opacity: 1;
  pointer-events: auto;
  z-index: 20;
}
.embla__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
}
.embla__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
  color: #ffffff;
  padding: 2rem 2rem 1.5rem;
  z-index: 9;
}
.embla__caption p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* Controls */
.embla__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  padding: 0;
}
.embla__btn:active {
  background: #ffffff;
  transform: translateY(-50%) scale(0.95);
}
.embla__btn:hover {
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  transform: translateY(-50%) scale(1.1);
}
.embla__btn--prev { left: 1rem; }
.embla__btn--next { right: 1rem; }

/* Indicators */
.embla__dots {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.3rem;
  z-index: 15;
  max-width: 90%;
  overflow: hidden;
  padding: 0.5rem 0;
  justify-content: center;
}
.embla__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  flex-shrink: 0;
}
.embla__dot::after {
  content: '';
  position: absolute;
  inset: -6px;
}
.embla__dot--active {
  background: #ffffff;
  width: 16px;
  border-radius: 3px;
}
.embla__dot:hover {
  background: rgba(255,255,255,0.8);
}

/* Pause on hover (desktop) */
@media (hover: hover) {
  .embla:hover [data-embla-autoplay] {
    --embla-autoplay-paused: true;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .embla__slide {
    transition: none;
    opacity: 1;
    transform: scale(1);
    filter: none;
  }
  .embla__slide.is-selected {
    opacity: 1;
    transform: scale(1);
  }
  .embla__btn, .embla__dot {
    transition: none;
  }
}

/* ===== Markdown editor (admin) ===== */
.md-editor { margin-bottom: 0.5rem; }
.md-editor-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 2px solid var(--pico-muted-border-color);
}
.md-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.3rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--pico-muted-color);
  border-radius: 0;
  width: auto;
}
.md-tab-active {
  color: var(--brand-teal);
  border-bottom-color: var(--brand-teal);
  font-weight: 600;
}
.md-preview {
  min-height: 6rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-top: none;
  border-radius: 0 0 6px 6px;
  background: var(--pico-background-color);
  font-size: 0.95rem;
  line-height: 1.6;
}
.md-preview p:last-child { margin-bottom: 0; }

/* ===== Markdown rendered content (public) ===== */
.md-content p { margin-bottom: 1rem; }
.md-content p:last-child { margin-bottom: 0; }
.md-content ul, .md-content ol { margin: 0.5rem 0 1rem 1.5rem; }
.md-content h2, .md-content h3, .md-content h4 { margin-top: 1.5rem; }

/* ===== Mobile optimisations ===== */

/* Prevent iOS Safari auto-zoom on form inputs (triggers when font-size < 16px) */
input, select, textarea { font-size: 1rem; }

@media (max-width: 768px) {
  /* Embla carousel responsive */
  .embla__viewport { height: auto; aspect-ratio: 4 / 3; }
  .embla__btn { width: 36px; height: 36px; font-size: 0.9rem; }
  .embla__btn--prev { left: 0.5rem; }
  .embla__btn--next { right: 0.5rem; }
  .embla__caption { padding: 1.25rem 1rem 1rem; }
  .embla__caption p { font-size: 0.95rem; }
  .embla__dots { bottom: 0.75rem; gap: 0.4rem; }
  .embla__dot { width: 6px; height: 6px; }
  .embla__dot--active { width: 18px; }
}

@media (max-width: 640px) {
  /* Nav: hide secondary text links; logo already links home, CTA button is the key action */
  .nav-hide-mobile { display: none !important; }

  /* Intro section: drop avatar on small screens to give text room */
  .intro-avatar { display: none; }

  /* Form rows: collapse 2-column grids to single column */
  .form-row { grid-template-columns: 1fr !important; }

  /* Photo grid: tighter min-width for phones */
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .photo-grid img { height: 140px; }

  /* Amenities: 2 tight columns still readable on phone */
  .amenities-grid { grid-template-columns: 1fr 1fr; gap: 0.4rem 1rem; }
}

/* ===== Testimonial pull-quote ===== */
.testimonial-card {
  position: relative;
  padding-left: 2.5rem !important;
}
.testimonial-card::before {
  content: '\201C';
  position: absolute;
  left: .75rem;
  top: -.1rem;
  font-size: 3.5rem;
  line-height: 1;
  color: var(--brand-teal);
  opacity: .3;
  font-family: Georgia, serif;
  pointer-events: none;
}

/* ===== Hero carousel name overlay ===== */
.carousel-hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 5;
  padding: 3rem 1.75rem 1.5rem;
  pointer-events: none;
  border-radius: 0 0 12px 12px;
}
.carousel-hero-overlay h1 {
  color: #fff;
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
  line-height: 1.15;
}
.carousel-hero-overlay p {
  color: rgba(255,255,255,.82);
  margin: .3rem 0 0;
  font-size: 1rem;
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
}
/* Push dot indicators above the overlay text on mobile */
@media (max-width: 768px) {
  .carousel-hero-overlay { padding: 2rem 1rem 1.25rem; }
  .carousel-indicators { bottom: 1.5rem; }
}

/* ===== Calendar grid ===== */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: var(--pico-card-background-color); border-radius: 0.3rem; font-size: 0.85rem;
}
.calendar-day[data-status="available"] { background: #e0f5f8; }
.calendar-day[data-status="pending"]   { background: #fff3cd; }
.calendar-day[data-status="booked"]    { background: #f8d7da; }
.calendar-day[data-status="blocked"]   { background: #d7d7d7; }
.calendar-day[data-status="turnover"]  { background: #fde2cc; }
