/* ============================================================
   Landing page styles for tools/area-calculator.php
   Additive only - reuses the site's base classes (.container,
   .content-section, .form-group, .btn, etc.) and adds the
   visual sections defined in area-calculator.md.
   All page-specific classes are prefixed "ac-" to avoid
   clashing with the site-wide stylesheet.
   ============================================================ */

:root {
  --ac-green: #2e7d32;
  --ac-green-dark: #1b5e20;
  --ac-green-light: #e8f5e9;
  --ac-amber: #ff8f00;
  --ac-border: #e2e8f0;
  --ac-surface: #ffffff;
  --ac-bg: #f8fafc;
  --ac-text: #1e293b;
  --ac-text-light: #64748b;
  --ac-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --ac-radius: 12px;
  --ac-accent-bg: #e3f2fd;
  --ac-orange-bg: #fff3e0;
}

.ac-container {
  max-width: 1100px;
}

.ac-page-shell .content-section,
.ac-page-shell .ac-hero,
.ac-page-shell .ac-unit-card,
.ac-page-shell .ac-why-card,
.ac-page-shell .ac-formula-card {
  background: #ffffff;
}

/* Keep the page containers white without changing the outer page background. */
.ac-page-shell .ac-section > .content-section,
.ac-page-shell .content-section.bhu-fade-in.bhu-visible,
.ac-page-shell .ac-info-block,
.ac-page-shell .ac-dyn-panel,
.ac-page-shell .ac-hero {
  background: #ffffff !important;
}

/* ---------- Section wrappers ---------- */
.ac-section {
  margin-bottom: 32px;
  scroll-margin-top: 90px;
}

.ac-section-heading {
  margin-bottom: 20px;
  text-align: center;
}

.ac-section-heading h2 {
  font-size: 1.5rem;
  color: var(--ac-green-dark);
  margin-bottom: 8px;
}

.ac-section-heading p {
  color: var(--ac-text-light);
  max-width: 680px;
  margin: 0 auto;
  text-wrap: pretty;
}

/* No gold underline under section titles on this page */
.content-section .ac-section-heading h2,
.ac-section-heading h2 {
  border-bottom: none;
  padding-bottom: 0;
  display: block;
}

.ac-section-heading blockquote {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ac-green-dark);
  font-style: normal;
  border-left: none;
  padding-left: 0;
  text-align: center;
  max-width: 680px;
  margin: 12px auto;
}

/* ---------- Hero ---------- */
.ac-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: center;
  background: linear-gradient(135deg, var(--ac-green-light) 0%, #f1f8e9 100%);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  padding: 32px 28px;
  box-shadow: var(--ac-shadow);
  margin-bottom: 32px;
}

.ac-hero-copy h2 {
  font-size: 1.65rem;
  color: var(--ac-green-dark);
  margin-bottom: 8px;
}

.ac-hero-copy > p {
  color: var(--ac-text-light);
  margin-bottom: 16px;
}

.ac-hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.ac-metric {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: 10px;
  padding: 10px 16px;
  text-align: center;
  min-width: 92px;
}

.ac-metric-label {
  display: block;
  font-size: 0.75rem;
  color: var(--ac-text-light);
}

.ac-metric-value {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ac-text);
}

.ac-metric-area {
  border-color: var(--ac-amber);
  background: #fff8e1;
}

.ac-metric-area .ac-metric-value {
  color: var(--ac-amber);
}

.ac-conversion-note {
  font-size: 0.85rem;
}

.ac-cta {
  display: inline-block;
  margin-top: 6px;
}

.ac-hero-visual svg {
  width: 100%;
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: 10px;
}

/* ---------- Calculator form ---------- */
.ac-calc-form .form-row {
  margin-bottom: 14px;
}

.ac-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* ---------- Map iframe ---------- */
.ac-map-section {
  margin-top: 20px;
}

.map-tool-wrap {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  overflow: hidden;
  background: #f1f5f9;
}

.map-tool-frame {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

@media (max-width: 640px) {
  .map-tool-frame { height: 480px; }
}

.ac-iframe-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--ac-text-light);
  text-align: center;
}

/* ---------- Shape cards ---------- */
.ac-shape-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.ac-shape-card {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--ac-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ac-shape-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.ac-shape-visual {
  background: var(--ac-bg);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.ac-shape-visual svg {
  width: 120px;
  margin: 0 auto;
}

.ac-shape-card h3 {
  font-size: 1.05rem;
  color: var(--ac-green-dark);
  margin-bottom: 6px;
}

.ac-shape-card p {
  font-size: 0.85rem;
  color: var(--ac-text-light);
  margin-bottom: 10px;
}

.ac-shape-link {
  color: var(--ac-green);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.ac-shape-link:hover {
  text-decoration: underline;
}

/* ---------- Measure ---------- */
.ac-measure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.ac-measure-visual {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  box-shadow: var(--ac-shadow);
  padding: 12px;
}

.ac-measure-visual svg {
  width: 100%;
  height: auto;
  background: var(--ac-green-light);
  border-radius: 10px;
  padding: 8px;
  display: block;
}

.ac-measure-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ac-measure-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ac-bg);
  border: 1px solid var(--ac-border);
  border-radius: 10px;
  padding: 12px 14px;
}

.ac-measure-icon {
  font-size: 1.2rem;
  background: var(--ac-green-light);
  color: var(--ac-green-dark);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ac-measure-item h3 {
  font-size: 0.98rem;
  color: var(--ac-green-dark);
}

.ac-measure-item p {
  font-size: 0.85rem;
  color: var(--ac-text-light);
}

/* ---------- Units ---------- */
.ac-unit-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}

.ac-unit-root {
  background: var(--ac-green-dark);
  color: #fff;
  border-color: var(--ac-green-dark);
  font-size: 1.05rem;
}

.ac-unit-arrow {
  color: var(--ac-text-light);
  font-weight: 700;
}

.ac-unit-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.ac-unit-card {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  box-shadow: var(--ac-shadow);
  padding: 12px 18px;
  text-align: center;
  min-width: 96px;
}

.ac-unit-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ac-green-dark);
  line-height: 1.2;
}

.ac-unit-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ac-text-light);
  margin-top: 4px;
}

.ac-unit-note {
  font-size: 0.8rem;
  color: var(--ac-text-light);
  text-align: center;
  max-width: none;
  margin: 4px auto 0;
}

@media (min-width: 769px) {
  .ac-unit-note {
    white-space: nowrap;
  }
}

.ac-unit-warn {
  font-size: 0.75rem;
  color: #7f1d1d;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 16px;
  max-width: none;
  margin: 12px auto 0;
}

.ac-unit-warn strong {
  display: inline;
  font-size: .85rem;
  margin-right: 4px;
}

@media (min-width: 769px) {
  .ac-unit-warn {
    white-space: nowrap;
  }
}

/* ---------- Why ---------- */
.ac-why-intro {
  max-width: 900px;
  color: var(--muted, #475569);
  line-height: 1.7;
  margin: 0 0 20px;
}
.ac-why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.ac-why-card {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  padding: 22px 18px;
  text-align: center;
  box-shadow: var(--ac-shadow);
}

.ac-why-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}

.ac-why-card h3 {
  font-size: 1rem;
  color: var(--ac-green-dark);
  margin-bottom: 6px;
}

.ac-why-card p {
  font-size: 0.85rem;
  color: var(--ac-text-light);
}

/* ---------- Checklist ---------- */
.ac-checklist {
  list-style: none;
  max-width: 640px;
  margin: 0 auto 16px;
  padding: 0;
}

.ac-checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ac-bg);
  border: 1px solid var(--ac-border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.ac-check-box {
  color: var(--ac-green);
  font-size: 1.1rem;
}

.ac-disclaimer {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.85rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* ---------- Formula ---------- */
.ac-formula-section {
  text-align: center;
}

.ac-formula-visual svg {
  width: 220px;
  margin: 0 auto 16px;
  background: var(--ac-green-light);
  border-radius: 10px;
  padding: 8px;
}

.ac-formula-equation,
.ac-formula-example {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ac-green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.ac-formula-example {
  font-size: 1.1rem;
  color: var(--ac-text);
}

.ac-eq-symbol {
  color: var(--ac-amber);
}

.ac-example-result {
  background: var(--ac-green-light);
  color: var(--ac-green-dark);
  border-radius: 8px;
  padding: 6px 16px;
}

.ac-formula-cta {
  color: var(--ac-text-light);
  font-size: 0.95rem;
  margin-top: 12px;
}

/* ---------- Story ---------- */
.ac-story-visual {
  text-align: center;
}

.ac-story-visual svg {
  width: 360px;
  max-width: 100%;
  margin: 0 auto 16px;
  background: var(--ac-green-light);
  border-radius: 10px;
  padding: 8px;
}

.ac-story-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ac-text);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ---------- Formula + Story (combined) ---------- */
.ac-formula-story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.ac-formula-card,
.ac-story-card {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  padding: 24px;
  box-shadow: var(--ac-shadow);
  display: flex;
  flex-direction: column;
}

.ac-formula-card .ac-formula-visual,
.ac-story-card .ac-story-visual {
  flex: 1 1 auto;
}

@media (max-width: 768px) {
  .ac-formula-story-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Mistakes table ---------- */
.ac-table-scroll {
  overflow-x: auto;
}

.ac-mistakes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 480px;
}

.ac-mistakes-table th,
.ac-mistakes-table td {
  border: 1px solid var(--ac-border);
  padding: 12px 16px;
  text-align: left;
}

.ac-mistakes-table th {
  background: var(--ac-green-light);
  color: var(--ac-green-dark);
}

.ac-mistakes-table tr:nth-child(even) td {
  background: var(--ac-bg);
}

/* ---------- Tool list ---------- */
.ac-tool-list {
  list-style: none;
  max-width: 640px;
  margin: 0 auto;
  padding: 0;
}

.ac-tool-list li {
  margin-bottom: 10px;
}

.ac-tool-list a {
  display: block;
  background: var(--ac-bg);
  border: 1px solid var(--ac-border);
  border-radius: 10px;
  padding: 13px 18px;
  text-decoration: none;
  color: var(--ac-text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.ac-tool-list a:hover {
  border-color: var(--ac-green);
  background: var(--ac-green-light);
  color: var(--ac-green-dark);
}

/* ---------- FAQ ---------- */
.ac-faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.ac-faq-item {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--ac-shadow);
}

.ac-faq-item summary {
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ac-green-dark);
  list-style-position: inside;
  transition: background 0.2s ease;
}

.ac-faq-item summary:hover {
  background: var(--ac-green-light);
}

.ac-faq-item[open] summary {
  border-bottom: 1px solid var(--ac-border);
  background: var(--ac-green-light);
}

.ac-faq-item p {
  padding: 14px 18px;
  font-size: 0.9rem;
  color: var(--ac-text-light);
}

/* Map section subtitle stays on one line (desktop) */
.ac-map-section .ac-section-heading p {
  max-width: none;
}

@media (min-width: 769px) {
  .ac-map-section .ac-section-heading p {
    white-space: nowrap;
  }
}

/* ---------- Map usage guide ---------- */
.ac-map-guide {
  background: var(--ac-bg);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  padding: 18px 22px;
  margin-bottom: 18px;
  box-shadow: var(--ac-shadow);
}

.ac-map-guide h3 {
  font-size: 1.05rem;
  color: var(--ac-green-dark);
  margin-bottom: 12px;
}

.ac-map-guide ol {
  margin: 0 0 10px;
  padding-left: 22px;
  color: var(--ac-text);
}

.ac-map-guide li {
  margin-bottom: 8px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.ac-map-guide li strong {
  color: var(--ac-green-dark);
}

.ac-map-guide-tip {
  font-size: 0.88rem;
  color: var(--ac-text-light);
  background: var(--ac-green-light);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 0 0;
}

/* ---------- Page title (below breadcrumb) ---------- */
.ac-page-title {
  text-align: center;
  margin: 0 0 26px;
}

.ac-page-title h1 {
  font-size: 1.9rem;
  color: var(--ac-green-dark);
  margin-bottom: 8px;
}

.ac-page-title p {
  font-size: 1.05rem;
  color: var(--ac-text-light);
  max-width: 680px;
  margin: 0 auto;
}

.ac-info-block {
  margin: 18px auto 0;
  max-width: 1100px;
  text-align: left;
  background: var(--ac-bg);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  padding: 20px 24px;
  box-shadow: var(--ac-shadow);
  font-size: 0.95rem;
  color: var(--ac-text);
}

.ac-info-block p {
  margin: 0 0 12px;
  max-width: none;
  color: var(--ac-text);
}

.ac-info-block .ac-info-sub {
  font-size: 1.05rem;
  color: var(--ac-green-dark);
  margin: 16px 0 8px;
}

.ac-info-list {
  margin: 0 0 12px;
  padding-left: 22px;
  list-style: disc;
  color: var(--ac-text);
}

.ac-info-list li {
  margin-bottom: 6px;
}

.ac-info-formula {
  background: var(--ac-green-light);
  color: var(--ac-green-dark);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  margin: 6px 0 14px;
}

.ac-info-example {
  font-weight: 700;
  color: var(--ac-green-dark);
}

/* ---------- Shape picker (cards now select the calculator) ---------- */
.ac-shape-picker {
  margin-bottom: 22px;
}

.ac-shape-hint {
  text-align: center;
  color: var(--ac-text-light);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.ac-shape-card {
  display: block;
  cursor: pointer;
  color: var(--ac-text);
}

.ac-shape-card:hover,
.ac-shape-card.active {
  border-color: var(--ac-green);
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.14);
}

.ac-shape-card.active {
  background: var(--ac-green-light);
}

.ac-shape-card.active .ac-shape-visual {
  background: var(--ac-green-light);
}

/* ---------- Dynamic calculator panels ---------- */
.ac-dyn-wrap {
  margin-top: 8px;
}

.ac-dyn-panel {
  display: none;
  background: var(--ac-bg);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  padding: 24px;
  animation: acPanelIn 0.22s ease;
}

.ac-dyn-panel.active {
  display: block;
}

@keyframes acPanelIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ac-dyn-result {
  margin-top: 18px;
}

.ac-dyn-result .alert-error {
  margin-bottom: 0;
}

.ac-irregular-note {
  margin: 16px 0 12px;
  padding: 12px 14px;
  background: var(--ac-orange-bg);
  border: 1px solid #ffe0b2;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--ac-text);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .ac-shape-grid,
  .ac-why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .ac-hero,
  .ac-measure-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .ac-shape-grid,
  .ac-why-grid {
    grid-template-columns: 1fr;
  }
  .ac-hero {
    padding: 24px 16px;
  }
}