/*
 * SendCheck's own styles. The look comes from the Zavanto design system: tokens in zavanto/css/tokens.css
 * and the zv- components in zavanto/css/components.css (both copied from Zavanto/Design, see design/zavanto/README.md).
 * This file only adds page layout, icons and what the mockup has that the components lack. The tool's own
 * styles are in css/tool.css. Token names only, never colour values.
 * No external fonts or CDNs: the CSP only allows files from this site.
 */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
    margin: 0;
}

h1:focus, [tabindex="-1"]:focus {
    outline: none;
}

p {
    margin: 0;
}

a {
    color: var(--accent-ink);
}

    a:hover {
        text-decoration-thickness: 2px;
    }

a.zv-btn {
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

code {
    font-family: var(--font-mono);
}

/* Icons (Shared/Icon.razor): 2px line, round ends, currentColor. */

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-bold {
    stroke-width: 2.4;
}

.zv-feature-icon .icon {
    width: 22px;
    height: 22px;
}

/* Error and 404 pages: one narrow column. */

.narrow {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 max(var(--space-5), var(--zv-safe-right)) 0 max(var(--space-5), var(--zv-safe-left));
}

.page-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.page-intro {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .page-intro h1 {
        font-size: 36px;
        line-height: 42px;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

.lead {
    font-size: 18px;
    line-height: 28px;
    color: var(--ink-muted);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
}

/* Home page: sections page-max wide, space-9 apart (the mockup's 56px top and 88px bottom). */

.home {
    display: flex;
    flex-direction: column;
    gap: var(--space-9);
    padding-top: calc(56px - var(--space-7));
    padding-bottom: calc(var(--space-9) - 56px);
}

.zv-hero, .zv-section {
    width: 100%;
}

/* Hero: the text, then the tool across the page's width (the tool needs the room for its two columns). */
.sc-hero {
    /* In landscape on a phone (viewport-fit=cover) the hero keeps clear of the notch, as Design's sections do. */
    padding-left: max(var(--space-5), var(--zv-safe-left));
    padding-right: max(var(--space-5), var(--zv-safe-right));
    flex-direction: column;
    /* Wrapping a column makes the tool's line as tall as the text's flex basis allows, leaving a gap under it. */
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--space-6);
}

.sc-hero-text {
    flex: 0 0 auto;
    max-width: var(--content-max);
}

.sc-hero-tool {
    display: flex;
    flex-direction: column;
    min-width: 0;
    scroll-margin-top: var(--space-5);
}

.sc-tool-notice {
    margin-top: var(--space-4);
}

.sc-tool-notice[hidden] {
    display: none;
}

.zv-notice .icon {
    width: 22px;
    height: 22px;
}

.zv-notice .zv-notice-body {
    font-size: 15px;
    line-height: 1.5;
}

.zv-cta .zv-btn-primary {
    flex: 0 0 auto;
}

@media (max-width: 600px) {
    .home {
        gap: var(--space-8);
        padding-top: 0;
    }

    .page-intro h1 {
        font-size: 30px;
        line-height: 36px;
    }

    .zv-compare {
        padding: var(--space-5);
    }

    .zv-cta {
        padding: var(--space-6) var(--space-5);
    }

    /* On a narrow phone the button takes the band's width and may wrap, instead of running past the screen. */
    .zv-cta .zv-btn-primary {
        flex: 1 1 auto;
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zv-faq summary svg {
        transition: none;
    }
}

/* Blazor */

#blazor-error-ui {
    background: var(--warning-soft);
    color: var(--ink);
    border-top: 1px solid var(--warning-line);
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem calc(0.7rem + var(--zv-safe-bottom)) 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* The tool's script shows and hides parts with the hidden attribute; a component that sets display must not
   override it. */
[hidden] {
    display: none !important;
}

/* ---- The start page's way to the work mode, under the tool ---- */
/* The Work mode button (Design: docs/components/Tip.md) at the right above the tool, on its own row: the tool has no
   choice of modes above it on the start page. */
.sc-tool-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--space-3);
}

/* The tip about the work mode, under the result (or the form, after Edit and check again). */
.sc-tip {
    margin-top: var(--space-4);
}

/* ---- The work mode (/arbeta, /work, Shared/WorkLayout): Zavanto/Design's tool shell and tool header. The theme
   button there shows where it switches to, as in the start page's header (Shared/MainLayout.razor.css). ---- */
.sc-work .theme-toggle span {
    display: flex;
}

.sc-work .theme-toggle .theme-icon-sun,
.sc-work .theme-toggle[data-current="dark"] .theme-icon-moon {
    display: none;
}

.sc-work .theme-toggle[data-current="dark"] .theme-icon-sun {
    display: flex;
}

.sc-work .zv-tool-menu .theme-toggle span[aria-hidden] {
    display: inline;
}

.sc-work-menu-note {
    display: flex;
    gap: var(--space-2);
    margin: var(--space-2) 0 0;
    padding: var(--space-2) var(--space-3);
    font-size: 13px;
    line-height: 18px;
    color: var(--ink-muted);
}

.sc-work-menu-note .icon {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    margin-top: 2px;
}

/* Save as app (Tip.md): left of it the shortcut hint, both at the right of the status bar. In the menu, the icon is
   drawn as the menu's other icons. */
.zv-tool-status-end + .zv-tool-status-end {
    margin-left: var(--space-4);
}

.zv-tool-menu [data-zv-install-open] svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.zv-tool-status .icon {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.sc-work-tool {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Home page: the guides under the questions (Guides/Guide.cs). */
.sc-guides {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-6);
}

    .sc-guides h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
    }

    .sc-guides ul {
        margin: 0;
        padding-left: 22px;
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        font-size: 16px;
        line-height: 1.5;
    }

    .sc-guides a {
        font-weight: 600;
    }

/* Guides (Guides/GuideArticle.razor): one readable column with breadcrumbs, the text, the button, the questions and
   "Read next", as in DataMask's guides. */
.guide-page {
    padding: var(--space-2) 0 var(--space-6);
}

.guide {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.guide-crumbs ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: 14px;
    color: var(--ink-muted);
}

    .guide-crumbs li + li::before {
        content: "›";
        margin-right: var(--space-2);
    }

.guide-title {
    margin: 0;
    font-size: 36px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
}

.guide-prose {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    font-size: 17px;
    line-height: 1.7;
}

    .guide-prose > * {
        margin: 0;
    }

    .guide-prose h2 {
        margin-top: var(--space-5);
        font-size: 24px;
        line-height: 1.25;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

    .guide-prose ul,
    .guide-prose ol {
        padding-left: 22px;
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
    }

/* The button to the tool, in the text where the guide names it. */
.guide-cta {
    padding: var(--space-2) 0;
}

.guide-faq {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

    .guide-faq h2,
    .guide-end h2 {
        margin: 0;
        font-size: 24px;
        line-height: 1.25;
        font-weight: 700;
    }

.guide-end {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
}

.guide-more {
    margin: 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: 16px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .guide-title {
        font-size: 30px;
    }

    .guide-prose {
        font-size: 16px;
    }
}
