/* ==========================================================================
   Thota Vaikuntam — storefront add-on (shop, cart, checkout, order, contact, legal)
   Linked only on those pages; builds on the tokens in main.css. No new colours.
   ========================================================================== */

/* ------------------------------------------------------------ layout helpers */
.container--narrow { max-width: calc(880px + 2 * var(--gutter)); }
.breadcrumb { font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); margin-bottom: 30px; }
/* the crumb link is underlined: same grey as the current page beside it, so colour alone would not mark it */
.breadcrumb a { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.breadcrumb a:hover { color: var(--ink); }

/* ------------------------------------------------------------ live price / availability */
.price { font-size: 1.65rem; letter-spacing: .04em; color: var(--ink); }
.price--lg { font-size: 2.1rem; }
.price:empty::before, .avail:empty::before { content: "\00a0"; }
.avail { font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); }
.avail.is-low { color: var(--red); }
.avail.is-out { color: var(--red); }
.avail.is-error { color: var(--grey-2); text-transform: none; letter-spacing: 0; }
.product-card__live, .product__live { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 0 0 1.2em; }
.product-card__live { margin-bottom: 12px; }   /* = meta → price, and year → button on /publications/ */

/* ------------------------------------------------------------ shop index */
.shop-intro { margin-bottom: var(--gap-y); }
/* Fixed square image window so the captions of every card sit on one baseline; the print is
   letterboxed (object-fit: contain) and centred in the window both ways, on the page white with no
   grey behind it (owner 2026-10-05: landscapes resting on the bottom edge broke the symmetry).
   Square rather than 4:5 since 2026-09-16: ten of the fourteen prints are landscape or panoramic. */
.product-card__media { display: block; aspect-ratio: 1 / 1; overflow: hidden; }
.product-card__media picture { display: block; width: 100%; height: 100%; }
.product-card__media img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 50%; }
/* one card per row: no neighbour to align captions with, so each print takes its own height
   instead of floating in white bands (a panorama would otherwise sit in ~150px of blank above and below) */
@media (max-width: 460px) {
  .product-card__media { aspect-ratio: auto; }
  .product-card__media picture, .product-card__media img { height: auto; }
}
/* two or three per row: each row's image area is as tall as its tallest print (a portrait caps it at a
   square), so a row of landscapes does not float in tall white bands; every print stays centred in it and
   the captions of a row share one line. Card = two rows of the shop grid (subgrid): image, then text. The
   grid's own row gap moves into the text block so the 50px between rows stays exact. Without subgrid or
   container units the square windows above apply. */
@supports (grid-template-rows: subgrid) and (width: 1cqw) {
  @media (min-width: 461px) {
    .shop-grid { row-gap: 0; margin-bottom: calc(-1 * var(--gap-y)); }
    .product-card { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
    .product-card__media { aspect-ratio: auto; container-type: inline-size; display: flex; align-items: center; justify-content: center; }
    .product-card__media picture { height: auto; }
    .product-card__media img { height: auto; max-height: 100cqw; }
    .product-card__body { padding-bottom: var(--gap-y); }
  }
}
.product-card__placeholder { width: 100%; height: 100%; background: var(--bg-soft); }
/* a short last row is centred (owner 2026-10-05): the grid is laid out in half-columns (6 at three per
   row, 4 at two per row) and every card spans two, so the leftover cards can start half a card in.
   Card widths and the 40px gutters are exactly those of the plain three- and two-column grids. */
@media (min-width: 769px) {
  .grid.shop-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .shop-grid > .product-card { grid-column: span 2; }
  .shop-grid > .product-card:nth-child(3n+1):nth-last-child(2) { grid-column: 2 / span 2; }   /* two left over */
  .shop-grid > .product-card:nth-child(3n+1):last-child { grid-column: 3 / span 2; }          /* one left over */
}
@media (min-width: 461px) and (max-width: 768px) {
  .grid.shop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shop-grid > .product-card { grid-column: span 2; }
  .shop-grid > .product-card:nth-child(2n+1):last-child { grid-column: 2 / span 2; }          /* one left over */
}
.product-card__note { font-size: var(--fs-meta); line-height: 2rem; color: var(--grey-1); margin: -4px 0 12px; }
.product-card__body { padding-top: var(--cap-gap); display: flex; flex-direction: column; container-type: inline-size; }
.product-card__body > .product-card__live { margin-top: auto; }   /* price and buttons line up across a row even when one caption runs to two lines */
.product-card__title { font-size: 1.65rem; line-height: 2.4rem; margin: 0 0 .3em; }
.product-card__title a { text-decoration: none; }
.product-card__meta { font-size: var(--fs-meta); line-height: 2.1rem; color: var(--grey-1); margin: 0 0 1em; }
.product-card__meta span { white-space: nowrap; }
.product-card__actions { margin: 0; }
/* a card just too narrow for "Enquire to buy" + "View print" side by side (three columns at ~1000–1139px, two at
   ~673–728px): tighter padding and gap keep them on one line instead of stacking; narrower cards still stack */
@container (max-width: 314px) {
  p.product-card__actions { column-gap: 8px; }   /* "p." outranks main.css p:has(> .btn) { gap: 8px 12px } */
  .product-card__actions .btn { padding-left: 16px; padding-right: 16px; }
}
/* the buy row waits for /api/products: the enquiry keeps its place, unseen, until cart.js knows which control applies */
.js [data-pending] { visibility: hidden; }

/* ------------------------------------------------------------ product */
.product__media img { width: 100%; height: auto; }
.spec { margin: 0 0 30px; border-top: 1px solid var(--hairline); }
.spec__row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0 20px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.spec dt { font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); line-height: 2.1rem; padding-top: .35em; }
.spec dd { margin: 0; }
.product__buy { padding: 26px 0; border-bottom: 1px solid var(--hairline); margin-bottom: 30px; }
.product__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 0 0 1.2em; }
.product__form .btn { margin: 0; }
.product__coa { max-width: 52ch; }
.product__blurb p { max-width: 62ch; }
.product__blurb > :last-child { margin-bottom: 0; }   /* the column's last block: 120 to the footer, not 143 */

/* ------------------------------------------------------------ buttons (states) */
.btn[disabled], .btn[aria-disabled="true"] { opacity: .35; cursor: not-allowed; pointer-events: none; }
.btn.is-busy { opacity: .6; cursor: progress; pointer-events: none; }
.btn.is-added { background: var(--red); border-color: var(--red); color: var(--white); }

/* ------------------------------------------------------------ forms */
.field { display: block; margin-bottom: 22px; }
.field__label { display: block; font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); margin-bottom: 8px; }
.field__opt { text-transform: none; letter-spacing: 0; color: var(--grey-2); }
.field__hint { display: block; font-size: var(--fs-meta); line-height: 2rem; color: var(--grey-2); margin-top: 6px; }
.field input:not([type="checkbox"]), .field select, .field textarea {
  display: block; width: 100%;
  font: inherit; color: var(--ink);
  font-size: max(16px, 1em); /* never below 16px: iOS Safari zooms the page into any smaller control */
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: 12px 14px;
  line-height: 1.6;
  transition: border-color var(--t-hover) ease;
  -webkit-appearance: none; appearance: none;
}
.field select {
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--grey-1) 50%), linear-gradient(135deg, var(--grey-1) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.field textarea { resize: vertical; min-height: 160px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink-2); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--red); }
.field__error { display: block; font-size: var(--fs-meta); line-height: 2rem; color: var(--red); margin-top: 6px; }
.field--inline { display: inline-block; margin: 0 0 8px; min-width: 110px; }
.field--inline select { width: auto; min-width: 90px; }
.field--check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; align-items: start; margin: 30px 0; }
.field--check input { width: 18px; height: 18px; margin: .45em 0 0; accent-color: var(--ink-2); }
.field--check label { max-width: 62ch; }
.field--check a { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }   /* the policy links read as links */
.field--check .field__error { grid-column: 2; margin-top: 0; }
.fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.fieldset legend { padding: 0; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 var(--gap-x); }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid__full { grid-column: 1 / -1; }
}
.hp { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------------ notices */
.notice {
  font-size: 1.45rem; line-height: 2.6rem;
  border-left: 1px solid var(--ink-2);
  padding: 10px 0 10px 20px;
  margin: 0 0 24px;
  max-width: 62ch;
}
.notice--info { border-color: var(--grey-2); color: var(--grey-1); }
.notice--error { border-color: var(--red); color: var(--red); }
.notice--ok { border-color: var(--ink-2); color: var(--ink); }

/* ------------------------------------------------------------ cart table */
.cart-table { width: 100%; border-collapse: collapse; margin: 10px 0 24px; }
.cart-table th, .cart-table td { text-align: left; vertical-align: middle; padding: 16px 12px 16px 0; border-bottom: 1px solid var(--hairline); }
.cart-table thead th { font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); font-weight: var(--fw); padding-top: 0; }
.cart-table tfoot th { font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); font-weight: var(--fw); border-bottom: 0; }
.cart-table tfoot td { border-bottom: 0; }
.cart-table__num { text-align: right !important; white-space: nowrap; }
.cart-table__th-item { width: 50%; }
.cart-item { display: flex; align-items: center; gap: 18px; }
.cart-thumb { flex: 0 0 72px; width: 72px; }
.cart-thumb img { width: 72px; height: auto; }
.cart-thumb--empty { height: 90px; background: var(--bg-soft); }
.cart-item__title { font-size: 1.45rem; text-transform: uppercase; letter-spacing: var(--track); margin: 0 0 .2em; }
.cart-item__title a { text-decoration: none; }
.cart-item__meta { font-size: var(--fs-meta); line-height: 2rem; color: var(--grey-1); margin: 0; }
.cart-item__warn { font-size: var(--fs-meta); line-height: 2rem; color: var(--red); margin: .3em 0 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--hairline); }
.qty__btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; color: var(--grey-1); } /* 44 x 44 tap target */
.qty__btn:hover, .qty__btn:focus-visible { color: var(--ink); background: var(--bg-soft); }
.qty__btn[disabled] { opacity: .3; cursor: not-allowed; }
.qty__val { min-width: 32px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-remove { display: inline-flex; align-items: center; min-height: 44px; padding: 0; font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-2); text-decoration: underline; text-underline-offset: .2em; } /* >= 44px hit area */
.cart-remove:hover, .cart-remove:focus-visible { color: var(--red); }
.cart-limit { margin-bottom: 16px; }
.cart-actions { margin: 0; }   /* the paragraph's own 23 above; nothing after the page's last block */
.cart-empty > :last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  /* stacked rows: the column headers stay for screen readers (visually hidden, not display:none), and the
     markup carries explicit table roles, which a display change would otherwise strip */
  .cart-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .cart-table, .cart-table tbody, .cart-table tfoot, .cart-table tr, .cart-table td, .cart-table th { display: block; }
  .cart-table tr { border-bottom: 1px solid var(--hairline); padding: 14px 0; }
  .cart-table td, .cart-table th { border: 0; padding: 4px 0; }
  .cart-table td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 90px; font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); }
  .cart-table__num { text-align: left !important; }
  .cart-table tfoot tr { display: flex; align-items: baseline; }
  .cart-table tfoot th { min-width: 90px; }   /* the subtotal lines up with the Price and Total values */
  .cart-table__spare { display: none !important; }
}

/* ------------------------------------------------------------ checkout */
.checkout { display: grid; grid-template-columns: 1fr; gap: var(--gap-y) var(--gap-x); align-items: start; }
@media (max-width: 1024px) {
  .checkout__summary { order: -1; } /* on phones the summary comes first, above the form and the payment CTA */
}
@media (min-width: 1025px) {
  .checkout { grid-template-columns: minmax(0, 7fr) minmax(280px, 4fr); }
  .checkout__summary { position: sticky; top: calc(var(--header-h) + 20px); }
}
.checkout__summary { background: var(--bg-soft); padding: 30px; }
.checkout__summary-title { font-size: 1.65rem; margin-bottom: 1em; }
.summary { border-top: 1px solid var(--hairline); }
.summary li { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.summary .cart-thumb { flex-basis: 56px; width: 56px; }
.summary .cart-thumb img { width: 56px; }
.summary__body { flex: 1 1 auto; min-width: 0; }
.summary__title { margin: 0; font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; }
.summary__meta { margin: 0; font-size: var(--fs-meta); line-height: 2rem; color: var(--grey-1); }
.summary__line { white-space: nowrap; }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); }
.summary__total .price { font-size: 2.1rem; }
.checkout__actions { margin: 0 0 var(--para); }   /* the last field's own 22px above, a paragraph's gap below */
.checkout__pay { padding-top: 10px; }
.checkout__form form > :last-child, .checkout__pay > :last-child { margin-bottom: 0; }   /* 120 to the footer, not 143 */

/* ------------------------------------------------------------ order */
.order__head { margin-bottom: 30px; }
.status { font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; }
.status--paid { color: var(--ink); }
.status--created, .status--pending { color: var(--grey-1); }
.order__retry { margin-top: 12px; }
.status--failed, .status--cancelled, .status--refunded { color: var(--red); }
.order__items { margin-bottom: 30px; }

/* ------------------------------------------------------------ contact */
.contact__media picture { width: 100%; }
.contact__media img { width: 100%; height: auto; }
.contact__form { margin-top: 0; }
.contact__form > :last-child, .contact__done > :last-child { margin-bottom: 0; }
/* closing strip, as .prevnext: 60 → hairline → 30 (the split's own 50px row gap + 10) */
.contact__links { margin-top: 10px; padding-top: 30px; border-top: 1px solid var(--hairline); }
.contact__list li { margin-bottom: .4em; }
.contact__list li:last-child { margin-bottom: 0; }
/* desktop: photograph with the links beneath it | heading and form. Both columns start and end on the
   same lines at any width — the message box takes up the slack when the photograph column is the
   taller one, the links drop to the foot of their column when the form is */
@media (min-width: 1024px) {
  .split.contact { grid-template-rows: auto 1fr; row-gap: 0; align-items: stretch; }
  .contact__media { grid-column: 1; grid-row: 1; position: static; }
  .contact__links { grid-column: 1; grid-row: 2; align-self: end; margin-top: var(--section-y); }
  .contact__body { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; }
  .contact__form { flex: 1 1 auto; display: flex; flex-direction: column; }
  .contact__form .form-grid { flex: 1 1 auto; grid-template-rows: auto auto 1fr; }
  .contact__form .field--message { display: flex; flex-direction: column; }
  .contact__form .field--message textarea { flex: 1 1 auto; }
}
.contact__list a { text-decoration: none; }
.contact__list a:hover { color: var(--grey-1); text-decoration: underline; }

/* ------------------------------------------------------------ legal */
.legal h1 { margin-bottom: .6em; }
.legal__updated { margin-bottom: .6em; }
.legal__notice { font-size: var(--fs-meta); line-height: 2.1rem; color: var(--grey-2); margin-bottom: 40px; }
.legal__section { margin-bottom: 40px; }
.legal__section h2 { font-size: 1.65rem; line-height: 1.6; margin-bottom: .8em; }
.legal p { max-width: 70ch; }
.legal__nav { display: flex; flex-wrap: wrap; gap: 0 24px; padding-top: 30px; border-top: 1px solid var(--hairline); font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); }
.legal__nav a[aria-current="page"] { color: var(--ink); }

/* ------------------------------------------------------------ dark theme */
.theme-dark .field input:not([type="checkbox"]), .theme-dark .field select, .theme-dark .field textarea { background: var(--white); }
