/*
Theme Name: PavementCalc Pro
Author: Custom Site Theme
Description: A fast, editable WordPress block theme for U.S. asphalt, pavement, parking lot, sealcoating and contractor calculator websites. Built for Full Site Editing and Yoast SEO compatibility.
Version: 1.5.0
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: pavementcalc-pro
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: block-patterns, full-site-editing, custom-colors, custom-logo, editor-style, featured-images, wide-blocks
*/

/* Accessibility */
:where(.wp-site-blocks) * { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
}

/* Shared utility classes used by the included templates/patterns. */
.pc-shell { position: relative; overflow: hidden; }
.pc-shell::before {
  content: "";
  position: absolute;
  width: 34rem;
  height: 34rem;
  right: -12rem;
  top: -20rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,170,35,.18) 0%, rgba(244,170,35,0) 70%);
  pointer-events: none;
}
.pc-eyebrow { letter-spacing: .09em; text-transform: uppercase; font-size: .78rem; font-weight: 750; }
.pc-card {
  height: 100%;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 18px;
  background: var(--wp--preset--color--white);
  box-shadow: 0 12px 34px rgba(18, 31, 43, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.pc-card:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(18,31,43,.10); border-color: #bfd0dc; }
.pc-card a { text-decoration: none; }
.pc-card a:hover { text-decoration: underline; text-underline-offset: .18em; }
.pc-tool-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--wp--preset--color--brand-soft);
  color: var(--wp--preset--color--brand);
  font-weight: 800;
}
.pc-stat { border-left: 3px solid var(--wp--preset--color--accent); padding-left: 1rem; }
.pc-trust-row { border-top: 1px solid rgba(255,255,255,.14); }
.pc-step-number {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--wp--preset--color--ink);
  color: white;
  font-weight: 800;
}
.pc-note {
  border-left: 4px solid var(--wp--preset--color--accent);
  background: var(--wp--preset--color--accent-soft);
  padding: 1rem 1.15rem;
  border-radius: 0 12px 12px 0;
}
.pc-calculator-frame {
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 20px;
  background: white;
  box-shadow: 0 14px 42px rgba(18,31,43,.07);
}
.pc-footer a { text-decoration: none; }
.pc-footer a:hover { text-decoration: underline; }

/* Native blocks */
.wp-block-button .wp-block-button__link { transition: transform .15s ease, box-shadow .15s ease; }
.wp-block-button .wp-block-button__link:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.wp-block-post-title a { text-decoration: none; }
.wp-block-post-title a:hover { text-decoration: underline; text-underline-offset: .16em; }
.wp-block-navigation a { text-underline-offset: .18em; }

@media (max-width: 781px) {
  .pc-shell::before { width: 22rem; height: 22rem; top: -11rem; right: -10rem; }
  .pc-mobile-stack { gap: 1rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}


/* Brand assets */
.pc-header-logo {
  flex: 0 0 auto;
  margin: 0;
}
.pc-header-logo img {
  display: block;
  width: min(250px, 38vw) !important;
  height: auto !important;
  max-height: 48px;
  object-fit: contain;
}
.pc-footer-logo {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}
.pc-footer-logo img {
  display: block;
  width: min(220px, 70vw) !important;
  height: auto !important;
  max-height: 42px;
  object-fit: contain;
}

/* Remove the WordPress root block-gap around template parts.
 * This keeps the hero flush with the header and the footer flush with
 * the final section instead of leaving a white strip between them.
 */
.wp-site-blocks > main,
.wp-site-blocks > footer,
.wp-site-blocks > .wp-block-template-part,
.wp-site-blocks > main + .wp-block-template-part {
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}
.pc-footer { margin-block-start: 0 !important; }

/* Remove automatic flow gaps between the homepage's full-width sections.
 * WordPress applies block-gap to direct children of flow-layout groups;
 * the homepage main wrapper is one such group, which can create a visible
 * white strip between differently colored sections. Internal block spacing
 * remains untouched because this targets direct children of <main> only.
 */
.wp-site-blocks > main.wp-block-group > * {
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}
.wp-site-blocks > main.wp-block-group > * + * {
  margin-block-start: 0 !important;
}

@media (max-width: 781px) {
  .pc-header-logo img { width: min(205px, 58vw) !important; max-height: 42px; }
  .pc-footer-logo img { width: min(200px, 66vw) !important; }
}

/* Keep the final article section flush with the dark CTA section.
 * The visible strip here comes from that section's own bottom padding,
 * not from WordPress block-gap. :has() keeps the rule narrowly scoped
 * and also fixes sites whose front-page template was previously saved.
 */
.wp-site-blocks > main.wp-block-group > .has-surface-background-color:has(+ .has-brand-dark-background-color) {
  padding-bottom: 0 !important;
}

/* Footer light theme */
.pc-footer {
  background: var(--wp--preset--color--white) !important;
  color: var(--wp--preset--color--ink) !important;
}
.pc-footer :where(p,h1,h2,h3,h4,h5,h6,li) {
  color: var(--wp--preset--color--ink) !important;
}
.pc-footer .wp-block-separator {
  background-color: var(--wp--preset--color--border) !important;
  color: var(--wp--preset--color--border) !important;
}


/* Inline SEO calculators used inside editable Gutenberg posts. */
.pc-inline-calculator {
  margin: 2rem 0 2.25rem;
  padding: clamp(1.25rem, 2vw, 2rem);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 32, 45, .08);
}
.pc-inline-calculator__header h2 { margin-top: .2rem; margin-bottom: .65rem; }
.pc-inline-calculator__header p { margin-top: 0; }
.pc-inline-calculator__eyebrow {
  margin: 0;
  color: var(--wp--preset--color--brand);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pc-inline-calculator__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.pc-inline-calculator__grid label {
  display: grid;
  gap: .45rem;
  font-size: .9rem;
  font-weight: 700;
  color: var(--wp--preset--color--ink);
}
.pc-inline-calculator input,
.pc-inline-calculator select {
  width: 100%;
  min-height: 46px;
  padding: .7rem .8rem;
  border: 1px solid #c9d2d9;
  border-radius: 9px;
  background: #fff;
  color: #142531;
  font: inherit;
}
.pc-inline-calculator__button {
  margin-top: 1.15rem;
  padding: .8rem 1.1rem;
  border: 0;
  border-radius: 9px;
  background: var(--wp--preset--color--accent);
  color: #17242d;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.pc-inline-calculator__result {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1.25rem;
}
.pc-inline-calculator__result > div {
  padding: .9rem;
  border-radius: 10px;
  background: var(--wp--preset--color--surface);
}
.pc-inline-calculator__result span,
.pc-inline-calculator__result strong { display: block; }
.pc-inline-calculator__result span { font-size: .8rem; color: var(--wp--preset--color--muted); }
.pc-inline-calculator__result strong { margin-top: .2rem; font-size: 1.05rem; color: var(--wp--preset--color--ink); }
.pc-inline-calculator__note { margin: 1rem 0 0; font-size: .82rem; color: var(--wp--preset--color--muted); }
@media (max-width: 640px) {
  .pc-inline-calculator__grid,
  .pc-inline-calculator__result { grid-template-columns: 1fr; }
}

/* Contractor estimate PDF generator. */
.pc-estimate-generator__section {
  margin-top: 1.35rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--wp--preset--color--border);
}
.pc-estimate-generator__section h3 {
  margin: 0 0 .9rem;
  font-size: 1.08rem;
}
.pc-estimate-generator__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem 1rem;
}
.pc-estimate-generator__grid label {
  display: grid;
  gap: .45rem;
  font-size: .9rem;
  font-weight: 700;
  color: var(--wp--preset--color--ink);
}
.pc-estimate-generator__wide { grid-column: 1 / -1; }
.pc-estimate-generator textarea {
  width: 100%;
  min-height: 94px;
  padding: .75rem .8rem;
  border: 1px solid #c9d2d9;
  border-radius: 9px;
  background: #fff;
  color: #142531;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}
.pc-estimate-generator__result {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1.4rem;
}
.pc-estimate-generator__result > div {
  padding: .9rem;
  border-radius: 11px;
  background: var(--wp--preset--color--surface);
}
.pc-estimate-generator__result span,
.pc-estimate-generator__result strong { display: block; }
.pc-estimate-generator__result span {
  font-size: .78rem;
  color: var(--wp--preset--color--muted);
}
.pc-estimate-generator__result strong {
  margin-top: .25rem;
  color: var(--wp--preset--color--ink);
  font-size: 1.08rem;
}
.pc-estimate-generator__result .pc-estimate-generator__result-primary {
  background: var(--wp--preset--color--brand-dark);
}
.pc-estimate-generator__result .pc-estimate-generator__result-primary span,
.pc-estimate-generator__result .pc-estimate-generator__result-primary strong {
  color: #fff;
}
.pc-estimate-generator__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.1rem;
}
.pc-estimate-generator__actions .pc-inline-calculator__button { margin-top: 0; }
.pc-estimate-generator__pdf {
  background: var(--wp--preset--color--brand-dark);
  color: #fff;
}
@media (max-width: 781px) {
  .pc-estimate-generator__result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pc-estimate-generator__grid,
  .pc-estimate-generator__result { grid-template-columns: 1fr; }
  .pc-estimate-generator__wide { grid-column: auto; }
  .pc-estimate-generator__actions { display: grid; }
  .pc-estimate-generator__actions .pc-inline-calculator__button { width: 100%; }
}
