/* Cards, shop, category and quote-band styles (SPEC §4.1-4.3, §5 #4). Loaded on the homepage and every WooCommerce
   page (shelf cards, related products). Owner: shop builder. Builds on base.css tokens; see theme/BUILD-CONTRACT.md.
   Radius 0 on photos and cards, 1px hairlines, no shadows, no gradients. */

/* ---------- card grid: 2 / 3 at 1024 / 4 at 1280; gaps 12/24 mobile, 24/48 from 600 ---------- */
/* .cards is ours; ul.products also covers WooCommerce's own loops (related products) and beats its float layout. */
.cards, .n71 ul.products {
  --card-gap: 24px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; row-gap: 0;
  margin: 0; padding: 0; list-style: none; clear: none;
}
.n71 ul.products::before, .n71 ul.products::after { content: none; display: none; }
@media (min-width: 600px) { .cards, .n71 ul.products { --card-gap: 48px; column-gap: var(--gap); } }
@media (min-width: 1024px) { .cards, .n71 ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .cards, .n71 ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- card (§4.1): 5 subgrid rows = media / title / line / price / action, so prices align across a row ---------- */
.card {
  position: relative; display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0;
  align-content: start; min-width: 0; margin: 0 0 var(--card-gap, 48px); padding: 0;
}
.n71 ul.products > li.card { float: none; width: auto; margin: 0 0 var(--card-gap, 48px); text-align: start; }
.card__link { grid-row: span 5; display: grid; grid-template-rows: subgrid; row-gap: 0; min-width: 0; color: inherit; text-decoration: none; }
.card--out .card__link { grid-row: span 4; }   /* action outside the link (Add to cart, WhatsApp) takes row 5 */
.card__link:focus-visible { outline-offset: 4px; }

.card__media { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--paper-2); border-radius: var(--r-0); }
.card__media img { width: 100%; height: 100%; margin: 0; object-fit: cover; transition: transform 400ms var(--ease); }
.card__badge {
  position: absolute; top: 12px; inset-inline-start: 12px; padding: 4px 8px;
  background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-1);
  font: 600 11px/1.3 var(--f-ui); letter-spacing: .08em; text-transform: uppercase;
}
html[lang="ar"] .card__badge { font: 500 12px/1.4 var(--f-ui); }

.card__title { position: relative; justify-self: start; align-self: start; margin-top: 14px; }
.card__title::after {   /* hover underline grows from the reading start (§5 #4) */
  content: ""; position: absolute; inset-inline: 0; bottom: -2px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left center; transition: transform 240ms var(--ease);
}
html[dir="rtl"] .card__title::after { transform-origin: right center; }
.card__line { margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__price { align-self: start; margin-top: 8px; font: 500 15px/1.4 var(--f-ui); font-variant-numeric: tabular-nums; }
.card__act { justify-self: start; align-self: start; margin-top: 12px; font: 500 14px/1.4 var(--f-ui); }
.card__btn.btn { min-height: 44px; padding: 0 16px; font-size: 14px; }   /* the quiet ghost "Add to cart", 44px in cards (SPEC §1.4) */
@media (max-width: 599px) {
  /* two narrow columns: let the descriptor take a second line instead of cutting it after a few words */
  .card__line { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .card__btn.btn { padding: 0 12px; }
}
@media (hover: hover) {
  .card__link:hover .card__media img { transform: scale(1.03); }
  .card__link:hover .card__title::after { transform: scaleX(1); }
  .card__link:hover .card__act { text-decoration-thickness: 2px; }
}

/* Eid bulk card: closes the grid, 2 columns wide, text only on a paper-2 plate */
.card--bulk {
  grid-column: span 2; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 16px;
  padding: clamp(24px, 3vw, 40px); background: var(--paper-2);
}
.card__q { max-width: 22ch; font: italic 400 22px/1.35 var(--f-text); }
html[lang="ar"] .card__q { font: 500 24px/1.6 var(--f-text); }
.card__bulk-cta { font: 500 15px/1.4 var(--f-ui); }

/* ---------- chapter header (§4.2 shop, §4.3 categories) ---------- */
.chapter { padding-block: clamp(20px, 3vw, 32px) clamp(32px, 5vw, 56px); }
.chapter__in { display: grid; row-gap: 12px; align-items: end; }
.chapter .crumbs { margin-bottom: clamp(16px, 4vw, 40px); }
.ground--sand .crumbs, .ground--sand .crumbs a { color: var(--ink-2); }
.chapter__line { max-width: 46ch; font-size: 17px; line-height: 1.6; color: var(--ink-2); }
html[lang="ar"] .chapter__line { font-size: 16px; line-height: 1.8; }
.chapter__tabs { margin-top: clamp(12px, 3vw, 28px); }
@media (max-width: 1023px) {
  .chapter__tabs { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }   /* scroll edge to edge */
}
@media (max-width: 599px) {
  .chapter__line { font-size: 16px; }
}
@media (min-width: 1024px) {
  .chapter__in { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
  .chapter__in > * { grid-column: 1 / -1; }
  .chapter__in > .chapter__h1 { grid-column: 1 / span 7; }
  .chapter__in > .chapter__line { grid-column: 8 / -1; padding-bottom: .6em; }   /* sits on the H1's last line */
}

/* ---------- archive layout ---------- */
.archive__crumbs { padding-block: 16px; }
.archive--weddings .chapter { padding-bottom: 0; }   /* the weddings band brings its own section padding (the newborn shelf trims its own top: .shelf--category) */
.archive__quotes { padding-top: var(--section); }
.archive__quotes > * { max-width: 760px; }
.archive__quotes .cards { max-width: none; margin-top: 24px; }
.archive__quotes-title { margin-bottom: 8px; }
.archive .empty-state { padding-block: 24px 48px; }

/* ---------- quote-only band at the end of the shop page (§4.2) ---------- */
.qband { margin-top: clamp(24px, 4vw, 48px); }
.qband__in { display: grid; gap: 32px; padding-top: clamp(40px, 5vw, 56px); border-top: 1px solid var(--ink); }
.qband__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 62%; background: var(--paper-2); }
.qband__copy { display: grid; gap: 16px; align-content: start; min-width: 0; }
.qband__copy .t-body { max-width: 52ch; }
@media (min-width: 1024px) {
  .qband__in { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }
  .qband__img { grid-column: 1 / span 4; aspect-ratio: 4 / 5; }
  .qband__copy { grid-column: 6 / -1; }
}

/* plain quote list: title + descriptor, "Quote on WhatsApp" at the end; hairlines between rows */
.qlist { margin-top: 8px; border-top: 1px solid var(--line); }
.qlist__row { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; min-height: 72px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.qlist__text { display: grid; gap: 2px; min-width: 0; }
.qlist__line { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.qlist__act { flex: none; display: inline-flex; align-items: center; min-height: 44px; font: 500 15px/1.4 var(--f-ui); }
@media (max-width: 599px) {
  .qlist__row { flex-direction: column; align-items: flex-start; }
}
