/* Categories, Manifestation Journals and Seraph pages. Builds on store.css tokens and components.
   Each section names its Dribbble source in a comment in the page's markup. */

/* All categories: head (Velure shot), side list and card grid */
.cat-index { padding-block: 32px var(--section); }
.cat-head { display: grid; gap: 12px; margin-bottom: 32px; }
.cat-head p { font-size: 16px; line-height: 1.5; color: var(--n-500); max-width: 48ch; }
.cat-body { display: grid; gap: 24px; }
.cat-side-list { display: none; }
.cat-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
.cat-card { display: grid; align-content: start; gap: 8px; min-width: 0; }
.cat-card-link { display: grid; gap: 8px; padding: 8px; border-radius: 16px; background: var(--n-50); color: var(--n-900); transition: background-color 150ms ease-out; }
.cat-card-media { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: var(--n-0); }
.cat-card-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; transition: scale 300ms var(--ease); }
.cat-card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 4px 4px 4px 8px; }
.cat-card-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; font-size: 16px; font-weight: 500; line-height: 1.3; }
.cat-card-count { display: block; margin-top: 2px; font-size: 14px; color: var(--n-500); font-variant-numeric: tabular-nums; }
.cat-card-chip { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9999px; background: var(--n-950); color: var(--n-0); transition: background-color 150ms ease-out; }
.cat-card-chip svg { width: 16px; height: 16px; }
.cat-subs { display: flex; flex-wrap: wrap; gap: 0 16px; padding-inline: 16px; font-size: 14px; }
.cat-subs a { display: inline-block; padding-block: 4px; color: var(--n-700); transition: color 150ms ease-out; }
@media (min-width: 768px) {
    .cat-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px; margin-bottom: 48px; }
    .cat-head p { text-align: right; }
    .cat-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
}
@media (min-width: 1024px) {
    .cat-body { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 24px; align-items: start; }
    .cat-side-list { display: block; position: sticky; top: 96px; padding: 24px; border-radius: 16px; background: var(--n-50); }
    .cat-side-title { margin-bottom: 16px; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
    .cat-side-list ul { display: grid; gap: 4px; }
    .cat-side-list a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 8px; background: var(--n-0); font-size: 14px; color: var(--n-900); transition: background-color 150ms ease-out, color 150ms ease-out; }
    .cat-side-count { color: var(--n-500); font-variant-numeric: tabular-nums; }
}

/* Closing band (Voltix shot): two-line heading left, line, field and link right */
.cat-search { padding-block: var(--section); background: var(--n-50); }
.cat-search-grid { display: grid; gap: 24px; }
.cat-search-form { display: grid; gap: 16px; justify-items: start; }
.cat-search-form p { font-size: 16px; line-height: 1.5; color: var(--n-700); }
.cat-search-form .field { width: 100%; }
.cat-search .field input { background: var(--n-0); }
@media (min-width: 1024px) {
    .cat-search-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: start; }
}

/* Journal hero (JH shot): hairline grid, cover cell, title cell, sub-cell, actions at the foot */
.jh { padding-block: 32px 0; }
.jh-grid { display: grid; border-top: 1px solid var(--n-100); border-left: 1px solid var(--n-100); }
.jh-grid > * { border-right: 1px solid var(--n-100); border-bottom: 1px solid var(--n-100); padding: 16px; }
.jh-cover { display: grid; place-items: center; background: var(--n-50); padding: 32px; }
.jh-cover img { width: min(72%, 320px); height: auto; filter: drop-shadow(0 24px 32px rgb(0 0 0 / 0.18)); }
.store .jh-title { font-size: clamp(40px, 5.6vw, 80px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.04; text-wrap: balance; }
.jh-sub { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.jh-text { font-size: 16px; line-height: 1.5; color: var(--n-700); }
.jh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
@media (min-width: 1024px) {
    .jh-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr); grid-template-rows: auto auto 1fr; }
    .jh-grid > * { padding: 24px; }
    .jh-cover { grid-row: 1 / 4; padding: 48px; }
    .jh-title { grid-column: 2 / 4; padding-bottom: 64px !important; }
    .jh-sub { grid-column: 2; }
    .jh-text { grid-column: 3; }
    .jh-actions { grid-column: 2 / 4; align-self: stretch; align-content: end; justify-content: flex-end; }
}

/* Why these journals (Alpha shot): dark band, list left, covers right, ruled foot row */
.why { margin-top: var(--section); padding-block: var(--section); background: var(--n-950); color: var(--n-0); }
.why-grid { display: grid; gap: 48px; padding-bottom: 48px; }
.why-title { margin-bottom: 24px; font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
.why-list dl { display: grid; gap: 20px; }
.why-list dt { font-size: 16px; font-weight: 500; }
.why-list dd { margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--n-400); max-width: 40ch; }
.why-visual { display: flex; align-items: flex-end; justify-content: center; gap: 16px; }
.why-visual img { width: 28%; height: auto; filter: drop-shadow(0 24px 32px rgb(0 0 0 / 0.45)); }
.why-visual img:nth-child(2) { width: 36%; }
.why-foot { display: grid; justify-items: start; gap: 24px; padding-top: 48px; border-top: 1px solid rgb(255 255 255 / 0.12); }
.why-foot p { font-size: 18px; line-height: 1.5; color: var(--n-100); max-width: 52ch; }
@media (min-width: 1024px) {
    .why-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: center; }
    .why-foot { grid-template-columns: minmax(0, 1fr) auto; align-items: center; justify-items: stretch; }
    .why-foot p { font-size: 20px; }
}

/* Editions (Cloris Land shot): number badge, centred name and text, picture in an inset panel at the foot */
.eds-head { display: grid; gap: 12px; }
.eds-head p { font-size: 16px; line-height: 1.5; color: var(--n-500); max-width: 44ch; }
.eds { display: grid; gap: 16px; }
.ed { min-width: 0; display: grid; justify-items: center; align-content: start; gap: 12px; padding: 24px 24px 0; border-radius: 16px; background: var(--n-50); text-align: center; overflow: hidden; }
.ed-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9999px; background: var(--n-0); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ed-name { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.ed-text { font-size: 16px; line-height: 1.5; color: var(--n-700); max-width: 36ch; }
.ed-points { font-size: 14px; line-height: 1.5; color: var(--n-500); max-width: 36ch; }
.ed-media { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; margin-top: 12px; border-radius: 12px 12px 0 0; background: var(--n-0); }
.ed-media { min-height: 0; }
.ed-media img { width: auto; max-width: 70%; height: 80%; object-fit: contain; transition: scale 300ms var(--ease); }
@media (min-width: 768px) {
    .eds-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px; }
    .eds-head p { text-align: right; }
    .eds { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
}

/* Seraph hero (Digcy shot): title left, product centre, line top right, ingredient card bottom left, photo card bottom right */
.sx { padding-block: 32px 0; }
.sx-grid { display: grid; gap: 24px; padding: 24px; border-radius: 16px; background: var(--n-100); overflow: hidden; }
.store .sx-title { font-size: clamp(44px, 7vw, 112px); font-weight: 400; letter-spacing: -0.03em; line-height: 1.02; }
.sx-lede { font-size: 16px; line-height: 1.5; color: var(--n-700); max-width: 32ch; }
.sx-product { overflow: hidden; border-radius: 12px; aspect-ratio: 4 / 5; max-height: 560px; }
.sx-product img { width: 100%; height: 100%; object-fit: cover; }
.sx-ingredient { display: grid; justify-items: start; gap: 8px; padding: 24px; border-radius: 12px; background: var(--n-0); }
.sx-ingredient strong { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.sx-ingredient span { font-size: 14px; line-height: 1.5; color: var(--n-700); margin-bottom: 8px; }
.sx-card { position: relative; display: none; overflow: hidden; border-radius: 12px; color: var(--n-0); }
.sx-card img { width: 100%; height: 100%; object-fit: cover; transition: scale 300ms var(--ease); }
.sx-card::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / 0.55)); }
.sx-card-cap { position: absolute; z-index: 1; left: 20px; right: 20px; bottom: 20px; display: grid; gap: 4px; font-size: 14px; line-height: 1.4; }
.sx-card-fig { font-size: 48px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
@media (min-width: 1024px) {
    .sx-grid {
        grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
        grid-template-rows: auto 1fr auto; gap: 24px 32px; padding: 48px;
        min-height: min(calc(100svh - 104px), 820px);
    }
    .sx-title { grid-column: 1 / 3; grid-row: 1; position: relative; z-index: 1; }
    .sx-lede { grid-column: 3; grid-row: 1; padding-top: 16px; }
    .sx-product { grid-column: 2; grid-row: 1 / 4; align-self: end; aspect-ratio: auto; height: 100%; max-height: 560px; margin-top: 160px; }
    .sx-ingredient { grid-column: 1; grid-row: 3; align-self: end; max-width: 360px; }
    .sx-card { display: block; grid-column: 3; grid-row: 2 / 4; align-self: end; aspect-ratio: 4 / 5; }
}

/* Why Seraph (Voltix shot): heading top right, photo with a cut corner, staggered cards with an icon */
.sw { display: grid; gap: 32px; }
.sw-head { display: grid; justify-items: start; gap: 12px; }
@media (min-width: 1024px) { .sw-head { justify-items: end; text-align: right; } }
.sw-head p { font-size: 16px; line-height: 1.5; color: var(--n-700); max-width: 40ch; }
.sw-photo { overflow: hidden; aspect-ratio: 4 / 5; max-height: 480px; border-radius: 16px; clip-path: polygon(0 0, calc(100% - 64px) 0, 100% 64px, 100% 100%, 0 100%); background: var(--n-50); }
.sw-photo img { width: 100%; height: 100%; object-fit: cover; }
.sw-cards { display: grid; gap: 12px; }
.sw-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-radius: 12px; background: var(--n-50); font-size: 14px; line-height: 1.5; color: var(--n-500); max-width: 440px; }
.sw-card strong { display: block; margin-bottom: 4px; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; color: var(--n-900); }
.sw-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9999px; background: var(--accent-50); color: var(--accent-700); }
.sw-icon svg { width: 20px; height: 20px; }
@media (min-width: 1024px) {
    .sw { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); grid-template-rows: auto 1fr; gap: 48px; }
    .sw-head { grid-column: 2; grid-row: 1; justify-self: end; max-width: 520px; }
    .sw-photo { grid-column: 1; grid-row: 1 / 3; align-self: end; width: 100%; }
    .sw-cards { grid-column: 2; grid-row: 2; }
    .sw-card { width: 60%; max-width: none; }
    .sw-card:nth-child(2), .sw-card:nth-child(4) { margin-left: 20%; }
    .sw-card:nth-child(3) { margin-left: 40%; }
}

@media (hover: hover) and (pointer: fine) {
    .cat-card-link:hover { background: var(--n-100); }
    .cat-card-link:hover img, .sx-card:hover img, .ed:hover .ed-media img { scale: 1.03; }
    .cat-card-link:hover .cat-card-chip { background: var(--accent-600); }
    .cat-side-list a:hover { background: var(--n-950); color: var(--n-0); }
    .cat-side-list a:hover .cat-side-count { color: var(--n-400); }
    .cat-subs a:hover { color: var(--accent-600); }
}

/* Product grid sized to its products, so a short range never leaves empty columns */
@media (min-width: 768px) {
    .range-shop { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); max-width: calc(var(--n, 3) * 400px); }
}

/* Distributor application */
.apply { margin-top: var(--section); padding-block: var(--section); background: var(--n-50); }
.apply-grid { display: grid; gap: 48px; align-items: start; }
.apply-copy { display: grid; gap: 24px; }
.apply-lede { font-size: 18px; line-height: 1.5; color: var(--n-700); max-width: 44ch; }
.apply-perks { display: grid; gap: 16px; }
.apply-perks dt { font-size: 16px; font-weight: 500; }
.apply-perks dd { margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--n-700); max-width: 44ch; }
.apply-contact { display: grid; justify-items: start; gap: 4px; }
.apply-contact-title { font-size: 14px; color: var(--n-500); margin-bottom: 4px; }
.apply-contact a { padding-block: 4px; font-size: 16px; font-weight: 500; color: var(--n-900); font-variant-numeric: tabular-nums; transition: color 150ms ease-out; }

.apply-panel { padding: 24px; border-radius: 16px; background: var(--n-0); }
.apply-title { margin-bottom: 24px; font-size: 24px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.apply-note { display: flex; gap: 12px; margin-bottom: 24px; padding: 16px; border-radius: 8px; font-size: 14px; line-height: 1.5; }
.apply-note svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.apply-note-title { font-weight: 500; }
.apply-note.is-ok { background: #ECFDF3; color: #05603A; }
.apply-note.is-error { background: var(--accent-50); color: var(--accent-700); }
.apply-form { display: grid; gap: 16px; }
.apply-field { display: grid; gap: 8px; }
.apply-field label { font-size: 14px; font-weight: 500; }
.apply-field label span { font-weight: 400; color: var(--n-500); }
.apply-field input, .apply-field select, .apply-field textarea {
    width: 100%; min-height: 48px; padding: 12px 16px; border: 0; border-radius: 8px;
    background: var(--n-50); color: var(--n-900); font-size: 16px;
    transition: background-color 150ms ease-out, box-shadow 150ms ease-out;
}
.apply-field textarea { resize: vertical; }
.apply-field input::placeholder { color: var(--n-500); }
.apply-field input:focus, .apply-field select:focus, .apply-field textarea:focus { outline: none; background: var(--n-0); box-shadow: 0 0 0 2px var(--accent-600); }
.apply-phone { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; }
.apply-submit { width: 100%; margin-top: 8px; }
.apply-submit:disabled { opacity: 0.7; cursor: progress; }

@media (min-width: 768px) {
    .apply-panel { padding: 48px; }
    .apply-submit { width: auto; justify-self: start; }
}
@media (min-width: 1024px) {
    .apply-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

@media (hover: hover) and (pointer: fine) {
    .apply-contact a:hover { color: var(--accent-600); }
}
