/* ==========================================================================
   Renovation Range — theme.css · "Site Desk, refined" (2026-11-29)
   Keeps the existing construction identity; fixes mobile bugs and polishes
   interaction, readability and detail. Loaded last. No content changes.
   ========================================================================== */

:root {
  --ease: cubic-bezier(.22, 1, .36, 1);
  --press: 4px 5px 0 rgba(23, 32, 31, .9);
}

/* ---------- 1. Bug fixes ---------- */

/* Long source URLs were cut off on phones (body has overflow-x:hidden) */
.rr-guide-sources a,
.rr-guide-content a,
.source-item a,
.source-list a,
.trust-section a,
.faq-list a,
.tool-guide-copy a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Tables never wider than the screen: scroll inside their own box */
.rr-guide-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.rr-guide-content table th,
.rr-guide-content table td { min-width: 7.5rem; }

/* ---------- 2. Typographic polish ---------- */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
p, li { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

/* Guide articles: calmer section headings, better reading rhythm */
.rr-guide-content h2 {
  font-size: clamp(2.1rem, 3.6vw, 3.3rem) !important;
  letter-spacing: -.035em !important;
  line-height: .95 !important;
  margin-top: 4rem !important;
  padding-top: 1.1rem !important;
  border-top: 0 !important;
  position: relative;
  scroll-margin-top: 6rem;
}
.rr-guide-content h2::before {
  /* short hazard tab instead of a hairline */
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 64px; height: 6px;
  background: repeating-linear-gradient(135deg, var(--lime) 0 6px, var(--ink) 6px 12px);
}
.rr-guide-content h3 {
  font-size: clamp(1.45rem, 2.2vw, 1.9rem) !important;
  letter-spacing: -.02em !important;
}
.rr-guide-content p,
.rr-guide-content li {
  color: #3f4a47 !important;
  font-size: 1.02rem !important;
  line-height: 1.75 !important;
}
.rr-guide-content strong { color: var(--ink); }
.rr-guide-content a {
  text-decoration-color: var(--lime) !important;
  text-decoration-thickness: 3px !important;
  text-underline-offset: 2px !important;
  transition: background-color .25s var(--ease);
}
.rr-guide-content a:hover { background-color: var(--lime-soft); }
.rr-guide-content li::marker { color: var(--copper); font-weight: 600; }

/* Tables inside guides */
.rr-guide-content table {
  border-collapse: collapse;
  background: var(--paper-bright);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.rr-guide-content th {
  background: var(--ink) !important;
  color: var(--paper-bright) !important;
  font-family: var(--mono) !important;
  font-size: .66rem !important;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: left;
  padding: .8rem .9rem !important;
}
.rr-guide-content td {
  padding: .8rem .9rem !important;
  border-top: 1px solid var(--line) !important;
  vertical-align: top;
  font-size: .93rem;
}
.rr-guide-content tbody tr:nth-child(even) td { background: rgba(23,32,31,.025); }

/* ---------- 3. Guides index: numbered shelf instead of a plain list ---------- */
.rr-guide-content:has(> h3 > a) { counter-reset: shelf; }
.rr-guide-content > h3:has(> a) {
  counter-increment: shelf;
  position: relative;
  margin: 0 !important;
  padding: 1.35rem 3rem .35rem 3.6rem !important;
  border-top: 1px solid var(--line);
  font-size: clamp(1.4rem, 2.1vw, 1.75rem) !important;
  line-height: 1.05 !important;
}
.rr-guide-content > h3:has(> a)::before {
  content: counter(shelf, decimal-leading-zero);
  position: absolute;
  left: 0; top: 1.55rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--copper);
  padding: .2rem .4rem;
  border: 1px solid currentColor;
}
.rr-guide-content > h3:has(> a)::after {
  content: "↗";
  position: absolute;
  right: .25rem; top: 1.35rem;
  font-family: var(--sans);
  font-size: 1.1rem;
  color: var(--ink-muted);
  transition: transform .4s var(--ease), color .3s var(--ease);
}
.rr-guide-content > h3:has(> a):hover::after { transform: translate(3px, -3px); color: var(--ink); }
.rr-guide-content > h3 > a {
  text-decoration: none !important;
  background-image: linear-gradient(var(--lime), var(--lime));
  background-size: 0 .32em;
  background-position: 0 88%;
  background-repeat: no-repeat;
  transition: background-size .5s var(--ease) !important;
}
.rr-guide-content > h3 > a:hover { background-size: 100% .32em; background-color: transparent !important; }
.rr-guide-content > h3:has(> a) + p {
  margin: 0 0 1.35rem !important;
  padding-left: 3.6rem;
  padding-right: 3rem;
  font-size: .95rem !important;
}

/* ---------- 4. Moving hazard tape (subtle, one direction) ---------- */
.hero::before,
.rr-guide-hero::after,
.trust-hero::after,
.model-note::before,
.result-panel::before {
  background-size: 28.28px 28.28px !important;
  animation: rr-tape 2.8s linear infinite;
}
@keyframes rr-tape { to { background-position: 28.28px 0; } }

/* ---------- 5. Tactile interaction (press-down cards & buttons) ---------- */
.button,
.cta-button,
a.cta-button,
.quote-cta,
.calc-button {
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .25s var(--ease) !important;
}
.button-lime:hover,
.calc-button:hover,
a.cta-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--press) !important;
}
.button-lime:active,
.calc-button:active,
a.cta-button:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(0,0,0,0) !important;
}

.tool-tab,
.related-tool-card,
.method-card,
.model-note-card,
.material-card {
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease) !important;
}
.tool-tab:not(.is-active):hover,
.related-tool-card:hover,
.method-card:hover,
.model-note-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 7px 0 rgba(23, 32, 31, .18) !important;
}
.material-card:hover { transform: translateY(-2px); }

.related-tool-link {
  transition: padding .3s var(--ease), background .3s var(--ease), color .3s var(--ease) !important;
}
.related-tool-link:hover { padding-left: .6rem !important; }

/* form fields: clearer focus */
.field-control:focus,
.field-control:focus-visible,
.input-wrap input:focus,
select:focus-visible {
  outline: 3px solid var(--lime) !important;
  outline-offset: 2px;
  box-shadow: 4px 4px 0 var(--ink) !important;
}
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--lime) !important;
  outline-offset: 3px;
}

/* live estimate: gentle "on air" pulse on the live dot */
.status-dot, .tag-dot, .live-chip::before {
  animation: rr-live 2.2s ease-in-out infinite;
}
@keyframes rr-live { 50% { opacity: .35; } }

/* FAQ rows */
.faq-list details summary,
.rr-guide-faq summary { transition: color .25s var(--ease), padding .3s var(--ease); }
.faq-list details summary:hover,
.rr-guide-faq summary:hover { color: var(--copper); }

/* guide TOC */
.rr-guide-toc a, .rr-guide-aside nav a {
  transition: color .2s var(--ease), padding .3s var(--ease), background .3s var(--ease);
}
.rr-guide-toc a:hover, .rr-guide-aside nav a:hover { padding-left: .35rem; color: var(--ink) !important; }

/* ---------- 6. Mobile refinements ---------- */
@media (max-width: 640px) {
  .rr-guide-content h2 { font-size: clamp(1.9rem, 9vw, 2.4rem) !important; }
  .rr-guide-content > h3:has(> a) { padding: 1.2rem 2rem .3rem 0 !important; }
  .rr-guide-content > h3:has(> a)::before { position: static; display: inline-block; margin-bottom: .55rem; margin-right: .5rem; vertical-align: middle; }
  .rr-guide-content > h3:has(> a) + p { padding-left: 0; padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
