/*
 * Phone layout fixes (Mefat, 2026-11-18, 15-point list). Loaded last on every page (partials/brand-head).
 * Script: public/assets/js/osh-mobile.js (menu, "Contents" sheet, compare fold).
 * Sections: 1 header menu, 2 home, 3 articles (width, byline, sidebar, contents sheet), 4 article tables,
 * 5 product page, 6 business compare, 7 footer.
 */

/* Short words that only phones show (byline); long ones hide there. */
.osh-m-short { display: none; }

/* ---------- 1. Header: full-screen menu on phones ---------- */
.osh-bh-menu-close, .osh-bh-burger { display: none; }
@media (max-width: 767px) {
    .osh-bh-menu > summary { gap: 10px; padding: 0 14px; user-select: none; -webkit-tap-highlight-color: transparent; }
    .osh-bh-burger { display: inline-grid; gap: 5px; width: 18px; }
    .osh-bh-burger i { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform var(--osh-motion-fast, .15s); }
    .osh-bh-menu[open] .osh-bh-menu-open { display: none; }
    .osh-bh-menu[open] .osh-bh-menu-close { display: inline; }
    .osh-bh-menu[open] .osh-bh-burger i:first-child { transform: translateY(3.5px) rotate(45deg); }
    .osh-bh-menu[open] .osh-bh-burger i:last-child { transform: translateY(-3.5px) rotate(-45deg); }

    /* While open: the page stays still, the header turns petrol and joins the panel. The blur must go,
       because a blurred header would trap the fixed panel inside itself. */
    html.osh-menu-open { overflow: hidden; }
    html.osh-menu-open .osh-bh { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--osh-petrol); color: #fff; border-bottom-color: rgb(255 255 255 / .14); }
    html.osh-menu-open .osh-bh .osh-bh-logo img.osh-only-light { display: none !important; }
    html.osh-menu-open .osh-bh .osh-bh-logo img.osh-only-dark { display: block !important; }
    html.osh-menu-open .osh-bh-menu > summary { border-color: rgb(255 255 255 / .5); }

    .osh-bh-menu .osh-bh-panel {
        position: fixed; inset: var(--osh-bh-h, 65px) 0 0 0; z-index: 99; width: auto;
        display: flex; flex-direction: column; gap: 28px;
        padding: 20px var(--osh-space-lg) calc(28px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto; overscroll-behavior: contain;
        border: 0; border-radius: 0; background: var(--osh-petrol); color: #fff;
        animation: osh-menu-in .22s ease-out both;
    }
    @keyframes osh-menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
    @media (prefers-reduced-motion: reduce) { .osh-bh-menu .osh-bh-panel { animation: none; } }
    /* faint radar rings behind the doors, the brand's one decoration */
    .osh-bh-menu .osh-bh-panel::before { content: ""; position: fixed; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; pointer-events: none;
        background: repeating-radial-gradient(circle, transparent 0 46px, rgb(255 255 255 / .05) 46px 47px); }
    .osh-bh-panel > * { position: relative; }

    .osh-bh-panel a.osh-bh-psearch { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border: 1px solid rgb(255 255 255 / .28); border-radius: 10px; background: rgb(255 255 255 / .07); color: rgb(255 255 255 / .82); font-size: 16px; }
    .osh-bh-psearch svg { flex: none; }

    .osh-bh-pdoor ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; padding: 0; border: 0; list-style: none; }
    .osh-bh-panel .osh-bh-pdoor a.is-door { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 2px 12px; min-height: 0; padding: 0 0 12px; border-bottom: 1px solid rgb(255 255 255 / .2); font-weight: 400; }
    .osh-bh-pk { grid-column: 1; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / .62); }
    .osh-bh-pdoor a[aria-current] .osh-bh-pk::after { content: " · you are here"; text-transform: none; letter-spacing: 0; font-weight: 400; }
    .osh-bh-pname { grid-column: 1; font: 500 40px/1.05 var(--osh-font-editorial); letter-spacing: -.01em; }
    .osh-bh-pdoor a.is-door svg { grid-column: 2; grid-row: 1 / span 2; align-self: center; transition: transform var(--osh-motion-fast, .15s); }
    .osh-bh-pdoor a.is-door:active svg { transform: translateX(4px); }
    .osh-bh-panel .osh-bh-pdoor a.is-sub { display: flex; align-items: center; min-height: 52px; height: 100%; padding: 10px 12px; border: 1px solid rgb(255 255 255 / .16); border-radius: 10px; background: rgb(255 255 255 / .04); color: #fff; font-size: 15px; font-weight: 500; line-height: 1.25; }
    .osh-bh-panel .osh-bh-pdoor a.is-sub:active { background: rgb(255 255 255 / .14); }

    .osh-bh-pfoot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 20px; border-top: 1px solid rgb(255 255 255 / .2); }
    .osh-bh-pfoot .osh-bh-panel-theme, .osh-bh-panel .osh-bh-pfoot a.osh-bh-pme { display: inline-flex; align-items: center; gap: 8px; width: auto; min-height: 44px; padding: 0 16px; border: 1px solid rgb(255 255 255 / .3); border-radius: 999px; background: none; color: #fff; font-size: 15px; font-weight: 600; }
    .osh-bh-panel .osh-bh-pfoot a.osh-bh-pme.is-up { background: #fff; color: var(--osh-petrol); border-color: #fff; }
    .osh-bh-panel a:focus-visible, .osh-bh-panel button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
}

/* ---------- 2. Home ---------- */
.osh-hp-strip li.is-narrow { display: none; }
@media (max-width: 767px) {
    /* 1. both hero buttons on one line */
    .osh-hp-actions { flex-wrap: nowrap; gap: var(--osh-space-sm); }
    .osh-hp-actions .osh-btn { flex: 1 1 auto; min-width: 0; justify-content: center; padding-inline: 12px; white-space: nowrap; font-size: clamp(14px, 3.9vw, 16px); }
    /* 15. tested-tools row: six logos and "+N" in one row that never scrolls */
    .osh-hp-strip ul { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; overflow: visible; padding-bottom: 0; }
    .osh-hp-strip li.is-wide { display: none; }
    .osh-hp-strip li.is-narrow { display: block; }
    .osh-hp-strip a { width: 100%; height: auto; aspect-ratio: 1; padding: 18%; }
    .osh-hp-strip .osh-hp-more-logos { padding: 0; font-size: 14px; }
    /* 2. comparison cards: one swipeable row of equal cards. The desktop rule (3 columns) sat later in
       osh-home.css and won, which squeezed the first three cards to 0px: the "3 borders" and the tall empty card. */
    .osh-hp .osh-hp-cmp { grid-template-columns: none; }
    .osh-hp .osh-hp-cmp a { gap: var(--osh-space-sm); padding: var(--osh-space-lg) var(--osh-space-lg) var(--osh-space-md); }
    .osh-hp-cmp-line { flex: 1 0 auto; }
    /* 14. logos stay inside their circles */
    .osh-hp-cmp-logos > span, .osh-hp-strip a { overflow: hidden; }
}

/* ---------- 3. Articles ---------- */
@media (max-width: 767px) {
    /* 3. text almost full width: 16px from each edge, like the header */
    #osh-main.osh-single { padding-inline: 0; }
    #osh-main .osh-article { padding-inline: var(--osh-space-lg); border-left: 0 !important; border-right: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
    #osh-main .osh-article > .osh-title { margin-inline: 0; }
    #osh-main .osh-content { padding-inline: 0; margin-top: var(--osh-space-xl); }
    #osh-main.osh-single { padding-top: 0; }

    /* 5. byline on one line: photo, name · updated date · comments */
    .osh-m-long { display: none; }
    .osh-m-short { display: inline; }
    #osh-main .osh-post-meta { padding: 10px 0; font-size: 14px; }
    #osh-main .osh-meta-items { flex-wrap: wrap; gap: 4px 0; white-space: nowrap; }
    #osh-main .osh-meta-author { flex-basis: auto; }
    #osh-main .osh-meta-author::after { display: none; }
    #osh-main .osh-meta-author img { width: 26px; height: 26px; }
    #osh-main .osh-meta-items > * + *::before { content: "·"; display: inline; width: auto; height: auto; margin: 0 8px; background: none; color: var(--osh-text-secondary); }
    #osh-main .osh-meta-items > .osh-meta-updated::before { display: inline; }
    #osh-main .osh-meta-updated { letter-spacing: 0; }
    #osh-main .osh-meta-comments { gap: 5px; }
}
@media (max-width: 1024px) {
    /* 8-10. under the article: no second "Summarize with AI", no second search (the menu has one),
       no long "Skip to" list (it becomes the Contents button below); the author box sits apart from the comments. */
    #osh-main .osh-sidebar { width: auto; max-width: none; margin-top: var(--osh-space-2xl); padding-inline: var(--osh-space-lg); }
    #osh-main .osh-sidebar .osh-ai-box,
    #osh-main .osh-sidebar .osh-sb-box:has(form[role="search"]) { display: none; }
    #osh-main .osh-sidebar .osh-sb-bio { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: start; }
    #osh-main .osh-sidebar .osh-sb-bio figure { margin: 0; }
    #osh-main .osh-sidebar .osh-sb-bio img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
    #osh-main .osh-sidebar .osh-sb-bio p { margin: 0; font-size: 15px; line-height: 1.55; }

    /* 10. "Skip to" becomes a bottom sheet behind a floating "Contents" button */
    .osh-sidebar .osh-stoc { display: none; }
    html.osh-stoc-open .osh-sidebar .osh-stoc {
        display: block; position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 121; height: auto; max-height: 72vh; margin: 0; overflow-y: auto; overscroll-behavior: contain;
        padding: 26px 20px calc(20px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 16px 16px 0 0;
        background: var(--osh-surface); box-shadow: 0 -12px 40px rgb(10 38 44 / .25); animation: osh-sheet-in .2s ease-out both;
    }
    html.osh-stoc-open .osh-sidebar .osh-stoc::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--osh-border-subtle); }
    html.osh-stoc-open .osh-stoc a { display: block; padding-block: 8px; }
    @keyframes osh-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
    .osh-stoc-veil { display: none; }
    html.osh-stoc-open .osh-stoc-veil { display: block; position: fixed; inset: 0; z-index: 120; background: rgb(10 38 44 / .45); }
    html.osh-stoc-open { overflow: hidden; }
    .osh-stoc-fab {
        position: fixed; right: var(--osh-space-lg); bottom: calc(var(--osh-space-lg) + env(safe-area-inset-bottom, 0px)); z-index: 110;
        display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px;
        background: var(--osh-petrol); color: #fff; font: 600 15px/1 var(--osh-font-body); cursor: pointer;
        box-shadow: 0 6px 20px rgb(10 38 44 / .3); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
    }
    .osh-stoc-fab.is-shown { opacity: 1; transform: none; pointer-events: auto; }
    :root[data-osh-theme="dark"] .osh-stoc-fab { background: #fff; color: var(--osh-petrol); }
}
@media (min-width: 1025px) { .osh-stoc-fab, .osh-stoc-veil { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .osh-stoc-fab { transition: none; } html.osh-stoc-open .osh-sidebar .osh-stoc { animation: none; } }

/* ---------- 4. Tables inside articles (phones: the tables turn into stacked cards) ---------- */
@media (max-width: 640px) {
    /* 6. section buttons (Malware detection, AI & technology ...) all full width */
    #osh-main .onlinesecurityhub .onlinesecurityhub-sec th { display: block; width: 100%; padding: 0 !important; }
    #osh-main .onlinesecurityhub .onlinesecurityhub-secbtn { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; justify-content: flex-start; text-align: left; padding: 12px 14px; }
    /* 7. a coloured result kept its dot where the product name belongs: the name comes back, the colour shows the result */
    #osh-main .onlinesecurityhub .onlinesecurityhub-table td:is(.onlinesecurityhub-g, .onlinesecurityhub-n, .onlinesecurityhub-w)::before {
        content: attr(data-pname); display: block; width: auto; height: auto; margin: 0; border-radius: 0; background: none;
        color: var(--osh-text-secondary); font-weight: 600; font-size: 0.72rem;
    }
    #osh-main .onlinesecurityhub .onlinesecurityhub-table { border: 0 !important; background: transparent !important; }
    #osh-main .onlinesecurityhub .onlinesecurityhub-scroll { border: 0 !important; background: transparent !important; }
    #osh-main .onlinesecurityhub .onlinesecurityhub-table tr.onlinesecurityhub-r { margin: 0 0 10px; border: 1px solid var(--osh-border-subtle); border-radius: 6px; overflow: hidden; }
    #osh-main .onlinesecurityhub .onlinesecurityhub-table tr.onlinesecurityhub-sec { margin: 14px 0 10px; }
    #osh-main .onlinesecurityhub .onlinesecurityhub-table td { overflow-wrap: anywhere; }

    /* 7. pricing and speed tables: one tidy card per product, long values wrap instead of running out */
    #osh-main :is(.osh-cmp-table, .osh-perf-table) { border: 0 !important; border-radius: 0 !important; background: transparent !important; overflow: visible !important; }
    #osh-main :is(.osh-cmp-table, .osh-perf-table) tbody tr { margin: 0 0 12px; padding: 2px 14px !important; border: 1px solid var(--osh-border-subtle) !important; border-radius: 8px; background: var(--osh-surface) !important; }
    #osh-main :is(.osh-cmp-table, .osh-perf-table) tbody td { flex-wrap: wrap; justify-content: flex-end; gap: 2px 10px; padding: 9px 0 !important; border: 0 !important; border-bottom: 1px solid var(--osh-border-subtle) !important; background: transparent !important; text-align: right; overflow-wrap: anywhere; }
    #osh-main :is(.osh-cmp-table, .osh-perf-table) tbody td:last-child { border-bottom: 0 !important; }
    #osh-main :is(.osh-cmp-table, .osh-perf-table) tbody td::before { margin-right: auto; }
    #osh-main :is(.osh-cmp-table, .osh-perf-table) tbody td.osh-product { padding-top: 12px !important; font-size: 17px; text-align: left; }
    #osh-main :is(.osh-cmp-table, .osh-perf-table) tbody tr:hover td { background: transparent !important; }
}

/* ---------- 5. Product page: action buttons in equal halves ---------- */
@media (max-width: 767px) {
    .v5-ph-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--osh-space-sm) !important; }
    .v5-ph-actions > a { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-width: 0; margin: 0 !important; padding-inline: 10px; text-align: center; white-space: nowrap; }
    .v5-ph-actions > a:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------- 6. Business compare on phones ---------- */
.osh-fold-btn { display: none; }
@media (max-width: 767px) {
    /* the four pickers fold behind one button once tools are picked */
    .osh-fold-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; margin: 0 0 var(--osh-space-md); padding: 0 16px; border: 1px solid var(--osh-border); border-radius: var(--osh-radius); background: var(--osh-surface); color: var(--osh-text); font: 600 15px/1 var(--osh-font-body); cursor: pointer; }
    .osh-fold-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
    .osh-bz-pick.is-folded { display: none; }

    /* the table: tool names stay on top, each fact is a label line with every tool's answer side by side */
    .osh-bz-cmpwrap { overflow: visible; border: 0; border-radius: 0; background: transparent; }
    .osh-bz-cmptable { display: block; min-width: 0; }
    .osh-bz-cmptable :is(thead, tbody) { display: block; }
    .osh-bz-cmptable tr { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
    .osh-bz-cmptable thead { position: sticky; top: var(--osh-bh-h, 65px); z-index: 5; background: var(--osh-canvas); border-bottom: 2px solid var(--osh-border); }
    .osh-bz-cmptable thead tr > td:first-child { display: none; }
    .osh-bz-cmptable :is(thead tr > :first-child, tbody th) { position: static; width: auto; }
    .osh-bz-cmptable thead th { padding: 10px 8px 10px 0; border: 0; background: transparent; }
    .osh-bz-cmptable thead th + th { padding-left: 8px; border-left: 1px solid var(--osh-border-subtle); }
    .osh-bz-tool { flex-direction: column; align-items: flex-start; gap: 6px; }
    .osh-bz-tool a { font-size: 14px; line-height: 1.3; }
    .osh-bz-tool small { display: none; }
    .osh-bz-remove { margin-top: 4px; font-size: 12.5px; }
    .osh-bz-cmptable tbody tr { border-bottom: 1px solid var(--osh-border-subtle); }
    .osh-bz-cmptable tbody tr:last-child { border-bottom: 0; }
    .osh-bz-cmptable tbody th { grid-column: 1 / -1; padding: 14px 0 4px; border: 0; background: transparent; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--osh-text-secondary); }
    .osh-bz-cmptable tbody td { padding: 0 8px 12px 0; border: 0; font-size: 14.5px; overflow-wrap: anywhere; }
    .osh-bz-cmptable tbody td + td { padding-left: 8px; border-left: 1px solid var(--osh-border-subtle); }
    .osh-bz-cmptable td a + a { margin-left: 0; }
    .osh-bz-cmptable td a { display: inline-block; margin-right: 10px; }
}

/* ---------- 7. Footer: a line between the small print and the policy links ---------- */
@media (max-width: 767px) {
    .osh-bf-base { gap: 0; }
    .osh-bf-base > nav { width: 100%; margin-top: var(--osh-space-lg); padding-top: var(--osh-space-md); border-top: 1px solid color-mix(in srgb, #fff 16%, transparent); }
}
