/*
Theme Name: Davidson Construction
Theme URI:
Author: Davidson Construction
Author URI:
Description: A residential construction theme for The Davidson Construction — Gilmer, Texas. Charcoal/cream/green palette with DM Serif Display + DM Sans typography.
Version: 1.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: davidson-construction
*/

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- Custom Properties ---- */
:root {
  --bg:       #f5f2ed;
  --bg2:      #ede9e2;
  --charcoal: #2c2f2e;
  --charcoal2:#3e4442;
  --green:    #4a6741;
  --green2:   #5c7d53;
  --cream:    #faf8f4;
  --text:     #2c2f2e;
  --text-mid: #5a5e5c;
  --text-dim: #8a908e;
  --border:   #d8d3cb;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ---- NAV ---- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2.5rem;
  background: var(--charcoal);
  border-bottom: 3px solid var(--green);
}
.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-logo span { color: #7aaa6e; }
.nav-links {
  display: flex; gap: 2rem; list-style: none; align-items: center;
}
.nav-links li { list-style: none; }
.nav-links a {
  text-decoration: none; font-size: 0.82rem;
  font-weight: 400; color: #a8b0ae; transition: color 0.2s;
}
.nav-links a:hover { color: var(--cream); }
.nav-links .current-menu-item a,
.nav-links .current_page_item a { color: var(--cream); }
.nav-cta,
.nav-links .nav-cta-item a {
  background: var(--green); color: var(--cream);
  font-size: 0.82rem; font-weight: 500;
  padding: 0.5rem 1.3rem; text-decoration: none;
  border-radius: 3px; transition: background 0.2s;
}
.nav-cta:hover,
.nav-links .nav-cta-item a:hover { background: var(--green2); color: var(--cream); }
.nav-toggle {
  display: none; background: none; border: none;
  cursor: pointer; flex-direction: column; gap: 5px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: #a8b0ae; border-radius: 2px; }

/* ---- MOBILE MENU ---- */
.mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: var(--charcoal); flex-direction: column;
  align-items: center; justify-content: center; gap: 2rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: 'DM Serif Display', serif; font-size: 2rem;
  color: var(--cream); text-decoration: none; transition: color 0.2s;
}
.mobile-menu a:hover { color: #7aaa6e; }
.mobile-close {
  position: absolute; top: 1.5rem; right: 2rem;
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; color: #a8b0ae;
}

/* ---- HERO ---- */
.hero-wrap { background: var(--charcoal); }
.hero {
  padding: 5rem 2.5rem 5.5rem;
  max-width: 800px; margin: 0 auto;
}
.hero-tag {
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #7aaa6e; margin-bottom: 1.2rem;
}
.hero-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  color: var(--cream); line-height: 1.1; margin-bottom: 1.4rem;
}
.hero-body {
  font-size: 1rem; font-weight: 300;
  color: #a8b0ae; line-height: 1.8;
  max-width: 48ch; margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.btn {
  display: inline-block; text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  padding: 0.75rem 1.8rem; border-radius: 3px; transition: all 0.2s;
}
.btn-green { background: var(--green); color: var(--cream); }
.btn-green:hover { background: var(--green2); }
.btn-outline { border: 1px solid #4e5552; color: #a8b0ae; }
.btn-outline:hover { border-color: #a8b0ae; color: var(--cream); }

/* ---- PAGE ---- */
.page-body { background: var(--cream); }

/* ---- SECTION ---- */
.section { padding: 4.5rem 2.5rem; max-width: 800px; margin: 0 auto; }
.section-header { margin-bottom: 2.5rem; }
.section-label {
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--green); margin-bottom: 0.5rem;
}
.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--charcoal); line-height: 1.2;
}
.section-body {
  font-size: 0.95rem; font-weight: 300;
  color: var(--text-mid); line-height: 1.8;
  margin-top: 0.8rem; max-width: 54ch;
}
.rule { border: none; border-top: 1px solid var(--border); margin: 0; }
.section-tinted { background: var(--bg2); }

/* ---- SERVICES ---- */
.services-list { display: flex; flex-direction: column; }
.service-row {
  display: flex; align-items: flex-start;
  gap: 2rem; padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}
.service-row:first-child { border-top: 1px solid var(--border); }
.service-num {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem; color: var(--border);
  min-width: 2.5rem; line-height: 1; padding-top: 2px;
}
.service-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem; color: var(--charcoal); margin-bottom: 0.4rem;
}
.service-name a { text-decoration: none; color: inherit; transition: color 0.2s; }
.service-name a:hover { color: var(--green); }
.service-desc {
  font-size: 0.88rem; font-weight: 300;
  color: var(--text-mid); line-height: 1.75;
}
.service-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.tag {
  font-size: 0.7rem; font-weight: 400;
  color: var(--green); background: #eef3ec;
  padding: 0.2rem 0.65rem; border-radius: 2px;
  text-decoration: none;
}
.tag:hover { background: #dde8da; }

/* ---- PROCESS ---- */
.process-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
.process-card {
  background: var(--cream); border: 1px solid var(--border);
  padding: 1.8rem; border-radius: 4px;
}
.process-step {
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green); margin-bottom: 0.5rem;
}
.process-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem; color: var(--charcoal); margin-bottom: 0.6rem;
}
.process-desc {
  font-size: 0.85rem; font-weight: 300;
  color: var(--text-mid); line-height: 1.75;
}

/* ---- ABOUT ---- */
.about-layout {
  display: grid; grid-template-columns: auto 1fr;
  gap: 3rem; align-items: start;
}
.about-photo {
  width: 140px; aspect-ratio: 1;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo svg { width: 40px; height: 40px; stroke: var(--border); fill: none; stroke-width: 1.5; }
.about-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem; color: var(--charcoal); margin-bottom: 0.3rem;
}
.about-role {
  font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--green); margin-bottom: 1.2rem;
}
.about-p {
  font-size: 0.9rem; font-weight: 300;
  color: var(--text-mid); line-height: 1.85; margin-bottom: 0.8rem;
}
.about-stats { display: flex; gap: 2rem; margin-top: 1.8rem; flex-wrap: wrap; }
.stat-num {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem; color: var(--charcoal); line-height: 1;
}
.stat-label { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.2rem; }

/* ---- WORK ---- */
.work-grid {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: 4px; overflow: hidden;
}
.work-item {
  background: var(--cream);
  display: grid; grid-template-columns: 220px 1fr;
}
.work-item a { text-decoration: none; color: inherit; }
.work-img {
  background: var(--charcoal2); min-height: 140px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.work-img img { width: 100%; height: 100%; object-fit: cover; }
.work-img.has-lightbox { cursor: pointer; }
.work-img.has-lightbox:hover img { opacity: 0.85; transition: opacity 0.2s; }
.work-img-placeholder { font-size: 0.72rem; color: #5a6460; letter-spacing: 0.08em; }
.work-info { padding: 1.6rem 2rem; display: flex; flex-direction: column; justify-content: center; }
.work-type {
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green); margin-bottom: 0.4rem;
}
.work-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem; color: var(--charcoal); margin-bottom: 0.5rem;
}
.work-name a { text-decoration: none; color: inherit; transition: color 0.2s; }
.work-name a:hover { color: var(--green); }
.work-desc { font-size: 0.83rem; font-weight: 300; color: var(--text-mid); line-height: 1.7; }

/* ---- CONTACT ---- */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.contact-info p {
  font-size: 0.9rem; font-weight: 300;
  color: var(--text-mid); line-height: 1.85; margin-bottom: 2rem;
}
.contact-detail-list { display: flex; flex-direction: column; gap: 1.2rem; }
.cd-label {
  font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 0.2rem;
}
.cd-value { font-size: 0.95rem; color: var(--charcoal); }
.cd-value a { text-decoration: none; color: inherit; transition: color 0.2s; }
.cd-value a:hover { color: var(--green); }
.cd-subtitle { font-size: 0.82rem; color: var(--text-dim); }
.contact-form-placeholder {
  padding: 2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.88rem;
  color: var(--text-mid);
  text-align: center;
}

/* Form styling (for shortcode output or fallback) */
.form-group { margin-bottom: 1.4rem; }
.form-group label {
  display: block; font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 0.5rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; background: var(--bg2);
  border: 1px solid var(--border); color: var(--text);
  padding: 0.65rem 0.9rem;
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 300;
  outline: none; border-radius: 3px; transition: border-color 0.2s; appearance: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--green); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group select option { background: var(--cream); }
.form-submit {
  background: var(--green); color: var(--cream); border: none;
  padding: 0.8rem 2rem; font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  border-radius: 3px; transition: background 0.2s; width: 100%;
}
.form-submit:hover { background: var(--green2); }
.form-feedback {
  margin-top: 1rem; font-size: 0.85rem; font-weight: 400;
  text-align: center; padding: 0.6rem; border-radius: 3px;
}
.form-feedback:empty { display: none; }
.form-feedback.success { color: var(--green); background: #eef3ec; }
.form-feedback.error { color: #8b3a3a; background: #f5eded; }

/* ---- LIGHTBOX ---- */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, 0.88);
  align-items: center; justify-content: center;
  padding: 2rem;
}
.lightbox.is-open { display: flex; }
.lightbox-close {
  position: absolute; top: 1.5rem; right: 2rem;
  background: none; border: none; cursor: pointer;
  font-size: 2rem; color: #a8b0ae; transition: color 0.2s;
  line-height: 1; z-index: 301;
}
.lightbox-close:hover { color: var(--cream); }
.lightbox-content { max-width: 900px; width: 100%; text-align: center; }
.lightbox-content img {
  max-width: 100%; max-height: 80vh;
  border-radius: 4px; object-fit: contain;
}
.lightbox-caption {
  margin-top: 1rem;
  font-size: 0.85rem; font-weight: 300;
  color: #a8b0ae;
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--charcoal); padding: 3rem 2.5rem;
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 1.5rem;
}
.footer-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem; color: var(--cream); margin-bottom: 0.3rem;
}
.footer-name span { color: #7aaa6e; }
.footer-tagline { font-size: 0.78rem; font-weight: 300; color: #6b7472; }
.footer-links { display: flex; gap: 1.8rem; list-style: none; }
.footer-links li { list-style: none; }
.footer-links a {
  font-size: 0.75rem; color: #6b7472;
  text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: #a8b0ae; }
.footer-copy { font-size: 0.72rem; color: #4a5250; width: 100%; }

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero > * { opacity: 0; animation: fadeUp 0.7s ease forwards; }
.hero-tag     { animation-delay: 0.1s; }
.hero-title   { animation-delay: 0.25s; }
.hero-body    { animation-delay: 0.4s; }
.hero-actions { animation-delay: 0.55s; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- GENERIC PAGE CONTENT ---- */
.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2.5rem;
}
.page-content h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--charcoal);
  margin-bottom: 2rem;
  line-height: 1.2;
}
.page-content .entry-content {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.85;
}
.page-content .entry-content p { margin-bottom: 1.2rem; }
.page-content .entry-content h2,
.page-content .entry-content h3,
.page-content .entry-content h4 {
  font-family: 'DM Serif Display', serif;
  color: var(--charcoal);
  margin: 2rem 0 0.8rem;
}
.page-content .entry-content ul,
.page-content .entry-content ol { margin-left: 1.5rem; margin-bottom: 1.2rem; }
.page-content .entry-content a { color: var(--green); text-decoration: underline; }
.page-content .entry-content a:hover { color: var(--green2); }
.page-content .entry-content img { border-radius: 4px; margin: 1.5rem 0; }

/* ---- SINGLE POST/CPT ---- */
.single-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2.5rem;
}
.single-meta {
  margin-bottom: 2rem;
}
.single-meta .type-label {
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green); margin-bottom: 0.5rem;
}
.single-meta h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--charcoal);
  line-height: 1.2;
}
.single-featured {
  margin-bottom: 2rem;
  border-radius: 4px;
  overflow: hidden;
}
.single-featured img { width: 100%; }
.single-body {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.85;
}
.single-body p { margin-bottom: 1.2rem; }
.single-body h2,
.single-body h3,
.single-body h4 {
  font-family: 'DM Serif Display', serif;
  color: var(--charcoal);
  margin: 2rem 0 0.8rem;
}
.single-body ul,
.single-body ol { margin-left: 1.5rem; margin-bottom: 1.2rem; }
.single-body a { color: var(--green); text-decoration: underline; }
.single-body a:hover { color: var(--green2); }
.single-body img { border-radius: 4px; margin: 1.5rem 0; }
.single-tags {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 2rem; padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.single-nav {
  display: flex; justify-content: space-between;
  margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.single-nav a {
  color: var(--green); text-decoration: none; transition: color 0.2s;
}
.single-nav a:hover { color: var(--green2); }

/* ---- ARCHIVE ---- */
.archive-header {
  background: var(--charcoal);
  padding: 3.5rem 2.5rem;
}
.archive-header-inner {
  max-width: 800px;
  margin: 0 auto;
}
.archive-header .section-label {
  color: #7aaa6e;
}
.archive-header .section-title {
  color: var(--cream);
}
.archive-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2.5rem;
}

/* Archive: services list */
.archive-services-list { display: flex; flex-direction: column; }

/* Archive: projects grid */
.archive-projects-grid {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: 4px; overflow: hidden;
}

/* ---- 404 ---- */
.error-hero {
  background: var(--charcoal);
  min-height: 70vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 4rem 2.5rem;
}
.error-hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--cream);
  margin-bottom: 1rem;
  line-height: 1.2;
}
.error-hero p {
  font-size: 1rem; font-weight: 300;
  color: #a8b0ae; margin-bottom: 2rem;
}
.error-hero .btn-green {
  display: inline-block;
}

/* ---- INDEX FALLBACK ---- */
.index-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2.5rem;
}
.index-content h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--charcoal);
  margin-bottom: 2rem;
}
.index-post {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.index-post:first-child { border-top: 1px solid var(--border); }
.index-post h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}
.index-post h3 a { text-decoration: none; color: var(--charcoal); transition: color 0.2s; }
.index-post h3 a:hover { color: var(--green); }
.index-post .index-excerpt {
  font-size: 0.88rem; font-weight: 300; color: var(--text-mid); line-height: 1.75;
}
.pagination { margin-top: 2rem; }
.pagination .nav-links { display: flex; gap: 1rem; justify-content: center; }
.pagination a, .pagination span {
  font-size: 0.85rem; padding: 0.4rem 0.8rem;
  border-radius: 3px; text-decoration: none;
}
.pagination a { color: var(--green); border: 1px solid var(--border); }
.pagination a:hover { background: var(--bg2); }
.pagination .current { background: var(--green); color: var(--cream); border: 1px solid var(--green); }

/* ---- RESPONSIVE ---- */
@media (max-width: 660px) {
  .site-nav { padding: 1rem 1.5rem; }
  .nav-links, .nav-cta-desktop { display: none; }
  .nav-toggle { display: flex; }
  .hero { padding: 3.5rem 1.5rem 4rem; }
  .section { padding: 3.5rem 1.5rem; }
  .process-grid { grid-template-columns: 1fr; }
  .about-layout { grid-template-columns: 1fr; }
  .about-photo { width: 100px; }
  .work-item { grid-template-columns: 1fr; }
  .work-img { min-height: 120px; }
  .contact-layout { grid-template-columns: 1fr; gap: 2rem; }
  .site-footer { flex-direction: column; padding: 2.5rem 1.5rem; }
  .page-content { padding: 3rem 1.5rem; }
  .single-content { padding: 3rem 1.5rem; }
  .archive-header { padding: 2.5rem 1.5rem; }
  .archive-content { padding: 2rem 1.5rem; }
}
