/* Experimental FAO Design System alignment layer.
   Keep the dashboard's behavior and dense analytical layout in app.css; this
   file supplies the corporate visual anchors and a restrained expressive tier. */

:root {
  --bg: #f2f2f2;
  --card-bg: #ffffff;
  --surface-soft: #f7f8f9;
  --ink: #545454;
  --muted: #66727a;
  --border: #d9e1e8;
  --accent: #116bac;
  --accent-strong: #116bac;
  --shadow: 0 8px 24px rgba(28, 71, 103, 0.08);
  --shadow-soft: 0 2px 8px rgba(28, 71, 103, 0.06);
  --font-ui: "Open Sans", Helvetica, Arial, sans-serif;
  --font-display: "Open Sans", Helvetica, Arial, sans-serif;
  --font-numeric: "Montserrat", "Open Sans", Helvetica, Arial, sans-serif;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--font-ui);
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  color: var(--ink);
  background: var(--bg);
}

.app {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.app > *,
.workspace > * {
  min-width: 0;
  max-width: 100%;
}

/* Corporate anchor: official blue logo, Open Sans title and calmer hierarchy. */
.masthead.fao-header {
  min-height: 82px;
  padding: 10px 22px;
  border: 0;
  border-bottom: 3px solid #116bac;
  background: #fff;
  box-shadow: 0 2px 10px rgba(28, 71, 103, 0.08);
}

.fao-logo-link {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 3px 15px 3px 0;
  border-right: 1px solid #d9e1e8;
}

.fao-logo {
  width: 182px;
  min-height: 44px;
  max-height: 52px;
}

.brand-kicker {
  color: #116bac;
  font-size: 10px;
  letter-spacing: 0.12em;
}

/* The kicker doubles as the link to the DIEM Hub home (standalone only). */
.brand-kicker-link {
  display: inline-block;
  text-decoration: none;
}

.brand-kicker-link:hover,
.brand-kicker-link:focus-visible {
  text-decoration: underline;
}

.brand-title {
  color: #1c4767;
  font-family: var(--font-ui);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Hub-embedded compact heading (see the `.app--embedded` block in app.css).
   Same corporate ink as the standalone title, caption scale. */
.embed-title {
  color: #1c4767;
}

.release-badge {
  border-color: #f58320;
  background: #fff5eb;
  color: #a94c00;
}

.masthead-actions {
  gap: 10px;
}

.language-control,
.survey-field label,
.theme-switcher-group-label,
.panel-header h3,
.map-title-label,
.data-lab-kicker,
.legacy-dashboard-kicker,
.lede-kicker,
.widget-tier-tag {
  color: #1c4767;
  font-weight: 700;
  letter-spacing: 0.075em;
}

.language-control select,
.survey-controls,
.masthead-more summary,
.rsel-menu,
.rsel-button {
  border-radius: 4px;
}

.language-control select,
.survey-controls {
  border-color: #cbd7df;
  background: #fff;
  box-shadow: none;
}

.survey-field + .survey-field {
  border-left-color: #d9e1e8;
}

.survey-field select,
.rsel-button {
  color: #1c4767;
  font-weight: 700;
}

.rsel-button:focus-visible,
.language-control select:focus-visible,
.masthead-more summary:focus-visible,
.theme-button:focus-visible,
.widget-card button:focus-visible,
.fao-dashboard-footer a:focus-visible {
  outline: 3px solid rgba(17, 107, 172, 0.32);
  outline-offset: 2px;
}

.masthead-more summary {
  border-color: #116bac;
  background: #116bac;
  color: #fff;
}

.masthead-more[open] summary,
.masthead-more summary:hover {
  border-color: #1688da;
  background: #1688da;
  color: #fff;
}

.masthead-more-menu {
  border-color: #b8cce2;
  border-radius: 4px;
  box-shadow: 0 14px 32px rgba(28, 71, 103, 0.16);
}

/* Keep themed navigation expressive, but anchor the band in FAO blue. */
.theme-nav {
  border-bottom-color: #b8cce2;
  background: linear-gradient(90deg, #f7f8f9 0%, #e5ecf4 100%);
}

.theme-button {
  border-radius: 4px 4px 0 0;
  color: #545454;
  font-weight: 600;
}

.theme-button:hover {
  background: rgba(255, 255, 255, 0.72);
}

.theme-button--active {
  background: #fff;
  font-weight: 700;
}

.theme-button--lab,
.theme-button--aggregated-data,
.theme-button--household-data {
  background: rgba(255, 255, 255, 0.5);
}

/* Analytical canvas: cleaner FAO surfaces without flattening the interactions. */
.workspace {
  gap: 12px;
  padding: 12px;
  background: #f2f2f2;
}

.map-wrap,
.right-panel,
.legacy-dashboard-view,
.card,
.widget-card,
.data-lab-header,
.trends-header,
.trend-card,
.anomaly-card,
.survey-summary,
.survey-resources,
.survey-design {
  border-color: #d9e1e8;
  border-radius: 5px;
  box-shadow: var(--shadow-soft);
}

.right-panel {
  background: #f7f8f9;
}

.panel-header,
.legacy-dashboard-header {
  background: #e5ecf4;
  border-bottom-color: #b8cce2;
  border-radius: 4px 4px 0 0;
}

.panel-header h3 {
  color: #1c4767;
}

.map-topbar,
.map-field-card,
.map-action-bar {
  border-color: #b8cce2;
  border-radius: 5px;
  box-shadow: 0 8px 22px rgba(28, 71, 103, 0.12);
}

.map-title {
  border-left: 0;
  border-top: 4px solid var(--accent-strong);
  border-radius: 4px;
}

.map-action-bar button,
.see-map-button,
.widget-export-button,
.legacy-dashboard-open {
  border-color: #b8cce2;
  border-radius: 4px;
  color: #116bac;
}

.map-action-bar button:hover,
.see-map-button:hover:not(:disabled),
.widget-export-button:hover:not(:disabled) {
  border-color: #116bac;
  background: #e5ecf4;
  color: #0b4f80;
}

.map-export-primary,
.data-lab-run,
.landing-go,
.team-access-button[data-action="signin"] {
  border-color: #116bac !important;
  background: #116bac !important;
  color: #fff !important;
}

.map-export-primary:hover,
.data-lab-run:hover,
.landing-go:hover,
.team-access-button[data-action="signin"]:hover {
  border-color: #1688da !important;
  background: #1688da !important;
}

.widget-card {
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.widget-card:hover {
  border-color: #b8cce2;
  box-shadow: 0 7px 20px rgba(17, 107, 172, 0.1);
}

.widget-card--hero {
  border-top-color: var(--accent-strong);
  box-shadow: 0 9px 24px rgba(28, 71, 103, 0.1);
}

.widget-card--hero .widget-title,
.lede-header h2,
.legacy-dashboard-header h2,
.data-lab-header h2,
.trends-header h2,
.landing-title {
  color: #1c4767;
  font-family: var(--font-ui);
  font-weight: 700;
}

.lede-card-value,
.trend-stat strong,
.anomaly-stat strong,
.widget-value,
.rt-value {
  font-family: var(--font-numeric);
  font-weight: 700;
}

/* Remove the repeated decorative side-stripe motif Christian flagged. Semantic
   warnings retain their colored edge; general content uses a quieter top cue. */
.lede-panel,
.legacy-survey-methodology,
.widget-card--optional {
  border-left-width: 1px;
}

.lede-panel {
  border-top: 3px solid #116bac;
  background: #fff;
}

.legacy-survey-methodology {
  border-top: 3px solid #116bac;
}

.widget-card--optional {
  border-top: 3px solid #f58320;
  background: #fff8f0;
}

.widget-optional-tag {
  border-color: #f5c28f;
  border-radius: 999px;
  background: #fff1df;
  color: #9a4700;
}

.lede-card {
  border-color: #d9e1e8;
  border-radius: 4px;
  background: #f7f8f9;
}

.lede-card-value,
.lede-kicker,
.widget-tier-tag {
  color: var(--accent-strong);
}

.empty,
.trends-empty,
.anomaly-empty,
.mapless-overlay {
  border-color: #b8cce2;
  background: #e5ecf4;
  color: #1c4767;
}

/* The landing remains high-impact, now using the sanctioned expressive tier. */
.landing {
  background:
    radial-gradient(circle at 82% 18%, rgba(87, 146, 201, 0.3), transparent 34%),
    linear-gradient(135deg, rgba(17, 107, 172, 0.96), rgba(28, 71, 103, 0.98));
}

.landing-card {
  border: 0;
  border-top: 6px solid #f58320;
  border-radius: 6px;
  box-shadow: 0 30px 90px rgba(8, 43, 68, 0.35);
}

.landing-kicker {
  color: #116bac;
}

.landing-theme-tile {
  border-radius: 4px;
}

.landing-theme-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(17, 107, 172, 0.12);
}

/* Mandatory compact FAO app footer, kept within the viewport grid. */
.fao-dashboard-footer.footer.footer-app {
  min-height: 38px;
  margin: 0;
  padding: 6px 18px;
  border-top: 1px solid #b8cce2;
  background: #1c4767;
  color: #fff;
  font-size: 10px;
  line-height: 1.35;
}

.fao-dashboard-footer .container-fluid {
  max-width: none;
  padding: 0;
}

.fao-dashboard-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fao-dashboard-footer .list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 15px;
  margin: 0;
  padding: 0;
}

.fao-dashboard-footer .list-inline-item {
  margin: 0;
}

.fao-dashboard-footer a,
.fao-dashboard-footer .copyright {
  color: #fff;
  text-decoration: none;
}

.fao-dashboard-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.fao-dashboard-footer .copyright {
  flex: 0 0 auto;
  font-weight: 700;
}

@media (max-width: 1280px) {
  .app {
    grid-template-rows: auto auto auto auto;
  }
}

@media (max-width: 900px) {
  .masthead.fao-header {
    padding: 10px 14px;
  }

  .fao-dashboard-footer-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 720px) {
  .fao-logo-link {
    padding-right: 10px;
  }

  .fao-logo {
    width: 150px;
    min-height: 40px;
  }

  .brand-title {
    font-size: 21px;
  }

  .fao-dashboard-footer.footer.footer-app {
    padding: 8px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-theme-tile,
  .widget-card {
    transition: none;
  }

  .landing-theme-tile:hover,
  .widget-card:hover {
    transform: none;
  }
}
