/* ==========================================================================
   Components — buttons, cards, accordions, modals, marquee, badges, forms
   ========================================================================== */

/* --- Buttons ---------------------------------------------------------- */

.ca-btn {
  display: inline-block;
  border: 0;
  border-radius: var(--ca-r-pill);
  padding: 14px 26px;
  font-family: var(--ca-font-body);
  font-size: var(--ca-text-base);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background var(--ca-dur-fast) var(--ca-ease),
              color var(--ca-dur-fast) var(--ca-ease);
}

.ca-btn--primary {
  background: var(--ca-orange);
  color: var(--ca-cream);
}
.ca-btn--primary:hover { background: var(--ca-orange-dark); color: var(--ca-cream); }

.ca-btn--outline {
  background: none;
  color: var(--ca-ink);
  border: 2px solid var(--ca-ink);
  padding: 12px 24px;
}
.ca-btn--outline:hover { background: var(--ca-tint-hover); color: var(--ca-ink); }

.ca-btn--sm { padding: 10px 20px; font-size: 14px; }
.ca-btn--sm.ca-btn--outline { padding: 8px 18px; }
.ca-btn--block { display: block; width: 100%; }

.ca-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Cards ------------------------------------------------------------ */

.ca-card {
  background: var(--ca-white);
  border: 1px solid var(--ca-hairline);
  border-radius: var(--ca-r-lg);
  padding: var(--ca-card-pad);
  box-shadow: var(--ca-shadow-md);
}

.ca-card--flat { box-shadow: none; }
.ca-card--sm { border-radius: var(--ca-r-md); padding: 18px; }

/* --- Badges ----------------------------------------------------------- */

.ca-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ca-font-mono);
  font-size: var(--ca-text-xs);
  letter-spacing: var(--ca-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ca-teal);
  border: 1px solid var(--ca-teal-line);
  background: var(--ca-teal-tint);
  padding: 6px 12px;
  border-radius: var(--ca-r-pill);
}

.ca-badge__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: ca-twinkle 1.6s ease-in-out infinite;
}

/* Open/Closed pill. Colour comes from a data attribute set by PHP and kept
   in sync by location.js, so a cached page still shows the right state. */
.ca-status {
  flex: none;
  font-family: var(--ca-font-mono);
  font-size: var(--ca-text-xs);
  font-weight: 700;
  color: var(--ca-cream);
  padding: 6px 12px;
  border-radius: var(--ca-r-pill);
  background: var(--ca-status-closed);
}
.ca-status[data-state="open"]   { background: var(--ca-status-open); }
.ca-status[data-state="soon"]   { background: var(--ca-status-soon); }
.ca-status[data-state="closed"] { background: var(--ca-status-closed); }

/* --- Accordion (native <details>, no JS) ------------------------------- */

.ca-accordion {
  border: 1px solid var(--ca-hairline-mid);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--ca-white);
  box-shadow: var(--ca-shadow-sm);
}

.ca-accordion__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--ca-panel-pad);
  cursor: pointer;
  color: var(--ca-ink);
  font-family: var(--ca-font-display);
  font-weight: 700;
  font-size: clamp(18px, 3vw, 24px);
  letter-spacing: var(--ca-tracking-tight);
  list-style: none;
}
.ca-accordion__summary::-webkit-details-marker { display: none; }
.ca-accordion__summary::marker { content: ""; }

.ca-accordion__title { display: flex; align-items: center; gap: 12px; }
.ca-accordion__title img { width: 36px; height: auto; }

/* The +/− affordance is drawn in CSS, so no icon font or JS is involved. */
.ca-accordion__sign {
  flex: none;
  position: relative;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--ca-hairline-str);
}
.ca-accordion__sign::before,
.ca-accordion__sign::after {
  content: "";
  position: absolute;
  inset: 50% 7px auto;
  height: 2px;
  background: var(--ca-orange);
  transform: translateY(-50%);
  transition: transform var(--ca-dur-fast) var(--ca-ease);
}
.ca-accordion__sign::after { transform: translateY(-50%) rotate(90deg); }
.ca-accordion[open] .ca-accordion__sign::after { transform: translateY(-50%) rotate(0deg); }

.ca-accordion__body { padding: 0 var(--ca-panel-pad) clamp(22px, 3vw, 28px); }

.ca-accordion--accent {
  border-color: var(--ca-orange-line);
  background: linear-gradient(180deg, var(--ca-peach), var(--ca-white));
}

/* --- Marquee (pure CSS) ------------------------------------------------ */

.ca-marquee {
  padding-block: var(--ca-section-pad);
  background: var(--ca-sand);
  border-block: 1px solid var(--ca-hairline);
  overflow: hidden;
}

.ca-marquee__label {
  text-align: center;
  font-family: var(--ca-font-mono);
  font-size: var(--ca-text-eyebrow);
  /* Mono at this size is already emphatic; bold makes it shout. */
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ca-faint-warm);
  margin-bottom: 16px;
}

.ca-marquee__track {
  display: flex;
  /*
   * Full width when static, so a single item can centre. Only the scrolling
   * variant grows to max-content — a max-content track has no spare room for
   * justify-content to distribute.
   */
  width: 100%;
  gap: 16px;
  padding-inline: 16px;
  /*
   * Only a scrolling track animates. One review has nothing to loop through,
   * so it sits centred instead of drifting for no reason.
   */
  justify-content: center;
}
.ca-marquee:hover .ca-marquee__track,
.ca-marquee:focus-within .ca-marquee__track { animation-play-state: paused; }

@keyframes ca-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ca-marquee__track {
    animation: none;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .ca-marquee__item { scroll-snap-align: start; }
}

.ca-stars {
  color: var(--ca-yellow);
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.ca-cite {
  font-family: var(--ca-font-mono);
  font-size: var(--ca-text-sm);
  color: var(--ca-faint);
  font-style: normal;
}
.ca-modal::backdrop {
  background: var(--ca-scrim);
  backdrop-filter: blur(3px);
}

.ca-modal__title { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.ca-modal__note { color: var(--ca-muted); font-size: 14.5px; line-height: 1.5; margin: 0 0 18px; }

.ca-modal__close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 34px; height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--ca-tint);
  color: var(--ca-ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.ca-modal__close:hover { background: var(--ca-tint-hover); }

.ca-modal__fallback {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ca-faint);
}

/* --- Forms ------------------------------------------------------------- */

.ca-input {
  width: 100%;
  background: var(--ca-cream);
  border: 1px solid rgba(20, 25, 43, 0.15);
  border-radius: var(--ca-r-pill);
  padding: 15px 22px;
  color: var(--ca-body);
  font-family: var(--ca-font-body);
  font-size: var(--ca-text-base);
}
.ca-input::placeholder { color: var(--ca-faint); }

.ca-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.ca-chip {
  background: var(--ca-teal-tint);
  border: 1px solid var(--ca-teal-line);
  border-radius: var(--ca-r-pill);
  padding: 8px 14px;
  color: var(--ca-teal);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ca-chip:hover { background: var(--ca-teal); color: var(--ca-cream); }

/* --- Social icons ------------------------------------------------------ */

.ca-social { display: flex; gap: 8px; flex-wrap: wrap; }
.ca-social a {
  width: 34px; height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ca-social a img { width: 100%; height: 100%; object-fit: contain; }
.ca-social--lg a { width: 42px; height: 42px; }

/* ==========================================================================
   Edge fade for horizontal scrollers

   Applied with mask-image rather than gradient overlays, so the fade works
   over whatever colour the section happens to be. An overlay would need to
   know the background; a mask does not, which matters because the review
   strip sits on sand, the events rail on warm cream and the gallery on a
   photo.
   ========================================================================== */

.ca-edge-fade,
.ca-marquee__viewport,
.ca-promos__viewport {
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 var(--ca-edge-fade),
    #000 calc(100% - var(--ca-edge-fade)),
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 var(--ca-edge-fade),
    #000 calc(100% - var(--ca-edge-fade)),
    transparent 100%
  );
}

/*
 * The location page gallery is deliberately NOT in the list above.
 *
 * The edge fade belongs on marquees, where cards run off both sides and the
 * fade signals "this continues". The gallery shows one full-bleed photo at a
 * time, so fading its left and right edges just looks like the image is
 * damaged. Its only gradient is the bottom scrim behind the caption area,
 * which is in the original design.
 */

.ca-marquee__viewport { overflow: hidden; }.ca-marquee__item {
  flex: none;
  width: min(420px, 84vw);
  background: var(--ca-white);
  border: 1px solid var(--ca-hairline);
  border-radius: var(--ca-r-md);
  padding: 18px 24px;
  box-shadow: var(--ca-shadow-sm);
}.ca-marquee__item p {
  color: var(--ca-body);
  font-size: 15.5px;
  margin: 0 0 12px;
  line-height: 1.5;
}

/*
 * The review strip was full-bleed while every other section sat inside the
 * page width, so it read as a different site. The band still spans edge to
 * edge — that is the design — but its contents now line up with everything
 * else.
 */
.ca-marquee__viewport,
.ca-promos__viewport {
  max-width: var(--ca-width);
  margin-inline: auto;
}/*
 * A column with one scrolling part, rather than two elements both capped at
 * 88vh and hoping the inner one wins.
 *
 * `min-height: 0` on the scrolling child is the bit that matters: a flex item
 * defaults to `min-height: auto`, which refuses to shrink below its content —
 * so the panel grows to fit fourteen stores, is clipped by the dialog, and
 * never scrolls. It is the classic reason a modal will not scroll.
 */
.ca-modal {
  width: min(92vw, 560px);
  max-height: min(88vh, 900px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--ca-cream);
  box-shadow: var(--ca-shadow-modal);
  overflow: hidden;
}

/*
 * The column layout applies only while the dialog is open.
 *
 * `display` on `.ca-modal` itself overrides the browser's own
 * `dialog:not([open]) { display: none }` — author styles beat the user-agent
 * stylesheet whatever the specificity — so the dialog stayed on screen with no
 * way to close it. Scoping to [open] leaves the closed state to the browser.
 */
.ca-modal[open] {
  display: flex;
  flex-direction: column;
}

.ca-modal--wide { width: min(94vw, 820px); }

.ca-modal__inner {
  flex: 1 1 auto;
  min-height: 0;
  padding: clamp(24px, 5vw, 34px);
  overflow-y: auto;
  /* Reaching the end of the list should not start scrolling the page behind. */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}.ca-modal__frame {
  width: 100%;
  height: min(62vh, 760px);
  border: 0;
  border-radius: 14px;
  background: var(--ca-white);
}

@media (max-width: 700px) {
  .ca-modal,
  .ca-modal--wide { width: 96vw; }
}

.ca-mk-picker__label { font-size: clamp(12px, 1.3vw, 14px); }


/* A track only animates when there is more than one thing in it. */
.ca-marquee__track.is-scrolling {
  width: max-content;
  justify-content: flex-start;
  animation: ca-marquee calc(var(--ca-marquee-items, 8) * var(--ca-marquee-per-item)) linear infinite;
}
