/* ── AllUnits.io calculator pages — shared styles ──
   Loaded after styles.css on every /calculators/ page.
   Mobile-first: single column; two-column calculator card from 820px up. */

/* ── Breadcrumbs ── */

.breadcrumbs {
    max-width: 960px;
    margin: 0 auto 0.75rem;
    font-size: 0.8rem;
    color: #a1a1aa;
}

.breadcrumbs a {
    color: #71717a;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--accent-ink);
    text-decoration: underline;
}

.breadcrumbs .crumb-sep {
    margin: 0 0.35rem;
    color: #d4d4d8;
    user-select: none;
}

.breadcrumbs .crumb-current {
    color: #52525b;
    font-weight: 600;
}

/* ── Hero ── */

.calc-hero {
    max-width: 760px;
    margin: 0 auto 1.5rem;
    text-align: center;
    padding: 0.5rem 0 0;
}

.calc-hero h1 {
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.calc-hero .calc-promise {
    color: #71717a;
    font-size: 1rem;
}

/* ── Calculator card ── */

.calc-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-top: 2.5px solid var(--accent);
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
}

@media (min-width: 820px) {
    .calc-card {
        grid-template-columns: 1fr 1fr;
        padding: 2.25rem;
        gap: 2.5rem;
    }
}

/* ── Inputs column ── */

.calc-inputs h2,
.calc-results h2 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #71717a;
    margin-bottom: 1rem;
}

.calc-field {
    margin-bottom: 1.1rem;
}

.calc-field label,
.calc-field .calc-label {
    display: block;
    font-weight: 600;
    color: #3f3f46;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

.calc-field .input-field {
    font-variant-numeric: tabular-nums;
}

.calc-hint {
    display: block;
    font-size: 0.78rem;
    color: #a1a1aa;
    margin-top: 0.3rem;
    line-height: 1.45;
}

.calc-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

/* Segmented control (waste factor etc.) */

.calc-seg {
    display: flex;
    gap: 3px;
    padding: 4px;
    background: #f0f0f0;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.calc-seg-btn {
    flex: 1;
    padding: 0.5rem 0.5rem;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #71717a;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.calc-seg-btn:hover {
    color: #27272a;
}

.calc-seg-btn.active {
    background: #ffffff;
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.calc-seg-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Materials list (results column) ── */

.calc-results {
    display: flex;
    flex-direction: column;
}

.materials-list {
    background: var(--accent-wash);
    border: 1px solid var(--accent-edge);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    flex: 1;
}

.materials-placeholder,
.materials-error {
    color: #71717a;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0.25rem 0;
}

.materials-error {
    color: #b91c1c;
}

.materials-subtitle {
    font-size: 0.85rem;
    color: #71717a;
    margin-bottom: 0.75rem;
}

.materials-group {
    padding: 0.6rem 0;
    border-top: 1px solid var(--accent-edge);
}

.materials-group:first-of-type {
    border-top: none;
    padding-top: 0;
}

.materials-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-ink);
    margin-bottom: 0.4rem;
}

.materials-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.25rem 1rem;
    font-size: 0.9rem;
    padding: 0.16rem 0;
}

.materials-row-label {
    color: #52525b;
}

.materials-row-value {
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 0;
}

.materials-row--strong .materials-row-label {
    color: var(--ink);
    font-weight: 600;
}

.materials-row--strong .materials-row-value {
    font-weight: 700;
    font-size: 1rem;
}

.materials-note {
    font-size: 0.8rem;
    color: #71717a;
    line-height: 1.55;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--accent-edge);
}

.materials-footer {
    font-size: 0.85rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--accent-edge);
    line-height: 1.5;
}

.materials-footer a {
    color: var(--accent-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.materials-footer a:hover {
    color: var(--ink);
}

/* Print / Copy actions */

.calc-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.calc-actions[hidden] {
    display: none;
}

.calc-action-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: 9px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.calc-action-btn--primary {
    background: var(--accent-bright);
    border: 1.5px solid var(--accent-bright);
    color: var(--ink);
}

.calc-action-btn--primary:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.calc-action-btn--secondary {
    background: #ffffff;
    border: 1.5px solid #d4d4d8;
    color: #3f3f46;
}

.calc-action-btn--secondary:hover {
    border-color: var(--accent);
    color: var(--accent-ink);
    background: var(--accent-tint);
}

.calc-action-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.calc-action-btn.copied {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #14532d;
}

/* ── Methodology block (quotable) ── */

.calc-methodology {
    max-width: 760px;
    margin: 2.25rem auto 0;
    padding: 1.1rem 1.4rem;
    background: #ffffff;
    border-left: 4px solid var(--accent);
    border-radius: 0 12px 12px 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    scroll-margin-top: 90px;
}

.calc-methodology-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent-ink);
    margin-bottom: 0.4rem;
}

.calc-methodology p {
    font-size: 0.95rem;
    color: #3f3f46;
    line-height: 1.75;
}

/* ── How it works / FAQ / prose sections ── */

.calc-section {
    max-width: 760px;
    margin: 2.25rem auto 0;
}

.calc-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 1.5px solid var(--border);
}

.calc-section p,
.calc-section li {
    font-size: 0.925rem;
    color: #52525b;
    line-height: 1.8;
    margin-bottom: 0.9rem;
}

.calc-section ul {
    padding-left: 1.25rem;
}

.calc-section li {
    margin-bottom: 0.4rem;
}

.calc-section a {
    color: var(--accent-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.calc-section a:hover {
    color: var(--ink);
}

.calc-formula {
    background: #f4f4f5;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.85rem;
    color: #27272a;
    margin-bottom: 0.9rem;
    overflow-x: auto;
    white-space: nowrap;
}

.calc-faq-item {
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 0;
}

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

.calc-faq-item h3 {
    font-size: 0.975rem;
    font-weight: 650;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.calc-faq-item p {
    margin-bottom: 0;
}

/* ── Hub + directory pages ── */

.tool-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    max-width: 760px;
    margin: 0 auto 1.5rem;
}

@media (min-width: 600px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1.25rem 1.25rem 1.1rem;
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tool-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.14);
    transform: translateY(-2px);
}

.tool-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}

.tool-card-desc {
    font-size: 0.85rem;
    color: #71717a;
    line-height: 1.5;
}

.dir-cluster {
    max-width: 760px;
    margin: 0 auto 2rem;
}

.dir-cluster h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.dir-cluster h2 a {
    color: inherit;
    text-decoration: none;
}

.dir-cluster h2 a:hover {
    color: var(--accent-ink);
}

.dir-cluster > p {
    font-size: 0.875rem;
    color: #71717a;
    margin-bottom: 0.75rem;
}

.dir-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.dir-list li {
    border-bottom: 1px solid #f0f0f0;
    padding: 0.55rem 0;
    font-size: 0.925rem;
    color: #52525b;
    line-height: 1.55;
}

.dir-list li:last-child {
    border-bottom: none;
}

.dir-list a {
    font-weight: 600;
    color: var(--accent-ink);
    text-decoration: none;
}

.dir-list a:hover {
    text-decoration: underline;
}

/* ── Reference tables inside calc sections ── */

.calc-table-wrap {
    overflow-x: auto;
    margin-bottom: 0.5rem;
}

.calc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.calc-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #71717a;
    padding: 0.55rem 0.8rem;
    border-bottom: 1.5px solid var(--border);
    background: #fafafa;
    white-space: nowrap;
}

.calc-table td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid #f4f4f5;
    color: #3f3f46;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.calc-table tr:last-child td {
    border-bottom: none;
}

.calc-table td:first-child {
    font-weight: 600;
    color: var(--ink);
}

/* ── Multi-bed rows (mulch) ── */

.bed-head,
.bed-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 1.5rem;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bed-head span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #71717a;
}

.bed-row .input-field {
    padding: 0.55rem 0.6rem;
    font-size: 0.95rem;
    min-width: 0;
    width: 100%;
}

/* ── Board-feet multi-row input ── */

.bf-head,
.bf-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 0.9fr 1.1fr 1.5rem;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bf-head span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #71717a;
}

.bf-row .input-field {
    padding: 0.55rem 0.6rem;
    font-size: 0.95rem;
}

.bf-remove {
    background: none;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    padding: 0.2rem;
    border-radius: 5px;
}

.bf-remove:hover {
    color: #b91c1c;
    background: #fef2f2;
}

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

.bf-add {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.bf-add:hover {
    color: var(--ink);
}

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

/* ── Embed section ── */

.embed-snippet {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 0.9rem;
    background: #f4f4f5;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.76rem;
    line-height: 1.6;
    color: #27272a;
    resize: vertical;
    white-space: pre;
    overflow-x: auto;
}

.embed-snippet:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.embed-actions {
    margin: 0.6rem 0 0.4rem;
}

.embed-actions .calc-action-btn {
    flex: none;
    padding: 0.5rem 1.1rem;
}

/* ── Disclaimer (above footer) ── */

.calc-disclaimer {
    max-width: 760px;
    margin: 2.5rem auto 0;
    font-size: 0.78rem;
    color: #a1a1aa;
    text-align: center;
    line-height: 1.6;
}

/* ── Print: materials list only, clean B/W ── */

@media print {
    body {
        background: #ffffff;
        animation: none;
    }

    .header,
    .footer,
    #sub-nav,
    .breadcrumbs,
    .calc-hero .calc-promise,
    .calc-inputs,
    .calc-actions,
    .calc-methodology,
    .calc-section,
    .calc-disclaimer,
    .related-converters,
    .skip-link {
        display: none !important;
    }

    .container {
        padding: 0;
        min-height: 0;
    }

    .calc-hero {
        text-align: left;
        margin-bottom: 0.75rem;
    }

    .calc-hero h1 {
        font-size: 1.3rem;
    }

    .calc-card {
        display: block;
        border: none;
        box-shadow: none;
        padding: 0;
        max-width: none;
    }

    .materials-list {
        background: #ffffff;
        border: 1px solid #18181b;
        border-radius: 6px;
    }

    .materials-group,
    .materials-note {
        border-color: #d4d4d8;
    }

    .materials-group-title,
    .materials-row-label,
    .materials-row-value,
    .materials-note,
    .materials-subtitle {
        color: #18181b;
    }

    .calc-results h2 {
        color: #18181b;
    }

    /* Attribution line, hidden on screen */
    .print-attribution {
        display: block !important;
        margin-top: 0.75rem;
        font-size: 0.75rem;
        color: #18181b;
    }
}

.print-attribution {
    display: none;
}
