/* css-content-card.css — styles that only matter when one of these sections is on the page:
 * cards-branches, cards-specials, cards-team, cards-testimonials.
 * Linked from each of them (see the first line of the section file); theme.css
 * holds the common styles. */

.cards--on-ground { --cards-ink-default: #fff; color: var(--cards-ink, var(--cards-ink-default)); }

.cards--full { display: flex; align-items: center; min-height: 100svh; }

.cards--full > .container { width: 100%; }

.cards__title { margin: 0; color: inherit; font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); }

.cards__sub { max-width: 48ch; margin: 0.6rem 0 0; opacity: 0.85; line-height: 1.6; }

.cards--center .cards__title,
.cards--center .cards__sub { text-align: center; margin-inline: auto; }

.cards__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: clamp(1.5rem, 4vw, 2.5rem) 0 0;
  padding: 0;
  list-style: none;
}

.cards--cols-1 .cards__grid { grid-template-columns: minmax(0, 1fr); max-width: 44rem; margin-inline: auto; }

.cards--cols-2 .cards__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cards--cols-4 .cards__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 63.99rem) {
  .cards--cols-3 .cards__grid,
    .cards--cols-4 .cards__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
  .cards__grid,
    .cards--cols-2 .cards__grid,
    .cards--cols-3 .cards__grid,
    .cards--cols-4 .cards__grid { grid-template-columns: minmax(0, 1fr); }
}
.card-x {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
}

.card-x__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-3, #eee); }

.card-x__media img { display: block; width: 100%; height: 100%; object-fit: cover; }

.card-x__media--ph { display: flex; align-items: center; justify-content: center; color: var(--muted); }

.card-x__body { flex: 1; padding: 1rem 1.1rem; text-align: center; }

.card-x__title { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: inherit; }

.card-x__title a { color: inherit; text-decoration: none; }

.card-x__subtitle { margin: 0.25rem 0 0; font-size: 0.85rem; font-weight: 600; color: var(--muted); }

.card-x__text { margin: 0.6rem 0 0; font-size: 0.9rem; line-height: 1.55; color: var(--ink-soft, var(--muted)); }

.card-x__chip {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.12rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-x__chip--open { background: color-mix(in srgb, #1f9d55 14%, var(--surface)); color: #1f7a45; }

.card-x__chip--closed { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }

.card-x__foot {
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--surface-2, var(--surface));
  font-size: 0.85rem;
  text-align: center;
}

.card-x__foot p { margin: 0 0 0.2rem; }

.card-x__foot a { color: var(--accent); font-weight: 600; }

/* Darker than --accent-ink: small text on the tinted card foot measured 3.68:1
 * (needs 4.5:1) with a mid-green accent. Underlined so it reads as a link. */
.card-x__link { display: inline-block; margin-top: 0.15rem; color: color-mix(in srgb, var(--accent) 50%, #000); text-decoration: underline; text-underline-offset: 0.2em; }

/* Team: a round portrait above the name. */
.card-x--team .card-x__media { width: 7.5rem; height: 7.5rem; aspect-ratio: 1; margin: 1.4rem auto 0; border-radius: 50%; }

/* Today's special: the photo beside the text. */
.card-x--specials { flex-direction: row; }

.card-x--specials .card-x__media { flex: 0 0 38%; aspect-ratio: auto; min-height: 8.5rem; }

.card-x--specials .card-x__body { text-align: start; }

.card-x--specials .card-x__subtitle { color: var(--accent); font-size: 0.95rem; font-weight: 700; }

.card-x--specials .card-x__text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Testimonial: a round photo beside the quote, on the section's own ground. */
.card-x--testimonials {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 0;
  background: transparent;
  color: inherit;
}

.card-x--testimonials .card-x__media { flex: 0 0 5.5rem; width: 5.5rem; height: 5.5rem; aspect-ratio: 1; border-radius: 50%; }

.card-x--testimonials .card-x__body { padding: 0; text-align: start; }

.card-x--testimonials .card-x__subtitle { color: inherit; opacity: 0.75; }

.card-x--testimonials .card-x__text { font-size: 1rem; font-style: italic; color: inherit; opacity: 0.92; }

/* ---- Content cards as a carousel ------------------------------------------------
 * Layout "Carousel" (sections/cards-*): the grid becomes one sideways track that
 * swipes and snaps — as many cards across as the Columns setting, one and a
 * peek of the next on a phone. Round arrows beside the title when it overflows
 * (theme.js / home-sections.js "Card carousels"). Branch cards carry a photo on
 * top in this layout like any other. */
.cards--carousel .container { position: relative; }

.cards--carousel .cards__grid {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
  max-width: none;
}

.cards--carousel .cards__grid::-webkit-scrollbar { display: none; }

.cards--carousel .cards__grid > .card-x {
  flex: 0 0 calc((100% - (var(--cards-n, 3) - 1) * 1rem) / var(--cards-n, 3));
  scroll-snap-align: start;
}

.cards--carousel.cards--cols-1 { --cards-n: 1; }

.cards--carousel.cards--cols-2 { --cards-n: 2; }

.cards--carousel.cards--cols-3 { --cards-n: 3; }

.cards--carousel.cards--cols-4 { --cards-n: 4; }

@media (max-width: 63.99rem) {
  .cards--carousel.cards--cols-3,
    .cards--carousel.cards--cols-4 { --cards-n: 2; }
}
@media (max-width: 40rem) {
  .cards--carousel .cards__grid { gap: 0.75rem; }
  .cards--carousel .cards__grid > .card-x { flex-basis: 84%; }
}
.cards__nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0.75rem 0 -0.5rem;
}

.cards__nav[hidden] { display: none; }

.cards__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
}

.cards__btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.cards__btn:disabled { opacity: 0.35; cursor: default; }

[dir="rtl"] .cards__btn svg { transform: scaleX(-1); }

@media (max-width: 40rem) {
  .cards__nav { display: none; }
}
