/* install-guide.css — shared by the install guides.
   Mobile-first: these pages are usually read on the phone being set up, so
   there is one narrow column at every screen size. The dark look is
   install-guide-dark.css, linked after this file with a media condition (see
   theme_mode_head() in system/lib.php), so a rule there wins over the same
   rule here. */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Reserve the scrollbar's width so pages don't shift when navigating */
html {
    scrollbar-gutter: stable;
    color-scheme: light;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #222;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
}

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Site header — same bar, same height, as the rest of the site */
.header {
    position: relative;
    background-color: var(--brand);
    color: #fff;
    text-align: center;
    padding: 24px 20px;
    /* Installed web app on iPhone: keep the title clear of the status bar */
    padding-top: max(24px, env(safe-area-inset-top));
    line-height: normal;
}

.header-title {
    color: #fff;
    text-decoration: none;
    font-size: 2rem;
    font-weight: bold;
}

.header p {
    margin-top: 8px;
    font-size: 1rem;
}

/* Phones: a shorter bar, so the page starts higher (same numbers as style.css) */
@media (max-width: 699px) {
    .header {
        padding: 14px 20px;
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .header-title {
        font-size: 1.6rem;
    }

    .header p {
        margin-top: 3px;
        font-size: 0.875rem;
    }
}

/* Light/dark button at the right of the header (theme_toggle_button()).
   The moon shows in the light look; install-guide-dark.css swaps in the sun. */
.theme-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background-color: rgba(255, 255, 255, 0.15);
}

.theme-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.theme-toggle .icon-sun {
    display: none;
}

.content {
    flex: 1;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 16px 16px 40px;
}

/* ---- Hero ---------------------------------------------------------------- */
.hero {
    background-color: #fff;
    border-radius: 14px;
    padding: 24px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 14px;
}

.eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-text);
    background-color: var(--brand-tint);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.hero h1 {
    font-size: 1.7rem;
    line-height: 1.2;
    color: var(--heading);
    margin-bottom: 10px;
}

.hero p {
    color: #444;
    font-size: 1.02rem;
}

.hero p + p {
    margin-top: 8px;
}

.download-btn {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 16px 20px;
    background-color: var(--accent);
    color: #fff;
    font-size: 1.15rem;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

.download-btn:hover,
.download-btn:focus {
    background-color: var(--accent-hover);
}

.download-btn:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}

/* The small print in the hero. Written as ".hero .x" so these win over the
   ".hero p" rule above, which has the same weight as a lone class. */
.hero .download-note {
    margin-top: 8px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

/* The hidden attribute must win over display rules set on the same element */
[hidden] {
    display: none !important;
}

/* One-tap install box on the Android web-app guide (shown by guide.js only
   when the browser offers an install prompt) */
.install-box {
    margin-top: 18px;
}

.install-btn {
    margin-top: 0;
    background-color: var(--brand);
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 1.15rem;
    font-weight: bold;
}

.install-btn:hover,
.install-btn:focus {
    background-color: var(--brand-hover);
}

.hero .install-done {
    padding: 12px 14px;
    background-color: var(--brand-tint);
    border-radius: 8px;
    color: var(--heading);
}

.hero .hero-alt {
    margin-top: 12px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.hero-alt a {
    color: var(--brand);
}
/* One-line device note under the code, and the "other TVs" accordion that
   keeps Fire TV / Samsung / LG out of the way of the Android TV steps */
.hero .hero-note {
    margin-top: 14px;
    font-size: 0.92rem;
    color: #666;
}
.hero-other {
    margin: 12px 0 0;
    box-shadow: none;
    border: 1px solid #dde3ea;
}
.hero-other summary {
    font-size: 0.95rem;
}

/* TV short code */
.code-box {
    text-align: center;
    margin: 18px 0 4px;
}

.code-box .code {
    display: inline-block;
    font-family: "Courier New", monospace;
    font-size: 2.2rem;
    letter-spacing: 6px;
    background-color: var(--brand-tint);
    color: var(--brand);
    border: 2px solid var(--brand);
    border-radius: 10px;
    padding: 10px 20px 10px 26px;
    font-weight: bold;
}

.hero .code-label {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

/* "Which TV do you have?" */

/* ---- Notices --------------------------------------------------------------- */
.guide-notice,
.step-help {
    border-radius: 10px;
    padding: 14px 16px;
    margin: 14px 0;
}

.guide-notice {
    background-color: var(--notice-tint);
    border-left: 4px solid var(--notice-stripe);
}

.step-help {
    background-color: var(--brand-tint);
    border-left: 4px solid var(--brand);
    margin-bottom: 0;
}

/* Direct child only: bold words inside the callout's own paragraphs, paths
   and tab panels must stay inline. */
.guide-notice > strong,
.step-help > strong {
    display: block;
    margin-bottom: 4px;
    color: var(--heading);
}

.guide-notice p,
.step-help p {
    font-size: 0.95rem;
    color: #444;
}

.guide-notice p + p,
.step-help p + p {
    margin-top: 6px;
}

.step-help a,
.step p a,
.faq-body a {
    color: var(--brand-text);
    font-weight: bold;
}

/* ---- Step cards -------------------------------------------------------------- */
.step {
    background-color: #fff;
    border-radius: 14px;
    padding: 18px 18px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 14px;
}

/* Marks a step as conditional, so numbered badges are not read as "do all" */
.step .step-when {
    display: inline-block;
    margin-bottom: 10px;
    padding: 3px 10px;
    background-color: #f1f1f1;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: bold;
    color: #666;
}

.step h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.15rem;
    color: var(--heading);
    margin-bottom: 10px;
}

.step-num {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--brand);
    color: #fff;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.step-num.step-done {
    background-color: #2e9e5b;
}

.step p {
    font-size: 1rem;
    color: #333;
}

.step p + p {
    margin-top: 8px;
}

.step img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 70vh;
    margin: 14px auto 0;
    border-radius: 10px;
    border: 1px solid #e3e3e3;
}

@media (min-width: 700px) {
    .step img {
        max-height: 520px;
    }
}

/* A settings path, e.g. Settings → Apps → Install unknown apps */
.path {
    display: block;
    margin-top: 8px;
    padding: 10px 12px;
    background-color: #f6f8fb;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #222;
    line-height: 1.5;
}

/* The paragraph after a settings path keeps the usual paragraph gap */
.path + p {
    margin-top: 8px;
}

/* ---- "Pick your phone" tabs ----------------------------------------------------
   Without JavaScript every panel stays visible under its own heading; the
   script adds .js, shows the buttons and hides all but the chosen panel. */
.tab-list {
    display: none;
}

.brand-tabs.js .tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}

.tab {
    font: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 8px 14px;
    border: 2px solid var(--brand);
    border-radius: 999px;
    background-color: #fff;
    color: var(--brand);
    cursor: pointer;
}

.tab.active {
    background-color: var(--brand);
    color: #fff;
}

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

.tab-panel h3 {
    font-size: 1rem;
    color: var(--heading);
    margin: 14px 0 4px;
}

.brand-tabs.js .tab-panel h3 {
    display: none;
}

.tab-panel[hidden] {
    display: none;
}

.step-help .tab-tip {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #666;
}

/* ---- Troubleshooting: tap to expand ------------------------------------------ */
.faq-section {
    margin-top: 22px;
}

.faq-section h2 {
    font-size: 1.15rem;
    color: var(--heading);
    margin: 0 4px 10px;
}

.faq {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
}

.faq summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 44px 14px 16px;
    font-weight: bold;
    color: var(--heading);
    position: relative;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.15s ease;
}

.faq[open] summary::after {
    transform: translateY(-30%) rotate(-135deg);
}

.faq-body {
    padding: 0 16px 16px;
}

.faq-body p {
    font-size: 0.97rem;
    color: #333;
}

.faq-body p + p {
    margin-top: 8px;
}

/* ---- Footer (system/partials/site-footer.php); style.css and live.css carry
   the same rules ----------------------------------------------------------- */
.footer-note {
    text-align: center;
    font-size: 0.92rem;
    color: #555;
    margin-top: 22px;
}

.footer-note + .footer-note {
    margin-top: 8px;
}

.footer-note a {
    color: var(--brand-text);
}

.footer {
    background-color: var(--brand);
    color: #fff;
    text-align: center;
    padding: 6px 8px 12px;
    line-height: normal;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav a {
    display: inline-block;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.25;
    padding: 10px 8px;
}

.footer-nav a:hover,
.footer-nav a:focus {
    text-decoration: underline;
}

/* Respect the OS "reduce motion" setting */
@media (prefers-reduced-motion: reduce) {
    .faq summary::after,
    .download-btn {
        transition: none;
    }
}
