/* =====================================
   MODEL CITY PORTRAITS DASHBOARD

   Used in:
   docs/model/index.ipynb

   Purpose:
   Turns the rendered notebook output into a clean
   dashboard-style model page.

   Structure:
   - Block 1: Analysis
     - Component: Point
     - Component: Axial
     - Component: Patch
     - Feature + text

   - Block 2: Mapping
     - Full-width map

   - Block 3: Projection
     - Graph text + graph
     - Artifact: Portrait
     - Artifact: Pattern
     - Artifact: Project
   ===================================== */


/* =====================================
   2. DASHBOARD CONTAINER
===================================== */

.mcp-dashboard {
  width: 100%;
  margin-top: 2rem;
}


/* =====================================
   3. BLOCK STRUCTURE
===================================== */

.mcp-block {
  margin: 3rem 0;
  padding-top: 1rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

.mcp-block:first-child {
  border-top: none;
}

.mcp-block-header {
  max-width: 760px;
  margin-bottom: 1.25rem;
}

.mcp-kicker {
  display: inline-block;
  margin-bottom: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--md-accent-fg-color);
}

.mcp-block-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.45rem;
  font-weight: 600;
}

.mcp-block-header p {
  margin: 0;
  color: var(--md-default-fg-color--light);
}


/* =====================================
   4. GRID SYSTEM
===================================== */

.mcp-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.mcp-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mcp-grid-feature {
  grid-template-columns: 2fr 1fr;
}

.mcp-grid-graph {
  grid-template-columns: 1fr 2fr;
}


/* =====================================
   5. CARDS / PANELS
===================================== */

.mcp-card {
  padding: 1rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 16px;
  background: var(--md-default-bg-color);
  overflow: hidden;
  isolation: isolate;
}

.mcp-card h3 {
  margin: 0 0 0.4rem 0;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mcp-card p {
  margin: 0 0 0.8rem 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--md-default-fg-color--light);
}

.mcp-text-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}


/* =====================================
   6. MAP PANELS
===================================== */

.mcp-map {
  width: 100%;
  height: 220px;
  min-height: 220px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--md-default-fg-color--lightest);
  background: #f8f9fb;
  position: relative;
  z-index: 0;
}

.mcp-map-small {
  height: 220px;
  min-height: 220px;
}

.mcp-map-medium {
  height: 320px;
  min-height: 320px;
}

.mcp-map-large {
  height: 520px;
  min-height: 520px;
}

/* Leaflet sizing fix */
.mcp-map .leaflet-container,
.leaflet-container {
  width: 100%;
  height: 100%;
  font-family: inherit;
  z-index: 0 !important;
}

/* Keep controls above tiles but below UI */
.leaflet-pane,
.leaflet-top,
.leaflet-bottom {
  z-index: 1 !important;
}

.leaflet-control {
  z-index: 2 !important;
}

/* MkDocs UI always above maps */
.md-header {
  z-index: 10000 !important;
}

.md-tabs {
  z-index: 9999 !important;
}

.md-sidebar {
  z-index: 9998 !important;
}

/* soften tiles */
.leaflet-tile {
  filter: saturate(0.9) contrast(1.05);
}

/* =====================================
   Leaflet Attribution (clean + minimal)
===================================== */

.leaflet-control-attribution {
  font-size: 8px;
  opacity: 0.4;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  border-radius: 6px;
}

.leaflet-control-attribution a {
  text-decoration: none;
  color: inherit;
}

/* subtle hover reveal */
.leaflet-control-attribution:hover {
  opacity: 0.8;
}
/* =====================================
   7. GRAPH PANEL
===================================== */

.mcp-graph-card {
  min-height: 500px;
}

.mcp-graph-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

#graph-reset-btn {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  cursor: pointer;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
}

#cy-network {
  width: 100%;
  height: 460px;
  min-height: 460px;
  border-radius: 12px;
  background: var(--md-code-bg-color);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* =====================================
   8. LEAFLET FIX
===================================== */

.md-header {
  z-index: 9999 !important;
}

.md-tabs {
  z-index: 9998 !important;
}

.leaflet-container {
  z-index: 1 !important;
}

.leaflet-pane,
.leaflet-top,
.leaflet-bottom,
.leaflet-control {
  z-index: 10 !important;
}


/* =====================================
   9. RESPONSIVE
===================================== */

@media screen and (max-width: 900px) {
  .mcp-grid-3,
  .mcp-grid-feature,
  .mcp-grid-graph {
    grid-template-columns: 1fr;
  }

  .mcp-map-large {
    height: 520px;
  }

  .mcp-block {
    margin: 2rem 0;
  }
}