/* ===================================================
   HomeCalc.uk — Shared Stylesheet
   Adapted from gardencalc.uk design system
   =================================================== */

:root {
  --stone: #2C2C2C;
  --stone-light: #3D3D3D;
  --brick: #8B4513;
  --brick-bright: #A0522D;
  --brick-pale: #DEB887;
  --cream: #FDFAF3;
  --cream-dark: #F5F0E3;
  --warm: #FFF8E1;
  --text: #2C2C2C;
  --text-soft: #5A5A5A;
  --text-muted: #8A8A8A;
  --border: #E0DDD4;
  --shadow: rgba(44, 44, 44, 0.08);
  --shadow-deep: rgba(44, 44, 44, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', -apple-system, sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
header {
  background: var(--stone);
  color: white;
  position: relative;
  overflow: hidden;
}
header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(139, 69, 19, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(160, 82, 45, 0.12) 0%, transparent 50%);
  pointer-events: none;
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
  position: relative;
}
.site-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  color: var(--brick-pale);
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-brand a {
  color: var(--brick-pale);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-brand svg { width: 22px; height: 22px; }

nav.calc-nav {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
nav.calc-nav a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
nav.calc-nav a:hover,
nav.calc-nav a.active { color: var(--brick-pale); }

.hero { padding-bottom: 2.5rem; }
.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  color: white;
}
.hero h1 span { color: var(--brick-bright); }
.hero p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 560px;
  font-weight: 300;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--brick); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.4rem; }

/* ===== MAIN ===== */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ===== HOMEPAGE GRID ===== */
.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--stone);
  margin-bottom: 1.5rem;
  margin-top: 2.5rem;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.calc-link {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 3px var(--shadow), 0 8px 32px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: block;
}
.calc-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow), 0 12px 40px rgba(44, 44, 44, 0.12);
  border-color: var(--brick);
}
.calc-link .icon { font-size: 2rem; margin-bottom: 0.75rem; }
.calc-link h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--stone);
  margin-bottom: 0.5rem;
}
.calc-link p { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 1rem; }
.calc-link .cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brick);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
.badge-live { background: rgba(139, 69, 19, 0.12); color: var(--brick); }
.badge-new { background: rgba(160, 82, 45, 0.15); color: var(--brick-bright); }

/* ===== CALCULATOR CARD ===== */
.calc-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px var(--shadow), 0 8px 32px var(--shadow);
  padding: 2.5rem;
  margin-bottom: 3rem;
  border: 1px solid var(--border);
  margin-top: 2rem;
}
.calc-card h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: var(--stone);
}
.calc-subtitle {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

/* ===== FORM ELEMENTS ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.form-group { display: flex; flex-direction: column; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}
.form-group input,
.form-group select {
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--cream);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%235A5A5A' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brick);
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.12);
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group .hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ===== CALCULATE BUTTON ===== */
.calc-button {
  margin-top: 2rem;
  width: 100%;
  padding: 1rem;
  background: var(--brick);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}
.calc-button:hover { background: var(--brick-bright); }
.calc-button:active { transform: scale(0.99); }

/* ===== RESULTS ===== */
.results {
  display: none;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.results.visible { display: block; }
.results-header {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: var(--stone);
  margin-bottom: 1.25rem;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.result-item {
  background: var(--warm);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
  border: 1px solid rgba(139, 69, 19, 0.15);
}
.result-item .label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.result-item .value {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem;
  color: var(--stone);
  line-height: 1.2;
}
.result-item .unit {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  color: var(--text-soft);
  font-weight: 400;
}
.result-note {
  background: var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.6;
  border-left: 3px solid var(--brick);
}
.result-note strong { color: var(--text); }

/* ===== EMAIL CAPTURE ===== */
.email-capture {
  background: var(--stone);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-bottom: 3rem;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.email-capture::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(139, 69, 19, 0.2) 0%, transparent 70%);
  pointer-events: none;
}
.email-capture h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  position: relative;
}
.email-capture p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}
.email-form {
  display: flex;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.email-form input {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
}
.email-form input::placeholder { color: rgba(255, 255, 255, 0.4); }
.email-form input:focus {
  outline: none;
  border-color: var(--brick-pale);
  background: rgba(255, 255, 255, 0.15);
}
.email-form button {
  padding: 0.85rem 1.5rem;
  background: var(--brick-bright);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.email-form button:hover { background: var(--brick); }
.email-note {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.75rem;
  position: relative;
}

/* ===== CONTENT SECTIONS ===== */
.content-section { margin-bottom: 3rem; }
.content-section h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--stone);
  margin-bottom: 1rem;
}
.content-section h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--stone-light);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.content-section p {
  color: var(--text-soft);
  margin-bottom: 1rem;
  max-width: 680px;
}

/* ===== DATA TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.data-table thead { background: var(--stone); color: white; }
.data-table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.data-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
}
.data-table tbody tr:hover { background: var(--warm); }

/* ===== FAQ ===== */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}
.faq-answer { color: var(--text-soft); max-width: 680px; }

/* ===== RELATED CALCULATORS ===== */
.related-section { margin-bottom: 3rem; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.related-link {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.related-link:hover { border-color: var(--brick); transform: translateY(-1px); }
.related-link .rel-icon { font-size: 1.5rem; }
.related-link .rel-title { font-weight: 600; font-size: 0.9rem; color: var(--stone); }
.related-link .rel-desc { font-size: 0.8rem; color: var(--text-muted); }

/* ===== FOOTER ===== */
footer {
  background: var(--stone);
  color: rgba(255, 255, 255, 0.5);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}
footer a { color: var(--brick-pale); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .calc-card { padding: 1.5rem; }
  .form-grid { grid-template-columns: 1fr; gap: 1rem; }
  .email-form { flex-direction: column; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .email-capture { padding: 2rem 1.5rem; }
  .calc-grid { grid-template-columns: 1fr; gap: 1rem; }
}
