/* =========================================================
   Azure Cheat Sheet — styles
   ========================================================= */
:root {
  --bg: #0b1220;
  --bg-elev: #111a2e;
  --bg-card: #16223a;
  --bg-card-hover: #1c2a47;
  --border: #22314f;
  --text: #e6ecf5;
  --text-dim: #9aa7be;
  --accent: #3b9cff;
  --accent-2: #0078D4;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
  --radius: 10px;
  --radius-sm: 6px;
}
[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4fb;
  --border: #e1e6f0;
  --text: #1a2236;
  --text-dim: #5a6783;
  --shadow: 0 4px 16px rgba(10,30,60,.08);
}
[data-theme="light"] .footer-accent {
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--accent-2) 50%, var(--border) 80%, transparent);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.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;
}

/* ============ HEADER ============ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 54px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hdr-left { display: flex; align-items: center; gap: 6px; }
.hdr-right { display: flex; align-items: center; gap: 2px; }

/* ---- Brand mark ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  color: var(--text);
  margin-right: 4px;
}
.brand-azure-icon {
  flex-shrink: 0;
}
.brand-wordmark {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-wordmark strong {
  font-weight: 700;
  color: var(--accent);
}

/* ---- Separator ---- */
.hdr-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 10px;
  flex-shrink: 0;
}

/* ---- View switch (underline tabs) ---- */
.view-switch {
  display: inline-flex;
  align-self: stretch;
  gap: 0;
}
.view-btn {
  background: transparent;
  color: var(--text-dim);
  border: 0;
  padding: 0 14px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0;
  cursor: pointer;
  transition: color .15s;
  position: relative;
}
.view-btn::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background .15s;
}
.view-btn:hover { color: var(--text); }
.view-btn.active {
  color: var(--accent);
}
.view-btn.active::after {
  background: var(--accent);
}

/* ---- Search ---- */
.search-wrap { position: relative; margin-left: 8px; }
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
#search {
  width: 220px;
  background: var(--bg-card);
  border: 1px solid transparent;
  color: var(--text);
  padding: 7px 34px 7px 30px;
  border-radius: 7px;
  font-size: 12.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
#search::placeholder { color: var(--text-dim); opacity: .7; }
#search:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(0,120,212,.12);
  background: var(--bg-elev);
}
.kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 10px;
  line-height: 18px;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, monospace;
}

/* ---- Ghost buttons ---- */
.ghost-btn {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}
.ghost-btn:hover {
  color: var(--accent);
  background: rgba(0,120,212,.08);
}

/* keep old class working if referenced elsewhere */
.icon-btn { 
  background: transparent;
  border: 0;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}
.icon-btn:hover {
  color: var(--accent);
  background: rgba(0,120,212,.08);
}

/* ============ MAIN / VIEWS ============ */
main { max-width: 1720px; margin: 0 auto; padding: 18px 20px; }
#view-tile { padding: 0; }
#view-list { padding-bottom: 60px; }
.view.hidden { display: none; }

/* ---------- Tile view (treemap, tight subgrid per category) ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(15, minmax(82px, 1fr));
  grid-template-rows: repeat(17, 82px);
  gap: 2px;
  padding: 2px;
  background: #ffffff;
  overflow: hidden;
}

/* Invisible container per category: inherits parent grid tracks via subgrid
   so its tiles snap to the main grid, but has no background of its own. Tiles
   are dense-packed within the block so services never spill to neighbors. */
.cat-block {
  display: grid;
  grid-template-columns: subgrid;
  grid-template-rows: subgrid;
  grid-auto-flow: row dense;
  position: relative;
}

/* Service tiles flip on hover to show a short description. The outer .tile
   is a transparent perspective container; .tile-inner is the rotating layer;
   .tile-face holds the colored background + content on each side. */
.tile {
  position: relative;
  min-width: 0;
  color: #fff;
  cursor: default;
  perspective: 700px;
}
.svc-tile {
  cursor: pointer;
  text-decoration: none;
}
.svc-tile:focus-visible {
  outline: 3px solid rgba(255,255,255,.82);
  outline-offset: 2px;
  z-index: 3;
}
.svc-tile:hover {
  text-decoration: none;
}

.tile-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.4, 0, .2, 1);
}
.svc-tile:hover .tile-inner,
.cat-title-tile:hover .tile-inner { transform: rotateY(180deg); }

.tile-face {
  position: absolute;
  inset: 0;
  background: var(--cat-color);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  text-align: center;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.tile-back {
  transform: rotateY(180deg);
  padding: 6px 5px;
}
.tile-back-text {
  font-size: 10px;
  line-height: 1.25;
  color: #fff;
  font-weight: 600;
  word-break: break-word;
}

/* Category header tile (2×2) uses the same flip structure as service tiles,
   so it also reveals a back face on hover. */
.cat-title-tile {
  grid-column: span 2;
  grid-row: span 2;
  cursor: default;
}
.cat-title-front {
  align-items: flex-start;
  justify-content: center;
  padding: 12px 14px;
  gap: 6px;
}
.cat-title-front h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: #fff;
  text-align: left;
}
.cat-title-front p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.35;
  color: rgba(255,255,255,.88);
  font-weight: 500;
  text-align: left;
}
.cat-title-back {
  gap: 2px;
}
.cat-title-back .cat-count {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.cat-title-back .cat-count-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.svc-tile:hover { z-index: 2; }

.tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.22);
  transition: transform .12s ease, box-shadow .12s ease;
  flex-shrink: 0;
}
.tile-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.tile-name {
  font-size: 8.5px;
  line-height: 1.15;
  color: #fff;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  padding: 0 2px;
}

.tile .badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #F7630C;
  color: #1a1a1a;
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  z-index: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.tile .badge.new {
  background: #FFD60A;
  color: #1a1a1a;
}

.tile.dimmed { opacity: .22; pointer-events: none; }
.list-row.dimmed { opacity: .18; pointer-events: none; }
.list-cat.dimmed { opacity: .18; pointer-events: none; }

/* Filler tile — occupies a trailing empty cell inside a cat-block so the
   white grid background doesn't show through. No content, no interaction. */
.tile-filler {
  background: var(--cat-color);
  cursor: default;
  perspective: none;
}

/* ---------- List view (GCP cheat-sheet style, multi-column) ---------- */
.list-header { margin-bottom: 20px; }
.list-header h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.list-header .list-sub { margin: 0; color: var(--text-dim); font-size: 13px; }

.list-grid {
  column-count: 4;
  column-gap: 32px;
}
@media (max-width: 1400px) { .list-grid { column-count: 3; } }
@media (max-width: 900px)  { .list-grid { column-count: 2; } }
@media (max-width: 600px)  { .list-grid { column-count: 1; } }

.list-cat {
  break-inside: avoid;
  margin-bottom: 18px;
  display: block;
}

/* Colored pill header per category */
.list-cat-header {
  background: var(--cat-color);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 14px;
  margin-bottom: 8px;
  line-height: 1.2;
}

.list-cat-rows { display: block; }

/* Each row = two columns: service name (left) + short description (right) */
.list-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  padding: 4px 6px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
  break-inside: avoid;
  border-radius: 3px;
  transition: background .12s;
}
.list-row:hover { background: rgba(127, 127, 127, 0.08); }
[data-theme="light"] .list-row:hover { background: rgba(0, 0, 0, 0.05); }

.list-name {
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.list-desc {
  color: var(--text-dim);
  font-weight: 400;
  word-break: break-word;
}
.list-name .badge {
  font-size: 8px;
  background: #F7630C;
  color: #fff;
  padding: 1px 4px;
  margin-left: 4px;
  border-radius: 3px;
  vertical-align: middle;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.list-name .badge.new { background: #16A34A; }

/* ============ FOOTER ============ */
.site-footer {
  position: relative;
  background: var(--bg);
  padding: 28px 28px 24px;
}
.footer-accent {
  position: absolute;
  top: 0; left: 28px; right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--accent) 50%, var(--border) 80%, transparent);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-brand p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}
.footer-dim { opacity: .6; }
.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer-cta {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent) !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: opacity .15s;
}
.footer-cta:hover { opacity: .8; }
.footer-socials {
  display: flex;
  gap: 4px;
}
.footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--text-dim);
  transition: color .15s, background .15s;
}
.footer-socials a:hover {
  color: var(--accent);
  background: rgba(0,120,212,.08);
}
.footer-links > .footer-cta + .footer-socials::before {
  content: '';
  display: block;
  width: 1px;
  height: 16px;
  background: var(--border);
  margin-right: 4px;
}
.site-footer p { margin: 0; }

/* ============ FILTER BAR ============ */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 28px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.filter-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
#stats-total {
  font-weight: 700;
  color: var(--text);
}
.stats-sep { opacity: .4; }
.filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  justify-content: flex-end;
}
.filter-controls::-webkit-scrollbar { display: none; }
.filter-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

/* ---- Status pills ---- */
.status-filters {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.status-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.status-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}
.status-chip.active {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.new { background: #16A34A; }
.status-dot.preview { background: #F7630C; }
.status-chip.active .status-dot.new,
.status-chip.active .status-dot.preview { background: #fff; }

/* ---- Category chips ---- */
.cat-chips {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  padding-bottom: 2px;
}
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cat-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}
.cat-chip.active {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}
.cat-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cat-chip.active .cat-chip-dot { opacity: .7; }
.cat-chip-count {
  font-size: 10px;
  opacity: .5;
  font-weight: 400;
}
.cat-chip.active .cat-chip-count { opacity: .7; }

/* ---- Search clear button ---- */
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 3px;
  transition: color .15s;
}
.search-clear:hover { color: var(--text); }



/* ---- List row focus ---- */
.list-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  z-index: 1;
  position: relative;
}

/* ---- Clickable category headers ---- */
.cat-title-tile[data-clickable] { cursor: pointer; }
.list-cat-header[data-clickable] {
  cursor: pointer;
  transition: opacity .15s;
}
.list-cat-header[data-clickable]:hover { opacity: .85; }

/* ============ RESPONSIVE ============ */
@media (max-width: 820px) {
  .site-header { flex-wrap: wrap; height: auto; padding: 12px 18px; gap: 8px; }
  .hdr-left { width: 100%; }
  .hdr-right { width: 100%; flex-wrap: wrap; }
  .brand-wordmark { font-size: 14px; }
  #search { width: 100%; }
  main { padding: 18px; }
  /* Tile grid: use full viewport width and allow deliberate horizontal scroll. */
  #view-tile {
    margin: 0 -18px;
    padding: 0 18px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tile-grid {
    width: max-content;
    min-width: 100%;
    grid-template-columns: repeat(15, 58px);
    grid-template-rows: repeat(17, 58px);
    overflow: visible;
  }
  .tile-face { padding: 4px 2px; gap: 3px; }
  .tile-name { font-size: 7px; }
  .tile-icon { width: 24px; height: 24px; }
  .tile-icon img { width: 16px; height: 16px; }
  .cat-title-front h2 { font-size: 9px; }
  .cat-title-front p { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  /* Filter bar: stack vertically on mobile */
  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 18px;
    gap: 8px;
  }
  .filter-controls { width: 100%; }
}
/* Very small phones — further shrink tiles */
@media (max-width: 480px) {
  .tile-grid {
    grid-template-columns: repeat(15, 46px);
    grid-template-rows: repeat(17, 46px);
  }
  .tile-name { font-size: 6.5px; }
  .tile-icon { width: 20px; height: 20px; }
  .tile-icon img { width: 14px; height: 14px; }
  .cat-title-front h2 { font-size: 8px; }
}

/* Print-only elements are hidden on screen */
.print-only { display: none; }

/* ============ PRINT ============ */
@media print {
  @page { size: A3 landscape; margin: 6mm 6mm 6mm 6mm; }
  html, body { height: auto; }

  /* Force light theme so print doesn't dump ink on a black background. */
  :root, [data-theme="dark"], [data-theme="light"] {
    --bg: #ffffff;
    --bg-elev: #ffffff;
    --text: #111111;
    --text-dim: #555555;
    --border: #cccccc;
  }
  html, body { background: #fff !important; color: #111 !important; }

  /* Hide interactive chrome. */
  .site-header,
  .view-switch,
  .hdr-right,
  .site-footer,
  .filter-bar,
  #view-tile { display: none !important; }

  /* Show list view only and flatten padding. */
  main { padding: 0 !important; max-width: none !important; }
  #view-list.hidden { display: block !important; }
  .list-header { display: none; }

  /* One-page A3 landscape: 4 wider columns, larger rows that fill the sheet. */
  .list-grid { column-count: 4; column-gap: 12px; }
  .list-cat {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 5px;
  }
  .list-cat-header {
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 3px 10px;
    font-size: 10px;
    margin-bottom: 3px;
    border-radius: 11px;
    letter-spacing: 0.04em;
  }
  .list-row {
    display: grid;
    grid-template-columns: 0.95fr 1.25fr;
    font-size: 9.5px;
    line-height: 1.25;
    padding: 1px 4px;
    gap: 6px;
    color: #111 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .list-name { color: #111 !important; font-weight: 700; }
  .list-desc { color: #555 !important; font-weight: 400; }
  .list-row:hover { background: transparent !important; }
  .list-name .badge { font-size: 7px; padding: 1px 3px; }

  /* Print header + footer — stronger branding block, still slim. */
  .print-only { display: block !important; }
  .print-header {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 2px 0 9px 0;
    margin: 0 0 10px 0;
    border-bottom: 2.5px solid #0078D4;
  }
  .print-header-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
  }
  .print-title-main {
    margin: 0;
    font-size: 38px;
    font-weight: 900;
    color: #0078D4 !important;
    letter-spacing: -0.02em;
    line-height: 0.95;
  }
  .print-title-sub {
    margin: 4px 0 0;
    font-size: 17px;
    font-weight: 700;
    color: #333 !important;
    letter-spacing: 0.01em;
    line-height: 1;
  }
  .print-header-center {
    align-self: center;
  }
  .print-center-top {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #111 !important;
    line-height: 1.25;
  }
  .print-center-sub {
    margin: 4px 0 0;
    font-size: 10px;
    color: #666 !important;
    line-height: 1.3;
  }
  .print-header-right {
    text-align: right;
    align-self: center;
  }
  .print-header-right p {
    margin: 0;
    font-size: 9px;
    color: #555 !important;
    line-height: 1.5;
  }
  .print-header-right .print-url {
    font-size: 12px;
    font-weight: 700;
    color: #0078D4 !important;
    margin-bottom: 2px;
  }
  .print-footer {
    display: block !important;
    margin-top: 4px;
    padding-top: 3px;
    border-top: 1px solid #cccccc;
    text-align: center;
    page-break-inside: avoid;
  }
  .print-footer p {
    margin: 1px 0;
    font-size: 7px;
    color: #666 !important;
    line-height: 1.3;
  }
}
