/* Public site look: Hanken Grotesk, a wider menu bar, glass panels and footer, and the home
   page's teaching cards. It sits on top of site.css and themes.css, so the colour themes and
   backgrounds from Admin > Appearance still apply.

   Loaded by _Layout.cshtml (public pages and the instructor portal). The admin area has its own
   layout and does not use it. _Layout puts these classes on <html>:
     sds-site     every page
     sds-reading  forms and long text: their content keeps the narrower Bootstrap width */

/* ---------------------------------------------------------------- font */
html.sds-site {
    --font-sans: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    --font-serif: var(--font-sans);
}

/* site.css (and the tutorial diagrams) name Inter directly in these places. */
html.sds-site body,
html.sds-site :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6),
html.sds-site .sds-hero-overline,
html.sds-site .sds-motto,
html.sds-site .reviews-summary-score,
html.sds-site .stat-card .stat-value,
html.sds-site .mini-step-number,
html.sds-site main svg text { font-family: var(--font-sans); }

html.sds-site body { -webkit-font-smoothing: antialiased; }

/* Hanken Grotesk has a smaller x-height than Inter (about 9%), so at the same size it reads smaller.
   font-size-adjust scales the glyphs up by about 5% and leaves line heights and layout alone.
   Form controls reset it in the browser's own stylesheet, and the tutorial diagrams are drawn to
   fit their labels, so those are set explicitly. */
html.sds-site { font-size-adjust: 0.525; }
html.sds-site :is(input, select, textarea, button, optgroup) { font-size-adjust: inherit; }
html.sds-site main svg text { font-size-adjust: none; }

/* ---------------------------------------------------------------- width */
/* Plain and "Clean sections" backgrounds. */
@media (min-width: 1200px) {
    html.sds-site .sds-navbar > .container,
    html.sds-site .sds-footer > .container,
    html.sds-site .sds-footer-bottom > .container,
    html.sds-site:not(.sds-reading) main > .container,
    html.sds-site:not(.sds-reading) main > section > .container { max-width: min(100% - 48px, 1600px); }
}

@media (min-width: 1400px) {
    html.sds-site .sds-navbar > .container,
    html.sds-site .sds-footer > .container,
    html.sds-site .sds-footer-bottom > .container,
    html.sds-site:not(.sds-reading) main > .container,
    html.sds-site:not(.sds-reading) main > section > .container { max-width: min(100% - 64px, 1600px); }
}

/* City photo and glow backgrounds: the menu bar and the glass panels share one width. */
@media (min-width: 576px) {
    html.sds-site:is([data-layers="city"], [data-layers="glow"]):not([data-admin]) { --sds-shell: calc(100% - 24px); }
}

@media (min-width: 1200px) {
    html.sds-site:is([data-layers="city"], [data-layers="glow"]):not([data-admin]) { --sds-shell: calc(100% - 48px); }
    html.sds-site:not(.sds-reading):is([data-layers="city"], [data-layers="glow"]):not([data-admin]) main > section > .container,
    html.sds-site:not(.sds-reading):is([data-layers="city"], [data-layers="glow"]):not([data-admin]) main > div.container { padding-left: 48px; padding-right: 48px; }
}

@media (min-width: 1400px) {
    html.sds-site:is([data-layers="city"], [data-layers="glow"]):not([data-admin]) { --sds-shell: min(100% - 64px, 1600px); }
}

/* Forms and long text: the panel is wide, its content stays at the usual Bootstrap width in the
   middle. --sds-read is that width; --sds-edge is the space the content had inside its panel. */
@media (min-width: 576px) {
    html.sds-site.sds-reading { --sds-read: 540px; --sds-edge: 18px; --sds-fluid-edge: 12px; }
}

@media (min-width: 768px) {
    html.sds-site.sds-reading { --sds-read: 720px; --sds-edge: 28px; }
}

@media (min-width: 992px) {
    html.sds-site.sds-reading { --sds-read: 960px; --sds-fluid-edge: 48px; }
}

@media (min-width: 1200px) {
    html.sds-site.sds-reading { --sds-read: 1140px; }
}

@media (min-width: 1400px) {
    html.sds-site.sds-reading { --sds-read: 1320px; }
}

@media (min-width: 576px) {
    /* A section is the panel, and its container sits inside it. */
    html.sds-site.sds-reading:is([data-layers="city"], [data-layers="glow"]):not([data-admin]) main > section > .container {
        padding-left: calc((100% - var(--sds-read)) / 2 + var(--sds-edge));
        padding-right: calc((100% - var(--sds-read)) / 2 + var(--sds-edge));
    }

    /* Here the container itself is the panel (percentages are of the whole page width). */
    html.sds-site.sds-reading:is([data-layers="city"], [data-layers="glow"]):not([data-admin]) main > div.container:not(.sds-flash) {
        padding-left: calc((var(--sds-shell) - var(--sds-read)) / 2 + 12px) !important;
        padding-right: calc((var(--sds-shell) - var(--sds-read)) / 2 + 12px) !important;
    }

    html.sds-site.sds-reading:is([data-layers="city"], [data-layers="glow"]):not([data-admin]) main > div.container-fluid {
        padding-left: calc((var(--sds-shell) - var(--sds-read)) / 2 + var(--sds-fluid-edge)) !important;
        padding-right: calc((var(--sds-shell) - var(--sds-read)) / 2 + var(--sds-fluid-edge)) !important;
    }
}

/* ---------------------------------------------------------------- home: slider and search */
/* The photo slider gets the larger half of the hero. */
@media (min-width: 992px) {
    html.sds-site .sds-hero .row > .col-lg-7 { width: 45%; }
    html.sds-site .sds-hero .row > .col-lg-5 { width: 55%; }
    html.sds-site .sds-hero .sds-showcase-frame { max-width: 900px; }
}

@media (min-width: 1200px) {
    html.sds-site .find-instructor-card { max-width: 1100px; }
}

/* ---------------------------------------------------------------- package cards */
/* Wider package cards get taller photos, so the pictures keep their shape.
   The views set these heights inline, hence !important. */
@media (min-width: 1400px) {
    html.sds-site .sds-package-grid .package-card { --sds-thumb-h: 230px !important; }
    html.sds-site .sds-package-grid .package-card > .card-img-top { height: 230px !important; }
    html.sds-site .sds-package-grid .package-card:has(> .package-thumb-fallback) { --sds-thumb-h: 190px !important; }
    html.sds-site .sds-package-grid .package-card > .package-thumb-fallback { height: 190px !important; }

    html.sds-site .sds-package-row .package-card { --sds-thumb-h: 170px !important; }
    html.sds-site .sds-package-row .package-card > .card-img-top { height: 170px !important; }
    html.sds-site .sds-package-row .package-card:has(> .package-thumb-fallback) { --sds-thumb-h: 150px !important; }
    html.sds-site .sds-package-row .package-card > .package-thumb-fallback { height: 150px !important; }
}

/* ---------------------------------------------------------------- page type and photos */
/* Type on very wide screens. */
@media (min-width: 1400px) {
    html.sds-site .sds-hero h1 { font-size: 4rem; }
    html.sds-site .sds-hero .lead { font-size: 1.25rem; max-width: 36rem; }
    html.sds-site .sds-about-intro p { font-size: 1.125rem; }
    html.sds-site .sds-about-intro p.lead { font-size: 1.375rem; }
}

/* About: with wider columns the photographs stand taller than the words, so both start at the top. */
@media (min-width: 992px) {
    html.sds-site .sds-about-intro { align-items: flex-start !important; }
}

/* Suburbs: these two photographs are small files, so they are not stretched across the wider page. */
html.sds-site .sds-suburb-photos { max-width: 1000px; margin-left: auto; margin-right: auto; }

/* ---------------------------------------------------------------- home: teaching and test day */
html.sds-site .sds-duo { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--spacing-5); }
html.sds-site .sds-duo > article { display: flex; flex-direction: column; align-items: flex-start; border-radius: 20px; padding: var(--spacing-5); }
html.sds-site main .sds-duo .section-title { font-size: clamp(1.875rem, 1.2vw + 1.45rem, 2.75rem); font-weight: 500; line-height: 1.1; letter-spacing: -.028em; margin-bottom: var(--spacing-4); }
html.sds-site main .sds-duo p { margin-bottom: var(--spacing-4); line-height: 1.625; }

/* Both photographs sit at the foot of their card, so the two line up. */
html.sds-site .sds-duo__photo { display: block; width: 100%; max-width: none; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 12px; margin: auto 0 var(--spacing-4); }
/* The school car is on a white background, so it is shown whole on white. */
html.sds-site .sds-duo__photo.sds-testday-car { object-fit: contain; background: #fff; border: 1px solid var(--color-border); max-width: none; border-radius: 12px; margin: auto 0 var(--spacing-4); }

html.sds-site .sds-duo__dark { background: var(--color-primary); color: var(--color-on-dark-muted); }
html.sds-site main .sds-duo__dark .section-title { color: var(--color-primary-foreground); }
html.sds-site main .sds-duo__dark p { color: var(--color-on-dark-muted); }
html.sds-site main .sds-duo__dark .sds-text-link { color: color-mix(in srgb, var(--color-accent-light) 65%, #fff); }
html.sds-site main .sds-duo__dark a:focus-visible { outline: 3px solid var(--color-accent-light); outline-offset: 3px; }
html.sds-site .sds-duo__dark .sds-text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; }

html.sds-site .sds-duo__light { background: var(--color-surface); border: 1px solid var(--color-border); }
html.sds-site .sds-duo__light .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }

@media (min-width: 640px) {
    html.sds-site .sds-duo > article { padding: var(--spacing-7); }
}

@media (min-width: 992px) {
    html.sds-site .sds-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    html.sds-site .sds-duo > article { padding: var(--spacing-8); }
}

@media (max-width: 479.98px) {
    html.sds-site .sds-duo__light .btn { width: 100%; }
}
