/* DALnet 2026 - Direction C (dark-first) */

@font-face {
  font-family: "InterVar";
  src: url("/skins/dalnet2026/assets/fonts/Inter-roman.var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "InterVar";
  src: url("/skins/dalnet2026/assets/fonts/Inter-italic.var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --surface: #121827;
  --surface-2: #0f1422;
  --border: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.70);
  --faint: rgba(255,255,255,0.55);
  --link: #86b7ff;
  --link-hover: #b3d1ff;
  --accent: #5eead4;
  --shadow: 0 10px 30px rgba(0,0,0,0.45);
  --radius: 14px;
  --maxw: 1100px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 700px at 20% -10%, rgba(94,234,212,0.14), transparent 60%),
              radial-gradient(1200px 700px at 90% 0%, rgba(134,183,255,0.14), transparent 60%),
              var(--bg);
  color: var(--text);
  font: 16px/1.55 "InterVar", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus, button:focus, input:focus {
  outline: 2px solid rgba(94,234,212,0.65);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.skip-link:focus { left: 12px; z-index: 9999; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11,14,20,0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.brand-link:hover {
  text-decoration: none;
  border-color: var(--border);
  background: rgba(255,255,255,0.03);
}
.brand-mark {
  font-weight: 800;
  letter-spacing: 0.2px;
}
.brand-mark::after {
  content: " • IRC network";
  font-weight: 600;
  color: var(--muted);
}

.search {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 260px;
}
.search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.search button {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(94,234,212,0.14);
  color: var(--text);
  cursor: pointer;
}
.search button:hover { background: rgba(94,234,212,0.22); }

.mainNav { border-top: 1px solid rgba(255,255,255,0.06); }
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 16px;
}

#horiznav.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Your menu generator likely emits <li> with <a> and sometimes nested <ul>. */
#horiznav > li { position: relative; }
#horiznav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text);
}
#horiznav a:hover {
  text-decoration: none;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
}

/* Dropdowns */
#horiznav li ul {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: rgba(18,24,39,0.98);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow);
  list-style: none;
  margin: 0;
}
#horiznav li:hover > ul { display: block; }
#horiznav li ul li a {
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
}

/* Layout */
.page { padding: 22px 16px 40px; }
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: start;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px;
  overflow: hidden;
}

/* Make legacy content look nicer without editing DB content */
.card img { max-width: 100%; height: auto; }
.card table { max-width: 100%; }
.card h1, .card h2, .card h3 { line-height: 1.2; }
.card h1 { font-size: 1.65rem; margin: 0 0 12px; }
.card h2 { font-size: 1.25rem; margin: 18px 0 10px; }
.card h3 { font-size: 1.05rem; margin: 16px 0 8px; }
.card p { margin: 10px 0; color: var(--text); }
.card hr { border: 0; border-top: 1px solid rgba(255,255,255,0.10); margin: 18px 0; }
.card code, .card pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.card pre {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.20);
  overflow: auto;
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 14px; }
.panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--text);
}
.panel-actions { margin-top: 10px; text-align: right; }
.newsbox { color: var(--muted); }

.field { display: grid; gap: 6px; margin: 10px 0; }
label { color: var(--muted); font-size: 0.92rem; }
input[type="text"], input[type="password"], input[type="search"] {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(134,183,255,0.14);
  color: var(--text);
  cursor: pointer;
}
button:hover { background: rgba(134,183,255,0.22); }

.footer {
  border-top: 1px solid rgba(255,255,255,0.10);
  padding: 20px 16px 30px;
  color: var(--muted);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.footer-links a { color: var(--faint); }
.footer-links a:hover { color: var(--link-hover); }

.sr-only {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .search { min-width: 0; width: 100%; }
  .topbar-inner { flex-wrap: wrap; }
  .brand-mark::after { content: ""; }
}

/* =========================================
   FIXES: icon size + sprite box + buttons
   ========================================= */

/* Hide external SVG sprite box */
.svg-sprite,
.svg-sprite object,
.svg-sprite svg {
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  position: absolute !important;
  left: -9999px !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Constrain icon size */
.icon,
button svg.icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 18px;
  fill: currentColor;
}

/* Header search compact sizing */
.topbar .search button,
.topbar .search input[type="search"] {
  width: auto;
}

.topbar .search button {
  padding: 8px 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Sidebar buttons full-width only in sidebar */
.sidebar .panel button {
  width: 100%;
  box-sizing: border-box;
}

button {
  width: auto;
}

/* Logo sizing */
.logo {
  display: block;
  height: 48px;          /* primary size */
  width: auto;
  max-height: 56px;      /* never exceed */
  object-fit: contain;
}

/* Slightly larger on desktop */
@media (min-width: 900px) {
  .logo {
    height: 54px;
  }
}

/* Smaller on mobile */
@media (max-width: 520px) {
  .logo {
    height: 40px;
  }
}


/* Wordmark next to logo */
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;              /* slightly more breathing room */
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

/* Main DALnet word */
.brand-name {
  font-weight: 800;
  font-size: 1.35rem;     /* ⬅ increased */
  letter-spacing: 0.3px;
}

/* IRC Network tagline */
.brand-tagline {
  font-weight: 600;
  font-size: 1rem;        /* ⬅ increased */
  color: var(--muted);
}

/* Sidebar submenu list styling */
.submenu ul {
  list-style: none;         /* remove default bullets */
  padding: 0;
  margin: 0;
}

.submenu li {
  margin: 6px 0;            /* vertical spacing */
}

.submenu a {
  display: block;           /* full clickable width */
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.submenu a:hover {
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}

.submenu li::before {
  content: "•";
  color: var(--accent);
  margin-right: 8px;
}

/* Add minimalist bullets to submenu links (structure-agnostic) */
.submenu a {
  position: relative;
  padding-left: 22px; /* room for bullet */
}

.submenu a::before {
  content: "→";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  opacity: 0.9;
}

/* Keep the background consistent while scrolling */
body {
  background-attachment: fixed, fixed, fixed;
}

/* Accordion panels (native details/summary) */
.accordion summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
  padding: 2px 0;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.95rem;
}

.accordion[open] summary::after {
  content: "▴";
}

.accordion-body {
  margin-top: 10px;
}

/* Tighten sidebar spacing */
.sidebar { gap: 10px; }
.panel { padding: 12px; }
.field { margin: 8px 0; }
input[type="text"], input[type="password"], input[type="search"] { padding: 9px 10px; }
.sidebar .panel button { padding: 9px 10px; }

/* Tip of the Day styling */
.tip {
  font-style: italic;
  color: var(--muted);
  line-height: 1.5;
  border-left: 3px solid rgba(94,234,212,0.5);
  padding-left: 10px;
}

/* Fix legacy content using h5 as page title */
.card > h5:first-child {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 0;
}

/* Legacy page titles sometimes use h5 — make them look like titles */
.card h5:first-of-type {
  font-size: 1.75rem !important;
  font-weight: 800 !important;
  margin: 0 0 12px !important;
  line-height: 1.2 !important;
  color: var(--text) !important;
}

/* =========================================
   Tighten top navigation spacing
   ========================================= */

/* Reduce space between menu items */
#horiznav.menu {
  gap: 4px;                 /* was 8px */
}

/* Slightly smaller nav text */
#horiznav a {
  font-size: 0.95rem;       /* slight reduction */
  padding: 6px 8px;         /* was larger */
}

/* Tighter dropdown menu spacing */
#horiznav li ul {
  padding: 6px;
}

#horiznav li ul li a {
  padding: 6px 8px;
  font-size: 0.92rem;
}

/* Fill the hover gap so nav menus don't randomly disappear sometimes when mousing around */
#horiznav > li > ul::before {
  position: absolute;
  content: '';
  background-color: transparent;
  top: -8px;
  width: calc(100% - var(--radius));
  height: 8px;
}
#horiznav > li > ul > li { position: relative; }
#horiznav > li > ul > li > ul { position: absolute; margin-left: 100%; top: 0px; left: -1.15rem; }

/* Add an arrow to nested nav menus */
#horiznav a.parent { display: flex; }
#horiznav a.parent::after { content: "\25B8"; margin-left: auto; }

/* Allow the page to be horizontally scrolled, with the sidebar peeking out */
@media only screen and (max-width: 980px) {
  .layout { grid-template-columns: 75vw 340px; }
}

/* Enable the nav click helper if the device is a touchscreen without hover support */
@media (hover: none), (pointer: coarse) {
  #horiznav span.top a.nohref { pointer-events: none; }
}

/* Add z-index to nav menus */
#horiznav li ul {
  z-index: 1;
}

/* Increase bullet padding */
.submenu a { padding-left: 1.75rem; }
