/* Landing block presentation styles
 *
 * First-party landing block widgets (apps/shortcodes/landing_widgets.py) used
 * to ship their structural CSS inside an inline <style> block in each template.
 * The HTML sanitizer (apps/content/services/html_sanitizer.py) strips <style>
 * tags and style attributes on non-God-Mode content, which silently removed the
 * CSS that these blocks depend on. Presentation CSS that a block needs in order
 * to render at all must therefore live here, in a stylesheet that is loaded in
 * every render context (public base, standalone landing pages, editor preview).
 *
 * Only static rules belong here. Per-instance values (e.g. background image,
 * overlay opacity) are passed as CSS custom properties via an inline style on a
 * <div>/<span>, which the sanitizer preserves.
 */

/* ============================================================
   Parallax Section (parallax_section / parallax-section)
   ============================================================ */
.parallax-section {
    position: relative;
    min-height: var(--parallax-min-height, 60vh);
    display: flex;
    align-items: center;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: var(--parallax-text-color, #ffffff);
    background-attachment: fixed;
}

.parallax-section__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, var(--parallax-overlay-opacity, 0.45));
}

/* row 811f1: the focal point is a class (the sanitizer strips an inline
   ``style`` outside God Mode). ``center`` keeps the base rule above and adds
   no class; every other registered choice sets ``background-position``. */
.parallax-section--pos-top {
    background-position: top;
}

.parallax-section--pos-bottom {
    background-position: bottom;
}

.parallax-section--pos-left {
    background-position: left;
}

.parallax-section--pos-right {
    background-position: right;
}

.parallax-section__content {
    position: relative;
    z-index: 2;
}

@media (max-width: 991.98px) {
    .parallax-section {
        /* fixed attachment is unreliable on mobile; fall back to scroll */
        background-attachment: scroll;
    }
}

/* ============================================================
   Gallery (gallery / ck-gallery-widget)
   Builtin widget in apps/shortcodes/widgets.py; its inline <style>
   is stripped by the sanitizer, so its structural CSS lives here.
   The --ck-gallery-columns custom property is passed inline on the
   wrapper <div> (preserved by the sanitizer).
   ============================================================ */
.ck-gallery-widget {
    margin: 1.5rem 0;
}

.ck-gallery-widget__items {
    display: grid;
}

.ck-gallery-widget--stack .ck-gallery-widget__items {
    grid-template-columns: 1fr;
}

.ck-gallery-widget--grid .ck-gallery-widget__items {
    grid-template-columns: repeat(var(--ck-gallery-columns, 3), minmax(0, 1fr));
}

.ck-gallery-widget--gap-none .ck-gallery-widget__items {
    gap: 0;
}

.ck-gallery-widget--gap-small .ck-gallery-widget__items {
    gap: 0.5rem;
}

.ck-gallery-widget--gap-medium .ck-gallery-widget__items {
    gap: 1rem;
}

.ck-gallery-widget--gap-large .ck-gallery-widget__items {
    gap: 1.5rem;
}

.ck-gallery-widget__item {
    margin: 0;
}

.ck-gallery-widget__link {
    display: block;
}

.ck-gallery-widget__image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* Grid presentation: uniform cropped tiles so mixed-orientation photos
   line up instead of rendering at full natural height. */
.ck-gallery-widget--grid .ck-gallery-widget__image {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.ck-gallery-widget__image--carousel {
    max-height: min(75vh, 720px);
    object-fit: contain;
    background: rgba(0, 0, 0, 0.04);
}

@media (max-width: 767px) {
    .ck-gallery-widget--grid .ck-gallery-widget__items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ============================================================
   Team Grid (team_grid)
   The img sizing is set via an inline style attribute that the
   sanitizer strips, so photos rendered at full resolution. Static
   sizing + card styling restored here; the rounded-circle/rounded-3
   shape classes are Bootstrap and survive sanitization.
   ============================================================ */
.team-section .team-photo img,
.team-section .photo-placeholder {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

.team-section .team-photo img {
    display: block;
    margin: 0 auto;
}

.team-section .team-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-section .team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.team-section .team-name {
    font-weight: 600;
}

.team-section .team-role {
    font-weight: 500;
    font-size: 0.9rem;
}

.team-section .team-bio {
    line-height: 1.5;
}

.team-section .team-social .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

@media (max-width: 768px) {
    .team-section .team-photo img,
    .team-section .photo-placeholder {
        width: 120px;
        height: 120px;
    }
}

/* ============================================================
   Product grid card image box (product-catalog 14a fixup b)
   Classes, not inline styles: the sanitizer drops style attributes in
   rendered bodies. The theme tokens --ck-product-card-ratio (1 / 1, 4 / 3,
   3 / 4) and --ck-product-card-fit (cover, contain) choose the box.
   ============================================================ */
.ck-product-card__media {
    aspect-ratio: var(--ck-product-card-ratio, 1 / 1);
    overflow: hidden;
}

.ck-product-card__media img {
    object-fit: var(--ck-product-card-fit, cover);
}

.ck-product-card__placeholder {
    background: var(--bg-tertiary);
}

/* ============================================================
   Category tile image box (row 810p)
   The tile keeps a fixed 4:3 box on every screen: the responsive image's
   intrinsic width/height attributes no longer stretch it on a phone. The
   theme tokens --ck-category-tile-ratio (e.g. 4 / 3, 1 / 1, 3 / 4) and
   --ck-category-tile-fit (cover, contain) choose the box. Classes, not
   inline styles: the sanitizer drops style attributes in rendered bodies.
   ============================================================ */
.ck-category-tile .card-img-top {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--ck-category-tile-ratio, 4 / 3);
    object-fit: var(--ck-category-tile-fit, cover);
}

.ck-category-tile__placeholder {
    aspect-ratio: var(--ck-category-tile-ratio, 4 / 3);
}

/* ============================================================
   Compact product row (product-catalog 14b-2)
   One dense row per product for large catalogues: thumbnail, title with
   author and condition, price and availability. Single line from md up,
   two lines on a phone; long text wraps. Classes, not inline styles, so it
   survives sanitized bodies. Theme variables only.
   ============================================================ */
.ck-products-list {
    margin: 0;
    padding: 0;
}

.ck-product-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    min-width: 0;
}

.ck-product-row__thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    object-fit: contain;
    object-position: center;
    background: var(--bg-tertiary);
    border-radius: 0.25rem;
}

.ck-product-row__placeholder {
    display: block;
    background: var(--bg-tertiary);
}

.ck-product-row__text {
    flex: 1 1 12rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-wrap: anywhere;
}

.ck-product-row__title {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
    min-width: 0;
}

.ck-product-row__author,
.ck-product-row__condition {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.ck-product-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.ck-product-row--sold-out .ck-product-row__thumb {
    opacity: 0.6;
}

@media (min-width: 768px) {
    .ck-product-row {
        flex-wrap: nowrap;
    }

    .ck-product-row__meta {
        flex: 0 0 auto;
        justify-content: flex-end;
        text-align: right;
    }
}

/* ============================================================
   Product archive filters toggle (product-catalog 28, row 485)
   Below md the filter form folds behind a button. The collapsing class is
   added by JavaScript only, so without JS the form stays open and the
   (server-hidden) button never shows.
   ============================================================ */
.ck-products-filters-toggle {
    min-height: 44px;
    width: 100%;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.ck-products-filters-toggle[hidden] {
    display: none;
}

@media (max-width: 767.98px) {
    .ck-products-filters.is-collapsed {
        display: none;
    }
}

@media (min-width: 768px) {
    .ck-products-filters-toggle {
        display: none;
    }
}

/* ============================================================
   Shared landing block colour band (site-gaps rows 809a/809b, fixup c)
   The section keeps its original py-* padding exactly as v2026.12.02 had it,
   so site CSS that pads a section still applies and colour never doubles the
   spacing. The author background paints on `.ck-band`, an absolutely
   positioned layer that covers the section's padding edge to edge; the
   readable text colour lives on the padding-free `.ck-band-content` above it.
   The sanitizer keeps the layer's inline style because it is a <div>.

   No colour set -> neither element is emitted, so the block renders exactly
   as v2026.12.02 did.
   ============================================================ */
.ck-band-host {
    position: relative;
    isolation: isolate;
}

.ck-band {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.ck-band-content {
    position: relative;
    z-index: 1;
}

/* Only the band's own title follows --ck-band-heading (the readable colour the
   server chose, or the theme heading colour when that already reaches 4.5:1).
   The titles of the in-scope blocks are `.display-5` / `.display-6`; card
   headings are `.feature-title` / `.team-name` / `.accordion-header` (h3) and
   keep the card's own foreground (row 809a fixup a). Weighs (0,2,1), beating
   main.css's heading rule without an important declaration. */
section .ck-band-content .display-5,
section .ck-band-content .display-6 {
    color: var(--ck-band-heading, inherit);
}

/* Muted/secondary text in the band uses the derived --ck-band-muted (≥ 4.5:1
   against the band). main.css paints .text-muted with --text-muted and
   !important, so this override needs an important declaration too. */
section .ck-band-content .text-muted {
    color: var(--ck-band-muted, var(--text-muted)) !important;
}

section .ck-band-content .text-secondary {
    color: var(--ck-band-muted, var(--text-secondary)) !important;
}

/* A card that paints its own surface keeps the theme's muted colour on its own
   background: neither the derived custom property nor the muted rules may leak
   into it and paint light-grey text on a white card. */
.ck-band-content :is(.ck-surface, .card, .accordion-item, .feature-card,
    .team-card, .connect-card, .book-card, .credential-card, .credential-badge,
    .appointment-card, .contact-form-wrapper, .insurance-item) {
    --bs-secondary-color: var(--text-secondary);
    --bs-secondary-rgb: 108, 117, 125;
}

section .ck-band-content :is(.ck-surface, .card, .accordion-item, .feature-card,
    .team-card, .connect-card, .book-card, .credential-card, .credential-badge,
    .appointment-card, .contact-form-wrapper, .insurance-item) .text-muted {
    color: var(--text-muted) !important;
}

section .ck-band-content :is(.ck-surface, .card, .accordion-item, .feature-card,
    .team-card, .connect-card, .book-card, .credential-card, .credential-badge,
    .appointment-card, .contact-form-wrapper, .insurance-item) .text-secondary {
    color: var(--text-secondary) !important;
}

/* ============================================================
   Block anchors (row 811f2)
   A block's optional anchor is a zero-height marker right before it, or
   the section's own id. The scroll margin clears the sticky site nav so a
   jump never hides the block under it; override --ck-anchor-scroll-margin
   on :root to match a taller nav.
   This stylesheet is loaded on the normal public layout AND on the
   standalone landing layout (which does not load main.css), so the smooth
   scroll pair lives here as well: reduce-motion wins on both.
   ============================================================ */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

.ck-anchor {
    display: block;
    height: 0;
    scroll-margin-top: var(--ck-anchor-scroll-margin, 5rem);
}

section[id] {
    scroll-margin-top: var(--ck-anchor-scroll-margin, 5rem);
}
