/* =========================================
   Quietly Hosted – tools.css
   Layered on top of main style.css
   Purpose:
   - Slightly tighter, more utilitarian feel
   - Support for interactive tools (forms/results)
   - Keep visual consistency with main site
   ========================================= */

/* ---------- Layout tweaks ---------- */

.qh-main--tool {
    padding-top: var(--s4);
    padding-bottom: 0;
}

.qh-section--tool {
    padding: var(--s5) 0;
}

/* Tools should feel tighter than marketing pages */
.qh-section--tool h1 {
    margin-bottom: var(--s2);
}

.qh-section--tool p {
    max-width: auto;
}

/* ---------- Tool page header override ---------- */

.qh-header {
    position: static;
    top: auto;
    z-index: auto;
    backdrop-filter: none;
}

/* ---------- Tool container ---------- */

.tool-wrap {
    max-width: 620px;
    margin: 0 auto;
}

/* ---------- Inputs ---------- */

.tool-panel {
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: var(--s3);
    box-shadow: var(--shadow-soft);
}

.tool-field {
    display: flex;
    flex-direction: column;
    gap: var(--s0);
    margin-bottom: var(--s2);
}

.tool-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
}

.tool-input {
    width: 100%;
    padding: 10px 10px;
    border-radius: 10px;
    border: 1px solid rgba(32, 44, 48, 0.16);
    font: inherit;
    background: #fff;
}

.tool-input:focus {
    outline: none;
    border-color: rgba(47, 107, 87, 0.45);
    box-shadow: 0 0 0 4px rgba(47, 107, 87, 0.12);
}

/* ---------- Grid (stations etc) ---------- */

.tool-grid {
    display: grid;
    gap: var(--s2);
}

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

/* ---------- Tooltips ---------- */

.tooltip {
    position: relative;
    cursor: help;
    color: var(--accent);
    font-weight: 700;
}

.tooltiptext {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;

    position: absolute;
    z-index: 10;

    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);

    background: #202c30;
    color: #fff;

    padding: 8px 10px;
    border-radius: 8px;

    font-size: 0.85rem;
    line-height: 1.4;

    width: auto;
    max-width: 260px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* ---------- Results ---------- */

.tool-results {
    margin: var(--s1);
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: var(--s3);
    box-shadow: var(--shadow-soft);
}

.tool-summary {
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: var(--s2);
}

.tool-result {
    padding: var(--s2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--hairline);
    background: #fafafa;
    margin-bottom: var(--s1);
}

.tool-result--best {
    background: rgba(47, 107, 87, 0.08);
    border-color: rgba(47, 107, 87, 0.25);
}

.tool-result--worst {
    background: rgba(176, 70, 70, 0.08);
    border-color: rgba(176, 70, 70, 0.25);
}

.tool-meta {
    font-size: 0.85rem;
    color: var(--muted);
    text-align: right;
}

/* ---------- Actions ---------- */

.tool-actions {
    display: flex;
    gap: var(--s1);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--s3);
}

/* --- Tool button sizing --- */

.qh-button {
    font-size: 1rem;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    line-height: 1.2;
}

/* Bigger buttons specifically inside tools */
.qh-main--tool .qh-button {
    padding: 0.4rem 0.8rem;
}

/* Primary tool action */
.qh-button--primary {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    margin-top: var(--s1);
}

.qh-button--primary:hover {
    filter: brightness(0.95);
}

/* Secondary / subtle */
.qh-button--ghost {
    background: transparent;
    border: 1px solid var(--hairline);
    color: var(--ink);
}

.qh-button--ghost:hover {
    background: rgba(32, 44, 48, 0.04);
}

/* ---------- Toggle / small links ---------- */

.tool-toggle {
    text-align: center;
    font-size: 0.9rem;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}

/* ---------- Minimal footer for tools ---------- */

.qh-footer-simple {
    border-top: 1px solid var(--hairline);
    color: var(--muted);
    font-size: 0.9rem;
}

.qh-footer-simple a {
    color: var(--ink);
}

/* ---------- SPLURT styles ---------- */

.qh-section--tool {
    padding: var(--s4) 0 var(--s5);
}

.tool-wrap {
    max-width: 620px;
    margin-inline: auto;
}

.qh-tool-header,
.qh-section--tool .qh-section-lede {
    text-align: center;
}

.qh-tool-header h1 {
    font-size: clamp(2rem, 6vw, 2.6rem);
    letter-spacing: 0.15em;
    margin-bottom: var(--s1);
}

.qh-tool-header {
    margin-bottom: var(--s4);
}

.qh-tool-tagline {
    font-size: 0.95rem;
    color: var(--muted);
    font-style: italic;
    margin-bottom: var(--s2);
}

/* ---------- Compact panel/input layout ---------- */

.tool-panel {
    padding: var(--s2);
    margin: var(--s1);
}

.tool-field {
    margin-bottom: 0;
}

.tool-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: var(--s-1);
}

.tool-input {
    font-size: 1rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
}

/* ---------- Station layout ---------- */

.tool-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s1);
}

@media (min-width: 480px) {
    .tool-grid--2 {
        grid-template-columns: 1fr 1fr;
        gap: var(--s1) var(--s2);
    }
}

.tool-station-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: var(--s1);
}

.tool-station-header span {
    flex: 0 0 auto;
    font-weight: 600;
}

.tool-station-header input {
    flex: 1;
    font-weight: 600;
}

/* ---------- Inline input + tooltip ---------- */

.tool-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* ---------- Divider ---------- */

.tool-divider {
    border: 0;
    border-top: 1px solid var(--hairline);
    margin: var(--s3) 0;
}

/* ---------- Small notes ---------- */

.tool-note {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: right;
}

/* ---------- Toggle ---------- */

.tool-toggle {
    margin-top: var(--s1);
}

/* ---------- SPLURT-US ---------- */

.tool-inline--full {
    width: 100%;
}

.tool-inline--full .tool-input {
    flex: 1;
    min-width: 0;
}

.splurt-station {
    margin-bottom: var(--s1);
}

.tool-result strong {
    display: inline-block;
    margin-bottom: 0.15rem;
}
