/*
Theme Name: Handled
Theme URI: https://handledrepairs.com
Author: Handled
Author URI: https://handledrepairs.com
Description: A conversion-focused, local-service marketplace theme for Handled. Built for a human-first contractor matching experience with future WooCommerce and AI-agent integrations.
Version: 1.3.0
Requires at least: 6.5
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: handled
Tags: custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, accessibility-ready, e-commerce, block-styles, wide-blocks
*/

:root {
  --handled-ink: #1f2a24;
  --handled-muted: #5f6d65;
  --handled-forest: #214f3b;
  --handled-forest-dark: #15372a;
  --handled-sage: #dce8df;
  --handled-sand: #f4efe5;
  --handled-cream: #fbfaf6;
  --handled-white: #ffffff;
  --handled-copper: #b56236;
  --handled-border: #d8ddd9;
  --handled-shadow: 0 18px 55px rgba(31, 42, 36, 0.10);
  --handled-radius-sm: 10px;
  --handled-radius: 18px;
  --handled-radius-lg: 30px;
  --handled-max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--handled-ink);
  background: var(--handled-cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--handled-forest); }
a:hover { color: var(--handled-copper); }
button, input, select, textarea { font: inherit; }
button, .button, .wp-element-button, .handled-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .78rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--handled-forest);
  color: var(--handled-white);
  font-weight: 750;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
button:hover, .button:hover, .wp-element-button:hover, .handled-button:hover {
  transform: translateY(-1px);
  background: var(--handled-forest-dark);
  color: var(--handled-white);
  box-shadow: 0 10px 25px rgba(21, 55, 42, .18);
}
.handled-button--secondary {
  border-color: var(--handled-forest);
  background: transparent;
  color: var(--handled-forest);
}
.handled-button--secondary:hover { background: var(--handled-sage); color: var(--handled-forest-dark); }
.handled-button--light { background: var(--handled-white); color: var(--handled-forest-dark); }
.handled-button--light:hover { background: var(--handled-sand); color: var(--handled-forest-dark); }

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  position: fixed !important;
  z-index: 100000;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 12px 16px;
  margin: 0;
  clip: auto;
  background: var(--handled-white);
  color: var(--handled-ink);
  border-radius: 6px;
  box-shadow: var(--handled-shadow);
}

.handled-container { width: min(calc(100% - 36px), var(--handled-max)); margin-inline: auto; }
.handled-narrow { width: min(calc(100% - 36px), 800px); margin-inline: auto; }
.handled-section { padding: clamp(64px, 8vw, 110px) 0; }
.handled-section--tight { padding: 48px 0; }
.handled-section--white { background: var(--handled-white); }
.handled-section--sage { background: var(--handled-sage); }
.handled-section--sand { background: var(--handled-sand); }
.handled-section--dark { background: var(--handled-forest-dark); color: var(--handled-white); }
.handled-kicker {
  margin: 0 0 .75rem;
  color: var(--handled-copper);
  font-size: .82rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .65em;
  color: inherit;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  line-height: 1.08;
  letter-spacing: -.025em;
}
h1 { font-size: clamp(2.9rem, 7vw, 5.8rem); }
h2 { font-size: clamp(2.15rem, 4.4vw, 3.75rem); }
h3 { font-size: clamp(1.35rem, 2.6vw, 2rem); }
p { margin: 0 0 1.15rem; }
.handled-lead { color: var(--handled-muted); font-size: clamp(1.1rem, 2vw, 1.32rem); max-width: 68ch; }
.handled-section--dark .handled-lead { color: rgba(255,255,255,.78); }
.handled-section-heading { max-width: 760px; margin-bottom: 2.2rem; }

.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  background: rgba(251, 250, 246, .94);
  border-bottom: 1px solid rgba(216, 221, 217, .8);
  backdrop-filter: blur(16px);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 1.5rem;
}
.site-branding { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.site-branding .custom-logo { width: auto; max-height: 50px; }
.site-title {
  margin: 0;
  font-family: ui-serif, Georgia, serif;
  font-size: 1.8rem;
  font-weight: 850;
  line-height: 1;
}
.site-title a { color: var(--handled-ink); text-decoration: none; }
.site-description { margin: .2rem 0 0; color: var(--handled-muted); font-size: .8rem; }
.site-navigation { display: flex; align-items: center; gap: 1rem; }
.site-navigation ul { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.site-navigation a { display: block; padding: .6rem .72rem; color: var(--handled-ink); font-size: .94rem; font-weight: 720; text-decoration: none; }
.site-navigation a:hover, .site-navigation .current-menu-item > a { color: var(--handled-copper); }
.menu-toggle { display: none; min-width: 48px; padding: .6rem; border-radius: 12px; }
.header-cta { white-space: nowrap; }

.handled-hero { position: relative; overflow: hidden; padding: clamp(75px, 10vw, 140px) 0 85px; }
.handled-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: min(48vw, 640px);
  height: 100%;
  background:
    radial-gradient(circle at 70% 15%, rgba(181,98,54,.28), transparent 32%),
    radial-gradient(circle at 40% 48%, rgba(33,79,59,.20), transparent 38%);
  pointer-events: none;
}
.handled-hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(330px, .72fr); align-items: center; gap: clamp(36px, 7vw, 90px); }
.handled-hero__copy p { max-width: 650px; }
.handled-hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.handled-proof-row { display: flex; flex-wrap: wrap; gap: 1rem 1.35rem; margin-top: 2rem; color: var(--handled-muted); font-size: .92rem; font-weight: 650; }
.handled-proof-row span::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: .45rem; border-radius: 50%; background: var(--handled-sage); color: var(--handled-forest); font-weight: 900; }
.handled-request-card {
  position: relative;
  padding: clamp(24px, 4vw, 38px);
  background: var(--handled-white);
  border: 1px solid rgba(216,221,217,.85);
  border-radius: var(--handled-radius-lg);
  box-shadow: var(--handled-shadow);
}
.handled-request-card__badge { display: inline-flex; padding: .35rem .65rem; margin-bottom: 1rem; border-radius: 999px; background: var(--handled-sage); color: var(--handled-forest-dark); font-size: .8rem; font-weight: 800; }
.handled-request-card label { display: block; margin-bottom: .35rem; font-weight: 800; font-size: .92rem; }
.handled-request-card textarea, .handled-request-card input, .handled-request-card select,
.handled-form input, .handled-form textarea, .handled-form select {
  width: 100%;
  padding: .85rem .95rem;
  border: 1px solid var(--handled-border);
  border-radius: 12px;
  background: var(--handled-white);
  color: var(--handled-ink);
}
.handled-request-card textarea:focus, .handled-request-card input:focus, .handled-request-card select:focus,
.handled-form input:focus, .handled-form textarea:focus, .handled-form select:focus {
  outline: 3px solid rgba(33,79,59,.16);
  border-color: var(--handled-forest);
}
.handled-field { margin-bottom: 1rem; }
.handled-form-note { margin: .7rem 0 0; color: var(--handled-muted); font-size: .83rem; }

.handled-trust-strip { padding: 18px 0; background: var(--handled-forest-dark); color: var(--handled-white); }
.handled-trust-strip__inner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .8rem 2.3rem; font-size: .92rem; font-weight: 700; }
.handled-trust-strip span { opacity: .92; }

.handled-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.handled-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.handled-card {
  padding: clamp(24px, 3vw, 34px);
  background: var(--handled-white);
  border: 1px solid var(--handled-border);
  border-radius: var(--handled-radius);
  box-shadow: 0 10px 36px rgba(31,42,36,.055);
}
.handled-card__number { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 1.2rem; border-radius: 14px; background: var(--handled-sage); color: var(--handled-forest-dark); font-weight: 900; }
.handled-card__icon { font-size: 2rem; margin-bottom: .9rem; }
.handled-card p:last-child { margin-bottom: 0; }

.handled-category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.handled-category {
  display: block;
  min-height: 175px;
  padding: 22px;
  border: 1px solid var(--handled-border);
  border-radius: var(--handled-radius);
  background: var(--handled-white);
  color: var(--handled-ink);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.handled-category:hover { transform: translateY(-3px); border-color: var(--handled-forest); box-shadow: var(--handled-shadow); color: var(--handled-ink); }
.handled-category strong { display: block; margin-top: 1.15rem; font-family: ui-serif, Georgia, serif; font-size: 1.25rem; }
.handled-category small { display: block; margin-top: .3rem; color: var(--handled-muted); line-height: 1.4; }

.handled-quote-demo { display: grid; grid-template-columns: .75fr 1.25fr; gap: clamp(28px, 6vw, 70px); align-items: center; }
.handled-quote-stack { display: grid; gap: 1rem; }
.handled-quote-card { position: relative; padding: 24px; border: 1px solid var(--handled-border); border-radius: var(--handled-radius); background: var(--handled-white); box-shadow: 0 10px 30px rgba(31,42,36,.06); }
.handled-quote-card--best { border: 2px solid var(--handled-forest); }
.handled-quote-card__flag { position: absolute; top: -12px; right: 18px; padding: .3rem .7rem; border-radius: 999px; background: var(--handled-forest); color: var(--handled-white); font-size: .76rem; font-weight: 800; }
.handled-quote-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: .8rem 0; color: var(--handled-muted); font-size: .88rem; }
.handled-price { font-size: 1.35rem; font-weight: 900; color: var(--handled-forest-dark); }

.handled-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.handled-stat { padding: 24px; border-left: 3px solid var(--handled-copper); background: rgba(255,255,255,.07); border-radius: 0 16px 16px 0; }
.handled-stat strong { display: block; font-family: ui-serif, Georgia, serif; font-size: 1.7rem; }
.handled-stat span { color: rgba(255,255,255,.72); font-size: .9rem; }

.handled-faq details { margin-bottom: .8rem; padding: 1rem 1.1rem; border: 1px solid var(--handled-border); border-radius: 14px; background: var(--handled-white); }
.handled-faq summary { cursor: pointer; font-weight: 800; }
.handled-faq details p { margin: .8rem 0 0; color: var(--handled-muted); }

.handled-cta-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2rem; padding: clamp(30px, 5vw, 58px); border-radius: var(--handled-radius-lg); background: var(--handled-forest); color: var(--handled-white); }
.handled-cta-panel p { color: rgba(255,255,255,.8); margin-bottom: 0; }

.handled-page-hero { padding: 70px 0 48px; background: var(--handled-sand); border-bottom: 1px solid var(--handled-border); }
.handled-page-hero h1 { max-width: 900px; font-size: clamp(2.5rem, 6vw, 4.7rem); }
.handled-content { padding: 60px 0 95px; }
.handled-content > *:first-child { margin-top: 0; }
.handled-content h2 { margin-top: 2.2rem; font-size: clamp(1.8rem, 3vw, 2.7rem); }
.handled-content h3 { margin-top: 1.8rem; }
.handled-content ul, .handled-content ol { padding-left: 1.35rem; }
.handled-content li { margin-bottom: .45rem; }
.handled-content table { width: 100%; border-collapse: collapse; }
.handled-content th, .handled-content td { padding: .8rem; border: 1px solid var(--handled-border); text-align: left; }
.handled-legal { font-size: 1rem; }
.handled-legal h2 { padding-top: 1rem; border-top: 1px solid var(--handled-border); }
.handled-legal .handled-legal-note { padding: 1rem 1.15rem; border-left: 4px solid var(--handled-copper); background: var(--handled-sand); border-radius: 0 12px 12px 0; }

.handled-form-shell { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 2rem; align-items: start; }
.handled-form { padding: clamp(24px, 4vw, 42px); border: 1px solid var(--handled-border); border-radius: var(--handled-radius-lg); background: var(--handled-white); box-shadow: var(--handled-shadow); }
.handled-form fieldset { margin: 0 0 1.6rem; padding: 0; border: 0; }
.handled-form legend { margin-bottom: 1rem; font-family: ui-serif, Georgia, serif; font-size: 1.55rem; font-weight: 800; }
.handled-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.handled-form label { display: block; margin-bottom: .35rem; font-size: .9rem; font-weight: 800; }
.handled-sidebar-card { position: sticky; top: 108px; padding: 24px; border-radius: var(--handled-radius); background: var(--handled-sage); }
.handled-sidebar-card ul { margin: 0; padding-left: 1.15rem; }
.handled-sidebar-card li { margin-bottom: .55rem; }
.handled-range-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.handled-range-item { padding: .9rem; border: 1px solid var(--handled-border); border-radius: 12px; background: var(--handled-cream); }
.handled-range-item label { display: flex; justify-content: space-between; gap: 1rem; }
.handled-range-item output { color: var(--handled-copper); font-weight: 900; }
.handled-demo-result { display: none; margin-top: 1.2rem; padding: 1rem 1.1rem; border-radius: 12px; background: var(--handled-sage); }
.handled-demo-result.is-visible { display: block; }

.site-footer { padding: 70px 0 24px; background: #12261d; color: rgba(255,255,255,.82); }
.site-footer a { color: var(--handled-white); }
.site-footer__grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 2rem; }
.site-footer h2, .site-footer h3 { color: var(--handled-white); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; }

.woocommerce .button, .woocommerce button.button, .woocommerce a.button { background: var(--handled-forest); color: var(--handled-white); border-radius: 999px; }
.woocommerce div.product, .woocommerce ul.products li.product { background: var(--handled-white); border-radius: var(--handled-radius); }

@media (max-width: 960px) {
  .site-navigation { position: absolute; top: 78px; left: 18px; right: 18px; display: none; flex-direction: column; align-items: stretch; padding: 1rem; background: var(--handled-white); border: 1px solid var(--handled-border); border-radius: 16px; box-shadow: var(--handled-shadow); }
  .site-navigation.is-open { display: flex; }
  .site-navigation ul { flex-direction: column; align-items: stretch; }
  .site-navigation a { padding: .8rem; }
  .menu-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .handled-hero__grid, .handled-quote-demo, .handled-form-shell { grid-template-columns: 1fr; }
  .handled-sidebar-card { position: static; }
  .handled-grid, .handled-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .handled-cta-panel { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .handled-container, .handled-narrow { width: min(calc(100% - 24px), var(--handled-max)); }
  .site-description { display: none; }
  .handled-hero { padding-top: 54px; }
  .handled-grid, .handled-grid--2, .handled-category-grid, .handled-stats, .handled-field-grid, .handled-range-grid, .site-footer__grid { grid-template-columns: 1fr; }
  .handled-hero__actions .handled-button { width: 100%; }
  .site-footer__bottom { flex-direction: column; }
}


/* Functional intake and site-health additions in 1.1.0. */
.handled-notice {
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--handled-border);
  border-left-width: 5px;
  border-radius: 12px;
  background: var(--handled-white);
}
.handled-notice:focus { outline: 3px solid rgba(33, 79, 59, .2); outline-offset: 3px; }
.handled-notice p { margin: .35rem 0 0; }
.handled-notice--success { border-left-color: var(--handled-forest); background: var(--handled-sage); }
.handled-notice--error { border-left-color: #a83b2f; background: #fff3f1; }
.handled-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.handled-check-field { margin: 1rem 0; padding: 1rem; border: 1px solid var(--handled-border); border-radius: 12px; background: var(--handled-cream); }
.handled-check-field label { display: flex; align-items: flex-start; gap: .7rem; margin: 0; font-weight: 600; }
.handled-check-field input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin-top: .15rem; flex: 0 0 auto; }
.handled-form button[disabled] { opacity: .65; cursor: wait; }
.handled-form input:invalid:focus,
.handled-form textarea:invalid:focus,
.handled-form select:invalid:focus { outline: 2px solid #a83b2f; outline-offset: 2px; }


/* Guided photo-first intake additions in 1.2.0. */
.handled-instructions {
  margin: 0 0 1.25rem;
  padding: 1.15rem 1.25rem;
  border-left: 5px solid var(--handled-copper);
  border-radius: 0 14px 14px 0;
  background: var(--handled-sand);
}
.handled-instructions h2 { margin: 0 0 .45rem; font-size: 1.35rem; }
.handled-instructions p { margin: 0; color: var(--handled-muted); }
.handled-address-grid { display: grid; grid-template-columns: 1.5fr .55fr .8fr; gap: 1rem; }
.handled-photo-field {
  padding: 1.15rem;
  border: 2px dashed var(--handled-border);
  border-radius: 14px;
  background: var(--handled-cream);
}
.handled-photo-field input[type="file"] { width: 100%; padding: .75rem; background: var(--handled-white); }
.handled-upload-status { margin: .55rem 0 0; color: var(--handled-forest-dark); font-weight: 800; }
.handled-submit-cta { width: 100%; min-height: 54px; font-size: 1.05rem; }
.handled-notice ul { margin: .75rem 0 0; padding-left: 1.25rem; }
.handled-notice li { margin-bottom: .35rem; }

@media (max-width: 640px) {
  .handled-address-grid { grid-template-columns: 1fr; }
}

/* Home-page-first intake in 1.3.0. */
.handled-intake-hero {
  padding: clamp(64px, 8vw, 105px) 0 34px;
  background:
    radial-gradient(circle at 92% 10%, rgba(181, 98, 54, .18), transparent 28%),
    radial-gradient(circle at 82% 72%, rgba(33, 79, 59, .13), transparent 30%),
    var(--handled-cream);
}
.handled-intake-hero__inner { max-width: 940px; }
.handled-intake-hero h1 { max-width: 920px; }
.handled-intake-section { padding-top: 30px; }
.handled-intake-heading { max-width: 800px; margin-bottom: 1.4rem; }
.handled-intake-heading h2 { margin-bottom: .35em; font-size: clamp(2rem, 4vw, 3.35rem); }
.handled-intake-section .handled-notice { max-width: 820px; }
.handled-category { cursor: default; }
.handled-category:hover { transform: none; border-color: var(--handled-border); box-shadow: none; }
.handled-category > span { color: var(--handled-copper); font-size: 1.45rem; }
.handled-form fieldset + fieldset {
  padding-top: 1.45rem;
  border-top: 1px solid var(--handled-border);
}

@media (max-width: 640px) {
  .handled-intake-hero { padding-top: 46px; }
  .handled-intake-section { padding-top: 18px; }
}
#request-form { scroll-margin-top: 96px; }
