/* =============================================================
   GLOBAL OPERATIONS LANDING PAGE
   Two-panel layout (accordion sidebar + dynamic content) used by
   landing.py. Dash auto-loads every file in assets/ — no import needed.

   NOTE: The §20 LANDING PAGE block below is copied verbatim from
   styles.css so this file is self-contained. styles.css is left
   untouched; duplicates can be removed there manually later.
============================================================= */

/* =============================================================
   §20  LANDING PAGE  (copied from styles.css)
   .landing-page (full-viewport flex column), .landing-header,
   .landing-card (hover-lift), .landing-card-grid, .landing-section
   Used by: landing.py (app root)
============================================================= */
.landing-page {
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem 5rem;
}

/* Header */
.landing-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 3rem;
}

.landing-logo {
  height: 100px;
  width: auto;
  object-fit: contain;
  margin-bottom: 1rem;
}

.landing-subtitle {
  font-size: 0.95rem;
  color: #303030;
  max-width: 800px;
  text-align: center;
  line-height: 1.6;
  margin: 0;
}

.landing-link {
  color: var(--zite-blue, #3f2b80);
  text-decoration: underline;
}

.landing-link:hover {
  color: #912478;
}

.landing-iom-logo {
  position: fixed;
  bottom: 1.25rem;
  right: 1.5rem;
  height: 72px;
  width: auto;
  object-fit: contain;
}

/* Sections */
.landing-sections {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.landing-section-heading {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #303030;
  margin: 0 0 0.75rem;
}

/* Card grid */
.landing-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* Individual card */
.landing-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.85rem 1.25rem;
  border-left: 4px solid #3f2b80;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

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

.landing-card-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.75;
}

.landing-card:hover .landing-card-icon {
  opacity: 1;
}

.landing-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.landing-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #303030;
}

.landing-card-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 640px) {
  .landing-title {
    font-size: 1.5rem;
  }
  .landing-card-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================
   TWO-PANEL OPERATIONS LAYOUT  (new)
============================================================= */
.ops-page {
  position: relative;
  display: flex;
  min-height: 100vh;
  background: var(--bg, #f5f5f5);
}

/* ── Sidebar ───────────────────────────────────────────────── */
.ops-sidebar {
  flex: 0 0 280px;
  width: 280px;
  background: #fff;
  border-right: 1px solid #e7e5f0;
  padding: 1.5rem 0.75rem;
  overflow-y: auto;
  box-shadow: var(--shadow, 0 2px 8px rgba(0, 0, 0, 0.06));
}

/* Brand logo (top-left) — mirrors the main app's .sidebar-brand */
.ops-sidebar-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0 1.25rem;
}

.ops-sidebar-brand .ops-logo {
  height: 95px;
  width: auto;
  object-fit: contain;
  display: block;
}

.ops-nav-section {
  margin-bottom: 0.35rem;
}

.ops-parent-btn {
  font-family: 'Inter', sans-serif;
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--zite-grey);
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius, 12px);
  transition: background 0.15s ease, color 0.15s ease;
}

.ops-parent-btn:hover {
  background: var(--light-grey);
  color: var(--zite-grey, #3f2b80);
}

/* Collapsible sub-link container — accordion (single-open) */
.ops-sublinks {
  display: none;
  flex-direction: column;
  padding: 0.25rem 0 0.25rem;
}

.ops-sublinks.open {
  display: flex;
}

.ops-sublink {
  /* Per-item highlight accent. Defaults to zite-blue; overridden inline via the
     --accent custom property (set from the sheet's `accent` field in landing.yaml). */
  --accent: var(--zite-blue, #3f2b80);
  display: block;
  font-family: 'Inter', sans-serif;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: #4b5563;
  padding: 0.35rem 0.75rem 0.35rem 1.25rem;
  margin: 0.15rem 0 0.15rem;
  border-radius: var(--radius, 12px);
  transition: background 0.15s ease, color 0.15s ease;
}

.ops-sublink:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}

/* Sidebar items that are real links (href in landing.yaml) — match buttons */
a.ops-sublink-link {
  text-decoration: none;
  box-sizing: border-box;
}

/* Active highlight — uses the item's accent (see --accent above) */
.ops-sublink.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ── Main content ──────────────────────────────────────────── */
.ops-main {
  flex: 1 1 auto;
  padding: 2.5rem 3rem 5rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.ops-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 860px;
}

.ops-image-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  flex: 1 1 0;
  gap: 1rem;
}

/* Image placeholder box */
.ops-image-box {
  width: 100%;
  border-left: 4px solid var(--accent, #3f2b80);
  border-radius: var(--radius);
  background: #ffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.75rem;
}

.ops-image-blank {
  width: 100%;
  align-items: center;
  justify-content: center;
}

/* Actual image (when a sheet sets `image:` in landing.yaml) */
.ops-image {
  display: block;
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  padding: 0.75rem;
}

/* Tinted image: the SVG masks a box filled with the accent colour, so the
   outline recolours dynamically (see _image_box in landing.py). --accent is
   inherited from .ops-image-box; mask-image is set inline per sheet. */
.ops-image-tint {
  width: 100%;
  height: 220px;
  background-color: var(--accent, var(--zite-blue, #3f2b80));
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
}

 /* For use of dashboard display card on country pages */
.ops-image-dash {
  /* Box matches the icon's aspect ratio so the mask fills it without distortion
     or side gaps. aspect-ratio = icon viewBox width / height (dashboard.svg is
     12 x 10 = 6/5). Fix the height; width is derived. */
  flex: 0 0 auto;
  align-self: center;   /* icon stays vertically centred even when text top-aligns */
  height: 55px;
  aspect-ratio: 6 / 5;
  /* The mask just stencils the shape; the visible colour + its transparency come
     from background-color. Match the card border: 25% accent at rest. */
  background-color: color-mix(in srgb, var(--accent) 25%, transparent);
  transition: background-color 0.15s ease;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
}

/* Individual card */
.ops-dashboard-card {
    --accent: var(--zite-blue, #3f2b80);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.85rem 1.25rem;
  border-left: 4px solid color-mix(in srgb, var(--accent) 25%, transparent);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: flex-start;         /* text top-aligns with sibling cards */
  justify-content: space-between;  /* text on the left, icon pushed right */
  gap: 0.75rem;
}

.ops-dashboard-card:hover {
  border-left: 4px solid var(--accent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Icon fill follows the card hover (descendant selector), matching the border */
.ops-dashboard-card:hover .ops-image-dash {
  background-color: var(--accent);
}

.ops-image-box-label {
  color: #b3aec9;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Metric cards row — same look as the existing landing cards */
.ops-metric-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.ops-metric-card {
  --accent: var(--zite-blue, #3f2b80);
  background: #fff;
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 2px 8px rgba(0, 0, 0, 0.06));
  border-left: 4px solid var(--accent, #3f2b80);
  padding: 1rem 1.25rem 0.75rem 1.25rem;
}

.ops-metric-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--zite-grey);
}
.ops-metric-title-2 {
  font-size: 1.1rem;
  font-weight: 550;
  color: var(--zite-grey);
}

.ops-metric-value {
  /* inherits --accent from .ops-metric-card (set inline per sheet) — do NOT
     redeclare --accent here or it resets to the default and ignores the card. */
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--accent, #3f2b80);
  margin-top: 0rem;
}


/* Country Pages */
.ops-country-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  flex: 1 1 0;
  gap: 1rem;
}

.ops-country-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  flex: 1 1 0;
  gap: 1rem;
}


/* Full-width text block (spans the three metric cards) */
.ops-text-block {
  background: #fff;
  border-left: 4px solid var(--accent, #3f2b80);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 2px 8px rgba(0, 0, 0, 0.06));
  padding: 1.5rem 1.75rem;
}

.ops-text-heading {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--zite-grey);
  margin: 0 0 0.75rem;
}

.ops-text-body {
  font-size: 0.9rem;
  color: var(--zite-grey);
  line-height: 1.7;
  margin: 0;
}

/* Other Tools — simple heading + paragraph view */
.ops-tool-view {
  max-width: 700px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 760px) {
  .ops-page {
    flex-direction: column;
  }
  .ops-sidebar {
    flex-basis: auto;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e7e5f0;
  }
  .ops-main {
    padding: 1.5rem 1.25rem 4rem;
  }
  .ops-metric-row {
    grid-template-columns: 1fr;
  }
}

