/* =====================================================================
   Accessibility and mobile fixes (issue #16)
   ===================================================================== */

/* Skip link: first focusable element, visible only on focus */
.ts-skip {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 10001;
    padding: 12px 18px;
    min-height: 44px;
    background: var(--ts-ink);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--ts-radius-sm);
    text-decoration: none;
    transform: translateY(-200%);
}
.ts-skip:focus,
.ts-skip:focus-visible {
    transform: none;
    color: #FFFFFF;
    outline: 3px solid var(--ts-orange);
    outline-offset: 2px;
}
main[tabindex="-1"]:focus { outline: none; }

/* Header controls: at least 44 x 44 px on phone and tablet */
@media (max-width: 1000px) {
    .ts-logo { min-height: 44px; min-width: 44px; }
    .ts-lang { padding: 0; gap: 0; }
    .ts-lang-opt { min-height: 44px; min-width: 44px; justify-content: center; padding: 4px 10px; }
}


/* Product screenshots shown large: about 1100 px wide on desktop, full width on phone */
.ts-shots { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 28px !important; max-width: 1100px; margin-left: auto; margin-right: auto; }
.ts-shot-hint { margin: 10px 0 0; font-size: 13px; color: var(--ts-muted); }

/* First-screen product shot on the layer pages */
.lp-shot { flex: 1.3 1 460px; min-width: 0; margin: 0; }
.lp-shot-frame { background: #FFFFFF; border: 1px solid var(--ts-line); border-radius: 16px; box-shadow: 0 24px 60px rgba(18,21,28,0.12); overflow: hidden; }
.lp-shot-bar { display: flex; align-items: center; gap: 6px; padding: 9px 14px; background: var(--ts-sand); border-bottom: 1px solid var(--ts-line); }
.lp-shot-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--ts-line-strong); }
.lp-shot-bar em { margin-left: 10px; font-size: 12px; font-style: normal; color: var(--ts-muted); }
.lp-shot img { display: block; width: 100%; height: auto; }
@media (max-width: 700px) {
    .lp-hero { padding-top: 24px !important; padding-bottom: 24px !important; gap: 0 !important; }
    .lp-hero-text { display: contents; }
    .lp-hero-text > * { flex: 0 0 auto; max-width: 100%; }
    .lp-hero-text > div:first-child { align-self: flex-start; margin-bottom: 14px !important; }
    .lp-hero-text h1 { margin-bottom: 14px !important; }
    .lp-hero-text p { margin-bottom: 16px !important; font-size: 16px !important; line-height: 1.5 !important; }
    .lp-hero { flex-direction: column; flex-wrap: nowrap !important; align-items: stretch !important; }
    .lp-shot { flex: 0 0 auto; order: 1; margin-top: 4px; }
    .lp-hero-note { order: 2; margin-top: 14px !important; }
}

/* Collapsible table of contents on phone (documentation, terms) */
.toc-toggle { display: none; }
@media (max-width: 1024px) {
    .toc-toggle {
        display: flex; align-items: center; justify-content: space-between; width: 100%;
        min-height: 48px; padding: 10px 16px; margin: 0 0 12px;
        font: inherit; font-size: 15px; font-weight: 700; color: var(--ts-ink);
        background: var(--ts-surface); border: 1px solid var(--ts-line-strong); border-radius: var(--ts-radius-sm); cursor: pointer;
    }
    .toc-toggle::after { content: "+"; font-size: 22px; font-weight: 500; color: var(--ts-orange-ink); }
    .toc-toggle[aria-expanded="true"]::after { content: "\2212"; }
    .toc-collapsible.is-collapsed > :not(.toc-toggle) { display: none !important; }
}

/* Platform: three product screenshots on the first screen */
.pf-trio { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; flex: 1.2 1 480px; }
.pf-card { margin: 0; }
.pf-card.pf-big { grid-column: 1 / -1; }
.pf-card .lp-shot-bar em { font-weight: 600; }
@media (max-width: 700px) { .pf-trio { display: block; } .pf-card:not(.pf-big) { display: none; } }
