/* VeniceStMark — Venetian Maritime & Byzantine Editorial Stylesheet */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-tint: #eaeff4;
  --navy: #122b40;
  --lagoon: #1b6b63;
  --gold: #b8862d;
  --ink: #161e26;
  --ink-soft: #4c5a67;
  --border: #d7e0e8;
  --radius: 10px;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

[data-theme="slate"] {
  --bg: #0f161d;
  --surface: #17212b;
  --surface-tint: #1e2b38;
  --navy: #7db4e0;
  --lagoon: #56b8ad;
  --gold: #dfb056;
  --ink: #edf2f7;
  --ink-soft: #9eb0c0;
  --border: #283847;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.7;
  font-size: 15.5px;
}

a { color: var(--lagoon); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top Utility Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  height: 62px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  gap: 16px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 700;
}
.topbar-brand:hover { text-decoration: none; }
.crest {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  border: 2px solid var(--gold);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 16px;
}
.topbar-title { font-family: var(--font-serif); font-size: 19px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.pill-btn {
  border: 1px solid var(--border);
  background: var(--surface-tint);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.rail-toggle { display: none; }

/* Layout Shell with Left Navigation Rail */
.shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  max-width: 1320px;
  margin: 0 auto;
  min-height: calc(100vh - 62px);
}

.left-rail {
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 18px;
}
.rail-group { margin-bottom: 24px; }
.rail-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 10px;
  padding-left: 10px;
}
.rail-list { list-style: none; display: grid; gap: 4px; }
.rail-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}
.rail-list a:hover, .rail-list a.active {
  background: var(--surface-tint);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}

.content-area { padding: 34px 40px 60px; }

/* Hero Banner */
.venice-banner {
  background: linear-gradient(125deg, #122b40 0%, #1b6b63 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 36px;
  margin-bottom: 30px;
  border-bottom: 4px solid var(--gold);
}
.venice-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #f3d28e;
  margin-bottom: 10px;
  display: block;
}
.venice-banner h1 {
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.12;
  margin-bottom: 14px;
}
.venice-banner p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 720px;
  font-size: 16px;
}

/* Metrics Strip */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.metric-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.metric-val {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
}
.metric-lbl { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

/* Grids & Cards */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 28px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.panel h2, .panel h3 {
  font-family: var(--font-serif);
  color: var(--navy);
  margin-bottom: 10px;
}
.panel p { color: var(--ink-soft); font-size: 14.8px; }

.article h1 { font-family: var(--font-serif); font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 14px; color: var(--navy); }
.article h2 { font-family: var(--font-serif); font-size: 25px; margin: 28px 0 10px; color: var(--navy); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.article p { margin-bottom: 14px; }
.article ul { margin: 0 0 18px 20px; display: grid; gap: 7px; }

.gold-note {
  background: var(--surface-tint);
  border-left: 4px solid var(--gold);
  padding: 16px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 20px 0;
}

.table-box { overflow-x: auto; margin: 18px 0 26px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--surface-tint); color: var(--navy); font-weight: 700; }
tr:last-child td { border-bottom: none; }

.search-input {
  width: 100%;
  max-width: 420px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  margin-bottom: 18px;
}

.form-stack { display: grid; gap: 14px; max-width: 560px; }
.form-stack label { font-size: 13.5px; font-weight: 600; display: grid; gap: 5px; }
.form-stack input, .form-stack textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
}
.btn-venice {
  background: var(--lagoon);
  color: #fff;
  border: none;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
}

.rail-footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .left-rail { display: none; border-right: none; border-bottom: 1px solid var(--border); }
  .left-rail.open { display: block; }
  .rail-toggle { display: inline-block; }
  .content-area { padding: 24px 18px 44px; }
  .metrics-strip, .grid-2 { grid-template-columns: 1fr; }
}
