/* The creator's storefront: /c/<org>/ (creator profile), /org/<org>/ (org landing) and,
 * since design QA r12b, the storefront home on the creator's own host (tenant_home).
 *
 * Design QA r3. The two pages were two templates for the same organisation with two
 * different headers (a cold Bootstrap bg-light band with no action; a brown band with a
 * login button pinned 700px from the name) and one placeholder course card — a beige box
 * with a stock notebook glyph — sitting alone in a three-up row. They now share one
 * header partial and one card partial, and both are styled here.
 *
 * Colour: --color-* tokens only. The per-request tenant accent arrives as --sf-accent,
 * set in each page's NONCED style block (a style="" attribute is refused by CSP).
 */

/* ── Header ─────────────────────────────────────────────────────────────────── */

.storefront-hero {
  background: var(--sf-accent, var(--color-primary));
  /* --sf-on-accent is chosen per accent (branding.on_accent_for): white on a dark accent, near-black on
     Warm White / Mint / Sky, where white text was invisible. */
  color: var(--sf-on-accent, #fff);
  /* A strip, not a slab: at 4.5rem a one-line tagline left ~300px of mostly empty colour
     beside a ~600px column at 1440 (design QA r12b). */
  padding-block: clamp(2rem, 5vw, 3rem);
}

/* Name, words and actions in ONE column: at 1440 the login button used to sit at the
   far right edge, reading as detached from the school it logs into. */
.storefront-hero__inner {
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 3vw, 2rem);
  max-width: 56rem;
}

.storefront-hero__name {
  margin: 0 0 .375rem;
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: var(--tracking-tighter);
}

/* 0.92 white, never the 0.75 opacity it had: on #7B5F5F that dropped a 5.8:1 pair to
   ~3.9:1, under 4.5:1 for the only sentence describing the school. */
.storefront-hero__tagline {
  margin: 0 0 .75rem;
  font-size: var(--font-size-lg);
  color: color-mix(in srgb, var(--sf-on-accent, #fff) 92%, transparent);
}
.storefront-hero__intro {
  margin: 0 0 .75rem;
  max-width: 46rem;
  color: color-mix(in srgb, var(--sf-on-accent, #fff) 92%, transparent);
}
.storefront-hero__summary {
  margin: 0 0 1.25rem;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: color-mix(in srgb, var(--sf-on-accent, #fff) 92%, transparent);
}

/* Split hero: the picture takes the right 42% of the band from lg up and is absent below it.
   Same background as the band (the section's own), picture pinned top-right at 100% of its
   column, bottom 20px masked out so it dissolves into that background. */
.storefront-hero--split { position: relative; }
.storefront-hero__art { display: none; }
@media (min-width: 992px) {
  .storefront-hero--split { min-height: 26rem; }
  .storefront-hero--split .storefront-hero__inner { max-width: 50%; }
  .storefront-hero--split .storefront-hero__art {
    display: block; position: absolute; top: 0; right: 0; bottom: 0; width: 42%;
    background: inherit; overflow: hidden;
  }
  .storefront-hero__art img {
    display: block; width: 100%; height: auto; max-height: 100%; object-fit: cover; object-position: top right;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 20px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 20px), transparent);
  }
}

/* /org/ only: the line that makes it the sign-in page learners are sent to. */
.storefront-hero__lede {
  margin: 0 0 1rem;
  font-weight: 600;
  color: var(--sf-on-accent, #fff);
}

.storefront-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
/* One label weight for both doors (the outline one rendered 400), and the light button on
   the warm surface token rather than Bootstrap's cool #F8F9FA. */
.storefront-hero__actions .btn { min-height: 48px; display: inline-flex; align-items: center; font-weight: 600; }
.storefront-hero__actions .btn-light {
  --bs-btn-bg: var(--color-surface);
  --bs-btn-border-color: var(--color-surface);
  --bs-btn-hover-bg: var(--color-surface-raised);
  --bs-btn-hover-border-color: var(--color-surface-raised);
  color: var(--color-fg);
}
/* The outline door follows the text colour, so it is visible on a light accent too. */
.storefront-hero__actions .btn-outline-light {
  --bs-btn-color: var(--sf-on-accent, #fff);
  --bs-btn-border-color: var(--sf-on-accent, #fff);
  --bs-btn-hover-color: var(--sf-accent, var(--color-primary));
  --bs-btn-hover-bg: var(--sf-on-accent, #fff);
  --bs-btn-hover-border-color: var(--sf-on-accent, #fff);
}
/* A light hero needs the logo tile to keep an edge. */
.storefront-logo { border: 1px solid color-mix(in srgb, var(--sf-on-accent, #fff) 25%, transparent); }

@media (max-width: 575.98px) {
  .storefront-hero__inner { flex-direction: column; }
  .storefront-hero__actions .btn { width: 100%; justify-content: center; }
}

/* Logo, or a monogram when there is none — an unconfigured creator's public face was
   an empty band holding only a name. */
.storefront-logo {
  flex: none;
  width: 88px;
  height: 88px;
  object-fit: contain;
  padding: .5rem;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
}
.storefront-monogram {
  flex: none;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  color: var(--color-primary-hover);
  border: 1px solid color-mix(in srgb, var(--sf-on-accent, #fff) 25%, transparent);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.storefront-monogram--sm {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.5rem;
}

/* ── Course grid ────────────────────────────────────────────────────────────── */

.storefront-section-title {
  margin: 0 0 1.5rem;
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}

.storefront-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 1.5rem;
}

.sf-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  color: var(--color-fg);
  text-decoration: none;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.sf-card:hover,
.sf-card:focus-visible {
  border-color: var(--color-border-strong);
  box-shadow: var(--elevation-3);
  transform: translateY(-2px);
  color: var(--color-fg);
}
.sf-card:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }

.sf-card__media { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; display: block; }

/* No art: a TYPESET COVER — the course title, 800 weight, on the brand gradient. A
   generic notebook glyph made the first picture a buyer saw of a paid course a
   placeholder. */
.sf-cover {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .25rem;
  padding: 1.25rem;
  background:
    radial-gradient(80% 90% at 100% 0%, rgba(255, 255, 255, .14) 0%, transparent 60%),
    /* Ends at a 60% mix, not the full hero dark: running to #2C2321 made a paid course's
       first picture a muddy near-black slab (design QA r12b). */
    linear-gradient(150deg, var(--sf-accent, var(--color-primary)) 0%, color-mix(in srgb, var(--sf-accent, var(--color-primary)) 60%, var(--color-bg-hero)) 100%);
  color: var(--sf-on-accent, #fff);
}
.sf-cover__org {
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  opacity: .85;
}
.sf-cover__mark {
  margin-bottom: auto;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}

.sf-card__body {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1;
  padding: 1.25rem;
}
.sf-card__title { margin: 0; font-size: var(--font-size-lg); font-weight: 700; line-height: 1.25; }
/* Three lines: at two, a 20-word tagline was cut mid-phrase ("…but were…"). */
.sf-card__tagline {
  margin: 0;
  color: var(--color-muted-fg);
  font-size: var(--font-size-sm);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sf-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  font-size: var(--font-size-sm);
  color: var(--color-muted-fg);
}
.sf-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--color-border);
}
.sf-card__price { font-weight: 700; color: var(--color-fg); }
.sf-card__cta {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-weight: 600;
  /* The brand colour, as on every other storefront link: amber was a third colour for one
     action, and the tenant host already used primary (design QA r12b). */
  color: var(--color-primary);
}

/* ONE course: a wide feature card, not one tile and two thirds of empty row. */
@media (min-width: 768px) {
  /* Spans the container: capped at 60rem it left a ~340px dead strip at 1440 beside the
     page's only content. */
  .storefront-grid--single { grid-template-columns: minmax(0, 1fr); }
  .storefront-grid--single .sf-card { flex-direction: row; }
  .storefront-grid--single .sf-card__media,
  .storefront-grid--single .sf-cover { width: 45%; flex: none; aspect-ratio: auto; min-height: 13rem; }
  .storefront-grid--single .sf-cover__mark { font-size: 3.5rem; }
  .storefront-grid--single .sf-card__body { padding: 1.75rem; }
}

.storefront-empty {
  padding: 3rem 1.5rem;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-xl);
  text-align: center;
  color: var(--color-muted-fg);
}

@media (prefers-reduced-motion: reduce) {
  .sf-card { transition: none; }
  .sf-card:hover, .sf-card:focus-visible { transform: none; }
}

/* ── Footer: one small monochrome block; the tenant's page carries no Yoshuko bar ───── */
.sf-footer { padding-block: 1rem; font-size: .8125rem; line-height: 1.5; color: var(--color-muted-fg, #6B625C); background: transparent; }
.sf-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; display: inline-block; padding-block: .2rem; }
.sf-footer a:hover, .sf-footer a:focus-visible { color: var(--color-fg, #1A1A1A); }
.sf-footer__links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.sf-footer__sep { opacity: .5; }
/* At phone width the links wrap: each is a full 44px tap target, and the divider (which
   ends up stranded at a line end) goes; the wrap itself separates the two groups. */
@media (max-width: 575.98px) {
  .sf-footer__links { gap: 0 1.25rem; }
  .sf-footer__links a { min-height: 44px; display: inline-flex; align-items: center; padding-block: 0; }
  .sf-footer__sep { display: none; }
}
