/*
 * MailCheck'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;
}

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

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

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

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

/* Guides (Guides/GuideArticle.razor): one readable column with breadcrumbs, the text with the button, and the questions. */
.guide-page {
    padding: var(--space-7) 0 var(--space-8);
}

.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;
    hyphens: auto;
}

.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);
    }

    .guide-prose > .guide-cta {
        margin: var(--space-2) 0;
    }

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

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

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

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

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

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

.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). */
.mc-hero {
    /* In landscape on a phone with a notch (viewport-fit=cover) the hero keeps clear of the insets, as Design's
       .zv-section and .zv-header-inner do (AppHeader.md "Installerad app (safe area)"). */
    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);
}

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

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

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

.mc-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 0.7rem 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 button Work mode (Design: docs/components/Tip.md): MailCheck has no modes, so it has a row of its own above the
   tool, at the right, on a phone too. The tip under the result is a row in the tool's flex column (css/tool.css). */
.mc-tool-top {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 var(--space-3);
}

/* "Save as app" after the shortcut's hint at the right of the status bar: the hint keeps margin-left: auto. */
.zv-tool-status .mc-status-install {
    margin-left: var(--space-3);
}

/* ---- The work mode (/arbeta, /work, Shared/WorkLayout): Zavanto/Design's tool shell and tool header. MailCheck has no
   modes in the middle, so the buttons go to the right on their own. The theme button shows where it switches to, as
   in the start page's header (Shared/MainLayout.razor.css). ---- */
.mc-work-shell .zv-tool-actions {
    margin-left: auto;
}

.mc-work-shell .theme-toggle span {
    display: flex;
}

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

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

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

.mc-work-shell .zv-tool-btn .icon,
.mc-work-shell .zv-tool-more .icon,
.mc-work-shell .zv-tool-menu .icon {
    width: 16px;
    height: 16px;
}

.mc-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);
}

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

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

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

.mc-work-tool .mc-tool-notice {
    margin: var(--space-3);
}

@media (max-width: 719.98px) {
    .mc-work-shell .zv-tool-more {
        margin-left: auto;
    }

    .mc-work-shell .zv-tool-more .icon {
        width: 20px;
        height: 20px;
    }
}
