/* ============================================================
   Cali Dream Construction — Premium Blog Stylesheet
   Construction-industry aesthetic: earth tones, copper accents
   Mobile-first, no frameworks, fast load
   ============================================================ */

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

:root {
  --charcoal: #2d2d2d;
  --slate: #3d3d3d;
  --warm-gray: #5a5a5a;
  --light-gray: #f5f3f0;
  --off-white: #faf9f7;
  --copper: #b87333;
  --copper-light: #d4944a;
  --copper-dark: #8f5a27;
  --amber: #c6922a;
  --amber-glow: rgba(198, 146, 42, 0.12);
  --sand: #e8dfd3;
  --blueprint: #1e3a5f;
  --blueprint-light: #2a4d78;
  --forest: #2d5a3d;
  --cream: #f7f2eb;
  --white: #ffffff;
  --border: #e0dbd4;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --max-content: 720px;
  --max-wide: 1100px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: var(--slate);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Reading Progress Bar --- */
.cd-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--copper), var(--amber));
  z-index: 10000;
  transition: width 0.15s ease;
}

/* --- Top Navigation Bar --- */
.cd-topbar {
  background: var(--charcoal);
  color: var(--white);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 9000;
  box-shadow: var(--shadow-md);
}

.cd-topbar-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cd-logo {
  text-decoration: none;
  color: var(--white);
  display: flex;
  flex-direction: column;
}

.cd-logo-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cd-logo-tagline {
  font-size: 0.72rem;
  color: var(--copper-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.cd-topbar-phone {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 18px;
  border: 1.5px solid var(--copper);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.cd-topbar-phone:hover {
  background: var(--copper);
  border-color: var(--copper);
}

/* --- Breadcrumbs --- */
.cd-breadcrumb {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  font-size: 0.82rem;
  color: var(--warm-gray);
}

.cd-breadcrumb-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
}

.cd-breadcrumb a {
  color: var(--copper-dark);
  text-decoration: none;
  transition: color 0.15s;
}

.cd-breadcrumb a:hover { color: var(--copper); }

.cd-breadcrumb .cd-sep {
  margin: 0 8px;
  color: var(--border);
}

/* --- Hero Banner --- */
.cd-hero {
  background: linear-gradient(135deg, var(--charcoal) 0%, var(--blueprint) 100%);
  color: var(--white);
  padding: 48px 24px 40px;
  position: relative;
  overflow: hidden;
}

.cd-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 1;
}

.cd-hero-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.cd-category-badge {
  display: inline-block;
  background: var(--copper);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 14px;
  border-radius: 3px;
  margin-bottom: 16px;
}

.cd-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.cd-hero-meta {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.cd-hero-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* --- Main Article Container --- */
.cd-article-wrap {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.cd-article {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 40px 0 60px;
  width: 100%;
}

/* --- Featured Image --- */
.cd-featured-img {
  margin: 0 0 32px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.cd-featured-img img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* --- Content Typography --- */
.cd-content h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--charcoal);
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--copper);
  line-height: 1.3;
}

.cd-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--slate);
  margin: 36px 0 12px;
  line-height: 1.35;
}

.cd-content h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--warm-gray);
  margin: 28px 0 10px;
}

.cd-content p {
  margin-bottom: 18px;
  color: var(--slate);
}

.cd-content a {
  color: var(--copper-dark);
  text-decoration: underline;
  text-decoration-color: var(--copper-light);
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.cd-content a:hover { color: var(--copper); }

.cd-content ul, .cd-content ol {
  margin: 16px 0 20px 24px;
}

.cd-content li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.cd-content li::marker {
  color: var(--copper);
}

.cd-content strong {
  color: var(--charcoal);
  font-weight: 600;
}

.cd-content blockquote {
  border-left: 4px solid var(--copper);
  background: var(--amber-glow);
  padding: 20px 24px;
  margin: 28px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--warm-gray);
}

.cd-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 40px 0;
}

.cd-content figure {
  margin: 32px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cd-content figure img {
  width: 100%;
  height: auto;
  display: block;
}

.cd-content figcaption {
  font-size: 0.82rem;
  color: var(--warm-gray);
  text-align: center;
  padding: 10px 16px;
  background: var(--light-gray);
}

/* --- Cost Breakdown Tables (Blueprint Style) --- */
.cd-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.92rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cd-content thead {
  background: linear-gradient(135deg, var(--blueprint) 0%, var(--blueprint-light) 100%);
  color: var(--white);
}

.cd-content th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cd-content td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}

.cd-content tbody tr {
  background: var(--white);
  transition: background 0.15s;
}

.cd-content tbody tr:nth-child(even) {
  background: var(--light-gray);
}

.cd-content tbody tr:hover {
  background: var(--amber-glow);
}

.cd-content tbody tr:last-child td {
  border-bottom: none;
}

/* --- Inline CTA Block --- */
.cd-inline-cta {
  background: linear-gradient(135deg, var(--charcoal) 0%, var(--blueprint) 100%);
  color: var(--white);
  padding: 32px;
  border-radius: var(--radius-lg);
  text-align: center;
  margin: 40px 0;
  position: relative;
  overflow: hidden;
}

.cd-inline-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: var(--copper);
  opacity: 0.08;
  border-radius: 50%;
}

.cd-inline-cta h3 {
  color: var(--white);
  font-size: 1.35rem;
  margin: 0 0 8px;
  border: none;
}

.cd-inline-cta p {
  color: rgba(255,255,255,0.85);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.cd-inline-cta .cd-cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.cd-btn-primary {
  display: inline-block;
  background: var(--copper);
  color: var(--white);
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.cd-btn-primary:hover {
  background: var(--copper-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(184, 115, 51, 0.3);
}

.cd-btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--white);
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid rgba(255,255,255,0.35);
  transition: all 0.2s ease;
  cursor: pointer;
}

.cd-btn-outline:hover {
  border-color: var(--copper-light);
  background: rgba(255,255,255,0.08);
}

/* --- Trust Block --- */
.cd-trust-block {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 40px 0;
}

.cd-trust-block h3 {
  color: var(--charcoal);
  font-size: 1.15rem;
  margin: 0 0 20px;
  border: none;
  text-align: center;
}

.cd-trust-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.cd-trust-item {
  text-align: center;
  padding: 16px 12px;
}

.cd-trust-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  display: block;
}

.cd-trust-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--charcoal);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.cd-trust-detail {
  font-size: 0.85rem;
  color: var(--warm-gray);
}

/* --- FAQ Accordion --- */
.cd-faq-section {
  margin: 48px 0;
}

.cd-faq-section > h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--copper);
}

.cd-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--white);
  transition: box-shadow 0.2s;
}

.cd-faq-item:hover {
  box-shadow: var(--shadow-sm);
}

.cd-faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--charcoal);
  font-size: 0.95rem;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  line-height: 1.5;
}

.cd-faq-q::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--copper);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 16px;
}

.cd-faq-item.active .cd-faq-q::after {
  transform: rotate(45deg);
}

.cd-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 20px;
  color: var(--warm-gray);
  font-size: 0.92rem;
  line-height: 1.7;
}

.cd-faq-item.active .cd-faq-a {
  max-height: 500px;
  padding: 0 20px 20px;
}

/* --- Related Posts Grid --- */
.cd-related-posts {
  margin: 48px 0 0;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.cd-related-posts h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 20px;
  border: none;
}

.cd-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.cd-related-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--slate);
  transition: all 0.2s ease;
  display: block;
}

.cd-related-card:hover {
  border-color: var(--copper-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.cd-related-card h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--charcoal);
  margin: 0 0 8px;
  line-height: 1.4;
}

.cd-related-card p {
  font-size: 0.82rem;
  color: var(--warm-gray);
  margin: 0;
  line-height: 1.5;
}

/* --- Sticky CTA Button --- */
.cd-sticky-cta {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 8000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.cd-sticky-cta.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cd-sticky-cta a {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--copper);
  color: var(--white);
  padding: 14px 24px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(184, 115, 51, 0.4);
  transition: all 0.2s ease;
}

.cd-sticky-cta a:hover {
  background: var(--copper-dark);
  box-shadow: 0 6px 25px rgba(184, 115, 51, 0.5);
  transform: translateY(-2px);
}

/* --- Footer --- */
.cd-footer {
  background: var(--charcoal);
  color: rgba(255,255,255,0.85);
  padding: 48px 24px 24px;
  margin-top: 0;
}

.cd-footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.cd-footer h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.cd-footer p, .cd-footer a {
  font-size: 0.88rem;
  line-height: 1.7;
}

.cd-footer a {
  color: var(--copper-light);
  text-decoration: none;
  transition: color 0.15s;
}

.cd-footer a:hover { color: var(--white); }

.cd-footer-links {
  list-style: none;
  padding: 0;
}

.cd-footer-links li {
  margin-bottom: 8px;
}

.cd-footer-bottom {
  max-width: var(--max-wide);
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
}

/* --- Before/After Comparison Placeholder --- */
.cd-before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 32px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.cd-ba-panel {
  position: relative;
  background: var(--light-gray);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cd-ba-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cd-ba-label {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--charcoal);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 3px;
}

/* --- Calculator Box --- */
.cd-calculator-box {
  background: linear-gradient(135deg, var(--blueprint) 0%, var(--blueprint-light) 100%);
  color: var(--white);
  padding: 28px;
  border-radius: var(--radius-lg);
  text-align: center;
  margin: 32px 0;
}

.cd-calculator-box h3 {
  color: var(--white);
  border: none;
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.cd-calculator-box p {
  color: rgba(255,255,255,0.85);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.cd-calculator-box a {
  display: inline-block;
  background: var(--amber);
  color: var(--white);
  padding: 10px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.cd-calculator-box a:hover {
  background: var(--copper-light);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  body { font-size: 16px; }

  .cd-hero { padding: 32px 20px 28px; }
  .cd-hero h1 { font-size: 1.65rem; }
  .cd-hero-meta { font-size: 0.8rem; gap: 10px; }

  .cd-topbar-inner { padding: 12px 16px; }
  .cd-logo-name { font-size: 1rem; }
  .cd-topbar-phone { font-size: 0.82rem; padding: 6px 14px; }

  .cd-article { padding: 28px 0 40px; }
  .cd-article-wrap { padding: 0 16px; }

  .cd-content h2 { font-size: 1.3rem; margin-top: 36px; }
  .cd-content h3 { font-size: 1.1rem; margin-top: 28px; }

  .cd-inline-cta { padding: 24px 20px; }
  .cd-inline-cta h3 { font-size: 1.15rem; }

  .cd-trust-items { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cd-trust-item { padding: 12px 8px; }

  .cd-related-grid { grid-template-columns: 1fr; }

  .cd-footer-inner { grid-template-columns: 1fr; gap: 24px; }

  .cd-sticky-cta { bottom: 16px; right: 16px; }
  .cd-sticky-cta a { padding: 12px 20px; font-size: 0.85rem; }

  .cd-before-after { grid-template-columns: 1fr; }

  .cd-content table { font-size: 0.85rem; }
  .cd-content th, .cd-content td { padding: 10px 12px; }

  .cd-content figure { margin: 24px -16px; border-radius: 0; }
}

@media (max-width: 480px) {
  .cd-hero h1 { font-size: 1.4rem; }
  .cd-topbar-phone span.cd-phone-text { display: none; }
  .cd-inline-cta .cd-cta-buttons { flex-direction: column; }
  .cd-inline-cta .cd-cta-buttons a { width: 100%; text-align: center; }
}

/* --- Print styles --- */
@media print {
  .cd-topbar, .cd-sticky-cta, .cd-inline-cta, .cd-trust-block,
  .cd-footer, .cd-progress-bar, .cd-breadcrumb { display: none; }
  .cd-article { max-width: 100%; padding: 0; }
  body { font-size: 12pt; line-height: 1.5; color: #000; background: #fff; }
}


/* === Internal Linking Engine Styles === */

.cd-category-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--off-white, #f8f7f4);
  border-bottom: 1px solid var(--border, #e5e2db);
  font-size: 0.82rem;
  color: var(--warm-gray, #8a8580);
  flex-wrap: wrap;
}

.cd-cat-link {
  color: var(--copper, #c9792e);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.cd-cat-link:hover {
  color: var(--copper-dark, #a86320);
  text-decoration: underline;
}

.cd-cat-city {
  color: var(--charcoal, #2c2825);
  font-weight: 500;
}

.cd-also-like {
  margin: 40px 0;
  padding: 24px 28px;
  background: var(--off-white, #f8f7f4);
  border-radius: var(--radius, 8px);
  border-left: 4px solid var(--copper, #c9792e);
}

.cd-also-like h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--charcoal, #2c2825);
  margin: 0 0 12px;
  border: none;
  padding: 0;
}

.cd-also-like ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cd-also-like li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border, #e5e2db);
}

.cd-also-like li:last-child {
  border-bottom: none;
}

.cd-also-like a {
  color: var(--copper, #c9792e);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.cd-also-like a:hover {
  color: var(--copper-dark, #a86320);
  text-decoration: underline;
}

/* === End Internal Linking Engine Styles === */
