/* ============================================================
   components.css — module cards, decorations, sections, drawer
   ============================================================ */

/* ---------------- Module card ---------------- */
.mcard {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border: none;
  padding: 0;
  background: var(--mc);
  color: #fff;
  overflow: hidden;
  border-radius: var(--radius);
  text-align: left;
  isolation: isolate;
  transform: translateZ(0);
  transition: transform var(--motion-dur) var(--motion-ease),
              box-shadow var(--motion-dur) var(--motion-ease);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.mcard:hover {
  transform: translateY(calc(var(--motion-lift) * -1)) scale(var(--motion-scale)) rotate(var(--motion-rot));
  box-shadow: 0 26px 50px -22px color-mix(in oklab, var(--mc) 65%, black 40%);
  z-index: 3;
}
.mcard:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* speech-bubble white circle */
.mcard__bubble {
  position: absolute;
  top: 14%;
  left: 50%;
  width: 62%;
  aspect-ratio: 1 / 1;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform var(--motion-dur) var(--motion-ease);
  z-index: 2;
}
/* little speech-bubble tail */
.mcard__bubble::after {
  content: "";
  position: absolute;
  bottom: 4%;
  right: 16%;
  width: 24%;
  height: 24%;
  background: #fff;
  border-bottom-right-radius: 60% 70%;
  border-top-left-radius: 80%;
  transform: rotate(8deg);
  z-index: -1;
}
.mcard:hover .mcard__bubble {
  transform: translateX(-50%) scale(1.03) rotate(calc(var(--motion-rot) * -0.6));
}
.mcard__icon { display: grid; place-items: center; }
.mcard__icon svg { transition: transform var(--motion-dur) var(--motion-ease); }
.mcard:hover .mcard__icon svg { transform: scale(1.06); }

/* diagonal slash crossing the label */
.mcard__slash {
  position: absolute;
  right: 30%;
  bottom: 4%;
  width: 14%;
  height: 56%;
  color: #fff;
  opacity: 0.92;
  z-index: 1;
}

/* footer label */
.mcard__foot {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 8%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  text-align: right;
  z-index: 3;
}
.mcard__num {
  font-family: var(--font-mono);
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: 0.12em;
  opacity: 0.72;
}
.mcard__label {
  font-size: clamp(20px, 2.5vw, 30px);
  max-width: 7em;
}
.mcard--compact .mcard__label { font-size: clamp(15px, 1.6vw, 18px); }

/* hover reveal row */
.mcard__hover {
  position: absolute;
  left: 9%;
  bottom: 8%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--motion-dur) var(--motion-ease),
              transform var(--motion-dur) var(--motion-ease);
  z-index: 3;
}
.mcard__cta { display: inline-flex; align-items: center; gap: 6px; }
.mcard__cta svg { stroke: #fff; }
.mcard__discipline { display: none; }
.mcard:hover .mcard__hover { opacity: 0.95; transform: none; }

/* ---- decorative corner accents (arcs + stripes) ---- */
.mcard__decor { position: absolute; pointer-events: none; z-index: 0; }
.mcard__decor--arc-tr,
.mcard__decor--arc-tl,
.mcard__decor--arc-bl {
  width: 46%;
  aspect-ratio: 1/1;
  border-radius: 50%;
  border: 13% solid currentColor;
}
.mcard__decor--arc-tr { top: -16%; right: -14%; }
.mcard__decor--arc-tl { top: -16%; left: -14%; }
.mcard__decor--arc-bl { bottom: -16%; left: -14%; }
.mcard__decor--stripe-tr,
.mcard__decor--stripe-bl {
  width: 150%;
  height: 16%;
  background: currentColor;
}
.mcard__decor--stripe-tr { top: 4%; right: -40%; transform: rotate(-45deg); transform-origin: right top; }
.mcard__decor--stripe-bl { bottom: 4%; left: -40%; transform: rotate(-45deg); transform-origin: left bottom; }

/* playful interaction style: drift the decor */
[data-motion="playful"] .mcard__decor {
  transition: transform 1.1s var(--motion-ease);
}
[data-motion="playful"] .mcard:hover .mcard__decor--arc-tr { transform: translate(-6px, 6px) rotate(12deg); }
[data-motion="playful"] .mcard:hover .mcard__decor--arc-tl { transform: translate(6px, 6px) rotate(-12deg); }
[data-motion="playful"] .mcard:hover .mcard__decor--arc-bl { transform: translate(6px, -6px) rotate(12deg); }

/* ---------------- Catalog grid ---------------- */
/* official SCA module-family strip */
.modstrip {
  margin: 0 0 clamp(28px, 4vw, 48px);
  padding: clamp(20px, 3vw, 34px) clamp(16px, 3vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.modstrip img { width: 100%; height: auto; display: block; }
.modstrip image-slot { display: block; width: 100%; height: clamp(96px, 13vw, 184px); --slot-bg: transparent; }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
}
@media (max-width: 860px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  .catalog-grid > .reveal:last-child:nth-child(3n + 1) { grid-column: auto; }
}

/* group / corporate discount banner */
.group-offer {
  display: flex; align-items: center; gap: clamp(20px, 3vw, 40px);
  margin: clamp(28px, 3.4vw, 44px) 0 clamp(36px, 4vw, 52px);
  padding: clamp(22px, 2.6vw, 32px) clamp(24px, 3vw, 40px);
  background: var(--ink);
  border-radius: 20px;
  color: var(--paper);
  position: relative; overflow: hidden;
}
.group-offer::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in oklab, var(--accent) 26%, transparent), transparent 60%);
  pointer-events: none;
}
.group-offer__badge {
  flex: none; position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: clamp(94px, 11vw, 124px); height: clamp(94px, 11vw, 124px);
  border-radius: 50%;
  background: var(--accent); color: #fff;
  box-shadow: 0 18px 40px -18px color-mix(in oklab, var(--accent) 70%, black);
}
.group-offer__pct { font-family: var(--font-display); font-weight: 900; font-size: clamp(30px, 3.6vw, 42px); line-height: 0.9; letter-spacing: -0.02em; }
.group-offer__off { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; margin-top: 4px; }
.group-offer__off-ar { font-family: "Thmanyah Sans", system-ui, sans-serif; direction: rtl; font-size: 13px; letter-spacing: 0; }
.group-offer__body { flex: 1; position: relative; z-index: 1; }
.group-offer__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.group-offer__title-ar { font-family: "Thmanyah Display", var(--font-serif); direction: rtl; font-weight: 700; font-size: clamp(18px, 2vw, 23px); color: color-mix(in oklab, var(--accent) 60%, var(--paper)); }
.group-offer__text { margin: 10px 0 0; font-size: 15.5px; line-height: 1.55; color: rgba(244,241,234,0.78); max-width: 62ch; }
.group-offer__text b { color: var(--paper); }
.group-offer__text-ar { display: block; font-family: "Thmanyah Sans", system-ui, sans-serif; font-size: 14.5px; line-height: 1.85; margin-top: 8px; color: rgba(244,241,234,0.7); }
.group-offer__text-ar b { color: var(--paper); }
.group-offer__cta { flex: none; position: relative; z-index: 1; align-self: center; }
@media (max-width: 760px) {
  .group-offer { flex-direction: column; align-items: flex-start; gap: 20px; }
  .group-offer__cta { align-self: stretch; justify-content: center; }
}

/* filter chips */
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  transition: all var(--motion-dur) var(--motion-ease);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---- price pill on card ---- */
.mcard__tag-pill {
  position: absolute;
  top: 9%;
  left: 9%;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.18);
  padding: 6px 11px;
  border-radius: 100px;
  backdrop-filter: blur(2px);
}
.mcard--soon { filter: saturate(0.55); }
.mcard--soon .mcard__bubble { opacity: 0.92; }
.mcard--soon .mcard__tag-pill { background: rgba(0,0,0,0.28); }

/* ---- cupping short-course card: dark bubble on a light card (matches the Intro-to-Cupping badge) ---- */
.mcard--cup {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}
.mcard--cup .mcard__bubble { background: var(--c-cupping); width: 46%; top: 12%; }
.mcard--cup .mcard__bubble::after { background: var(--c-cupping); }
.mcard--cup .mcard__slash { color: var(--ink); opacity: 0.4; }
.mcard--cup .mcard__label { color: var(--ink); font-size: clamp(14px, 1.45vw, 18px); max-width: 9em; }
.mcard--cup .mcard__num { color: var(--muted); opacity: 1; font-size: clamp(9px, 0.85vw, 11px); }
.mcard--cup .mcard__tag-pill { background: var(--ink); color: var(--paper); }
.mcard--cup .mcard__cta { color: var(--ink); }
.mcard--cup .mcard__cta svg { stroke: var(--ink); }
.mcard--cup:hover { box-shadow: 0 26px 50px -24px rgba(38,33,28,0.5); }

/* ---------------- Short-course cards ---------------- */
.short-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 1.6vw, 20px);
}
@media (max-width: 820px) { .short-grid { grid-template-columns: 1fr; } }
.scard {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--motion-dur) var(--motion-ease),
              box-shadow var(--motion-dur) var(--motion-ease),
              border-color var(--motion-dur) var(--motion-ease);
}
.scard:hover {
  transform: translateY(calc(var(--motion-lift) * -0.5));
  box-shadow: 0 22px 44px -26px rgba(74,48,34,0.6);
  border-color: var(--c-cupping);
}
.scard:focus-visible { outline: 3px solid var(--c-cupping); outline-offset: 3px; }

/* photo banner (user-droppable real image) */
.scard__photo {
  position: relative;
  width: 100%;
  height: clamp(150px, 16vw, 184px);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.scard__photo image-slot { --slot-bg: var(--paper-2); }
.scard__price-pill {
  position: absolute; top: 12px; left: 12px; z-index: 3; white-space: nowrap;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--paper); background: var(--ink);
  padding: 7px 12px; border-radius: 100px;
}
.scard__body { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px 0; }
.scard__name { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.05; letter-spacing: -0.01em; }
.scard__name-ar { display: block; font-family: "Thmanyah Display", var(--font-serif); direction: rtl; font-weight: 700; font-size: 17px; line-height: 1.4; color: var(--muted); margin-top: 6px; }
.scard__meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.scard__blurb { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.scard__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px 22px; }
.scard__book {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--paper); background: var(--accent); border: none;
  padding: 11px 16px; border-radius: 100px; cursor: pointer;
  transition: transform var(--motion-dur) var(--motion-ease), filter var(--motion-dur) var(--motion-ease);
}
.scard__book svg { stroke: var(--paper); }
.scard__book:hover { transform: translateY(-1px); filter: brightness(1.05); }
.scard__cta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.scard:hover .scard__cta { color: var(--c-cupping); }

/* ---- real-photo / PNG treatment inside the module-card bubble ---- */
.mcard__photo {
  width: 92%; height: 92%;
  margin: 4%;
  border-radius: 50%;
  overflow: visible;
}
.mcard__photo image-slot { --slot-bg: transparent; }
.mcard--photo .mcard__bubble { overflow: visible; }

/* ---- clean neutral curriculum cards: the icon circle is the hero ---- */
.mcard--photo {
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(38,33,28,0.04), 0 16px 32px -26px rgba(38,33,28,0.5);
}
[data-intensity="muted"] .mcard--photo { background: var(--surface); }
.mcard--photo:hover {
  border-color: color-mix(in oklab, var(--mc) 50%, var(--line));
  box-shadow: 0 2px 4px rgba(38,33,28,0.05), 0 28px 48px -28px color-mix(in oklab, var(--mc) 38%, rgba(38,33,28,0.5));
}
.mcard__badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 84%; height: 84%;
  background: transparent;
  border-radius: 0; padding: 0;
  display: grid; place-items: center;
  transition: transform var(--motion-dur) var(--motion-ease);
  z-index: 2;
}
.mcard--photo:hover .mcard__badge { transform: translate(-50%, -50%) scale(1.04); }
.mcard__badge image-slot { width: 100%; height: 100%; }
.mcard__index {
  position: absolute; top: 14px; left: 16px; z-index: 3;
  font-family: var(--font-mono); font-size: clamp(10px, 0.9vw, 12px);
  letter-spacing: 0.12em; color: var(--muted);
  background: transparent; padding: 0;
}
/* a lone final card (e.g. Q Grader, 7th of 7) centres itself in the row */
.catalog-grid > .reveal:last-child:nth-child(3n + 1) { grid-column: 2; }
.mcard--photo .mcard__hover { left: 0; right: 0; bottom: 14px; justify-content: center; }
.mcard--photo .mcard__cta { color: var(--ink); }
.mcard--photo .mcard__cta svg { stroke: var(--ink); }
.mcard--soon.mcard--photo .mcard__badge { opacity: 0.96; }

/* ---- big index number (hero stack + cards without a photo) ---- */
.mcard__bignum {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 6vw, 78px);
  line-height: 1;
  letter-spacing: -0.03em;
}
