/* ============================================================
   Cubic Yards to Tons Calculator — Page-specific styles
   cubic-yards-to-tons-calculator.css
   Primary: Blue #2563EB | Extends site design system
   ============================================================ */

/* ── Hero Section ─────────────────────────────────────────── */
.cyd-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 36px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: center;
}

.cyd-hero-copy { max-width: 600px; }

.cyd-hero .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 16px;
  padding: 7px 14px;
  border: 1px solid #d4dff5;
  border-radius: 99px;
  background: #edf2fd;
  color: #2563EB;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.cyd-hero .hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563EB;
}

.cyd-hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.5px;
  margin: 0 0 14px;
  color: #111827;
}

.cyd-hero h1 span { color: #2563EB; }

.cyd-hero .hero-sub {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #4B5563;
  margin: 0 0 22px;
}

.cyd-hero .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 28px;
  background: #2563EB;
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background .2s, transform .15s;
}

.cyd-hero .hero-cta:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.cyd-hero .hero-cta svg { width: 18px; height: 18px; }

.cyd-hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cyd-hero-visual svg {
  width: 100%;
  max-width: 420px;
  height: auto;
}

/* ── Calculator Section ───────────────────────────────────── */
.cyd-calc-section {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.cyd-calc-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  overflow: hidden;
}

.cyd-calc-header {
  padding: 22px 28px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cyd-calc-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.cyd-calc-body { padding: 24px 28px 28px; }

/* ── Mode Toggle ──────────────────────────────────────────── */
.cyd-mode-toggle {
  display: flex;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 28px;
}

.cyd-mode-toggle button {
  flex: 1;
  padding: 11px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  color: #6B7280;
  cursor: pointer;
  transition: all .2s;
}

.cyd-mode-toggle button.active {
  background: #fff;
  color: #2563EB;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ── Input Rows ───────────────────────────────────────────── */
.cyd-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.cyd-input-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.cyd-input-group { display: flex; flex-direction: column; gap: 6px; }

.cyd-input-group label {
  font-size: .8rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.cyd-input-group input,
.cyd-input-group select {
  padding: 12px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fafbfc;
  color: #111827;
  transition: border-color .2s, box-shadow .2s;
}

.cyd-input-group input:focus,
.cyd-input-group select:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.cyd-input-group input[type="number"] {
  font-variant-numeric: tabular-nums;
}

/* ── Unit Selector ────────────────────────────────────────── */
.cyd-unit-select {
  display: flex;
  gap: 6px;
}

.cyd-unit-select button {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid #d1d5db;
  background: #fafbfc;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: #6B7280;
  cursor: pointer;
  transition: all .2s;
}

.cyd-unit-select button.active {
  border-color: #2563EB;
  background: #edf2fd;
  color: #2563EB;
}

/* ── Density Display ──────────────────────────────────────── */
.cyd-density-display {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 20px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cyd-density-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cyd-density-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #edf2fd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563EB;
}

.cyd-density-text .density-label {
  font-size: .78rem;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.cyd-density-text .density-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}

.cyd-density-custom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cyd-density-custom label {
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
}

.cyd-density-custom input {
  width: 80px;
  padding: 9px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: .95rem;
  text-align: center;
  font-family: inherit;
}

.cyd-density-custom input:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ── Formula Box ──────────────────────────────────────────── */
.cyd-formula-box {
  background: #f0f5ff;
  border: 1.5px solid #bfd5ff;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 20px 0;
}

.cyd-formula-box .fb-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #2563EB;
  margin-bottom: 8px;
}

.cyd-formula-box .fb-formula {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
}

/* ── Results Dashboard ────────────────────────────────────── */
.cyd-results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #f0f0f0;
}

.cyd-result-card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  transition: transform .15s;
}

.cyd-result-card:hover { transform: translateY(-2px); }

.cyd-result-card.primary {
  background: #2563EB;
  border-color: #2563EB;
  color: #fff;
}

.cyd-result-card .rc-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 1.1rem;
  background: rgba(37,99,235,.12);
  color: #2563EB;
}

.cyd-result-card.primary .rc-icon {
  background: rgba(255,255,255,.2);
  color: #fff;
}

.cyd-result-card .rc-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 5px;
  color: #6B7280;
}

.cyd-result-card.primary .rc-label { color: rgba(255,255,255,.8); }

.cyd-result-card .rc-value {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #111827;
}

.cyd-result-card.primary .rc-value { color: #fff; }

.cyd-result-card .rc-sub {
  font-size: .75rem;
  color: #9CA3AF;
  margin-top: 3px;
}

.cyd-result-card.primary .rc-sub { color: rgba(255,255,255,.65); }

/* ── Content Sections ─────────────────────────────────────── */
.cyd-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.cyd-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 44px 0 18px;
  color: #111827;
}

.cyd-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: #1F2937;
}

.cyd-content p {
  font-size: .95rem;
  line-height: 1.7;
  color: #4B5563;
  margin: 0 0 14px;
}

/* ── Tables ───────────────────────────────────────────────── */
.cyd-table-wrap {
  overflow-x: auto;
  margin: 18px 0 28px;
}

.cyd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

.cyd-table thead th {
  background: #2563EB;
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.cyd-table thead th:first-child { border-radius: 10px 0 0 0; }
.cyd-table thead th:last-child { border-radius: 0 10px 0 0; }

.cyd-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  color: #374151;
}

.cyd-table tbody tr:nth-child(even) { background: #f9fafb; }
.cyd-table tbody tr:hover { background: #edf2fd; }

.cyd-table .highlight {
  font-weight: 700;
  color: #2563EB;
}

/* ── Project Cards ────────────────────────────────────────── */
.cyd-project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0 28px;
}

.cyd-project-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  transition: transform .15s, box-shadow .15s;
}

.cyd-project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

.cyd-project-card .pj-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #edf2fd;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: #2563EB;
  font-size: 1.2rem;
}

.cyd-project-card .pj-name {
  font-size: .9rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.cyd-project-card .pj-conversion {
  font-size: 1.1rem;
  font-weight: 800;
  color: #2563EB;
  margin-bottom: 4px;
}

.cyd-project-card .pj-desc {
  font-size: .78rem;
  color: #9CA3AF;
}

/* ── Steps Section ────────────────────────────────────────── */
.cyd-steps {
  counter-reset: step;
  margin: 18px 0 28px;
}

.cyd-step {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

.cyd-step:last-child { border-bottom: none; }

.cyd-step-num {
  counter-increment: step;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #edf2fd;
  color: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  flex-shrink: 0;
}

.cyd-step-body h4 {
  margin: 0 0 4px;
  font-size: .95rem;
  font-weight: 700;
  color: #111827;
}

.cyd-step-body p {
  margin: 0;
  font-size: .88rem;
  color: #6B7280;
  line-height: 1.6;
}

/* ── Info Grid ────────────────────────────────────────────── */
.cyd-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 18px 0 28px;
}

.cyd-info-card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
}

.cyd-info-card .info-title {
  font-size: .95rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.cyd-info-card .info-text {
  font-size: .85rem;
  color: #6B7280;
  line-height: 1.6;
}

.cyd-info-card .info-highlight {
  font-size: 1.4rem;
  font-weight: 800;
  color: #2563EB;
  margin: 8px 0 4px;
}

/* ── Example Box ──────────────────────────────────────────── */
.cyd-example-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 18px 0 28px;
}

.cyd-example-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
}

.cyd-example-card .ex-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #2563EB;
  margin-bottom: 6px;
}

.cyd-example-card .ex-title {
  font-size: .95rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.cyd-example-card .ex-desc {
  font-size: .82rem;
  color: #6B7280;
  line-height: 1.5;
}

/* ── FAQ Accordion ────────────────────────────────────────── */
.cyd-faq-list {
  margin: 18px 0 28px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
}

.cyd-faq-item {
  border-bottom: 1px solid #f0f0f0;
}

.cyd-faq-item:last-child { border-bottom: none; }

.cyd-faq-q {
  width: 100%;
  padding: 18px 44px 18px 20px;
  background: #fff;
  border: none;
  text-align: left;
  font-size: .95rem;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  position: relative;
  transition: background .15s;
  font-family: inherit;
}

.cyd-faq-q:hover { background: #f9fafb; }

.cyd-faq-q::after {
  content: '+';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #edf2fd;
  color: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  transition: transform .2s;
}

.cyd-faq-item.open .cyd-faq-q::after {
  content: '\2212';
  transform: translateY(-50%) rotate(180deg);
}

.cyd-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
}

.cyd-faq-item.open .cyd-faq-a {
  max-height: 300px;
}

.cyd-faq-a-inner {
  padding: 0 20px 18px;
  font-size: .9rem;
  line-height: 1.7;
  color: #4B5563;
}

/* ── Conversion Chart Table ───────────────────────────────── */
.cyd-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 18px 0 28px;
}

.cyd-chart-item {
  text-align: center;
  padding: 14px 10px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.cyd-chart-item .chart-cy {
  font-size: 1.2rem;
  font-weight: 800;
  color: #111827;
}

.cyd-chart-item .chart-tons {
  font-size: .9rem;
  font-weight: 700;
  color: #2563EB;
  margin-top: 2px;
}

/* ── Internal Links ───────────────────────────────────────── */
.cyd-internal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 28px;
}

.cyd-internal-links a {
  padding: 9px 18px;
  border: 1.5px solid #e5e7eb;
  border-radius: 99px;
  font-size: .85rem;
  font-weight: 600;
  color: #2563EB;
  text-decoration: none;
  transition: all .2s;
  background: #fff;
}

.cyd-internal-links a:hover {
  border-color: #2563EB;
  background: #edf2fd;
}

/* ── Breadcrumbs ──────────────────────────────────────────── */
.cyd-breadcrumbs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px 0;
  display: flex;
  gap: 6px;
  font-size: .82rem;
  color: #9CA3AF;
  align-items: center;
}

.cyd-breadcrumbs a {
  color: #2563EB;
  text-decoration: none;
  font-weight: 600;
}

.cyd-breadcrumbs a:hover { text-decoration: underline; }

.cyd-breadcrumbs .sep { color: #d1d5db; font-weight: 400; }

.cyd-breadcrumbs .current { color: #6B7280; font-weight: 500; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .cyd-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 28px 20px 24px;
    text-align: center;
  }

  .cyd-hero-copy { max-width: 100%; }
  .cyd-hero h1 { font-size: 2rem; }
  .cyd-hero-visual { display: none; }

  .cyd-calc-section { padding: 0 16px 40px; }
  .cyd-content { padding: 0 16px 48px; }

  .cyd-input-row,
  .cyd-input-row.cols-3 {
    grid-template-columns: 1fr;
  }

  .cyd-results {
    grid-template-columns: repeat(2, 1fr);
  }

  .cyd-project-grid,
  .cyd-info-grid,
  .cyd-example-grid,
  .cyd-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .cyd-hero h1 { font-size: 1.6rem; }
  .cyd-hero .hero-sub { font-size: .9rem; }

  .cyd-calc-header {
    padding: 16px 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .cyd-calc-body { padding: 16px 18px 20px; }

  .cyd-mode-toggle button { font-size: .78rem; padding: 9px 10px; }

  .cyd-results { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cyd-result-card { padding: 14px 10px; }
  .cyd-result-card .rc-value { font-size: 1.1rem; }

  .cyd-content h2 { font-size: 1.25rem; }
  .cyd-project-grid { grid-template-columns: repeat(2, 1fr); }
}
