/* =====================================================================
   SHIM-ME Hub — Calculator shortcode CSS  (Bucket B)
   Scoped to #shim-calculator (the WPBakery row's el_id — bare, no #).
   Enqueued by the plugin only on pages that render [shim_calculator].

   §0 rules in force:
   · Every selector prefixed with  body #shim-calculator
   · color, font-family, font-size, font-weight, letter-spacing,
     text-transform  all carry  !important
   · Layout props (display, grid, position, padding, margin) do NOT
     need !important unless a specific Total override is confirmed.
   ===================================================================== */

/* ------------------------------------------------------------------
   Head block (eyebrow + h2 + lead)
   ------------------------------------------------------------------ */
body #shim-calculator .shim-calc__head {
    max-width: 720px;
    margin-bottom: 56px;
}

/* ------------------------------------------------------------------
   Two-column panel
   ------------------------------------------------------------------ */
body #shim-calculator .shim-calc__panel {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 0;
    border: 1px solid var(--shim-line);
    background: var(--shim-bg-3);
}

/* ------------------------------------------------------------------
   LEFT — input column
   ------------------------------------------------------------------ */
body #shim-calculator .shim-calc__input {
    padding: 44px;
    border-right: 1px solid var(--shim-line);
}

body #shim-calculator .shim-calc__step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--shim-mono) !important;
    font-size: 11px !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
    color: var(--shim-text-dim) !important;
    margin-bottom: 28px;
}

body #shim-calculator .shim-calc__step-n {
    background: var(--shim-red);
    color: #fff !important;
    padding: 4px 8px;
    font-weight: 600 !important;
}

body #shim-calculator .shim-calc__label {
    display: block;
    font-family: var(--shim-display) !important;
    font-weight: 700 !important;
    font-size: 32px !important;
    text-transform: uppercase !important;
    letter-spacing: -0.005em !important;
    color: var(--shim-text) !important;
    margin-bottom: 16px;
}

/* Input field */
body #shim-calculator .shim-calc__field {
    position: relative;
    display: flex;
    align-items: baseline;
    background: #000;
    border: 1px solid var(--shim-line-2);
    padding: 18px 22px;
    margin-bottom: 24px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

body #shim-calculator .shim-calc__field:focus-within {
    border-color: var(--shim-red);
    box-shadow: 0 0 0 1px var(--shim-red-glow);
}

body #shim-calculator .shim-calc__field input {
    flex: 1;
    background: transparent;
    border: 0;
    color: #fff !important;
    font-family: var(--shim-display) !important;
    font-weight: 700 !important;
    font-size: 72px !important;
    line-height: 1 !important;
    letter-spacing: -0.02em !important;
    outline: none;
    width: 100%;
    min-width: 0;
}

body #shim-calculator .shim-calc__field input::-webkit-outer-spin-button,
body #shim-calculator .shim-calc__field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

body #shim-calculator .shim-calc__field input[type=number] {
    -moz-appearance: textfield;
}

body #shim-calculator .shim-calc__unit {
    font-family: var(--shim-mono) !important;
    font-size: 13px !important;
    color: var(--shim-text-mute) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.2em !important;
    margin-left: 12px;
}

/* ------------------------------------------------------------------
   Ruler
   ------------------------------------------------------------------ */
body #shim-calculator .shim-calc__ruler {
    margin-bottom: 20px;
}

body #shim-calculator .shim-ruler__bar {
    position: relative;
    height: 28px;
    background:
        repeating-linear-gradient(90deg, var(--shim-line) 0 1px, transparent 1px 14.28%),
        var(--shim-bg-2);
    border: 1px solid var(--shim-line);
}

body #shim-calculator .shim-ruler__fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, var(--shim-red-deep), var(--shim-red));
    width: 50%; /* JS overrides this live */
    transition: width .2s ease;
}

body #shim-calculator .shim-ruler__ticks {
    display: flex;
    justify-content: space-between;
    font-family: var(--shim-mono) !important;
    font-size: 10px !important;
    color: var(--shim-text-mute) !important;
    margin-top: 8px;
    letter-spacing: 0.08em !important;
}

/* ------------------------------------------------------------------
   Help text + "Why" toggle
   ------------------------------------------------------------------ */
body #shim-calculator .shim-calc__help {
    color: var(--shim-text-dim) !important;
    font-size: 14px !important;
    margin: 6px 0 24px;
    line-height: 1.5;
}

body #shim-calculator .shim-calc__why {
    background: transparent;
    border: 0;
    font-family: var(--shim-mono) !important;
    font-size: 12px !important;
    color: var(--shim-text-dim) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.16em !important;
    border-bottom: 1px dotted var(--shim-text-mute);
    padding: 4px 0;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}

body #shim-calculator .shim-calc__why:hover {
    color: var(--shim-red) !important;
    border-color: var(--shim-red);
}

body #shim-calculator .shim-calc__why-body {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--shim-line);
    background: #0A0A0A;
    font-size: 13px !important;
    color: var(--shim-text-dim) !important;
    line-height: 1.6;
}

body #shim-calculator .shim-calc__why-body p {
    margin: 0 0 8px;
}

body #shim-calculator .shim-calc__why-body p:last-child {
    margin: 0;
    color: var(--shim-red) !important;
    font-size: 12px !important;
}

/* ------------------------------------------------------------------
   RIGHT — result column
   ------------------------------------------------------------------ */
body #shim-calculator .shim-calc__result {
    padding: 44px;
    background:
        radial-gradient(ellipse at top right, rgba(227, 29, 30, 0.18), transparent 60%),
        var(--shim-bg-3);
    position: relative;
    display: flex;
    flex-direction: column;
}

body #shim-calculator .shim-calc__result-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

body #shim-calculator .shim-calc__result-tag {
    font-size: 11px !important;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--shim-line);
    padding: 6px 10px;
    color: var(--shim-text-dim) !important;
    letter-spacing: 0.18em !important;
}

/* Big number */
body #shim-calculator .shim-calc__result-number {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    border-bottom: 1px solid var(--shim-line);
    padding-bottom: 30px;
    margin-bottom: 28px;
}

body #shim-calculator .shim-calc__big {
    font-family: var(--shim-display) !important;
    font-weight: 900 !important;
    font-size: clamp(120px, 16vw, 220px) !important;
    line-height: 0.82 !important;
    color: #fff !important;
    letter-spacing: -0.04em !important;
    text-shadow: 0 0 60px rgba(227, 29, 30, 0.25);
}

body #shim-calculator .shim-calc__unitL {
    font-family: var(--shim-mono) !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.2em !important;
    color: var(--shim-text-dim) !important;
    padding-bottom: 16px;
    line-height: 1.5;
}

body #shim-calculator .shim-calc__result-copy {
    font-size: 15px !important;
    line-height: 1.6 !important;
    color: var(--shim-text-dim) !important;
    margin: 0 0 24px;
    max-width: 50ch;
}

/* Breakdown grid */
body #shim-calculator .shim-calc__result-bd {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--shim-line);
    border-bottom: 1px solid var(--shim-line);
    margin-bottom: 28px;
}

body #shim-calculator .shim-calc__result-bd > div {
    padding: 18px 16px;
    border-right: 1px solid var(--shim-line);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body #shim-calculator .shim-calc__result-bd > div:last-child {
    border-right: 0;
}

body #shim-calculator .shim-calc__result-bd .shim-mono {
    font-size: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.16em !important;
    color: var(--shim-text-mute) !important;
}

body #shim-calculator .shim-calc__result-bd b {
    font-family: var(--shim-display) !important;
    font-weight: 700 !important;
    font-size: 32px !important;
    line-height: 1 !important;
    color: #fff !important;
}

/* CTA area */
body #shim-calculator .shim-calc__result-cta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    align-items: flex-start;
}

/* ------------------------------------------------------------------
   Notes strip (A / B / C)
   ------------------------------------------------------------------ */
body #shim-calculator .shim-calc__notes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 28px;
    border-top: 1px solid var(--shim-line);
    padding-top: 24px;
}

body #shim-calculator .shim-calc__notes > div {
    font-size: 13px !important;
    color: var(--shim-text-dim) !important;
    display: flex;
    gap: 12px;
    padding-right: 24px;
    line-height: 1.5;
}

body #shim-calculator .shim-calc__notes .shim-mono {
    color: var(--shim-red) !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    padding-top: 2px;
}

body #shim-calculator .shim-calc__notes a {
    color: var(--shim-text) !important;
    border-bottom: 1px solid var(--shim-red);
}

body #shim-calculator .shim-calc__notes a:hover {
    color: var(--shim-red) !important;
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 1024px) {
    body #shim-calculator .shim-calc__panel {
        grid-template-columns: 1fr;
    }
    body #shim-calculator .shim-calc__input {
        border-right: 0;
        border-bottom: 1px solid var(--shim-line);
    }
    body #shim-calculator .shim-calc__notes {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    body #shim-calculator .shim-calc__notes > div {
        padding-right: 0;
    }
}

@media (max-width: 720px) {
    body #shim-calculator .shim-calc__input,
    body #shim-calculator .shim-calc__result {
        padding: 28px 24px;
    }
    body #shim-calculator .shim-calc__field input {
        font-size: 52px !important;
    }
    body #shim-calculator .shim-calc__big {
        font-size: clamp(80px, 20vw, 120px) !important;
    }
    body #shim-calculator .shim-calc__result-bd {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ------------------------------------------------------------------
   INSTALL GUIDE MODAL
   Uses the same .shim-data-modal CSS classes as the TEST DATA modals
   in shim-proof.css — identical visual language, same box/backdrop.
   Defined here so shim-proof.css is not required on calc-only pages.
   ------------------------------------------------------------------ */

/* If shim-proof.css is also loaded (proof section on same page),
   these rules are harmlessly duplicated — no conflict. */

.shim-data-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}
.shim-data-modal[hidden] {
    display: none;
}

.shim-data-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: pointer;
}

.shim-data-modal__box {
    position: relative;
    z-index: 1;
    width: min(800px, 96vw);
    max-height: 90vh;
    overflow-y: auto;
    background: #0d0d0d;
    border: 1px solid var(--shim-line);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85);
    padding: 40px 40px 48px;
    box-sizing: border-box;
}
/* --vhb base: padding/overflow/max-height shared by all VHB modals */
.shim-data-modal__box--vhb {
    padding: 0 !important;       /* head carries its own padding; iframe runs edge-to-edge */
    overflow: hidden;             /* clips iframe border-radius if ever added */
    max-height: none;             /* player ratio dictates height — no scroll needed */
}
/* --install compound selector: 2-class specificity beats shim-proof.css's
   single-class .shim-data-modal__box--vhb { width: min(720px,96vw) } rule
   regardless of stylesheet load order. */
.shim-data-modal__box--vhb.shim-data-modal__box--install {
    width: min(1540px, 96vw);
}

/* ------------------------------------------------------------------
   Neutralise Bootstrap container constraints that bleed into the
   modal overlay. Total / WPBakery load Bootstrap on the page, which
   applies fixed max-widths at each breakpoint. Inside our modal the
   container must fill 100% of the box — not a fixed pixel cap.
   ------------------------------------------------------------------ */

/* Base: reset padding/margin for all container variants inside modal */
.shim-data-modal .container,
.shim-data-modal .container-sm,
.shim-data-modal .container-md,
.shim-data-modal .container-lg,
.shim-data-modal .container-xl,
.shim-data-modal .container-xxl {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* sm breakpoint — Bootstrap sets max-width:540px here; disable mt-sm-1 */
@media (min-width: 576px) {
    .shim-data-modal .container,
    .shim-data-modal .container-sm {
        max-width: 100% !important;
    }
    .shim-data-modal .mt-sm-1 {
        margin-top: 0 !important;
    }
}

/* lg breakpoint — Bootstrap sets max-width:960px here; force 100% */
@media (min-width: 992px) {
    .shim-data-modal .container,
    .shim-data-modal .container-lg,
    .shim-data-modal .container-md,
    .shim-data-modal .container-sm {
        max-width: 100% !important;
    }
}

.shim-data-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: transparent !important;
    border: 1px solid var(--shim-line) !important;
    color: var(--shim-text) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    transition: border-color .15s ease, color .15s ease;
}
.shim-data-modal__close:hover {
    border-color: var(--shim-red) !important;
    color: var(--shim-red) !important;
}
.shim-data-modal__close svg {
    display: block !important;
    flex-shrink: 0;
    pointer-events: none;
}

/* Modal head — eyebrow + title + optional download button
   Carries its own padding because the VHB box variant has padding: 0 */
.shim-data-modal__vhb-head {
    padding: 28px 32px 20px;
    padding-right: 60px; /* clear the × close button */
    margin-bottom: 0;
    border-bottom: 1px solid var(--shim-line);
}
.shim-data-modal__vhb-head h3 {
    font-family: var(--shim-display) !important;
    font-weight: 700 !important;
    font-size: 26px !important;
    text-transform: uppercase !important;
    letter-spacing: -0.005em !important;
    color: var(--shim-text) !important;
    margin: 6px 0 10px !important;
    line-height: 1.1 !important;
}
.shim-data-modal__vhb-head p {
    font-family: var(--shim-body) !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: var(--shim-text-dim) !important;
    margin: 0 !important;
}

/* Eyebrow variant (red) */
.shim-eyebrow--red {
    color: var(--shim-red) !important;
}

/* Player wrapper — fixed-height clip container.
   The setupvideos player is wider than pure 16:9 (it has a chapter sidebar)
   and taller (bottom nav bar). Fixed height + overflow: hidden clips only the
   bottom bar; the wider modal gives the sidebar room to render.
   Height was chosen so a ~1540 px wide player shows the full video + sidebar. */
.shim-calc-modal__player {
    position: relative;
    width: 100%;
    height: 640px;
    overflow: hidden;
    background: #000;
    line-height: 0; /* collapse inline gap */
}
.shim-calc-modal__player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Slightly taller than 100% so the player's bottom nav bar hangs below
       the clipped area while the video + sidebar occupy the visible 560 px */
    height: 115%;
    border: 0;
}

@media (max-width: 600px) {
    /* Keep generic box padding for non-vhb modals */
    .shim-data-modal__box:not(.shim-data-modal__box--vhb) {
        padding: 24px 20px 32px;
    }
    .shim-data-modal__vhb-head {
        padding: 20px 20px 16px;
        padding-right: 52px;
    }
    .shim-data-modal__vhb-head h3 {
        font-size: 20px !important;
    }
    /* Reduce player height on narrow screens where sidebar collapses */
    .shim-calc-modal__player {
        height: 220px;
    }
}
