/* ================================================
   TRIBECA CALCULATOR — calculator.css
   WordPress plugin edition
   ================================================ */

/* --- Variables --- */
:root {
  --color-primary:    #16163f;
  --color-accent:     #f4e948;
  --color-gold:       #d3b574;
  --color-dark-blue:  #2e2e53;
  --color-link-blue:  #2b4496;
  --color-body-text:  #4a4a4a;
  --color-light-gray: #eeeeee;
  --color-border:     #cccccc;
  --color-white:      #ffffff;

  --font-heading: 'Montserrat', sans-serif;
  --font-body:    'Signika Negative', sans-serif;

  --radius: 8px;
}

/* --- Reset — scoped to the calculator so WordPress styles are unaffected --- */
.calculator-wrapper *,
.calculator-wrapper *::before,
.calculator-wrapper *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ================================================
   WRAPPER
   ================================================ */

.calculator-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.09);
  overflow: hidden;
}

/* ================================================
   HEADER
   ================================================ */

.calculator-header {
  text-align: center;
  padding: 2.5rem 2rem 2rem;
  border-bottom: 1px solid var(--color-light-gray);
}

.calculator-header h2 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.calculator-header p {
  font-size: 0.95rem;
  color: #888;
}

/* ================================================
   GRID — 4 columns
   ================================================ */

.calculator-grid {
  display: grid;
  grid-template-columns: 270px 1fr 1fr 1fr;
  align-items: stretch;
  border-top: 1px solid var(--color-light-gray);
}

/* ================================================
   COLUMN BASE
   ================================================ */

.col {
  border-right: 1px solid var(--color-light-gray);
}

.col-competitor {
  border-right: none;
}

/* ================================================
   COLUMN HEADERS
   ================================================ */

.col-header {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--color-light-gray);
  background: #fafafa;
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Featured column header — Tribeca */
.col-header--featured {
  background: var(--color-primary);
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-dark-blue);
  min-height: 75px;
  font-size: 0.9rem;
  position: relative;
}

/* Extends the Tribeca header — 20px upward, ~8px downward */
.col-header--featured::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -1px;
  right: -1px;
  height: 20px;
  background: var(--color-primary);
}

/* ================================================
   INPUT COLUMN
   ================================================ */

.inputs-body {
  padding: 0.875rem 1.5rem 1.75rem;
}

.input-group {
  margin-bottom: 0.7rem;
}

.input-group:last-child {
  margin-bottom: 0;
}


.input-label {
  display: block;
  font-size: 0.82rem;
  color: var(--color-body-text);
  line-height: 1.45;
  margin-bottom: 0.22rem;
}

.calc-input {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-white);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.calc-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(22, 22, 63, 0.1);
}

.calc-input.invalid {
  border-color: #c0392b;
}

.calc-input.urgency-empty {
  background-color: #fffacb;
}

/* ================================================
   SCENARIO COLUMNS — shared
   ================================================ */

.col-body {
  padding: 1.5rem;
}

/* Subtle tint on the featured Tribeca column */
.col-tribeca .col-body {
  background: #f6f7ff;
}

/* ── Settlement value display at top of each column ── */

.scenario-value {
  text-align: center;
  padding: 0.7rem 0 0.9rem;
  border-bottom: 1px solid var(--color-light-gray);
  margin-bottom: 0.5rem;
}

.scenario-value__amount {
  font-family: var(--font-heading);
  font-size: 2.06rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.scenario-value__label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #aaa;
  margin-top: 0.25rem;
}

/* ── Data rows ── */

.scenario-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.81rem 0;
  border-bottom: 1px solid var(--color-light-gray);
}

.scenario-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Colored dot indicator */
.scenario-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.dot--na    { background: #ddd; }
.dot--cost  { background: #a6bdd0; }
.dot--fees  { background: #4d789d; }
.dot--total { background: var(--color-primary); }

.scenario-row__amount {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.31rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.scenario-row__label {
  display: block;
  font-size: 0.91rem;
  color: #999;
  margin-top: 0.15rem;
  line-height: 1.35;
}

/* Total row — slightly larger */
.scenario-row--total {
  min-height: 101px;
  border-bottom: none;
}

.scenario-row--total .scenario-row__amount {
  font-size: 1.5rem;
}

.scenario-row--total .scenario-row__label {
  color: #777;
}

/* Timing row */
.scenario-row--timing {
  border-top: 2px solid var(--color-gold);
  margin-top: 0.25rem;
  background-color: rgba(211, 181, 116, 0.1);
  justify-content: center;
  text-align: center;
}

.scenario-row--timing .scenario-row__amount {
  font-size: 1.51rem;
  color: var(--color-dark-blue);
}

.scenario-row--timing .scenario-row__label {
  font-size: 0.91rem;
  color: #aaa;
}

/* ================================================
   GRID — explicit row placement for CTA strip
   ================================================ */

.col-inputs                         { grid-row: 1 / 3; }
.col-settled, .col-tribeca,
.col-competitor                     { grid-row: 1; }

/* ================================================
   CTA STRIP
   ================================================ */

.cta-strip {
  grid-column: 2 / 5;
  grid-row: 2;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 1.75rem 2rem;
  text-align: center;
  border-top: 3px solid var(--color-accent);
  display: none;
}

.cta-strip.visible {
  display: block;
}

/* ── Insight box overlay ── */

.input-group--urgency {
  position: relative;
}

.insight-box {
  display: none;
  position: absolute;
  left: calc(100% + 1.25rem);
  top: 0;
  width: 240px;
  z-index: 10;
  background: var(--color-accent);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.9rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.insight-box.visible {
  display: block;
}

.insight-box::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 1rem;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 9px solid var(--color-accent);
}

.insight-box__inner {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.insight-box__icon {
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1.5;
  color: var(--color-primary);
}

.insight-box__content p {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--color-primary);
}

.insight-box__cta {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--color-primary);
  color: var(--color-white);
  text-align: center;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 4px;
  transition: background 0.15s;
}

.insight-box__cta:hover {
  background: var(--color-dark-blue);
}

.insight-box__close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--color-primary);
  opacity: 0.45;
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
}

.insight-box__close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.07);
}

.cta-strip__headline {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 0.3rem;
}

.cta-strip__sub {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1rem;
}

.cta-strip__btn {
  display: inline-block;
  padding: 0.65rem 1.75rem;
  background: var(--color-accent);
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  letter-spacing: 0.03em;
  transition: background 0.15s;
}

.cta-strip__btn:hover {
  background: #e5d93c;
}

.cta-strip__disclaimer {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.6rem;
}

/* ================================================
   FOOTER
   ================================================ */

.calculator-footer {
  font-size: 0.73rem;
  color: #bbb;
  text-align: center;
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--color-light-gray);
  line-height: 1.65;
}

/* ================================================
   RESPONSIVE SCALING — tablet to desktop
   Desktop-first. Discrete breakpoints only.
   ================================================ */

/* ── 992px — tablet landscape ── */
@media (max-width: 992px) {

  .calculator-header {
    padding: 2rem 1.5rem 1.5rem;
  }

  .calculator-header h2 {
    font-size: 1.6rem;
  }

  .calculator-grid {
    grid-template-columns: 210px 1fr 1fr 1fr;
  }

  .col-header {
    padding: 1.1rem 1rem;
    font-size: 0.73rem;
  }

  .col-header--featured {
    font-size: 0.83rem;
  }

  .inputs-body {
    padding: 0.75rem 1.1rem 1.5rem;
  }

  .col-body {
    padding: 1.1rem;
  }

  .scenario-value__amount {
    font-size: 1.75rem;
  }

  .scenario-row__amount {
    font-size: 1.15rem;
  }

  .scenario-row--total .scenario-row__amount {
    font-size: 1.3rem;
  }

  .scenario-row--timing .scenario-row__amount {
    font-size: 1.3rem;
  }

  .cta-strip {
    padding: 1.5rem;
  }

  .calculator-footer {
    padding: 1rem 1.5rem;
  }

}

/* ── 768px — tablet portrait ── */
@media (max-width: 768px) {

  .calculator-header {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .calculator-header h2 {
    font-size: 1.35rem;
  }

  .calculator-grid {
    grid-template-columns: 168px 1fr 1fr 1fr;
  }

  .col-header {
    padding: 0.85rem 0.7rem;
    font-size: 0.66rem;
    min-height: 56px;
  }

  .col-header--featured {
    font-size: 0.76rem;
    min-height: 62px;
  }

  .inputs-body {
    padding: 0.65rem 0.85rem 1.1rem;
  }

  .input-group {
    margin-bottom: 0.55rem;
  }

  .input-label {
    font-size: 0.75rem;
  }

  .calc-input {
    font-size: 0.9rem;
    padding: 0.45rem 0.6rem;
  }

  .col-body {
    padding: 0.85rem 0.75rem;
  }

  .scenario-value__amount {
    font-size: 1.45rem;
  }

  .scenario-row {
    gap: 0.5rem;
  }

  .scenario-row__amount {
    font-size: 1rem;
  }

  .scenario-row__label {
    font-size: 0.82rem;
  }

  .scenario-row--total {
    min-height: 82px;
  }

  .scenario-row--total .scenario-row__amount {
    font-size: 1.15rem;
  }

  .scenario-row--timing .scenario-row__amount {
    font-size: 1.2rem;
  }

  .scenario-row--timing .scenario-row__label {
    font-size: 0.82rem;
  }

  .insight-box {
    width: 200px;
  }

  .cta-strip {
    padding: 1.25rem;
  }

  .cta-strip__headline {
    font-size: 0.9rem;
  }

  .calculator-footer {
    padding: 0.9rem 1rem;
  }

}

/* ================================================
   MOBILE — desktop passthrough for new elements
   ================================================ */

.scenarios-wrapper { display: contents; }

.mobile-edit-btn,
.sheet-close-btn,
.scroll-dots,
.mobile-scrim,
.tile-edit-btn { display: none; }

/* ================================================
   MOBILE LAYOUT — @media (max-width: 640px)
   ================================================ */

@media (max-width: 640px) {

  /* Grid becomes single-column flex */
  .calculator-grid {
    display: flex;
    flex-direction: column;
  }

  /* Input column → fixed bottom sheet */
  .col-inputs {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 100;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    max-height: 85vh;
    grid-row: unset;
  }

  .col-inputs.sheet-open { transform: translateY(0); }

  /* col-header inside the sheet */
  .col-inputs .col-header { border-radius: 12px 12px 0 0; }

  /* Tile edit button — top-right of col-body, above the content padding */
  .col-body { position: relative; }

  .tile-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    right: 6px;
    width: 26px;
    height: 26px;
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
  }

  /* Scenario columns: horizontal snap scroll */
  .scenarios-wrapper {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.75rem 45vw 0.75rem 5vw;
    scroll-padding-left: 5vw;
  }

  .scenarios-wrapper::-webkit-scrollbar { display: none; }

  .col-settled, .col-tribeca, .col-competitor {
    min-width: 50vw;
    width: 50vw;
    flex-shrink: 0;
    scroll-snap-align: start;
    border: 2px solid var(--color-gold);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 8px;
    position: relative;
  }

  /* Tribeca column first visually */
  .col-tribeca    { order: 1; }
  .col-settled    { order: 2; }
  .col-competitor { order: 3; }

  /* Remove bottom padding so the timing row sits flush with the tile border */
  .col-body { padding-bottom: 0; }

  .scenario-row--advance { min-height: 83px; }

  /* col-body horizontal padding at this breakpoint = 0.75rem */
  .scenario-row--timing {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Reset featured header ::before (looks wrong full-width) */
  .col-header--featured::before { display: none; }
  .col-header--featured { min-height: 56px; }

  /* CTA strip: full width below scroll area */
  .cta-strip {
    grid-column: unset;
    grid-row: unset;
  }

  /* Insight box: inline inside the bottom sheet */
  .insight-box {
    position: static;
    width: 100%;
    left: unset; top: unset;
    margin-top: 0.75rem;
    box-shadow: none;
  }

  .insight-box::before { display: none; }

  /* Edit button — ghost style so it doesn't compete with the scenario tiles */
  .mobile-edit-btn {
    display: block;
    width: calc(100% - 2rem);
    margin: 0.75rem 1rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--color-body-text);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
  }

  /* Sheet close button */
  .sheet-close-btn {
    display: block;
    width: calc(100% - 2rem);
    margin: 1rem 1rem 1.25rem;
    padding: 0.8rem;
    background: var(--color-accent);
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
  }

  /* Scroll dots */
  .scroll-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
  }

  .scroll-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--color-border);
    transition: background 0.2s;
  }

  .scroll-dot.active { background: var(--color-primary); }

  .scenarios-wrapper {
    touch-action: pan-x pinch-zoom;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
  }

  .scroll-dot {
    cursor: pointer;
  }

  /* Scrim */
  .mobile-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99;
  }

  .mobile-scrim.visible { display: block; }

}


/* ================================================
   MOBILE RESPONSIVE TUNE-UP — v1.0.1
   ================================================ */

.calculator-wrapper {
  width: 100%;
}

@media (max-width: 640px) {
  .calculator-wrapper {
    border-radius: 0;
    box-shadow: none;
    margin-left: auto;
    margin-right: auto;
  }

  .calculator-header {
    padding: 1.25rem 1rem 1rem;
  }

  .calculator-header h2 {
    font-size: 1.25rem;
    line-height: 1.2;
  }

  .calculator-header p {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .col-inputs {
    border-right: none;
  }

  .col-inputs .col-header,
  .col-settled .col-header,
  .col-tribeca .col-header,
  .col-competitor .col-header {
    min-height: auto;
    padding: 0.9rem 1rem;
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .inputs-body {
    padding: 0.85rem 1rem 1rem;
  }

  .input-group {
    margin-bottom: 0.8rem;
  }

  .input-label {
    font-size: 0.84rem;
    line-height: 1.4;
  }

  .calc-input {
    min-height: 44px;
    font-size: 1rem;
    padding: 0.7rem 0.8rem;
  }

  .mobile-edit-btn {
    width: calc(100% - 1.5rem);
    margin: 0.75rem auto 0.5rem;
  }

  .scenarios-wrapper {
    gap: 0.75rem;
    padding: 0.5rem 1rem 0.5rem;
    scroll-padding-left: 1rem;
  }

  .col-settled,
  .col-tribeca,
  .col-competitor {
    min-width: 82vw;
    width: 82vw;
    margin: 0;
  }

  .col-body {
    padding: 1rem 0.9rem 0;
  }

  .tile-edit-btn {
    top: 0.2rem;
    right: 0.35rem;
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
  }

  .scenario-value {
    padding-top: 0.35rem;
  }

  .scenario-value__amount {
    font-size: 1.65rem;
  }

  .scenario-row {
    gap: 0.65rem;
    padding: 0.7rem 0;
  }

  .scenario-row__amount {
    font-size: 1.05rem;
  }

  .scenario-row__label {
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .scenario-row--total {
    min-height: auto;
    padding-bottom: 0.9rem;
  }

  .scenario-row--total .scenario-row__amount,
  .scenario-row--timing .scenario-row__amount {
    font-size: 1.2rem;
  }

  .scenario-row--timing {
    margin-left: -0.9rem;
    margin-right: -0.9rem;
    padding: 0.85rem 0.9rem;
  }

  .cta-strip {
    display: block;
    margin: 0.25rem 1rem 1rem;
    border-radius: 10px;
    padding: 1.1rem 1rem;
  }

  .cta-strip__headline {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .cta-strip__sub {
    font-size: 0.85rem;
    line-height: 1.45;
  }

  .cta-strip__btn {
    width: 100%;
    padding: 0.85rem 1rem;
  }

  .calculator-footer {
    padding: 1rem;
    font-size: 0.72rem;
  }
}

@media (max-width: 480px) {
  .scenarios-wrapper {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    scroll-padding-left: 0.75rem;
  }

  .col-settled,
  .col-tribeca,
  .col-competitor {
    min-width: 88vw;
    width: 88vw;
  }

  .scenario-value__amount {
    font-size: 1.5rem;
  }

  .scenario-row__amount {
    font-size: 1rem;
  }

  .sheet-close-btn {
    width: calc(100% - 1.5rem);
    margin: 0.85rem auto 1rem;
  }
}
