/* MapCheck Maps shell. Tokens follow the v6 report system (templates/v6) and the
   brand logo; fonts are the report's own DM Sans / DM Serif Display (SIL OFL),
   self-hosted (the CSP allows no font CDN). */
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url("/shell/fonts/DMSans-400.ttf") format("truetype"); }
@font-face { font-family: "DM Sans"; font-weight: 500; font-display: swap; src: url("/shell/fonts/DMSans-500.ttf") format("truetype"); }
@font-face { font-family: "DM Sans"; font-weight: 600; font-display: swap; src: url("/shell/fonts/DMSans-600.ttf") format("truetype"); }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url("/shell/fonts/DMSans-700.ttf") format("truetype"); }
@font-face { font-family: "DM Serif Display"; font-weight: 400; font-display: swap; src: url("/shell/fonts/DMSerifDisplay-400.ttf") format("truetype"); }

:root {
  --teal: #213d47;        /* logo outline / "Map" */
  --brown: #8f5e2a;       /* logo "Check" */
  --green: #4a7c3f;
  --green-dark: #2d5a24;
  --green-light: #e8f2e5;
  --grey-900: #1a1e24;
  --grey-700: #374151;
  --grey-500: #6b7280;
  --grey-300: #c8ccd0;
  --grey-200: #e2e4e7;
  --grey-100: #f0f1f3;
  --grey-50: #f8f9fa;
  --header-h: 60px;
  --side-w: 380px;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-display: "DM Serif Display", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--grey-900);
  background: #fff;
  font-size: 14px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
a { color: var(--green-dark); }

/* Header */
.mc-header {
  flex: 0 0 var(--header-h);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  border-bottom: 3px solid var(--green);
  background: #fff;
  z-index: 3;
}
.mc-brand { display: flex; align-items: center; flex: 0 0 auto; }
.mc-brand img { height: 44px; width: auto; display: block; }
.mc-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  color: var(--teal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-credits { flex: 0 0 auto; font-size: 12px; color: var(--grey-500); text-decoration: none; }
.mc-credits:hover { text-decoration: underline; }

/* Layout */
.mc-main { flex: 1 1 auto; display: flex; min-height: 0; position: relative; }
.mc-side {
  flex: 0 0 var(--side-w);
  width: var(--side-w);
  border-right: 1px solid var(--grey-200);
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 2;
}
.mc-side-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.mc-sheet-handle { display: none; }
.mc-map { flex: 1 1 auto; position: relative; min-width: 0; background: var(--grey-100); }
.mc-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.mc-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(248, 249, 250, 0.96); padding: 24px; text-align: center; z-index: 4;
}
.mc-overlay[hidden] { display: none; }
.mc-imagery-note {
  position: absolute; left: 10px; bottom: 34px; z-index: 3; pointer-events: none;
  background: rgba(255, 255, 255, 0.92); color: var(--grey-700); font-size: 12px;
  padding: 4px 9px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.mc-imagery-note[hidden] { display: none; }
.mc-overlay p { max-width: 420px; font-size: 15px; color: var(--grey-700); }

/* Sections */
.mc-section { border-bottom: 1px solid var(--grey-200); }
.mc-section-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: none; border: 0; cursor: pointer;
  font: 600 12px/1 var(--font-body); letter-spacing: 1px; text-transform: uppercase;
  color: var(--green-dark);
}
.mc-chevron { width: 8px; height: 8px; border-right: 2px solid var(--grey-500); border-bottom: 2px solid var(--grey-500); transform: rotate(45deg); transition: transform .15s; margin-top: -4px; }
.mc-section-head[aria-expanded="false"] .mc-chevron { transform: rotate(-45deg); margin-top: 0; }
.mc-section-body { padding: 0 18px 16px; }
.mc-section-head[aria-expanded="false"] + .mc-section-body { display: none; }

.mc-prop-title { font-family: var(--font-display); font-size: 20px; line-height: 1.2; color: var(--teal); margin: 0 0 10px; }
.mc-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 14px; }
.mc-facts dt { color: var(--grey-500); font-size: 12.5px; }
.mc-facts dd { margin: 0; font-size: 13.5px; font-weight: 500; }
.mc-subhead { font: 600 12px/1.2 var(--font-body); color: var(--grey-700); margin: 14px 0 6px; }
.mc-summary { margin: 0; padding-left: 18px; }
.mc-summary li { margin: 0 0 6px; font-size: 13.5px; }
.mc-limit { font-size: 12px; color: var(--grey-500); margin: 12px 0 0; }
.mc-muted { color: var(--grey-500); }

/* Layers */
.mc-layer { padding: 8px 0; border-top: 1px solid var(--grey-100); }
.mc-layer:first-child { border-top: 0; }
.mc-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.mc-toggle input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 10px; background: var(--grey-300); position: relative; flex: 0 0 auto; cursor: pointer; transition: background .15s; margin: 0; }
.mc-toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.mc-toggle input:checked { background: var(--green); }
.mc-toggle input:checked::after { left: 16px; }
.mc-toggle input:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; }
.mc-legend { list-style: none; margin: 6px 0 2px 44px; padding: 0; }
.mc-legend li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--grey-700); margin: 3px 0; }
.mc-sw { flex: 0 0 14px; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.25); margin-top: 2px; }
.mc-sw.line { height: 4px; border: 0; border-radius: 2px; margin-top: 7px; }
.mc-sw.outline { background: transparent; border: 2px solid #e53935; }
.mc-layer-note { font-size: 12px; color: var(--grey-500); margin: 4px 0 0 44px; }

.mc-foot { padding: 14px 18px 18px; font-size: 12px; color: var(--grey-500); }
.mc-foot strong { color: var(--green); font-weight: 600; }

/* Phone: the side panel becomes a bottom sheet over the map. */
@media (max-width: 760px) {
  :root { --header-h: 52px; }
  .mc-header { gap: 10px; padding: 0 12px; }
  .mc-brand img { height: 34px; }
  .mc-title { font-size: 17px; }
  .mc-credits { font-size: 11px; max-width: 74px; line-height: 1.2; text-align: right; }
  .mc-main { flex-direction: column; }
  /* Map sits ABOVE the sheet (not under it), so the property stays centred in the
     part of the map you can see; collapsing the sheet gives the map the space. */
  .mc-map { order: 1; flex: 1 1 auto; min-height: 0; }
  .mc-side {
    order: 2; flex: 0 0 auto; width: auto; max-height: 48%;
    border-right: 0; border-top: 1px solid var(--grey-200);
    border-radius: 14px 14px 0 0; box-shadow: 0 -4px 18px rgba(0,0,0,.18);
    margin-top: -14px; position: relative;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mc-sheet-handle {
    display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%;
    padding: 8px 0 6px; border: 0; background: none; cursor: pointer;
    font: 500 12px/1 var(--font-body); color: var(--grey-500);
  }
  .mc-sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--grey-300); }
  .mc-side.collapsed .mc-side-body { display: none; }
  .mc-section-head { padding: 12px 16px; }
  .mc-section-body { padding: 0 16px 14px; }
}
