/* ══════════════════════════════════════════
   ConcreteCalculator.site — Design System
   Warm Construction Theme
   ══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* Construction Earth Palette */
  --bg: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-input: #F5F1EB;
  --bg-hero: linear-gradient(135deg, #2D2926 0%, #3E3530 50%, #4A3F38 100%);
  --bg-result: linear-gradient(135deg, #FF8C42 0%, #E6692B 100%);

  /* Text */
  --text-primary: #2D2926;
  --text-secondary: #6B5E54;
  --text-muted: #9B8E82;
  --text-on-dark: #FAF7F2;
  --text-on-accent: #FFFFFF;

  /* Accent Colors */
  --amber: #FF8C42;
  --amber-light: #FFB380;
  --amber-dark: #E6692B;
  --concrete: #8B8680;
  --concrete-light: #B5AFA8;
  --concrete-dark: #5C5650;
  --green: #4CAF50;
  --green-light: #E8F5E9;
  --red: #E53935;
  --red-light: #FFEBEE;
  --blue: #2196F3;
  --blue-light: #E3F2FD;

  /* Borders & Shadows */
  --border: #E8E2DA;
  --border-focus: #FF8C42;
  --shadow-sm: 0 1px 3px rgba(45,41,38,0.06);
  --shadow-md: 0 4px 12px rgba(45,41,38,0.08);
  --shadow-lg: 0 8px 32px rgba(45,41,38,0.12);
  --shadow-glow: 0 0 0 3px rgba(255,140,66,0.15);

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --max-width: 1200px;
  --nav-height: 60px;

  /* Fonts */
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--amber-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
}
.nav-inner {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}
.nav-logo svg { flex-shrink: 0; }
.brand-concrete { color: var(--text-primary); }
.brand-calc { color: var(--amber); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--bg-input);
  color: var(--amber-dark);
}
.hamburger {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  color: var(--text-primary);
}
.hamburger svg { width: 24px; height: 24px; }

/* ── Mobile Menu ── */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(45,41,38,0.5);
  backdrop-filter: blur(4px);
}
.mobile-menu.open { display: block; }
.mobile-menu-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: slideIn 0.25s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } }
.mobile-menu-close {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.mobile-menu-close button {
  background: none;
  border: none;
  padding: 4px;
}
.mobile-menu-panel a {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
}
.mobile-menu-panel a:hover {
  background: var(--bg-input);
  color: var(--amber-dark);
}

/* ── Page Hero ── */
.page-hero {
  background: var(--bg-hero);
  padding: 48px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 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: 0.6;
}
.page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--text-on-dark);
  margin-bottom: 8px;
  position: relative;
}
.page-hero h1 span { color: var(--amber); }
.page-hero p {
  color: rgba(250,247,242,0.75);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
  position: relative;
}

/* ── Container ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Calculator Layout ── */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: -40px auto 40px;
  max-width: 1000px;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header svg { width: 20px; height: 20px; color: var(--amber); }
.card-body { padding: 20px; }

/* ── Shape Selector ── */
.shape-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.shape-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}
.shape-btn svg { width: 32px; height: 32px; color: var(--concrete); transition: color 0.2s; }
.shape-btn:hover { border-color: var(--amber-light); }
.shape-btn.active {
  border-color: var(--amber);
  background: rgba(255,140,66,0.06);
  color: var(--amber-dark);
  box-shadow: var(--shadow-glow);
}
.shape-btn.active svg { color: var(--amber); }

/* ── Form Inputs ── */
.input-group { margin-bottom: 16px; }
.input-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.input-field {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: all 0.2s;
  outline: none;
}
.input-field:focus {
  border-color: var(--amber);
  box-shadow: var(--shadow-glow);
  background: #fff;
}
.input-with-unit {
  position: relative;
}
.input-with-unit .input-field { padding-right: 50px; }
.input-unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.select-field {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}
.select-field:focus {
  border-color: var(--amber);
  box-shadow: var(--shadow-glow);
}

/* ── Checkbox ── */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--amber);
  cursor: pointer;
}
.checkbox-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ── Result Card ── */
.result-hero {
  background: var(--bg-result);
  border: none;
  color: white;
  text-align: center;
  padding: 28px 20px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(255,140,66,0.25);
}
.result-hero .result-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.85;
  margin-bottom: 4px;
}
.result-hero .result-value {
  font-size: 2.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1.1;
}
.result-hero .result-unit {
  font-size: 1rem;
  opacity: 0.8;
  margin-top: 2px;
}

/* ── Result Grid ── */
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.result-item {
  background: var(--bg-input);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.result-item .ri-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.result-item .ri-value {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.result-item .ri-value.green { color: var(--green); }
.result-item .ri-value.amber { color: var(--amber-dark); }

/* ── Bags Table ── */
.bags-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
.bags-table th, .bags-table td {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.bags-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bags-table td {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.bags-table tr:last-child td { border-bottom: none; }
.bags-table .highlight {
  background: rgba(255,140,66,0.06);
  font-weight: 600;
  color: var(--amber-dark);
}

/* ── SVG Diagram ── */
.diagram-container {
  text-align: center;
  padding: 20px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.diagram-container svg {
  max-width: 200px;
  height: auto;
  margin: 0 auto;
}

/* ── Other Calculators Grid ── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 24px 0 40px;
}
.calc-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.25s;
}
.calc-link:hover {
  border-color: var(--amber-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.calc-link svg { width: 36px; height: 36px; color: var(--amber); flex-shrink: 0; }
.calc-link strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text-primary);
}
.calc-link span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── FAQ ── */
.faq-section { margin: 40px 0; }
.faq-section h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.faq-item:hover { box-shadow: var(--shadow-sm); }
.faq-q {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--amber);
  font-weight: 300;
  transition: transform 0.2s;
}
.faq-item.open .faq-q::after {
  content: '−';
  transform: rotate(180deg);
}
.faq-a {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
  transition: max-height 0.3s, padding 0.3s;
}
.faq-item.open .faq-a {
  max-height: 400px;
  padding: 0 20px 16px;
}

/* ── Content Section ── */
.content-section {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 24px;
}
.content-section h2 {
  font-size: 1.3rem;
  margin: 32px 0 12px;
  color: var(--text-primary);
}
.content-section h3 {
  font-size: 1.1rem;
  margin: 24px 0 8px;
  color: var(--text-primary);
}
.content-section p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}
.content-section ul, .content-section ol {
  margin: 12px 0 16px 24px;
  color: var(--text-secondary);
}
.content-section li {
  margin-bottom: 8px;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ── Footer ── */
.footer {
  background: var(--text-primary);
  color: rgba(250,247,242,0.7);
  padding: 32px 24px;
  margin-top: 60px;
  font-size: 0.85rem;
  text-align: center;
}
.footer strong { color: var(--text-on-dark); }
.footer-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-links a { color: rgba(250,247,242,0.5); }
.footer-links a:hover { color: var(--amber); }

/* ── Blog Card ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 32px 0;
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.25s;
}
.blog-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  text-decoration: none;
}
.blog-card-img {
  height: 160px;
  background: var(--bg-hero);
  display: flex;
  align-items: center;
  justify-content: center;
}
.blog-card-img svg { width: 48px; height: 48px; color: var(--amber); }
.blog-card-body { padding: 20px; }
.blog-card-body h3 {
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.blog-card-body p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.blog-card-meta {
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .calc-layout {
    grid-template-columns: 1fr;
    margin-top: -24px;
  }
  .page-hero { padding: 36px 20px 60px; }
  .shape-selector { grid-template-columns: repeat(3, 1fr); }
  .result-grid { grid-template-columns: 1fr; }
  .input-row { grid-template-columns: 1fr; }
  .result-hero .result-value { font-size: 2.2rem; }
}

@media (max-width: 480px) {
  .shape-selector { grid-template-columns: repeat(2, 1fr); }
}

/* ── Print ── */
@media print {
  .nav, .hamburger, .mobile-menu, .footer, .faq-section { display: none; }
  .page-hero { background: #eee !important; color: #000 !important; }
  .result-hero { background: #eee !important; color: #000 !important; box-shadow: none; }
}

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }
