/*
 * Packetflow skin for NetBox (netbox_brand_theme: true).
 *
 * The dark side of www.packetflow.be: ink paper, warm greys, orange accent,
 * Poppins for the interface and Lora for page titles. Colours only change in
 * dark mode; light mode stays NetBox's own, with our fonts. Layout is
 * untouched. Selectors start with html[data-bs-theme=dark] so they match
 * NetBox's own dark rules in specificity and win by coming later.
 *
 * Palette (pack-website global.css, [data-side="industrie"]):
 *   ink #1a1815  card #24211c  raised #2e2a24  border #4a453d
 *   text #c9c2b6  muted #a8a097  strong #f5f1ea
 *   orange #f37f21  orange on dark #f8ae6e  button #c2410c / hover #9a3412
 */

/* Fonts (SIL OFL 1.1, see fonts/), self-hosted: no third-party request. */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/lora-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("fonts/lora-latin-600-normal.woff2") format("woff2"); }

:root {
  --tblr-font-sans-serif: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tblr-body-font-family: var(--tblr-font-sans-serif);
  --pf-font-display: "Lora", Georgia, serif;
  /* Poppins runs wider than NetBox's Inter: one step down keeps the
     tables on the lines NetBox laid them out for. */
  --tblr-body-font-size: .8125rem;
}
/* "Community" under the logo would read as part of our name; the footer
   still names NetBox and its edition. */
.netbox-edition { display: none; }
body { font-family: var(--tblr-font-sans-serif); }
.page-title, .card-header, h2.card-header, .card-title {
  font-family: var(--pf-font-display);
  font-weight: 600;
  letter-spacing: 0;
}

/* ---- Dark palette ------------------------------------------------------ */
html[data-bs-theme=dark] {
  color-scheme: dark;

  /* Neutral ramp, warm: everything NetBox derives from gray-* follows. */
  --tblr-gray-100: #f5f1ea;
  --tblr-gray-200: #ede7db;
  --tblr-gray-300: #c9c2b6;
  --tblr-gray-400: #a8a097;
  --tblr-gray-500: #8a8278;
  --tblr-gray-600: #6b6359;
  --tblr-gray-700: #4a453d;
  --tblr-gray-800: #24211c;
  --tblr-gray-900: #1a1815;

  --tblr-body-bg: #1a1815;
  --tblr-body-bg-rgb: 26, 24, 21;
  --tblr-body-color: #c9c2b6;
  --tblr-body-color-rgb: 201, 194, 182;
  --tblr-emphasis-color: #f5f1ea;
  --tblr-emphasis-color-rgb: 245, 241, 234;
  --tblr-heading-color: #f5f1ea;
  --tblr-secondary: #a8a097;
  --tblr-secondary-rgb: 168, 160, 151;
  --tblr-secondary-color: #a8a097;
  --tblr-secondary-color-rgb: 168, 160, 151;
  --tblr-tertiary-color: #8a8278;
  --tblr-tertiary-color-rgb: 138, 130, 120;
  --tblr-muted: #a8a097;
  --tblr-muted-rgb: 168, 160, 151;

  --tblr-secondary-bg: #2e2a24;
  --tblr-secondary-bg-rgb: 46, 42, 36;
  --tblr-tertiary-bg: #24211c;
  --tblr-tertiary-bg-rgb: 36, 33, 28;
  --tblr-bg-forms: #1a1815;
  --tblr-bg-surface: #24211c;
  --tblr-bg-surface-secondary: #1a1815;
  --tblr-bg-surface-tertiary: #2e2a24;
  --tblr-active-bg: #2e2a24;
  --tblr-light-bg-subtle: #2e2a24;
  --tblr-dark-bg-subtle: #1a1815;

  --tblr-border-color: #4a453d;
  --tblr-border-color-translucent: rgba(168, 160, 151, 0.18);
  --tblr-dark-mode-border-color: #4a453d;
  --tblr-dark-mode-border-color-translucent: rgba(168, 160, 151, 0.18);
  --tblr-dark-mode-border-dark-color: #4a453d;
  --tblr-dark-mode-border-active-color: #6b6359;
  --tblr-border-dark-color: #4a453d;
  --tblr-border-active-color: #6b6359;
  --tblr-light-border-subtle: #4a453d;
  --tblr-dark-border-subtle: #2e2a24;

  /* Orange instead of NetBox teal. */
  --tblr-primary: #f37f21;
  --tblr-primary-rgb: 243, 127, 33;
  --tblr-primary-fg: #1a1815;
  --tblr-primary-darken: #c2410c;
  --tblr-primary-text-emphasis: #f8ae6e;
  --tblr-primary-bg-subtle: rgba(243, 127, 33, 0.12);
  --tblr-primary-border-subtle: rgba(243, 127, 33, 0.35);
  --tblr-link-color: #f8ae6e;
  --tblr-link-color-rgb: 248, 174, 110;
  --tblr-link-hover-color: #fbc99d;
  --tblr-link-hover-color-rgb: 251, 201, 157;
  --tblr-highlight-color: #f5f1ea;
  --tblr-highlight-bg: rgba(243, 127, 33, 0.35);
  --tblr-focus-ring-color: rgba(243, 127, 33, 0.3);
  --tblr-code-color: #f8ae6e;
  --tblr-navbar-active-bg: rgba(243, 127, 33, 0.12);
}

/* NetBox's own dark rules with fixed colours. */
html[data-bs-theme=dark],
html[data-bs-theme=dark] .navbar,
html[data-bs-theme=dark] .page-header { background-color: #1a1815; }
html[data-bs-theme=dark] .page,
html[data-bs-theme=dark] .page-tabs .nav-tabs .nav-link.active { background-color: #1a1815 !important; }
html[data-bs-theme=dark] .card {
  background: #24211c !important;
  border-color: #4a453d;
}
html[data-bs-theme=dark] .card-header { border-bottom-color: #4a453d; color: #f5f1ea; }
html[data-bs-theme=dark] .card-footer { background: #24211c; border-top-color: #4a453d; }
html[data-bs-theme=dark] .page-title { color: #f5f1ea; }

/* Sidebar */
html[data-bs-theme=dark] .navbar-vertical.navbar-expand-lg {
  background: #24211c;
  border-right: 1px solid #4a453d;
}
html[data-bs-theme=dark] .navbar-vertical.navbar-expand-lg .nav-link-title,
html[data-bs-theme=dark] .navbar-vertical.navbar-expand-lg .nav-link-icon,
html[data-bs-theme=dark] .navbar-vertical.navbar-expand-lg .dropdown-item > a { color: #ede7db !important; }
html[data-bs-theme=dark] .navbar-vertical.navbar-expand-lg .text-secondary { color: #f8ae6e !important; }
html[data-bs-theme=dark] .navbar-vertical.navbar-expand-lg .nav-item.dropdown.active:after { border-color: #f37f21 !important; }
html[data-bs-theme=dark] .navbar-vertical.navbar-expand-lg .dropdown-item.active,
html[data-bs-theme=dark] .navbar-vertical.navbar-expand-lg .dropdown-item:hover { background-color: rgba(243, 127, 33, 0.12) !important; }

/* Tabs */
html[data-bs-theme=dark] .nav-tabs .nav-link { color: #a8a097; }
html[data-bs-theme=dark] .nav-tabs .nav-link.active { color: #f5f1ea; border-color: #4a453d; box-shadow: inset 0 2px 0 #f37f21; }

/* Tables */
html[data-bs-theme=dark] .table thead th,
html[data-bs-theme=dark] .markdown > table thead th {
  background: #2e2a24 !important;
  color: #a8a097;
}
html[data-bs-theme=dark] .table { --tblr-table-border-color: #4a453d; --tblr-table-hover-bg: rgba(243, 127, 33, 0.06); }
html[data-bs-theme=dark] .table-primary { --tblr-table-bg: rgba(243, 127, 33, 0.14); }

/* Cable status rows: the site's softer green, amber and grey. */
html[data-bs-theme=dark] tr[data-cable-status=connected] { --tblr-table-bg-state: rgba(124, 199, 154, 0.07); }
html[data-bs-theme=dark] tr[data-cable-status=planned] { --tblr-table-bg-state: rgba(168, 160, 151, 0.10); }
html[data-bs-theme=dark] tr[data-cable-status=decommissioning] { --tblr-table-bg-state: rgba(243, 127, 33, 0.10); }

/* Buttons: burnt orange fill with a white label (5.2:1), like the site. */
html[data-bs-theme=dark] .btn-primary {
  --tblr-btn-bg: #c2410c;
  --tblr-btn-color: #ffffff;
  --tblr-btn-hover-bg: #9a3412;
  --tblr-btn-hover-color: #ffffff;
  --tblr-btn-active-bg: #9a3412;
  --tblr-btn-active-color: #ffffff;
  --tblr-btn-disabled-bg: #c2410c;
  --tblr-btn-disabled-color: #ffffff;
  color: #ffffff !important;
}
html[data-bs-theme=dark] .bg-primary,
html[data-bs-theme=dark] .text-bg-primary { background-color: #c2410c !important; color: #ffffff !important; }
html[data-bs-theme=dark] .page-link.active,
html[data-bs-theme=dark] .active > .page-link { background-color: #c2410c; border-color: #c2410c; color: #ffffff; }

/* NetBox's cyan/info buttons (Bookmark, Subscribe, Installed) clash with
   the orange: neutral raised buttons instead. */
html[data-bs-theme=dark] .btn-cyan,
html[data-bs-theme=dark] .btn-info {
  --tblr-btn-bg: #2e2a24;
  --tblr-btn-color: #f5f1ea;
  --tblr-btn-border-color: #4a453d;
  --tblr-btn-hover-bg: #4a453d;
  --tblr-btn-hover-color: #ffffff;
  --tblr-btn-hover-border-color: #6b6359;
  --tblr-btn-active-bg: #4a453d;
  --tblr-btn-active-color: #ffffff;
}

/* Forms */
html[data-bs-theme=dark] .form-control,
html[data-bs-theme=dark] .form-select { background-color: #1a1815; border-color: #4a453d; }
html[data-bs-theme=dark] .form-control:focus,
html[data-bs-theme=dark] .form-select:focus { border-color: #f37f21; }
html[data-bs-theme=dark] .form-check-input:checked { background-color: #c2410c; border-color: #c2410c; }

/* Dropdowns, modals */
html[data-bs-theme=dark] .dropdown-menu { background-color: #24211c; border-color: #4a453d; }
html[data-bs-theme=dark] .dropdown-item:hover,
html[data-bs-theme=dark] .dropdown-item:focus { background-color: rgba(243, 127, 33, 0.12); }
html[data-bs-theme=dark] .modal-content { background-color: #24211c; }

/* netbox-ot diagrams: warm zone outlines instead of NetBox blue (the arrows
   keep their red/amber/green meaning). */
html[data-bs-theme=dark] .ot-map .zone { stroke: #8a8278; }

/* Footer */
html[data-bs-theme=dark] .footer { background-color: #1a1815; border-top-color: #4a453d; color: #8a8278; }

html[data-bs-theme=dark] ::selection { background-color: rgba(243, 127, 33, 0.4); }
