@import url("../vendor/leaflet/leaflet.css");
@import url("../vendor/leaflet-markercluster/MarkerCluster.css");
@import url("../vendor/leaflet-markercluster/MarkerCluster.Default.css");

:root {
  --cloud-white: #f7f4ec;
  --paper-white: #fffefa;
  --warm-paper: #efe9dc;
  --charcoal: #343432;
  --deep-meadow: #344223;
  --deep-sky: #3f6b88;
  --soft-sky: #7fa2be;
  --field-olive: #556324;
  --autumn-rust: #a45c2b;
  --harvest-ochre: #c28a3d;
  --cloud-grey: #d7d4cc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--charcoal);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  background: var(--cloud-white);
}

a { color: var(--deep-sky); text-underline-offset: 0.15em; }
a:hover { color: var(--autumn-rust); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--harvest-ochre);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: -5rem;
  left: 1rem;
  padding: 0.7rem 1rem;
  color: #fff;
  background: var(--deep-meadow);
}
.skip-link:focus { top: 1rem; }

.site-header {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  min-height: 4.2rem;
  padding: 0.7rem max(1rem, calc((100vw - 1180px) / 2));
  background: var(--paper-white);
  border-bottom: 1px solid var(--cloud-grey);
}
.brand {
  color: var(--deep-meadow);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--autumn-rust); font-size: 0.72em; text-transform: uppercase; }
.site-header nav { display: flex; flex: 1; flex-wrap: wrap; gap: 0.9rem; }
.site-header nav a { color: var(--charcoal); font-size: 0.92rem; text-decoration: none; }
.site-header nav a:hover { color: var(--autumn-rust); }
.account { display: flex; align-items: center; gap: 0.65rem; font-size: 0.9rem; }
.account form { margin: 0; }
.link-button {
  padding: 0;
  color: var(--deep-sky);
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
}
.language-switch select {
  width: auto;
  min-width: 7.4rem;
  padding: 0.35rem 1.8rem 0.35rem 0.55rem;
  font-size: 0.86rem;
  background-color: var(--paper-white);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell { width: min(1180px, calc(100% - 2rem)); min-height: 72vh; margin: 0 auto; padding: 2rem 0 4rem; }
.page-heading { max-width: 850px; margin: 1rem 0 2rem; }
.page-heading h1 { margin: 0.1rem 0 0.5rem; color: var(--deep-meadow); font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.08; }
.lead { font-size: 1.15rem; }
.split-heading { display: flex; max-width: none; align-items: flex-start; justify-content: space-between; gap: 2rem; }

.hero {
  padding: clamp(2rem, 7vw, 5rem);
  color: #fff;
  background: linear-gradient(118deg, var(--deep-meadow), var(--deep-sky));
  border-radius: 1.2rem;
  box-shadow: 0 18px 48px rgb(52 52 50 / 14%);
}
.hero.compact { margin: 1rem 0 2.5rem; }
.hero h1 { max-width: 780px; margin: 0; color: #fff; font-size: clamp(2.3rem, 6vw, 4.5rem); line-height: 1; }
.hero p:not(.eyebrow) { max-width: 740px; font-size: 1.08rem; }

.eyebrow { margin: 0 0 0.75rem; color: #fff; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow.dark { color: var(--autumn-rust); }

h1, h2, h3 { color: var(--deep-meadow); line-height: 1.2; }
h2 { padding-bottom: 0.3rem; border-bottom: 1px solid var(--cloud-grey); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin: 1.5rem 0 3rem; }
.card, .resource-row, .version-card, .form-card, .metadata, .prose-block, .comment {
  background: var(--paper-white);
  border: 1px solid var(--cloud-grey);
  border-radius: 0.8rem;
}
.card { padding: 1.25rem; }
.card h2 { border: 0; }

.stack { display: grid; gap: 1rem; }
.compact-stack { gap: 0.6rem; }
.resource-row, .version-card { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.25rem; }
.resource-row h2, .resource-row h3, .version-card h3 { margin: 0.35rem 0; border: 0; }
.tag { display: inline-block; padding: 0.18rem 0.55rem; color: var(--deep-meadow); font-size: 0.78rem; font-weight: 700; background: #e5ead5; border-radius: 999px; }
.mini-meta { display: grid; grid-template-columns: auto auto; flex: 0 0 260px; gap: 0.2rem 0.8rem; margin: 0; font-size: 0.86rem; }
.mini-meta dt { color: var(--deep-meadow); font-weight: 700; }
.mini-meta dd { margin: 0; }

.metadata { display: grid; grid-template-columns: minmax(10rem, 0.35fr) 1fr; gap: 0.6rem 1rem; padding: 1.25rem; }
.metadata dt { color: var(--deep-meadow); font-weight: 700; }
.metadata dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.prose-block { min-height: 10rem; margin-bottom: 1rem; padding: 1.25rem; }

.form-card { max-width: 850px; padding: clamp(1.1rem, 3vw, 2rem); }
.form-card.narrow { max-width: 540px; }
.compact-form { margin-top: 1rem; padding: 1rem; }
.field, .form-card p { margin: 0 0 1.2rem; }
label { display: block; margin-bottom: 0.35rem; color: var(--deep-meadow); font-weight: 700; }
input, textarea, select {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem;
  color: var(--charcoal);
  font: inherit;
  background: var(--paper-white);
  border: 1px solid #777;
  border-radius: 0.35rem;
}
input[type="file"] { padding: 0.4rem; }
.help, .muted { color: #666; font-size: 0.88rem; }
.errorlist { color: #8b3217; font-weight: 700; }

.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1.2rem; }
.button {
  display: inline-block;
  padding: 0.7rem 1rem;
  color: #fff;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  background: var(--deep-sky);
  border: 1px solid var(--deep-sky);
  border-radius: 0.4rem;
  cursor: pointer;
}
.button:hover { color: #fff; background: #325771; }
.button.secondary { color: var(--deep-meadow); background: var(--paper-white); border-color: var(--field-olive); }
.button.secondary:hover { background: var(--warm-paper); }

.notice, .messages {
  padding: 1rem 1.2rem;
  background: var(--warm-paper);
  border-left: 0.35rem solid var(--harvest-ochre);
}
.messages { width: min(1180px, calc(100% - 2rem)); margin: 1rem auto; }
.messages p { margin: 0; }
.comment { padding: 1rem; border-left: 0.35rem solid var(--soft-sky); }
.comment p { margin-top: 0; }
code { overflow-wrap: anywhere; }
.report { max-width: 850px; margin: 0 auto; }

footer { padding: 2rem max(1rem, calc((100vw - 1180px) / 2)); color: var(--cloud-white); background: var(--deep-meadow); }
footer p { margin: 0.25rem 0; }

@media (max-width: 800px) {
  .site-header, .split-heading, .resource-row, .version-card { align-items: stretch; flex-direction: column; }
  .site-header nav { order: 3; }
  .two-column { grid-template-columns: 1fr; }
  .mini-meta { flex-basis: auto; }
}

@media (max-width: 560px) {
  .metadata { grid-template-columns: 1fr; }
  .page-shell { width: min(100% - 1rem, 1180px); }
}

@media print {
  .site-header, footer, .no-print { display: none; }
  .page-shell { width: 100%; padding: 0; }
}


/* SEA structured input-gathering workflow */
.form-section,
.readiness-panel {
  margin: 0 0 1.5rem;
  padding: clamp(1rem, 3vw, 1.6rem);
  background: var(--paper-white);
  border: 1px solid var(--cloud-grey);
  border-radius: 0.8rem;
}
.form-section legend {
  padding: 0 0.5rem;
  color: var(--deep-meadow);
  font-size: 1.35rem;
  font-weight: 800;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.2rem;
}
.form-grid .field-wide { grid-column: 1 / -1; }
.repeatable-grid { display: grid; gap: 1rem; }
.repeatable-card {
  padding: 1.1rem;
  background: #fbfaf5;
  border: 1px solid var(--cloud-grey);
  border-radius: 0.65rem;
}
.repeatable-card h3 { margin-top: 0; }
.delete-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.delete-field label { margin: 0; }
.delete-field input[type="checkbox"] { width: auto; order: -1; }
.readiness-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.readiness-heading h2 { margin: 0; border: 0; }
.readiness-heading strong,
.readiness-score { color: var(--deep-meadow); font-size: 1.5rem; }
progress {
  width: 100%;
  height: 0.9rem;
  accent-color: var(--field-olive);
}
.status-ok { color: var(--field-olive); font-weight: 700; }
.sticky-actions {
  position: sticky;
  z-index: 4;
  bottom: 0;
  padding: 0.8rem;
  background: rgb(247 244 236 / 94%);
  border-top: 1px solid var(--cloud-grey);
}
.intake-summary { margin-bottom: 1.5rem; }
.compact-metadata { margin-top: 1rem; padding: 0; border: 0; }
.report-wide { max-width: 1180px; }
.table-wrap { max-width: 100%; margin: 0 0 1.5rem; overflow-x: auto; }
.report-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.report-table th,
.report-table td {
  padding: 0.65rem;
  border: 1px solid var(--cloud-grey);
  text-align: left;
  vertical-align: top;
}
.report-table th { color: var(--deep-meadow); background: var(--warm-paper); }



@media (max-width: 800px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field-wide { grid-column: auto; }
  .readiness-heading { align-items: flex-start; }
}

/* Integrity-checked rich hromada-profile artifacts */
.rich-profile-section { margin: 2rem 0 3rem; }
.profile-map-shell {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(18rem, 1fr);
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.profile-leaflet-map {
  width: 100%;
  min-height: 38rem;
  height: min(72vh, 46rem);
  background:
    linear-gradient(rgb(255 254 250 / 82%), rgb(255 254 250 / 82%)),
    repeating-linear-gradient(0deg, transparent 0 39px, rgb(63 107 136 / 9%) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgb(63 107 136 / 9%) 39px 40px);
  border: 1px solid var(--cloud-grey);
  border-radius: 0.8rem;
}
.profile-leaflet-map:focus-visible {
  outline: 3px solid var(--harvest-ochre);
  outline-offset: 3px;
}
.profile-leaflet-map .leaflet-control-zoom a {
  width: 1.85rem;
  height: 1.85rem;
  line-height: 1.75rem;
  color: var(--deep-meadow);
}
.profile-layer-panel {
  min-width: 0;
  max-height: min(72vh, 46rem);
  padding: 1rem;
  overflow-y: auto;
  background: var(--paper-white);
  border: 1px solid var(--cloud-grey);
  border-radius: 0.8rem;
}
.profile-layer-panel > h3 { margin-top: 0; }
.profile-basemap-control {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0 0 0.75rem;
  padding: 0.65rem;
  border: 1px solid var(--cloud-grey);
  border-radius: 0.45rem;
}
.profile-basemap-control legend {
  padding: 0 0.25rem;
  color: var(--deep-meadow);
  font-weight: 700;
}
.profile-basemap-control label,
.profile-layer-heading {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
}
.profile-map-status {
  min-height: 1.8rem;
  padding: 0.35rem 0;
}
.profile-layer-group {
  margin: 0.75rem 0;
  border-top: 1px solid var(--cloud-grey);
}
.profile-layer-group h4 { margin: 0; padding: 0.7rem 0 0.35rem; }
.profile-layer-row {
  margin: 0 0 0.6rem;
  padding: 0.65rem;
  background: var(--warm-paper);
  border-radius: 0.45rem;
}
.profile-layer-heading > input { margin-top: 0.25rem; }
.profile-layer-heading > label {
  display: grid;
  flex: 1;
  gap: 0.05rem;
  cursor: pointer;
}
.profile-feature-count,
.profile-layer-sources,
.profile-popup-sources {
  color: #666;
  font-size: 0.78rem;
}
.profile-layer-sources {
  margin: 0.35rem 0;
  overflow-wrap: anywhere;
}
.profile-opacity {
  display: grid;
  grid-template-columns: auto minmax(6rem, 1fr);
  gap: 0.55rem;
  align-items: center;
  margin: 0.35rem 0;
  font-size: 0.82rem;
}
.profile-opacity input { width: 100%; accent-color: var(--field-olive); }
.profile-layer-legend {
  display: grid;
  gap: 0.2rem;
  margin: 0.4rem 0;
  padding: 0;
  font-size: 0.78rem;
  list-style: none;
}
.profile-layer-legend li {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.profile-legend-symbol {
  display: inline-block;
  flex: 0 0 auto;
  width: 1rem;
  height: 0.75rem;
  background: var(--legend-colour);
  border: 1px solid rgb(52 52 50 / 38%);
}
.profile-legend-line {
  height: 0;
  background: transparent;
  border: 0;
  border-top: 3px solid var(--legend-colour);
}
.profile-legend-point {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
}
.profile-layer-download { display: inline-block; margin-top: 0.25rem; font-size: 0.8rem; }
.profile-map-quality { margin-bottom: 0; font-size: 0.82rem; }
.profile-cluster-point {
  background: transparent;
  border: 0;
}
.profile-cluster-point span {
  display: block;
  width: var(--point-size);
  height: var(--point-size);
  background: var(--point-colour);
  border: 1px solid var(--paper-white);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgb(52 52 50 / 45%);
}
.profile-feature-popup {
  max-width: min(24rem, 70vw);
  max-height: 20rem;
  overflow: auto;
}
.profile-feature-popup h4,
.profile-raster-popup h4 { margin: 0 0 0.5rem; }
.profile-feature-popup table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.profile-feature-popup th,
.profile-feature-popup td {
  padding: 0.25rem;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--cloud-grey);
  text-align: left;
  vertical-align: top;
}
.profile-feature-popup th { width: 38%; }
.profile-raster-popup section + section {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--cloud-grey);
}
.profile-raster-popup p { margin: 0.2rem 0; }
.rich-map-gallery,
.rich-download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.rich-map-card {
  margin: 0;
  padding: 0.8rem;
  background: var(--paper-white);
  border: 1px solid var(--cloud-grey);
  border-radius: 0.8rem;
}
.rich-map-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.45rem;
}
.rich-map-card figcaption { padding-top: 0.65rem; }
.rich-download {
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem;
  background: var(--paper-white);
  border: 1px solid var(--cloud-grey);
  border-radius: 0.5rem;
  text-decoration: none;
}
.rich-download span { color: #666; font-size: 0.86rem; }

@media (max-width: 900px) {
  .profile-map-shell { grid-template-columns: 1fr; }
  .profile-leaflet-map { min-height: 26rem; height: 62vh; }
  .profile-layer-panel { max-height: none; }
}
