/* Hamco blog: reading design (BLOG-DESIGN-1, owner 2026-10-30).
   Loads after single-post.css on single posts. Makes posts easier to read on every screen:
   shorter hero, article first on phones, clear type, styled Quick Answer, tables, lists, contents and FAQ.
   Interactive parts (progress bar, FAQ toggles, sidebar contents) come from js/blog-reading.js. */

:root {
    --hq-red: #E10600;
    --hq-navy: #0E1A2B;
    --hq-ink: #1B2330;
    --hq-soft: #4A5568;
    --hq-chalk: #F3F5F8;
    --hq-line: #E6EAF0;
    --hq-zebra: #F8FAFC;
}

/* ---------- Hero: shorter, so the answer is close to the top ---------- */
.post-hero {
    min-height: clamp(280px, 42vh, 440px);
}

.post-hero-content {
    padding: 48px 20px 40px;
}

/* ---------- Layout: one wide centered column, no sidebar (owner, 2026-10-30) ----------
   The author box already sits under every article, so the sidebar copy is not needed. */
.single-post .post-sidebar {
    display: none;
}

.single-post .post-content-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

/* Wide reading area: 1400px (owner, 2026-10-30). The theme's page container stops at 1200px, so it is widened too. */
.single-post .post-container,
.single-post .hero-container {
    max-width: 1440px;
}

.single-post .post-main-content {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ---------- Reading column and body text (wide, owner 2026-10-30) ---------- */
.post-content {
    max-width: 1400px;
    font-size: 19px;
    line-height: 1.8;
    color: var(--hq-ink);
}

.post-content p {
    margin: 0 0 1.15em;
}

.post-content strong {
    color: var(--hq-navy);
}

.post-content a {
    color: var(--hq-navy);
    text-decoration: underline;
    text-decoration-color: var(--hq-red);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.post-content a:hover {
    color: var(--hq-red);
}

.post-content a:focus-visible,
.post-sidebar a:focus-visible,
.hq-faq summary:focus-visible {
    outline: 3px solid var(--hq-red);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Headings: athletic, clear steps ---------- */
.post-content h2 {
    font-family: 'Teko', 'Arial Narrow', sans-serif;
    font-weight: 600;
    font-size: clamp(30px, 3.4vw, 40px);
    line-height: 1.05;
    letter-spacing: 0.2px;
    color: var(--hq-navy);
    margin: 2.1em 0 0.7em;
    padding-bottom: 12px;
    position: relative;
}

.post-content h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 4px;
    border-radius: 2px;
    background: var(--hq-red);
}

.post-content h3 {
    font-size: 21px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--hq-navy);
    margin: 1.7em 0 0.45em;
}

.post-content h2 + h3 {
    margin-top: 0.9em;
}

/* ---------- Lists ---------- */
.post-content ul,
.post-content ol {
    padding-left: 1.35em;
    margin: 0 0 1.3em;
}

/* The theme's reset removes list markers; bring numbers and bullets back */
.post-content ol {
    list-style: decimal;
}

.post-content ul {
    list-style: disc;
}

.post-content #ez-toc-container ul,
.post-content #ez-toc-container ol {
    list-style: none;
}

.post-content li {
    margin: 0.4em 0;
    padding-left: 0.2em;
}

.post-content li::marker {
    color: var(--hq-red);
    font-weight: 700;
}

/* ---------- Quick Answer card (marked by the script) ---------- */
.post-content figure.wp-block-table.hq-answer {
    background: var(--hq-chalk);
    border: 0;
    border-left: 6px solid var(--hq-red);
    border-radius: 0 14px 14px 0;
    padding: 20px 24px;
    margin: 0 0 2em;
    overflow: visible;
}

.post-content figure.hq-answer table,
.post-content figure.hq-answer td {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    min-width: 0 !important;
}

.post-content figure.hq-answer td {
    font-size: 18px;
    line-height: 1.7;
    color: var(--hq-ink);
}

.post-content figure.hq-answer td > strong:first-child {
    display: block;
    font-family: 'Teko', 'Arial Narrow', sans-serif;
    font-weight: 600;
    font-size: 26px;
    line-height: 1;
    color: var(--hq-navy);
    margin-bottom: 8px;
}

/* ---------- Tables: always fit the column, never scroll sideways (owner, 2026-10-30) ---------- */
.post-content figure.wp-block-table {
    margin: 1.6em 0 2em;
    overflow: hidden;
    border: 1px solid var(--hq-line);
    border-radius: 14px;
    position: relative;
}

.post-content figure.wp-block-table table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 0 !important;
    table-layout: auto;
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.post-content figure.wp-block-table td,
.post-content figure.wp-block-table th {
    border: 0;
    border-bottom: 1px solid var(--hq-line);
    padding: 12px 16px;
    vertical-align: top;
    text-align: left;
    background: #fff;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: manual;
}

/* Hamco's row in any table stands out by its tint and red edge, not by bold (owner, 2026-10-30: "no bold at all") */
.post-content figure.wp-block-table tr.hq-hamco td,
.post-content figure.wp-block-table tbody tr.hq-hamco:nth-child(even) td {
    background: #FFF1F0;
    color: var(--hq-ink);
}

.post-content figure.wp-block-table tr.hq-hamco td:first-child {
    box-shadow: inset 5px 0 0 var(--hq-red);
    color: var(--hq-navy);
}

/* Dates, prices, short values and web addresses stay on one line (owner, 2026-10-30) */
.post-content figure.wp-block-table td.hq-nowrap,
.post-content figure.wp-block-table th.hq-nowrap {
    white-space: nowrap;
}

/* Tables with 6 or more columns (marked by the script): a little smaller so they fit the column */
.post-content figure.wp-block-table table.hq-dense td,
.post-content figure.wp-block-table table.hq-dense th {
    font-size: 14px;
    padding: 10px 10px;
}

.post-content figure.wp-block-table tbody tr:nth-child(even) td {
    background: var(--hq-zebra);
}

.post-content figure.wp-block-table tr:last-child td {
    border-bottom: 0;
}

.post-content figure.wp-block-table thead td,
.post-content figure.wp-block-table thead th,
.post-content figure.wp-block-table tr.hq-head td,
.post-content figure.wp-block-table tr.hq-head th {
    background: var(--hq-navy) !important;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    border-bottom: 0;
}

.post-content figure.wp-block-table thead strong,
.post-content figure.wp-block-table tr.hq-head strong {
    color: #fff;
}

/* Tables on phones: each row becomes a small card, every value labelled with its column name.
   The script copies the header text into data-label on each cell (table.hq-cards). */
@media (max-width: 768px) {
    .post-content figure.wp-block-table:has(table.hq-cards) {
        border: 0;
        border-radius: 0;
        overflow: visible;
    }

    .post-content table.hq-cards,
    .post-content table.hq-cards tbody,
    .post-content table.hq-cards tr,
    .post-content table.hq-cards td,
    .post-content table.hq-cards th {
        display: block;
        width: 100%;
    }

    .post-content table.hq-cards thead,
    .post-content table.hq-cards tr.hq-head {
        display: none;
    }

    .post-content table.hq-cards tr {
        border: 1px solid var(--hq-line);
        border-radius: 12px;
        margin: 0 0 12px;
        overflow: hidden;
        background: #fff;
    }

    .post-content figure.wp-block-table table.hq-cards td,
    .post-content figure.wp-block-table table.hq-cards tbody tr:nth-child(even) td {
        background: #fff;
        border-bottom: 1px solid var(--hq-line);
        padding: 10px 14px;
        font-size: 16px;
    }

    .post-content figure.wp-block-table table.hq-cards td:last-child {
        border-bottom: 0;
    }

    .post-content figure.wp-block-table table.hq-cards td:first-child {
        background: var(--hq-chalk);
        font-weight: 700;
        color: var(--hq-navy);
    }

    .post-content table.hq-cards tr.hq-hamco {
        border: 2px solid var(--hq-red);
    }

    .post-content figure.wp-block-table table.hq-cards tr.hq-hamco td {
        background: #fff;
    }

    .post-content figure.wp-block-table table.hq-cards tr.hq-hamco td:first-child {
        background: #FFF1F0;
        box-shadow: none;
    }

    .post-content table.hq-cards td[data-label]:not(:first-child)::before {
        content: attr(data-label);
        display: block;
        font-size: 13px;
        font-weight: 700;
        color: var(--hq-soft);
        margin-bottom: 2px;
    }
}

/* ---------- No contents box inside posts (owner, 2026-10-30) ---------- */
.post-content #ez-toc-container {
    display: none;
}

/* ---------- FAQ: tap a question to open the answer ---------- */
.post-content details.hq-faq {
    border-bottom: 1px solid var(--hq-line);
}

.post-content details.hq-faq:first-of-type {
    border-top: 1px solid var(--hq-line);
}

.post-content details.hq-faq summary {
    list-style: none;
    cursor: pointer;
    position: relative;
    padding: 18px 44px 18px 0;
    font-size: 19px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--hq-navy);
}

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

.post-content details.hq-faq summary::after {
    content: "+";
    position: absolute;
    right: 4px;
    top: 50%;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    border-radius: 50%;
    background: var(--hq-chalk);
    color: var(--hq-red);
    font-size: 22px;
    line-height: 30px;
    text-align: center;
    font-weight: 700;
}

.post-content details.hq-faq[open] summary::after {
    content: "\2212";
    background: var(--hq-red);
    color: #fff;
}

.post-content details.hq-faq .hq-faq-body {
    padding: 0 0 16px;
}

.post-content details.hq-faq .hq-faq-body > :last-child {
    margin-bottom: 0;
}

/* ---------- Images ---------- */
.post-content img {
    border-radius: 12px;
    height: auto;
}

.post-content figcaption {
    font-size: 14px;
    color: var(--hq-soft);
    text-align: center;
    margin-top: 8px;
}

/* ---------- Reading progress bar ---------- */
#hq-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--hq-red);
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 9999;
    pointer-events: none;
}

/* ---------- Sidebar contents on wide screens (built by the script) ---------- */
.post-sidebar .sidebar-widget.toc-widget.hq-on {
    display: block;
    position: sticky;
    top: 24px;
}

.post-sidebar .toc-widget.hq-on h3 {
    font-family: 'Teko', 'Arial Narrow', sans-serif;
    font-weight: 600;
    font-size: 26px;
    color: var(--hq-navy);
}

.post-sidebar .toc-widget.hq-on ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.post-sidebar .toc-widget.hq-on li {
    margin: 0;
}

.post-sidebar .toc-widget.hq-on a {
    display: block;
    padding: 8px 12px;
    border-left: 3px solid var(--hq-line);
    color: var(--hq-soft);
    font-size: 15px;
    line-height: 1.35;
    text-decoration: none;
}

.post-sidebar .toc-widget.hq-on a:hover {
    color: var(--hq-navy);
}

.post-sidebar .toc-widget.hq-on a.is-active {
    border-left-color: var(--hq-red);
    color: var(--hq-navy);
    font-weight: 700;
    background: var(--hq-chalk);
}

@media (min-width: 1025px) {
    .post-content-grid {
        align-items: stretch;
    }
}

@media (max-width: 1024px) {
    .post-sidebar .sidebar-widget.toc-widget.hq-on {
        display: none;
    }
}

/* ---------- Small screens ---------- */
@media (max-width: 768px) {
    .post-hero {
        min-height: 240px;
    }

    .post-hero-content {
        padding: 32px 16px 28px;
    }

    .post-meta-details {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 16px;
    }

    .post-meta-details .meta-separator {
        display: none;
    }

    .post-content {
        font-size: 17px;
    }

    .post-content h2 {
        margin-top: 1.8em;
    }

    .post-content h3 {
        font-size: 19px;
    }

    .post-content figure.wp-block-table td,
    .post-content figure.wp-block-table th {
        padding: 10px 12px;
        font-size: 15px;
    }

    .post-content figure.wp-block-table.hq-answer {
        padding: 16px 18px;
    }
}

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    #hq-progress {
        display: none;
    }
}

@media print {
    #hq-progress {
        display: none;
    }
}
