/* Safe Drone Academy -- Open Category Flight Guide
   Brand: red #DA0A36, charcoal #262626, white, light grey #F7F7F9
   Headings: Poppins. Body/buttons: Noto Sans JP. */

:root {
  --red: #da0a36;
  --red-dark: #b50a2d;
  --charcoal: #262626;
  --grey-bg: #f7f7f9;
  --grey-border: #e2e2e7;
  --grey-text: #5c5c66;
  --white: #ffffff;
  --green: #2a7a4b;
  --green-bg: #eaf5ee;
  --amber: #9a6400;
  --amber-bg: #fbf1dc;
  --focus: #1457b8;
  --radius: 10px;
  --max-width: 1040px;
  --font-head: 'Poppins', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Noto Sans JP', 'Segoe UI', Arial, sans-serif;
  --shadow-sm: 0 1px 2px rgba(38, 38, 38, 0.08);
  --shadow-md: 0 6px 20px rgba(38, 38, 38, 0.10);
}

@media (prefers-reduced-motion: no-preference) {
  :root { --transition: 160ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --transition: 0ms; }
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
@media (prefers-reduced-motion: no-preference) {
  html:focus-within { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.55;
  font-size: 1rem;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--charcoal);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; }
a { color: var(--red-dark); }
a:hover { color: var(--red); }

img, svg { max-width: 100%; }

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--charcoal);
  color: var(--white);
  padding: 0.75em 1.25em;
  border-radius: 0 0 8px 0;
  z-index: 1000;
}
.skip-link:focus {
  left: 0;
  top: 0;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--grey-border);
  background: var(--white);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: none;
  padding: 0.9rem 2rem;
}
.site-header .logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.site-header img.logo {
  height: 42px;
  width: auto;
  display: block;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--charcoal);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--red);
}
.header-cart {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--white);
  color: var(--red);
  box-shadow: 0 2px 8px rgba(38, 38, 38, 0.2);
}
.header-cart svg { width: 19px; height: 19px; }
.header-cart:hover { color: var(--red-dark); }

/* ---- Hero ---- */
.hero {
  background: var(--white);
  padding: 0 0 2.5rem;
  text-align: center;
}
.hero-image {
  position: relative;
  width: 100%;
  height: clamp(260px, 40vw, 520px);
  overflow: hidden;
}
.hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-banner-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: min(640px, 85%);
  background: var(--red);
  padding: 0.5em 0.9em;
  text-align: center;
}
.hero-banner-overlay h1 {
  color: var(--white);
  margin: 0;
  font-size: clamp(1.5rem, 4.2vw, 2.5rem);
}
.hero-footer {
  max-width: 760px;
  padding-top: 2rem;
}
.hero-footer .note {
  font-size: 0.92rem;
  color: var(--grey-text);
  max-width: 56ch;
  margin: 1.25rem auto 0;
}
/* Reference page still uses a simple text-only hero (no banner image) */
.hero .container { max-width: 760px; }
.hero p.sub {
  font-size: 1.1rem;
  color: var(--grey-text);
  margin-left: auto;
  margin-right: auto;
}
.hero:not(:has(.hero-image)) { padding: 3rem 0 2.5rem; }

.section-kicker {
  text-align: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  color: var(--charcoal);
  margin: 0 0 0.5rem;
}
.section-kicker.kicker-red { color: var(--red); }

/* ---- Heading size/colour overrides requested for specific sections ---- */
#how-it-works-heading,
#operator-heading,
#training-heading,
#compare-heading {
  font-size: 1.35rem;
}
#legacy-heading,
#other-heading,
#faq-heading {
  text-align: center;
  color: var(--red);
}
#zones2-heading { color: var(--red); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover { background: var(--red-dark); color: var(--white); }
.btn-secondary {
  background: var(--white);
  color: var(--charcoal);
  border-color: var(--grey-border);
}
.btn-secondary:hover { border-color: var(--charcoal); }
.btn-text {
  background: none;
  border: none;
  color: var(--red-dark);
  font-weight: 700;
  padding: 0.5em 0.25em;
  text-decoration: underline;
}
.btn-text:hover { color: var(--red); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.btn-row .btn { flex: 1 1 260px; text-align: center; }

.zones-layout {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.zones-text { flex: 1 1 320px; }
.zones-image-link {
  flex: 0 1 300px;
  display: block;
  align-self: center;
}
.zones-image-link img {
  display: block;
  width: 100%;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
}

/* ---- Entry choice cards ---- */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}
.choice-card {
  display: block;
  text-align: left;
  background: var(--white);
  border: 2px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.choice-card:hover { border-color: var(--red); box-shadow: var(--shadow-sm); }
.choice-card[aria-pressed="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}
.choice-card .choice-icon { margin-bottom: 0.75rem; }
.choice-card h3 { margin-bottom: 0.35rem; }
.choice-card p { margin: 0; color: var(--grey-text); font-size: 0.95rem; }
.choice-card-badged { display: flex; align-items: flex-start; gap: 1rem; }
.choice-card-badged > div { min-width: 0; }

/* ---- Class label badges (what to look for on the drone itself) ---- */
.class-badge-legend {
  overflow-x: auto;
  margin: 0 0 1.25rem;
}
.class-badge-legend svg { height: 60px; width: auto; display: block; }
.option-badge {
  flex-shrink: 0;
  width: 52px;
  height: 32px;
  display: inline-flex;
}
.option-badge svg { width: 100%; height: 100%; display: block; }

/* ---- Guide / wizard ---- */
.guide-section { padding: 2.5rem 0 3.5rem; }
.guide-shell {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}
@media (max-width: 560px) {
  .guide-shell { padding: 1.25rem; }
}

.progress-wrap {
  margin-bottom: 1.5rem;
}
.progress-label {
  font-size: 0.85rem;
  color: var(--grey-text);
  margin-bottom: 0.4rem;
  display: block;
}
.progress-track {
  height: 8px;
  background: var(--grey-bg);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 999px;
  transition: width var(--transition);
}

.step-question {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.step-help {
  color: var(--grey-text);
  margin-bottom: 1.25rem;
}

.option-list {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 2px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font: inherit;
  font-weight: 600;
  color: var(--charcoal);
  cursor: pointer;
  min-height: 48px;
  transition: border-color var(--transition), background var(--transition);
}
.option-btn:hover { border-color: var(--red); }
.option-btn .hint {
  font-weight: 400;
  color: var(--grey-text);
  font-size: 0.88rem;
}
.option-list-badged .option-btn { justify-content: flex-start; }
.option-list-badged .option-btn .hint { margin-left: auto; padding-left: 0.5rem; }

.why-details {
  background: var(--grey-bg);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.5rem;
}
.why-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--red-dark);
}
.why-details summary::marker { color: var(--red); }
.why-details p { margin: 0.6rem 0 0; color: var(--grey-text); }
.why-links { font-size: 0.92rem; }

.step-image {
  margin: 0 0 1.25rem;
  padding: 0;
}
.step-image img {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
}
.step-image figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--grey-text);
  margin-top: 0.5rem;
}

.info-list {
  margin: 0 0 1.5rem;
  padding-left: 1.9rem;
  color: var(--grey-text);
}
.info-list li { margin-bottom: 0.5rem; }

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  border-top: 1px solid var(--grey-border);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}
.wizard-actions .spacer { flex: 1 1 auto; }

.answer-trail {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--grey-text);
}
.answer-trail button { font-size: 0.85rem; }

/* ---- Results ---- */
.result-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.result-banner.is-ok { background: var(--green-bg); border: 1px solid #bfe2cc; }
.result-banner.is-check { background: var(--amber-bg); border: 1px solid #ecd49a; }
.result-banner.is-specific { background: var(--grey-bg); border: 1px solid var(--grey-border); }
.result-banner h2 { margin-bottom: 0.25rem; }
.result-banner .badge {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.3em 0.7em;
  border-radius: 8px;
  color: var(--white);
  background: var(--charcoal);
  flex-shrink: 0;
}
.result-banner.is-ok .badge { background: var(--green); }
.result-banner.is-check .badge { background: var(--amber); color: var(--white); }
.result-banner.is-specific .badge { background: var(--red); }

.checklist {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}
.check-card {
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.check-card h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
}
.check-card .status-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.status-pill.required { background: #fde2e8; color: #9a0f33; }
.status-pill.not-required { background: var(--green-bg); color: var(--green); }
.status-pill.check { background: var(--amber-bg); color: var(--amber); }
.status-pill.optional { background: var(--grey-bg); color: var(--grey-text); }
.check-card ul { margin: 0.5rem 0 0; padding-left: 1.9rem; }
.check-card li { margin-bottom: 0.4rem; }

.conditional-box {
  background: var(--amber-bg);
  border: 1px solid #ecd49a;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.conditional-box h3 { color: var(--amber); font-size: 1rem; margin-bottom: 0.5rem; }
.conditional-box ul { margin: 0; padding-left: 1.9rem; }

.answers-summary {
  margin: 2rem 0;
  border-top: 1px dashed var(--grey-border);
  padding-top: 1.25rem;
}
.answers-summary dl {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
}
.answers-summary dt { color: var(--grey-text); }
.answers-summary dd { margin: 0; font-weight: 600; }

/* ---- Static explainer sections ---- */
.explain-section { padding: 2.5rem 0; }
.explain-section.alt-bg { background: var(--grey-bg); }
.explain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.full-width-card { margin-top: 1.5rem; }
.full-width-card p { max-width: none; }
.full-width-text { max-width: none; }
.explain-grid > .diagram-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
}
.explain-grid > .diagram-wrap svg { height: 100%; width: auto; max-width: 100%; }
.operator-section p, .operator-section li { max-width: none; }
.operator-section h4 { margin: 1.5rem 0 0.5rem; font-size: 1.05rem; }
.operator-diagram {
  display: flex;
  justify-content: center;
  margin: 2rem 0 0.5rem;
}
.operator-diagram svg { height: 280px; width: auto; max-width: 100%; }
.operator-section .section-gap { margin-top: 2.5rem; }
.full-width-card.rules-box { margin-top: 2.5rem; }
.specific-category-box {
  background: var(--amber-bg);
  border-color: #ecd49a;
}
.specific-category-box h3 { color: var(--amber); }
.rule-diagram-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}
.rule-diagram-row .diagram-wrap {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rule-diagram-row .diagram-wrap svg { height: 100%; width: auto; max-width: 100%; }
.diagram-caption {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--grey-text);
  margin: 0.5rem 0 0;
}
@media (max-width: 640px) {
  .rule-diagram-row { grid-template-columns: repeat(2, 1fr); }
}
.explain-card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.explain-card .diagram-wrap {
  height: 140px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.explain-card .diagram-wrap svg { height: 100%; width: auto; max-width: 100%; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  background: var(--white);
}
.compare-table caption { text-align: left; font-weight: 700; margin-bottom: 0.75rem; }
.compare-table th, .compare-table td {
  border: 1px solid var(--grey-border);
  padding: 0.75rem 0.9rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
}
.compare-table thead th { background: var(--grey-bg); font-family: var(--font-head); }
.compare-table tbody th { white-space: nowrap; }
.compare-table tbody th p { white-space: normal; }

.table-scroll { overflow-x: auto; margin-top: 1.5rem; -webkit-overflow-scrolling: touch; }
.table-scroll .compare-table { margin-top: 0; }

/* ---- Interactive qualification stage guide ---- */
.qual-stage-list { margin-top: 1.75rem; }
.qual-stage {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.qual-stage summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
}
.qual-stage summary::-webkit-details-marker { display: none; }
.qual-stage summary::before {
  content: '+';
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--grey-bg);
  color: var(--red);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.qual-stage[open] summary::before { content: '\2212'; }
.qual-stage-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--red);
}
.qual-stage-body { margin-top: 1rem; }
.qual-stage-summary-text { color: var(--grey-text); max-width: none; }
.qual-stage-items { margin: 0.75rem 0 0; padding-left: 1.9rem; }
.qual-stage-items li { margin-bottom: 0.5rem; }
.qual-stage-items .status-pill {
  margin-left: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: inline-block;
}
.qual-stage-items .status-pill.required { background: #fde2e8; color: #9a0f33; }
.qual-stage-items .status-pill.optional { background: var(--grey-bg); color: var(--grey-text); }
.qual-stage-items .status-pill.recommended { background: var(--amber-bg); color: var(--amber); }
.qual-stage .conditional-box { margin: 1rem 0 0; }
.qual-stage .conditional-box p { max-width: none; }
.qual-stage-course-link { margin: 1rem 0 0; }

/* ---- FAQ ---- */
.faq-list { margin-top: 1.5rem; }
.faq-item {
  border-bottom: 1px solid var(--grey-border);
  padding: 0.9rem 0;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-head);
  font-size: 1.02rem;
}
.faq-item p { margin-top: 0.6rem; color: var(--grey-text); }

/* ---- Contact / sources ---- */
.contact-box, .sources-box {
  background: var(--grey-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.notes-box {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}
.notes-box p { font-size: 0.95rem; max-width: none; }
.notes-box strong { color: var(--red-dark); }
.notes-box ul { font-size: 0.95rem; margin: 0.5rem 0 1.25rem; }
.sources-box ul { padding-left: 1.9rem; }
.sources-box li { margin-bottom: 0.4rem; }
.review-note {
  font-size: 0.85rem;
  color: var(--grey-text);
  margin-top: 1rem;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--grey-border);
  padding: 2rem 0;
  color: var(--grey-text);
  font-size: 0.88rem;
}
.site-footer a { color: var(--grey-text); }
.site-footer p { max-width: none; }
.site-footer .footer-links { display: flex; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; margin-top: 0.5rem; }

/* ---- Utility ---- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.text-muted { color: var(--grey-text); }
.print-only { display: none; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
[hidden] { display: none !important; }

@media (max-width: 640px) {
  .site-header .container { flex-direction: column; align-items: flex-start; }
  .header-right { width: 100%; justify-content: flex-start; }
  .answers-summary dl { grid-template-columns: 1fr; }
}
