/* ═══════════════════════════════════════════════════════════════
   Tool Content Sections — V4 Retro Radio Operator
   Below-fold SEO content styling for tool pages.
   Uses --v4-* design tokens from v4_critical.html.
   Updated: 2026-02-11
   Changes: Fixed width inconsistency across prose/lists/grids.
   Improved H2/H3 heading readability (removed uppercase, fixed
   tracking, bumped cap-title from 12px to 16px). Added vertical
   rhythm spacing around tips lists. Refined responsive rules.
   ═══════════════════════════════════════════════════════════════ */


/* ───────────────────────────────────────────────────────────────
   Container
   ─────────────────────────────────────────────────────────────── */
.tool-content {
    max-width: var(--v4-content-width);
    margin: 0 auto;
    padding: 0 var(--v4-space-6);
    padding-bottom: var(--v4-space-16);
}


/* ───────────────────────────────────────────────────────────────
   Section base
   ─────────────────────────────────────────────────────────────── */
.tc-section {
    padding: var(--v4-space-12) 0 var(--v4-space-8);
}


/* ───────────────────────────────────────────────────────────────
   Section rule (decorative divider)
   ─────────────────────────────────────────────────────────────── */
.tc-section-rule {
    display: flex;
    align-items: center;
    gap: var(--v4-space-3);
    margin-bottom: var(--v4-space-8);
    opacity: 0.5;
}

.tc-rule-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--v4-text-muted);
    flex-shrink: 0;
}

.tc-rule-line {
    flex: 1;
    height: 1px;
    background: var(--v4-border-dim);
}


/* ───────────────────────────────────────────────────────────────
   Typography
   ─────────────────────────────────────────────────────────────── */
.tc-heading {
    font-family: var(--v4-font-display);
    font-size: var(--v4-text-xl);
    font-weight: 700;
    color: var(--v4-text-primary);
    letter-spacing: -0.01em;
    text-shadow: var(--v4-glow-text);
    margin: 0 0 var(--v4-space-6);
    /* No uppercase — mixed case is far more scannable at content
       heading sizes. The display font and bold weight provide
       sufficient hierarchy without shouting. */
}

.tc-prose {
    /* Removed max-width: 72ch — the .tool-content container
       (960px) now governs width. This eliminates the jarring
       width mismatch between prose blocks and full-width
       elements like capability grids and howto cards. */
}

.tc-prose p {
    font-family: var(--v4-font-body);
    font-size: var(--v4-text-md);
    line-height: 1.75;
    color: var(--v4-text-secondary);
    margin: 0 0 var(--v4-space-5);
}

.tc-prose p:last-child {
    margin-bottom: 0;
}

.tc-lead {
    font-size: var(--v4-text-lg);
    color: var(--v4-text-primary);
    line-height: 1.7;
    max-width: 72ch; /* Lead paragraphs keep a narrower measure
                        for comfortable reading at the larger font size. */
}

.tc-prose code {
    font-family: var(--v4-font-mono);
    font-size: 0.9em;
    color: var(--v4-text-primary);
    background: var(--v4-bg-surface);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-sm);
    padding: 0.1em 0.4em;
    word-break: break-all;
}

.tc-prose a {
    color: var(--v4-text-primary);
    text-decoration: underline;
    text-decoration-color: var(--v4-border-base);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}

.tc-prose a:hover {
    text-decoration-color: var(--v4-text-primary);
}

/* ── Rich prose elements (template partials) ── */
.tc-prose strong {
    color: var(--v4-text-primary);
    font-weight: 600;
}

.tc-prose kbd {
    font-family: var(--v4-font-mono);
    font-size: 0.85em;
    color: var(--v4-text-primary);
    background: var(--v4-bg-surface);
    border: 1px solid var(--v4-border-dim);
    border-bottom-width: 2px;
    border-radius: var(--v4-radius-sm);
    padding: 0.15em 0.45em;
    white-space: nowrap;
}

/* Timing table (encoding-rules partial) */
.tc-timing-table {
    width: 100%;
    max-width: 600px;
    border-collapse: collapse;
    margin: var(--v4-space-6) 0;
    font-family: var(--v4-font-body);
    font-size: var(--v4-text-base);
}

.tc-timing-table th,
.tc-timing-table td {
    text-align: left;
    padding: var(--v4-space-3) var(--v4-space-4);
    border-bottom: 1px solid var(--v4-border-dim);
    color: var(--v4-text-secondary);
}

.tc-timing-table th {
    color: var(--v4-text-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: var(--v4-text-sm);
    letter-spacing: 0.08em;
}

.tc-timing-table td strong {
    color: var(--v4-text-primary);
    font-weight: 700;
}

.tc-timing-table td code {
    font-family: var(--v4-font-mono);
    font-size: 1.1em;
    color: var(--v4-text-primary);
}

/* Settings definition list (settings-guide partial) */
.tc-settings-dl {
    margin: 0;
    padding: 0;
}

.tc-settings-dl .tc-setting-block {
    margin-bottom: var(--v4-space-6);
}

.tc-settings-dl .tc-setting-block:last-child {
    margin-bottom: 0;
}

.tc-settings-dl dt {
    margin-bottom: var(--v4-space-2);
}

.tc-settings-dl dd {
    margin-left: 0;
    padding-left: var(--v4-space-5);
    border-left: 2px solid var(--v4-border-dim);
}


/* ───────────────────────────────────────────────────────────────
   Capability / Limitation cards
   ─────────────────────────────────────────────────────────────── */
.tc-capability-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--v4-space-5);
    margin-top: var(--v4-space-8);
}

.tc-cap-card {
    background: var(--v4-bg-elevated);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-lg);
    padding: var(--v4-space-6);
}

.tc-cap-card--can {
    border-color: rgba(51, 204, 51, 0.25);
}

.tc-cap-card--cannot {
    border-color: rgba(255, 51, 51, 0.2);
}

.tc-cap-title {
    display: flex;
    align-items: center;
    gap: var(--v4-space-2);
    font-family: var(--v4-font-display);
    font-size: var(--v4-text-md);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 var(--v4-space-4);
    /* Bumped from --v4-text-sm (12px) to --v4-text-md (16px).
       12px was unreadable for an H3. Uppercase kept here since
       these are short label-style headings (2-4 words). */
}

.tc-cap-card--can .tc-cap-title {
    color: var(--v4-accent-green);
}

.tc-cap-card--cannot .tc-cap-title {
    color: var(--v4-accent-red);
}

.tc-cap-icon {
    flex-shrink: 0;
}

.tc-cap-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tc-cap-list li {
    font-family: var(--v4-font-body);
    font-size: var(--v4-text-base);
    line-height: 1.6;
    color: var(--v4-text-secondary);
    padding: var(--v4-space-2) 0;
    padding-left: var(--v4-space-5);
    position: relative;
}

.tc-cap-card--can .tc-cap-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--v4-accent-green);
    font-weight: 700;
    font-size: var(--v4-text-sm);
}

.tc-cap-card--cannot .tc-cap-list li::before {
    content: "✗";
    position: absolute;
    left: 0;
    color: var(--v4-accent-red);
    font-weight: 700;
    font-size: var(--v4-text-sm);
}

.tc-cap-list li + li {
    border-top: 1px solid var(--v4-border-dim);
}


/* ───────────────────────────────────────────────────────────────
   Sub-headings (H3 inside sections)
   ─────────────────────────────────────────────────────────────── */
.tc-subheading {
    font-family: var(--v4-font-display);
    font-size: var(--v4-text-lg);
    font-weight: 700;
    color: var(--v4-text-primary);
    letter-spacing: -0.01em;
    margin: 0 0 var(--v4-space-3);
    /* Removed uppercase — these headings are long descriptive
       titles (e.g. "Text to Morse Code (Translate Mode)") where
       uppercase tanks readability. Bold + display font + 18px
       provides clear hierarchy over body text. */
}


/* ───────────────────────────────────────────────────────────────
   How-To / Mode blocks
   ─────────────────────────────────────────────────────────────── */
.tc-howto-mode {
    background: var(--v4-bg-elevated);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-lg);
    padding: var(--v4-space-6);
    margin-top: var(--v4-space-5);
}

.tc-howto-mode + .tc-howto-mode {
    margin-top: var(--v4-space-4);
}

.tc-howto-mode .tc-subheading {
    font-size: var(--v4-text-md);
    margin-bottom: var(--v4-space-4);
}


/* ───────────────────────────────────────────────────────────────
   Tips list
   ─────────────────────────────────────────────────────────────── */
.tc-tips-list {
    list-style: none;
    margin: var(--v4-space-6) 0;
    padding: 0;
    /* Removed max-width: 72ch — fills container like grids/cards. */
}

.tc-tip-item {
    font-family: var(--v4-font-body);
    font-size: var(--v4-text-md);
    line-height: 1.75;
    color: var(--v4-text-secondary);
    padding: var(--v4-space-4) 0;
    padding-left: var(--v4-space-6);
    position: relative;
    border-bottom: 1px solid var(--v4-border-dim);
}

.tc-tip-item:first-child {
    padding-top: 0;
}

.tc-tip-item:last-child {
    border-bottom: none;
}

.tc-tip-item::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--v4-text-muted);
    font-size: var(--v4-text-sm);
}

.tc-tip-item strong {
    color: var(--v4-text-primary);
}


/* ───────────────────────────────────────────────────────────────
   Use Cases grid
   ─────────────────────────────────────────────────────────────── */
.tc-usecases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--v4-space-4);
    margin-top: var(--v4-space-6);
}

.tc-usecase-card {
    background: var(--v4-bg-elevated);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-lg);
    padding: var(--v4-space-5);
    text-align: center;
    transition: border-color 0.2s;
}

.tc-usecase-card:hover {
    border-color: var(--v4-border-base);
}

.tc-usecase-icon {
    font-size: 1.8rem;
    margin-bottom: var(--v4-space-3);
    line-height: 1;
}

.tc-usecase-title {
    font-family: var(--v4-font-display);
    font-size: var(--v4-text-sm);
    font-weight: 600;
    color: var(--v4-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 var(--v4-space-2);
}

.tc-usecase-desc {
    font-family: var(--v4-font-body);
    font-size: var(--v4-text-base);
    line-height: 1.55;
    color: var(--v4-text-secondary);
    margin: 0;
}


/* ───────────────────────────────────────────────────────────────
   History callout box
   ─────────────────────────────────────────────────────────────── */
.tc-callout-box {
    background: var(--v4-bg-elevated);
    border: 1px solid var(--v4-border-dim);
    border-left: 3px solid var(--v4-text-muted);
    border-radius: var(--v4-radius-lg);
    padding: var(--v4-space-6);
}

.tc-callout-box .tc-heading {
    font-size: var(--v4-text-lg);
}

.tc-callout-link {
    display: inline-block;
    margin-top: var(--v4-space-4);
    font-family: var(--v4-font-body);
    font-size: var(--v4-text-sm);
    color: var(--v4-text-primary);
    text-decoration: underline;
    text-decoration-color: var(--v4-border-base);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}

.tc-callout-link:hover {
    text-decoration-color: var(--v4-text-primary);
}


/* ───────────────────────────────────────────────────────────────
   Settings guide blocks
   ─────────────────────────────────────────────────────────────── */
.tc-setting-block {
    padding: var(--v4-space-5) 0;
    border-bottom: 1px solid var(--v4-border-dim);
}

.tc-setting-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tc-setting-block .tc-subheading {
    font-size: var(--v4-text-md);
    margin-bottom: var(--v4-space-2);
}


/* ───────────────────────────────────────────────────────────────
   FAQ accordion
   ─────────────────────────────────────────────────────────────── */
.tc-faq-list {
    /* Removed max-width: 72ch — matches full container width. */
}

.tc-faq-item {
    border-bottom: 1px solid var(--v4-border-dim);
}

.tc-faq-item:last-child {
    border-bottom: none;
}

.tc-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: var(--v4-space-4) 0;
    font-family: var(--v4-font-body);
    font-size: var(--v4-text-md);
    font-weight: 600;
    color: var(--v4-text-primary);
    line-height: 1.5;
    list-style: none;
    user-select: none;
}

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

.tc-faq-question::after {
    content: "+";
    flex-shrink: 0;
    margin-left: var(--v4-space-4);
    font-family: var(--v4-font-mono);
    font-size: var(--v4-text-lg);
    font-weight: 400;
    color: var(--v4-text-muted);
    transition: transform 0.2s;
}

.tc-faq-item[open] .tc-faq-question::after {
    content: "−";
}

.tc-faq-answer {
    padding: 0 0 var(--v4-space-5);
}

.tc-faq-answer p {
    font-family: var(--v4-font-body);
    font-size: var(--v4-text-base);
    line-height: 1.7;
    color: var(--v4-text-secondary);
    margin: 0;
}


/* ───────────────────────────────────────────────────────────────
   Related tools grid
   ─────────────────────────────────────────────────────────────── */
.tc-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--v4-space-4);
    margin-top: var(--v4-space-6);
}

.tc-related-card {
    display: block;
    background: var(--v4-bg-elevated);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-lg);
    padding: var(--v4-space-5);
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tc-related-card:hover {
    border-color: var(--v4-border-base);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.tc-related-title {
    font-family: var(--v4-font-display);
    font-size: var(--v4-text-sm);
    font-weight: 600;
    color: var(--v4-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 var(--v4-space-2);
}

.tc-related-desc {
    font-family: var(--v4-font-body);
    font-size: var(--v4-text-base);
    line-height: 1.55;
    color: var(--v4-text-secondary);
    margin: 0;
}


/* ───────────────────────────────────────────────────────────────
   CTA section
   ─────────────────────────────────────────────────────────────── */
.tc-cta {
    padding-bottom: var(--v4-space-16);
}

.tc-cta-box {
    text-align: center;
    padding: var(--v4-space-8) var(--v4-space-6);
    background: var(--v4-bg-elevated);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-lg);
}

.tc-cta-box .tc-heading {
    margin-bottom: var(--v4-space-3);
}

.tc-cta-text {
    font-family: var(--v4-font-body);
    font-size: var(--v4-text-md);
    line-height: 1.6;
    color: var(--v4-text-secondary);
    margin: 0 0 var(--v4-space-6);
    max-width: 50ch;
    margin-left: auto;
    margin-right: auto;
}

.tc-cta-button {
    display: inline-block;
    font-family: var(--v4-font-display);
    font-size: var(--v4-text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--v4-bg-base);
    background: var(--v4-text-primary);
    border: none;
    border-radius: var(--v4-radius-md);
    padding: var(--v4-space-3) var(--v4-space-8);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.tc-cta-button:hover {
    opacity: 0.85;
}


/* ───────────────────────────────────────────────────────────────
   Responsive
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .tool-content {
        padding: 0 var(--v4-space-4);
        padding-bottom: var(--v4-space-12);
    }

    .tc-section {
        padding: var(--v4-space-8) 0 var(--v4-space-6);
    }

    .tc-heading {
        font-size: var(--v4-text-lg);
    }

    .tc-prose p {
        font-size: var(--v4-text-base);
    }

    .tc-lead {
        font-size: var(--v4-text-md);
        max-width: none; /* Full-width on tablet/mobile */
    }

    .tc-capability-grid {
        grid-template-columns: 1fr;
        gap: var(--v4-space-4);
    }

    .tc-cap-card {
        padding: var(--v4-space-4);
    }

    .tc-cap-title {
        font-size: var(--v4-text-base);
    }

    .tc-usecases-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--v4-space-3);
    }

    .tc-related-grid {
        grid-template-columns: 1fr;
    }

    .tc-howto-mode {
        padding: var(--v4-space-4);
    }

    .tc-subheading {
        font-size: var(--v4-text-md);
    }

    .tc-callout-box {
        padding: var(--v4-space-4);
    }

    .tc-cta-box {
        padding: var(--v4-space-6) var(--v4-space-4);
    }
}

@media (max-width: 480px) {
    .tool-content {
        padding: 0 var(--v4-space-3);
    }

    .tc-heading {
        font-size: var(--v4-text-md);
    }

    .tc-section-rule {
        margin-bottom: var(--v4-space-6);
    }

    .tc-usecases-grid {
        grid-template-columns: 1fr;
    }

    .tc-usecase-card {
        text-align: left;
        display: flex;
        gap: var(--v4-space-3);
        align-items: flex-start;
    }

    .tc-usecase-icon {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .tc-tip-item {
        font-size: var(--v4-text-base);
    }

    .tc-faq-question {
        font-size: var(--v4-text-base);
    }
}


/* ═══════════════════════════════════════════════════════════════
   Learn Pages — Educational article styling
   Added: 2026-02-11
   For /learn/ pages that extend the same V4 design system.
   ═══════════════════════════════════════════════════════════════ */

/* Learn page article container */
.learn-article {
    padding-top: var(--v4-space-12);
}

.learn-header {
    padding-top: 0;
}

.learn-h1 {
    font-family: var(--v4-font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--v4-text-primary);
    letter-spacing: -0.02em;
    text-shadow: var(--v4-glow-text);
    margin: 0 0 var(--v4-space-8);
    line-height: 1.2;
}

/* Alphabet reference grid (two-column A–Z table) */
.tc-alphabet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: var(--v4-space-6) 0;
    background: var(--v4-bg-elevated);
    border: 1px solid var(--v4-border-dim);
    border-radius: var(--v4-radius-lg);
    overflow: hidden;
    font-family: var(--v4-font-body);
    font-size: var(--v4-text-base);
}

.tc-alpha-row {
    display: grid;
    grid-template-columns: 3rem 1fr 3rem 1fr;
    border-bottom: 1px solid var(--v4-border-dim);
}

.tc-alpha-row:last-child {
    border-bottom: none;
}

.tc-alpha-header {
    font-weight: 700;
    font-size: var(--v4-text-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--v4-text-muted);
    background: var(--v4-bg-surface);
}

.tc-alpha-row > span {
    padding: var(--v4-space-2) var(--v4-space-3);
    color: var(--v4-text-secondary);
    display: flex;
    align-items: center;
}

.tc-alpha-row > span:nth-child(1),
.tc-alpha-row > span:nth-child(3) {
    font-weight: 700;
    color: var(--v4-text-primary);
    font-family: var(--v4-font-mono);
    justify-content: center;
    background: var(--v4-bg-surface);
    border-right: 1px solid var(--v4-border-dim);
}

.tc-alpha-row > span:nth-child(2) {
    border-right: 1px solid var(--v4-border-dim);
}

.tc-alpha-row > span code {
    font-family: var(--v4-font-mono);
    font-size: 1em;
    color: var(--v4-text-primary);
    letter-spacing: 0.15em;
}

/* Responsive: stack alphabet grid on mobile */
@media (max-width: 480px) {
    .tc-alpha-row {
        grid-template-columns: 2.5rem 1fr 2.5rem 1fr;
    }

    .tc-alpha-row > span {
        padding: var(--v4-space-1) var(--v4-space-2);
        font-size: var(--v4-text-sm);
    }
}

@media (max-width: 360px) {
    .tc-alphabet-grid {
        grid-template-columns: 1fr;
    }

    .tc-alpha-row {
        grid-template-columns: 2.5rem 1fr;
    }

    /* Hide the second pair of columns on very small screens */
    .tc-alpha-row > span:nth-child(3),
    .tc-alpha-row > span:nth-child(4) {
        display: none;
    }
}
