/* Styling for the Landlord Tools / calculator landing pages.
   Builds on css/style.css (root vars, nav, footer, .btn). Scoped to .calc-* . */

.calc-hero {
  background: linear-gradient(160deg, var(--dark) 0%, var(--dark-2) 100%);
  color: #fff;
  padding: 96px 20px 64px;
  text-align: center;
}
.calc-hero .calc-eyebrow {
  display: inline-block;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue-light);
  font-weight: 700;
  margin-bottom: 14px;
}
.calc-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  margin: 0 0 16px;
}
.calc-hero p.lead {
  max-width: 640px;
  margin: 0 auto 28px;
  color: rgba(255,255,255,.82);
  font-size: 1.1rem;
  line-height: 1.55;
}

.calc-run-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transition: background .15s, transform .15s;
}
.calc-run-btn:hover { background: var(--accent-dark); transform: translateY(-1px); text-decoration: none !important; }
.calc-run-note { margin-top: 12px; font-size: .85rem; color: rgba(255,255,255,.6); }

.calc-body {
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 20px;
}
.calc-body h2 {
  font-size: 1.6rem;
  margin: 40px 0 12px;
  color: var(--text);
}
.calc-body h2:first-child { margin-top: 0; }
.calc-body p { color: var(--text); line-height: 1.65; margin: 0 0 16px; }
.calc-body ul { color: var(--text); line-height: 1.7; padding-left: 22px; margin: 0 0 16px; }

.calc-formula {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 0 24px;
  font-size: 1.05rem;
  color: var(--text);
}
.calc-formula strong { color: var(--blue); }

.calc-example {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 26px;
  margin: 0 0 28px;
}
.calc-example h3 { margin: 0 0 14px; font-size: 1.15rem; color: var(--text); }
.calc-example table { width: 100%; border-collapse: collapse; }
.calc-example td { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .98rem; }
.calc-example td:last-child { text-align: right; font-weight: 600; }
.calc-example tr:last-child td { border-bottom: none; }
.calc-example tr.calc-result td {
  border-top: 2px solid var(--blue);
  padding-top: 12px;
  font-weight: 700;
  color: var(--blue);
  font-size: 1.1rem;
}

.calc-cta-mid {
  text-align: center;
  padding: 8px 0 8px;
}

/* The nav ribbon must always be opaque on calculator pages (it has a sidebar
   scrolling beneath it). The global nav is transparent until .scrolled, which
   on these pages lets the sidebar show through and cover the logo/links at the
   very top. Force the same dark background the .scrolled state uses, always. */
#nav {
  background: rgba(13,17,23,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--dark-border);
  z-index: 300;
}

/* ── Calculator sidebar (interlinking to all other calculators) ──────────────
   Mirrors the app's calculator list: grouped by category, current page
   highlighted. Desktop: a real sticky column to the left of the content.
   Mobile: collapses into a slim edge tab that slides the list over the
   content (same "peek drawer" feel as the app), implemented in pure CSS
   transforms + a small JS toggle in js/main.js. Real <a> links throughout,
   so the page is fully usable with JS disabled (list just sits inline). */

.calc-layout {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  align-items: start;
}

/* Sidebar is sticky below the 64px fixed nav. Its top offset (84px) keeps a
   20px gap under the ribbon while pinned; the matching margin-top puts it in
   the same spot at scroll-0. The nav (z-index 200, now always opaque above)
   always paints over it, so content scrolls cleanly beneath the ribbon. */
.calc-nav {
  position: sticky;
  top: 84px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 0;
  margin: 84px 0 0 20px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  z-index: 1;
}

.calc-nav h3 {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-light);
  margin: 0 0 6px;
  padding: 0 20px;
}
.calc-nav h3:not(:first-child) { margin-top: 18px; }

.calc-nav ul { list-style: none; }
.calc-nav li { margin: 0; }
.calc-nav a {
  font-size: .87rem;
  color: var(--text);
  display: block;
  padding: 7px 20px;
  transition: background .15s;
}
.calc-nav a:hover { background: var(--border); text-decoration: none; }
.calc-nav a.active {
  background: var(--blue);
  color: #fff !important;
  font-weight: 600;
}

.calc-content { min-width: 0; grid-column: 2; }
.calc-content .calc-hero { border-radius: 0 0 0 0; margin: 0 0 0 0; }

/* The scrim and the mobile pull-tab toggle are only shown on mobile; hidden
   (and out of the grid) on desktop. */
.calc-nav-scrim, .calc-nav-toggle { display: none; }

@media (max-width: 900px) {
  .calc-layout { grid-template-columns: 1fr; }

  /* The drawer sits fully off-screen when closed; only a small pull-tab
     (the ::after handle) pokes out at the left edge as the "tap to open"
     affordance (the app's PeekDrawer feel). Same small tab in both states. */
  .calc-nav {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 80vw;
    max-width: 300px;
    margin: 0;
    border-radius: 0;
    border: none;
    padding-top: 76px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 250;
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
    overflow-y: auto;
  }
  .calc-nav.open { transform: translateX(0); }

  /* Real clickable pull-tab, a fixed button pinned to the screen's left edge
     (independent of the off-screen drawer so it's always hittable). JS creates
     it and toggles the drawer. The chevron flips, and it slides to sit beside
     the drawer when open. */
  .calc-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 26px;
    height: 56px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 2px 0 8px rgba(0,0,0,.2);
    cursor: pointer;
    z-index: 251;
    transition: left .25s ease;
    padding: 0;
  }
  /* When open, ride the drawer's right edge (drawer width 80vw capped 300px). */
  .calc-nav-toggle.open { left: min(80vw, 300px); }

  .calc-nav::after { display: none; }

  .calc-nav.open ~ .calc-nav-scrim { display: block; }

  .calc-nav-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 240;
  }
}

/* The index grid of calculators */
.tools-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}
.tools-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-light);
  margin: 0 0 16px;
  padding-top: 36px;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin: 0 auto;
  padding: 0 0 28px;
}
.tools-section:last-child .tools-grid { padding-bottom: 64px; }
.tool-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none !important; }
.tool-card .tool-icon { font-size: 1.8rem; margin-bottom: 10px; }
.tool-card h3 { margin: 0 0 8px; font-size: 1.2rem; color: var(--text); }
.tool-card p { margin: 0; color: var(--text-light); font-size: .92rem; line-height: 1.5; }
