/* Crochet Therappy: page CSS on top of the kit (assets/system.css). Tokens only, no second system. */

/* logo: the client's round mark beside the name */
.nav__logo { display: inline-flex; align-items: center; gap: var(--s-3); font-family: var(--font-display); }
.logo-mark { width: 40px; height: 40px; flex: none; }
@media (max-width: 639px) { .logo-mark { width: 32px; height: 32px; } }
.wa-ic { width: 20px; height: 20px; flex: none; margin-inline-end: var(--s-2); }

/* ------------------------------------------------ product grid */
.pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-7) var(--gutter); }
@media (max-width: 1023px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-3); } }

.pcard { display: flex; flex-direction: column; min-width: 0; }
.pcard[hidden] { display: none; }
.pcard__link { display: flex; flex-direction: column; gap: var(--s-4); color: inherit; text-decoration: none; flex: 1 1 auto;
  transition: transform var(--dur) var(--ease); }
.pcard__img { display: block; overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface); }
.pcard__img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 420ms var(--ease); }
.pcard__name { display: block; font: 500 16px/24px var(--font-text); letter-spacing: 0; margin: 0; min-height: 48px; }
.pcard__meta { display: flex; justify-content: space-between; gap: var(--s-3); margin: var(--s-2) 0 var(--s-4);
  font-size: 15px; line-height: 22px; color: var(--muted); }
.pcard__add { width: 100%; }
@media (hover: hover) {
  .pcard__link:hover { transform: translateY(-2px); }
  .pcard__link:hover .pcard__img img { transform: scale(1.03); }
  .pcard__link:hover .pcard__name { text-decoration: underline; text-underline-offset: 3px; }
}
@media (max-width: 639px) {
  .pcard__meta { flex-direction: column; gap: 0; font-size: 14px; }
  .pcard__name { font-size: 15px; line-height: 22px; min-height: 44px; }
  .pcard__add { padding-inline: var(--s-3); font-size: 15px; }
}
[data-add][aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* filter chips */
.shop-filter { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-6); }
.chip { min-height: 44px; padding: 0 var(--s-5); border: 1px solid var(--line-strong, rgba(42,29,23,.25)); background: transparent;
  color: var(--ink); font: 500 15px/1 var(--font-text); cursor: pointer; border-radius: 999px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.chip span { color: var(--muted); margin-inline-start: 4px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] span { color: inherit; opacity: .7; }
@media (hover: hover) { .chip:not([aria-pressed="true"]):hover { background: var(--surface); } }

/* the full collection pages grow with their pieces */
main > section.shop--page { min-height: 0; height: auto; }

/* the name across the footer: sixteen letters, so it is set to the wrap's width, never wider */
.closing .close__word { font-size: min(10.4vw, 152px); line-height: 1.15; white-space: nowrap; }

/* ------------------------------------------------ custom orders */
.steps { row-gap: var(--s-6); }
#custom .steps { display: grid; gap: var(--s-5); }
#custom .step { padding-top: var(--s-4); }
#custom .step h3 { margin: 0 0 var(--s-1); }
.step { border-top: 1px solid var(--line); padding-top: var(--s-5); }
.step h3 { font: 500 var(--t-lead)/1.4 var(--font-text); letter-spacing: 0; margin: var(--s-3) 0 var(--s-2); }
.step p { margin: 0; color: var(--ink); line-height: 1.6; }
.steps__n { font: var(--display-weight) 32px/1 var(--font-display); color: var(--action); }
#how .steps { margin-top: var(--s-8); }

/* ------------------------------------------------ prose, faq title */
.prose h3 { font-size: 20px; line-height: 28px; margin: var(--s-5) 0 0; }
.prose h3:first-child { margin-top: 0; }
.prose p { line-height: 1.7; margin: 0; }
.faq__title { margin: 0 0 var(--s-6); }

/* ------------------------------------------------ breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-6); padding: 0; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-inline-end: var(--s-2); opacity: .6; }
.crumbs a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); display: inline-flex; align-items: center; min-height: 32px; }

/* ------------------------------------------------ product page */
.pdp__photo { margin: 0; overflow: hidden; background: var(--surface); aspect-ratio: 4 / 5; }
.pdp__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pdp__info h1 { font-size: clamp(30px, 2.2vw + 14px, 44px); line-height: 1.12; margin: var(--s-3) 0 var(--s-4); }
.pdp__status { display: flex; align-items: center; gap: var(--s-2); margin: 0; font-size: 15px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot--ready { background: var(--action); }
.pdp__price { font: 500 22px/1.3 var(--font-text); margin: 0 0 var(--s-5); }
.pdp__actions { margin: var(--s-6) 0 var(--s-7); }
.pdp__rows .rows__value { color: var(--muted); text-align: end; }
@media (min-width: 1024px) { .pdp__info { position: sticky; top: calc(var(--nav) + var(--s-6)); } }
@media (max-width: 1023px) {
  .pdp__photo { aspect-ratio: 4 / 5; max-height: 72svh; }
  .pdp__info { margin-top: var(--s-6); }
}
@media (max-width: 639px) {
  .pdp__rows > li, #workshops .rows > li, #booking .rows > li { flex-direction: column; align-items: flex-start; gap: 2px; padding-block: var(--s-3); }
  .pdp__rows .rows__value, #workshops .rows__value, #booking .rows__value { text-align: start; }
}

/* ------------------------------------------------ the list pill and sheet */
.listpill { position: fixed; inset-inline-end: 16px; bottom: calc(16px + var(--bar, 0px)); z-index: 11;
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 48px; padding: 0 var(--s-5);
  background: var(--ink); color: var(--bg); border: 0; border-radius: 999px; font: 500 16px/1 var(--font-text); cursor: pointer;
  box-shadow: 0 6px 20px rgba(42, 29, 23, .22); transition: transform var(--dur) var(--ease); }
.listpill[hidden] { display: none; }
.listpill b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--action); color: var(--action-ink); font-size: 14px; }
.listpill.is-bump { animation: ct-bump 360ms var(--ease); }
@keyframes ct-bump { 40% { transform: scale(1.08); } }
@media (hover: hover) { .listpill:hover { transform: translateY(-2px); } }
@media (max-width: 639px) {
  .listpill { bottom: calc(12px + env(safe-area-inset-bottom)); min-height: 44px; padding: 0 var(--s-4); font-size: 15px; inset-inline-end: 12px;
    transition: bottom 240ms var(--ease); }
  :root:has(> body > nav.actionbar:is([data-bar="shown"], [data-bar="always"])) .listpill { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

.listsheet { width: min(480px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; margin-inline-start: auto; padding: var(--s-6);
  border: 0; background: var(--bg); color: var(--ink); overflow-y: auto; }
.listsheet::backdrop { background: rgba(42, 29, 23, .45); }
.listsheet[open] { display: flex; flex-direction: column; gap: var(--s-4); }
.listsheet__head { display: flex; align-items: center; justify-content: space-between; }
.listsheet__head h2 { margin: 0; font-size: 28px; }
.listsheet__close { width: 44px; height: 44px; border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; color: var(--ink); }
.listsheet__items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.listsheet__items li { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.listsheet__items img { width: 56px; height: 70px; object-fit: cover; display: block; }
.listsheet__items a { color: inherit; font-weight: 500; text-decoration: none; }
.listsheet__items button { min-height: 44px; border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }
.listsheet__empty { color: var(--muted); padding: var(--s-4) 0; }
.listsheet__label { font-size: 14px; font-weight: 500; }
.listsheet textarea { width: 100%; font: 16px/1.5 var(--font-text); padding: var(--s-3); border: 1px solid var(--line-strong, rgba(42,29,23,.3)); background: #fff; color: var(--ink); border-radius: 2px; }
.listsheet .btn { width: 100%; }

/* a photograph that leads to its piece: square corners, zooms inside its frame */
.ph-link { display: block; overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface); transition: transform var(--dur) var(--ease); }
.ph-link img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 420ms var(--ease); }
.faq-photo { aspect-ratio: 4 / 3; }
@media (hover: hover) { .ph-link:hover { transform: translateY(-2px); } .ph-link:hover img { transform: scale(1.03); } }
@media (max-width: 639px) { #custom .ph-link { aspect-ratio: 4 / 3; } }

/* the home page shows six pieces on a phone (two screens); all of them are on the shop page */
@media (max-width: 639px) { #collection .pgrid:last-child > .pcard:nth-child(n+3) { display: none; } }

/* ------------------------------------------------ the language switch and the Arabic pages */
.lang-switch { font-weight: 500; }
.nav__actions { gap: var(--s-5); }
html[lang="ar"] {
  --font-display: "IBM Plex Sans Arabic", "Rethink Sans", system-ui, sans-serif;
  --font-text: "IBM Plex Sans Arabic", "Rethink Sans", system-ui, sans-serif;
  --display-tracking: 0;
}
html[lang="ar"] :is(h1, h2, h3, .close__word, .pcard__name) { letter-spacing: 0; }
html[lang="ar"] :is(h1, .t-h1) { line-height: 1.3; }
html[lang="ar"] :is(h2, .t-h2) { line-height: 1.4; }
html[lang="ar"] body { line-height: 1.75; }
/* the Latin brand name keeps its own face inside Arabic text */
html[lang="ar"] .nav__logo { font-family: "Rethink Sans", system-ui, sans-serif; }
/* arrows point the way the text reads */
[dir="rtl"] .m-arrow { transform: scaleX(-1); }
