/*
Theme Name: DIY Cost Tools
Theme URI: https://diycosttools.com
Author: DIY Cost Tools
Description: A fast, accessible WordPress theme for home-project calculators, cost guides, and practical DIY planning.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 7.4
Text Domain: diy-cost-tools
*/

:root {
  --dct-navy: #102a43;
  --dct-blue: #1261a0;
  --dct-blue-dark: #0b4d82;
  --dct-orange: #f28c28;
  --dct-orange-dark: #d46f0b;
  --dct-green: #15803d;
  --dct-ink: #17202a;
  --dct-muted: #526475;
  --dct-line: #d9e2ec;
  --dct-soft: #f3f7fa;
  --dct-white: #fff;
  --dct-shadow: 0 12px 32px rgba(16, 42, 67, .1);
  --dct-radius: 18px;
  --dct-container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--dct-ink);
  background: var(--dct-white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--dct-blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--dct-blue-dark); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
.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; top: 10px; left: 10px; z-index: 100000; width: auto; height: auto;
  padding: .7rem 1rem; clip: auto; background: var(--dct-white); color: var(--dct-navy); font-weight: 800;
}
.dct-container { width: min(calc(100% - 2rem), var(--dct-container)); margin-inline: auto; }
.dct-narrow { width: min(calc(100% - 2rem), 820px); margin-inline: auto; }
.dct-section { padding: 4.5rem 0; }
.dct-section--soft { background: var(--dct-soft); }
.dct-eyebrow {
  margin: 0 0 .5rem; color: var(--dct-orange-dark); font-size: .8rem; font-weight: 900;
  letter-spacing: .12em; text-transform: uppercase;
}
h1, h2, h3, h4 { color: var(--dct-navy); line-height: 1.16; letter-spacing: -.025em; }
h1 { font-size: clamp(2.3rem, 6vw, 4.9rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.18rem, 2.5vw, 1.5rem); }
.dct-section-heading { max-width: 720px; margin-bottom: 2rem; }
.dct-section-heading h2 { margin: .2rem 0 .6rem; }
.dct-section-heading p { margin: 0; color: var(--dct-muted); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 999; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--dct-line); backdrop-filter: blur(12px); }
.dct-topbar { background: var(--dct-navy); color: #dce9f5; font-size: .83rem; text-align: center; padding: .36rem 1rem; }
.dct-header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.dct-brand { display: inline-flex; align-items: center; gap: .72rem; color: var(--dct-navy); text-decoration: none; font-size: 1.25rem; font-weight: 900; white-space: nowrap; }
.dct-brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--dct-orange); color: var(--dct-navy); box-shadow: 0 6px 16px rgba(242,140,40,.27); }
.dct-brand-mark svg { width: 24px; height: 24px; }
.custom-logo { max-height: 52px; width: auto; }
.dct-menu-toggle { display: none; border: 0; border-radius: 10px; padding: .65rem .8rem; background: var(--dct-soft); color: var(--dct-navy); font-weight: 800; }
.dct-primary-menu, .dct-primary-menu ul { list-style: none; padding: 0; margin: 0; }
.dct-primary-menu { display: flex; align-items: center; gap: .25rem; }
.dct-primary-menu a { display: block; padding: .7rem .85rem; color: var(--dct-navy); text-decoration: none; font-size: .94rem; font-weight: 750; border-radius: 9px; }
.dct-primary-menu a:hover, .dct-primary-menu .current-menu-item > a { background: var(--dct-soft); color: var(--dct-blue-dark); }
.dct-primary-menu .menu-item-has-children { position: relative; }
.dct-primary-menu .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 250px; padding: .55rem; background: var(--dct-white); border: 1px solid var(--dct-line); border-radius: 14px; box-shadow: var(--dct-shadow); }
.dct-primary-menu .menu-item-has-children:hover > .sub-menu,
.dct-primary-menu .menu-item-has-children:focus-within > .sub-menu { display: block; }

/* Hero */
.dct-hero { position: relative; overflow: hidden; padding: 6rem 0 5.2rem; background: linear-gradient(135deg, #0e263c 0%, #123e62 58%, #1261a0 100%); color: var(--dct-white); }
.dct-hero::before { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; top: -220px; border: 90px solid rgba(255,255,255,.05); border-radius: 50%; }
.dct-hero-grid { position: relative; display: grid; grid-template-columns: minmax(0,1.25fr) minmax(300px,.75fr); align-items: center; gap: 4rem; }
.dct-hero h1 { margin: .3rem 0 1rem; color: var(--dct-white); max-width: 800px; }
.dct-hero-lede { max-width: 720px; color: #d7e7f3; font-size: 1.18rem; }
.dct-search { display: flex; max-width: 660px; margin-top: 1.8rem; padding: .38rem; background: var(--dct-white); border-radius: 14px; box-shadow: 0 14px 38px rgba(0,0,0,.2); }
.dct-search input { flex: 1; min-width: 0; padding: .8rem 1rem; border: 0; outline: 0; color: var(--dct-ink); }
.dct-search button, .dct-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 0; border-radius: 10px; padding: .82rem 1.15rem; background: var(--dct-orange); color: #1b2b38; font-weight: 900; text-decoration: none; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.dct-search button:hover, .dct-button:hover { transform: translateY(-1px); background: #ff9e3d; color: #102a43; }
.dct-button--blue { background: var(--dct-blue); color: var(--dct-white); }
.dct-button--blue:hover { background: var(--dct-blue-dark); color: var(--dct-white); }
.dct-hero-card { padding: 1.6rem; border: 1px solid rgba(255,255,255,.17); border-radius: 24px; background: rgba(255,255,255,.09); box-shadow: 0 20px 50px rgba(0,0,0,.18); backdrop-filter: blur(10px); }
.dct-hero-card h2 { margin: 0 0 1rem; color: var(--dct-white); font-size: 1.25rem; }
.dct-check-list { list-style: none; margin: 0; padding: 0; }
.dct-check-list li { display: flex; gap: .75rem; align-items: flex-start; padding: .65rem 0; color: #e8f1f8; border-bottom: 1px solid rgba(255,255,255,.1); }
.dct-check-list li:last-child { border-bottom: 0; }
.dct-check { display: grid; place-items: center; flex: 0 0 25px; height: 25px; border-radius: 50%; background: var(--dct-orange); color: var(--dct-navy); font-size: .78rem; font-weight: 900; }

/* Cards */
.dct-grid { display: grid; gap: 1.25rem; }
.dct-grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.dct-grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.dct-card { display: flex; flex-direction: column; min-height: 100%; padding: 1.45rem; border: 1px solid var(--dct-line); border-radius: var(--dct-radius); background: var(--dct-white); box-shadow: 0 7px 22px rgba(16,42,67,.05); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.dct-card:hover { transform: translateY(-3px); border-color: #afc7db; box-shadow: var(--dct-shadow); }
.dct-card-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 1rem; border-radius: 14px; background: #e9f3fa; color: var(--dct-blue); font-size: 1.35rem; }
.dct-card h3 { margin: 0 0 .45rem; }
.dct-card p { margin: 0 0 1rem; color: var(--dct-muted); font-size: .96rem; }
.dct-card-link { margin-top: auto; font-weight: 850; text-decoration: none; }
.dct-card-link::after { content: " \2192"; }
.dct-stat-band { background: var(--dct-orange); color: var(--dct-navy); }
.dct-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; padding: 1.1rem 0; text-align: center; }
.dct-stat strong { display: block; font-size: 1.35rem; line-height: 1.2; }
.dct-stat span { font-size: .82rem; font-weight: 700; }

/* Calculator */
.dct-page-hero { padding: 4.2rem 0 3rem; background: linear-gradient(180deg, #eef6fb, #fff); text-align: center; }
.dct-page-hero h1 { margin: .35rem auto .8rem; max-width: 900px; font-size: clamp(2.25rem,5vw,4rem); }
.dct-page-hero p { max-width: 720px; margin: 0 auto; color: var(--dct-muted); }
.dct-calculator-wrap { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(280px,.85fr); gap: 1.5rem; align-items: start; margin: 2rem 0; }
.dct-calculator, .dct-results { padding: clamp(1.2rem,3vw,2rem); border: 1px solid var(--dct-line); border-radius: 20px; background: var(--dct-white); box-shadow: var(--dct-shadow); }
.dct-calculator h2, .dct-results h2 { margin-top: 0; font-size: 1.45rem; }
.dct-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.dct-field { display: flex; flex-direction: column; gap: .35rem; }
.dct-field--full { grid-column: 1 / -1; }
.dct-field label { color: var(--dct-navy); font-size: .9rem; font-weight: 850; }
.dct-field small { color: var(--dct-muted); font-size: .78rem; }
.dct-field input, .dct-field select, .dct-contact-form input, .dct-contact-form textarea {
  width: 100%; min-height: 48px; border: 1px solid #b8c7d4; border-radius: 10px; padding: .68rem .78rem; background: var(--dct-white); color: var(--dct-ink);
}
.dct-field input:focus, .dct-field select:focus, .dct-contact-form input:focus, .dct-contact-form textarea:focus { outline: 3px solid rgba(18,97,160,.18); border-color: var(--dct-blue); }
.dct-calculator .dct-button { width: 100%; margin-top: 1.2rem; }
.dct-results { position: sticky; top: 110px; background: var(--dct-navy); color: var(--dct-white); }
.dct-results h2 { color: var(--dct-white); }
.dct-result-list { display: grid; gap: .75rem; }
.dct-result-row { padding: .8rem 0; border-bottom: 1px solid rgba(255,255,255,.14); }
.dct-result-row:last-child { border-bottom: 0; }
.dct-result-label { display: block; color: #bcd2e4; font-size: .82rem; }
.dct-result-value { display: block; color: var(--dct-white); font-size: 1.5rem; font-weight: 900; }
.dct-calculator-note { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.14); color: #c8d8e5; font-size: .78rem; }
.dct-formula-box { margin: 2rem 0; padding: 1.25rem 1.4rem; border-left: 5px solid var(--dct-orange); border-radius: 0 12px 12px 0; background: var(--dct-soft); }
.dct-formula-box h2 { margin-top: 0; font-size: 1.35rem; }

/* Content */
.site-main { min-height: 55vh; }
.dct-content { padding: 3.5rem 0 5rem; }
.dct-content > *:first-child { margin-top: 0; }
.dct-content h2 { margin-top: 2.2rem; }
.dct-content h3 { margin-top: 1.7rem; }
.dct-breadcrumbs { padding-top: 1.2rem; color: var(--dct-muted); font-size: .86rem; }
.dct-breadcrumbs a { color: var(--dct-muted); }
.dct-post-card { padding: 1.5rem; margin-bottom: 1rem; border: 1px solid var(--dct-line); border-radius: var(--dct-radius); }
.dct-post-card h2 { margin: 0 0 .5rem; font-size: 1.55rem; }
.dct-meta { color: var(--dct-muted); font-size: .84rem; }
.dct-notice { padding: 1rem 1.1rem; border-radius: 12px; background: #eaf6ee; color: #155b2d; }
.dct-notice--error { background: #fff0f0; color: #8a2525; }
.dct-contact-form { display: grid; gap: 1rem; max-width: 680px; }
.dct-contact-form textarea { min-height: 180px; resize: vertical; }
.dct-honeypot { position: absolute; left: -9999px; }
.dct-ad-slot { min-height: 90px; display: grid; place-items: center; margin: 1.5rem 0; border: 1px dashed #b8c7d4; border-radius: 10px; color: #718497; background: #f8fafc; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }

/* Footer */
.site-footer { background: #0b1f31; color: #b9ccdc; }
.dct-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; padding: 4rem 0 2.5rem; }
.site-footer h2, .site-footer h3 { color: var(--dct-white); }
.site-footer a { color: #d8e8f4; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .45rem 0; }
.dct-footer-bottom { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; border-top: 1px solid rgba(255,255,255,.1); font-size: .82rem; }

@media (max-width: 920px) {
  .dct-menu-toggle { display: inline-flex; }
  .dct-site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: .7rem 1rem 1rem; background: var(--dct-white); border-bottom: 1px solid var(--dct-line); box-shadow: var(--dct-shadow); }
  .dct-site-nav.is-open { display: block; }
  .dct-primary-menu { display: block; }
  .dct-primary-menu .sub-menu { position: static; display: block; padding-left: 1rem; border: 0; box-shadow: none; }
  .dct-hero-grid, .dct-calculator-wrap { grid-template-columns: 1fr; }
  .dct-hero { padding: 4.2rem 0; }
  .dct-hero-card { max-width: 620px; }
  .dct-results { position: static; }
  .dct-grid--4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .dct-section { padding: 3.2rem 0; }
  .dct-grid--3, .dct-grid--4, .dct-stats, .dct-footer-grid { grid-template-columns: 1fr; }
  .dct-stats { gap: .35rem; }
  .dct-stat { padding: .45rem; }
  .dct-field-grid { grid-template-columns: 1fr; }
  .dct-field--full { grid-column: auto; }
  .dct-search { display: grid; }
  .dct-search button { width: 100%; }
  .dct-footer-bottom { display: block; }
}

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