/*
 * Campaign page (soofos.nl /black-friday/, design approved by Anton on
 * 2026-11-20). Gutenberg page (inc/public-page-migrations/black-friday.php)
 * with the soofos/campaign-* blocks (soofos-commerce) rendering
 * template-parts/campaign/*. Loaded by page slug (soofos_enqueue_page_styles).
 *
 * Navy hero with a drifting wall of discounted courses, the course page's
 * flash-sale countdown grown, deal cards overlapping the hero, then the
 * course list (two rows of category chips) and the FAQ. Tokens only.
 */

.sf-bf [hidden] { display: none !important; }

.sf-bf {
    background: var(--page);
    color: var(--body);
    font-family: var(--font);
}
.sf-bf > *,
.sf-bf .wp-block-group { margin-block: 0; }
/* Classic theme: each group wraps its blocks in an inner container. It takes
   no part in the layout, so the grids below place the blocks themselves. */
.sf-bf .wp-block-group__inner-container { display: contents; }
.sf-bf .is-layout-flow > * { margin-block: 0; }

.sf-bf-inner,
.sf-bf-hero__inner,
.sf-bf-faq__inner {
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
}

/* ---------- Buttons ---------- */

.sf-bf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 12px 22px;
    border-radius: var(--r-btn);
    font: 900 17px/1.2 var(--font);
    text-decoration: none;
    border: 0;
    cursor: pointer;
    box-sizing: border-box;
    text-align: center;
}
.sf-bf-btn--buy { background: var(--red); color: var(--white); box-shadow: var(--soofos-shadow-red-cta); }
.sf-bf-btn--buy:hover,
.sf-bf-btn--buy:focus-visible { background: var(--red-hover); color: var(--white); }
.sf-bf-btn--buy[aria-disabled="true"] { background: var(--ink-2); box-shadow: none; cursor: default; }
.sf-bf-btn--ghost { background: var(--white); color: var(--deep-blue); border: 1px solid var(--card-border); font-size: 15px; min-height: 46px; }
.sf-bf-btn--ghost:hover { border-color: var(--blue); }
.sf-bf-btn--light { background: var(--white); color: var(--ink); min-height: 46px; font-size: 15px; }

/* ---------- Hero ---------- */

.sf-bf-hero {
    background: var(--ink);
    color: var(--on-navy);
    position: relative;
    overflow: hidden;
}
.sf-bf-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
    padding-block: 56px 132px;
    position: relative;
    z-index: 1;
}
.sf-bf-hero__copy { display: grid; gap: 20px; align-content: start; }
.sf-bf-hero__copy > * { margin: 0; }

.sf-bf-band {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    background: var(--red);
    color: var(--white);
    font-weight: 900;
    font-size: 15px;
    border-radius: var(--r-btn);
    padding: 6px 14px;
}
.sf-bf-title {
    font-size: clamp(40px, 6.2vw, 76px);
    line-height: .98;
    font-weight: 900;
    letter-spacing: -.035em;
    text-wrap: balance;
    color: var(--on-navy);
}
.sf-bf-lead {
    font-size: clamp(17px, 1.6vw, 20px);
    color: var(--on-navy-strong);
    max-width: 34ch;
    line-height: 1.45;
}
.sf-bf-lead b { color: var(--on-navy); }

/* Countdown: the course page's flash sale (red band + navy segments), grown. */
.sf-bf-countdown { justify-self: start; width: min(100%, 460px); }
.sf-bf-flash {
    border-radius: var(--r-card);
    overflow: hidden;
    box-shadow: var(--shadow-on-navy);
}
.sf-bf-flash__band {
    background: var(--red);
    color: var(--white);
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    padding: 7px 10px;
}
.sf-bf-flash__segs { display: flex; gap: 8px; background: var(--veil); padding: 12px; }
.sf-bf-flash__seg {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: var(--on-navy-fill);
    border: 1px solid var(--on-navy-line);
    border-radius: var(--r-btn);
    padding: 10px 4px;
    min-width: 0;
}
.sf-bf-flash__num { font-size: 34px; font-weight: 900; color: var(--on-navy); font-variant-numeric: tabular-nums; line-height: 1; }
.sf-bf-flash__unit { font-size: 12px; font-weight: 700; color: var(--on-navy-muted); }
.sf-bf-countdown--small .sf-bf-flash__num { font-size: 22px; }
.sf-bf-countdown--small .sf-bf-flash__seg { padding: 7px 2px; }
.sf-bf-countdown--small .sf-bf-flash__segs { padding: 10px; gap: 6px; }

.sf-bf-ended {
    background: var(--veil);
    border: 1px solid var(--on-navy-line);
    border-radius: var(--r-card);
    padding: 20px;
    display: grid;
    gap: 10px;
    justify-items: start;
    color: var(--on-navy-strong);
}
.sf-bf-ended p { margin: 0; }
.sf-bf-ended__title { font-size: 20px; font-weight: 900; color: var(--on-navy); }

/* Course wall: best sellers drifting, each tile with its sale price. */
.sf-bf-wall {
    position: relative;
    height: 520px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    transform: rotate(-6deg) translateY(-10px);
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
}
.sf-bf-wall__col { display: flex; flex-direction: column; gap: 14px; animation: sf-bf-drift 46s linear infinite; }
.sf-bf-wall__col:nth-child(2) { animation-direction: reverse; animation-duration: 54s; margin-top: -80px; }
.sf-bf-wall__col:nth-child(3) { animation-duration: 50s; margin-top: -30px; }
@keyframes sf-bf-drift { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.sf-bf-tile {
    position: relative;
    flex: none;
    border-radius: var(--r-card-sm);
    overflow: hidden;
    background: var(--ink-2);
    aspect-ratio: 3 / 2;
    box-shadow: var(--shadow-on-navy);
}
.sf-bf-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-bf-tile__off {
    position: absolute; right: 8px; top: 8px;
    background: var(--red); color: var(--white);
    font-weight: 900; font-size: 12px;
    border-radius: var(--r-btn); padding: 2px 7px;
}
.sf-bf-tile__tag {
    position: absolute; left: 8px; bottom: 8px;
    display: flex; gap: 6px; align-items: baseline;
    background: var(--white); border-radius: var(--r-btn);
    padding: 3px 8px; box-shadow: var(--shadow-soft);
}
.sf-bf-tile__tag b { color: var(--ink); font-size: 14px; font-weight: 900; }
.sf-bf-tile__tag s { color: var(--muted); font-size: 11.5px; }
@media (prefers-reduced-motion: reduce) { .sf-bf-wall__col { animation: none; } }

@media (max-width: 900px) {
    .sf-bf-hero__inner { grid-template-columns: minmax(0, 1fr); padding-block: 36px 120px; gap: 28px; }
    .sf-bf-wall { height: 230px; order: -1; transform: rotate(-4deg); margin-inline: -30px; }
    .sf-bf-wall__col:nth-child(2) { margin-top: -40px; }
    .sf-bf-countdown { justify-self: stretch; }
}

/* ---------- Deals (overlap the hero) ---------- */

.sf-bf-deals-wrap { margin-top: -96px; position: relative; z-index: 2; }
.sf-bf-deals__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.sf-bf-deals__grid[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sf-bf-deals__grid[data-n="1"] { grid-template-columns: minmax(0, 1fr); max-width: 600px; }
@media (max-width: 1060px) { .sf-bf-deals__grid[data-n="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .sf-bf-deals__grid, .sf-bf-deals__grid[data-n="3"] { grid-template-columns: minmax(0, 1fr); } }

.sf-bf-deal {
    background: var(--white);
    border: 1px solid var(--card-border);
    border-radius: var(--r-card-lg);
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-float);
    position: relative;
}
.sf-bf-deal.is-lead { border: 2px solid var(--blue); }
.sf-bf-deal__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sf-bf-deal__title { margin: 0; font-size: 26px; color: var(--ink); font-weight: 900; letter-spacing: -.01em; }
.sf-bf-deal__sub { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.sf-bf-deal__badge {
    flex: none;
    width: 76px; height: 76px;
    border-radius: 50%;
    background: var(--red); color: var(--white);
    display: grid; place-items: center; text-align: center;
    font-weight: 900; line-height: 1;
    transform: rotate(8deg);
}
.sf-bf-deal__badge b { font-size: 22px; display: block; }
.sf-bf-deal__badge small { font-size: 11px; font-weight: 800; }
.sf-bf-deal__badge--blue { background: var(--deep-blue); transform: none; }
.sf-bf-deal__price {
    display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    padding: 16px 0;
}
.sf-bf-deal__now { font-size: clamp(52px, 6vw, 68px); font-weight: 900; color: var(--ink); letter-spacing: -.04em; line-height: .9; }
.sf-bf-deals__grid[data-n="3"] .sf-bf-deal__now { font-size: clamp(44px, 4.4vw, 56px); }
.sf-bf-deal__side { display: grid; gap: 2px; padding-bottom: 4px; }
.sf-bf-deal__was { font-size: 17px; color: var(--muted); font-weight: 700; }
.sf-bf-deal__was s { color: var(--faint); }
.sf-bf-deal__per { font-size: 15px; font-weight: 800; color: var(--ink); }
.sf-bf-deal__checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.sf-bf-deal__checks li { display: flex; gap: 10px; font-size: 15px; color: var(--body); }
.sf-bf-deal__checks li::before {
    content: "";
    flex: none;
    width: 20px; height: 20px; margin-top: 1px;
    border-radius: 50%;
    background: var(--blue-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232261ab' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.sf-bf-deal .sf-bf-btn { margin-top: auto; width: 100%; }
.sf-bf-deal__fine { font-size: 13.5px; color: var(--muted); margin: -6px 0 0; text-align: center; }

/* ---------- Courses ---------- */

.sf-bf-courses { padding-block: 64px 24px; }
.sf-bf-deals-wrap:empty + .sf-bf-courses,
.sf-bf-hero + .sf-bf-courses { padding-top: 40px; }
.sf-bf-courses__title {
    font-size: clamp(26px, 3.2vw, 36px);
    color: var(--ink);
    font-weight: 900;
    margin: 0;
    letter-spacing: -.02em;
    text-wrap: balance;
    scroll-margin-top: 90px;
}
.sf-bf-courses__intro { color: var(--muted); margin: 6px 0 18px; max-width: 60ch; }
/* Members who have every course: the block's own note replaces the intro. */
.sf-bf-courses:has([data-all-access]) .sf-bf-courses__intro { display: none; }
.sf-bfc__note { color: var(--muted); margin: -12px 0 18px; max-width: 60ch; }

.sf-bfc__bar {
    position: sticky;
    top: var(--sf-nav-h, 0px);
    z-index: 5;
    background: var(--page);
    padding-block: 12px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 20px;
    display: grid;
    gap: 12px;
}
/* Categories: always two rows; on narrow screens both rows scroll sideways together. */
.sf-bfc__chips {
    display: grid;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-block: 2px;
}
.sf-bfc__chips::-webkit-scrollbar { display: none; }
@media (min-width: 1000px) {
    .sf-bfc__chips { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.sf-bfc__chip {
    border: 1px solid var(--card-border);
    background: var(--white);
    color: var(--ink);
    font: 700 14px var(--font);
    border-radius: var(--r-pill);
    padding: 0 14px;
    min-height: 42px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}
.sf-bfc__chip span { color: var(--muted); font-weight: 700; font-size: 12.5px; background: var(--canvas); border-radius: var(--r-pill); padding: 1px 7px; }
.sf-bfc__chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.sf-bfc__chip[aria-pressed="true"] span { background: var(--soofos-overlay-white-15); color: var(--white); }
@media (min-width: 1000px) {
    .sf-bfc__chip { overflow: hidden; text-overflow: ellipsis; }
}

.sf-bfc__tools { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sf-bfc__count { font-size: 14px; color: var(--muted); font-weight: 700; margin: 0; }
.sf-bfc__tools-r { display: flex; gap: 10px; }
.sf-bfc__search { position: relative; }
.sf-bfc__search svg { position: absolute; left: 11px; top: 13px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.sf-bfc__search input {
    font: 600 14px var(--font);
    height: 42px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-btn);
    padding: 0 12px 0 34px;
    width: 240px;
    background: var(--white);
    color: var(--ink);
    box-sizing: border-box;
}
.sf-bfc__sort select {
    font: 700 14px var(--font);
    height: 42px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-btn);
    padding: 0 10px;
    background: var(--white);
    color: var(--ink);
}
@media (max-width: 760px) {
    .sf-bfc__tools { flex-direction: column-reverse; align-items: stretch; }
    .sf-bfc__tools-r { width: 100%; }
    .sf-bfc__search { flex: 1; }
    .sf-bfc__search input { width: 100%; }
}

.sf-bfc__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1060px) { .sf-bfc__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .sf-bfc__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 420px) { .sf-bfc__grid { grid-template-columns: minmax(0, 1fr); } }
.sf-bfc__item, .sf-bfc__item .course-card-wrap { height: 100%; }
/* The campaign discount on the image and the sale price in red (mockup). */
.sf-bfc__card .course-card__badge { background: var(--red); color: var(--white); border-radius: var(--r-btn); font-size: 13px; top: 10px; left: 10px; }
.sf-bfc__sale { color: var(--red-ink); font-size: 18px; }

.sf-bfc__empty {
    background: var(--white);
    border: 1px dashed var(--card-border);
    border-radius: var(--r-card);
    padding: 32px;
    text-align: center;
    color: var(--muted);
    margin: 0;
}
.sf-bfc__more { display: flex; justify-content: center; margin-top: 28px; }

/* ---------- FAQ ---------- */

.sf-bf-faq { padding-block: 32px 72px; }
.sf-bf-faq__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; }
@media (max-width: 820px) { .sf-bf-faq__inner { grid-template-columns: minmax(0, 1fr); } }
.sf-bf-faq h2 { font-size: 28px; color: var(--ink); font-weight: 900; margin: 0; letter-spacing: -.01em; }
.sf-bf-faq details {
    background: var(--white);
    border: 1px solid var(--card-border);
    border-radius: var(--r-card-sm);
    padding: 16px 18px;
    margin: 0 0 10px;
}
.sf-bf-faq summary { font-weight: 800; color: var(--ink); cursor: pointer; }
.sf-bf-faq details p { margin: 8px 0 0; }

/* ---------- After the end (campaign.js or the server) ---------- */

.sf-bf.is-ended .sf-bf-deals-wrap,
.sf-bf.is-ended .sf-bf-courses,
.sf-bf.is-ended .sf-bf-wall,
.sf-bf:has(.sf-bf-countdown .sf-bf-ended:not([hidden])) .sf-bf-courses { display: none; }
.sf-bf.is-ended .sf-bf-hero__inner,
.sf-bf:has(.sf-bf-countdown .sf-bf-ended:not([hidden])) .sf-bf-hero__inner { padding-block-end: 64px; }
