

/* ========== THEME VARIABLES ========== */
:root {
  --bg: #eee;
  --text: black;
  --border: #ccc;
  --tag-bg: #ccc;
  --text-muted: #666;
  --text-subtle: #bbb;
}

body.dark-mode {
  --bg: #222;
  --text: #ccc;
  --border: #444;
  --tag-bg: #111;
  --text-muted: #ccc;
  --text-subtle: #888;
   --tag-bg: #444;
}

/* LIGHT MODE */
body.light-mode .sidebar {
  --bg: #f5f5f5;      /* light gray */
  --text: #fff;
  --border: #444;
  --tag-bg: #000;
}

/* DARK MODE */
body.dark-mode .sidebar {
  --bg: #222;
  --text: white;
  --border: #444;
  --tag-bg: #000;
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

body.reduce-motion .sidebar {
  transition: none !important;
}

/* ========== GLOBAL LAYOUT ========== */
html, body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  font-family: Helvetica, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  box-sizing: border-box;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 200vh;
  background-color: var(--bg);
  z-index: -1;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: none;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: bold;
  margin: 1vh 0;
}

h2 {
font-size: clamp(14px, 4vw, 18px);
text-align: center;
}

h1 {
  font-size: clamp(20px, 4vw, 24px);
  text-align: center;
}

p {
  font-size: clamp(13px, 1.3vw, 16px);
  color: var(--text);
  text-align: left;
  line-height: 1.5;
  margin: 0.8em 0;
}

.landing p {
  text-align: center;
}

.digest-card h2,
.digest-card p {
  text-align: left;
}

.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  padding: 2vw;
  gap: 2vh;
}

.top-right {
  position: absolute;
  top: 2vw;
  right: 2vw;
  display: flex;
  gap: 2vw;
}

/* ========== BUTTONS ========== */
.btn-solid {
  padding: 0.8em 1.6em;
  font-weight: bold;
  border-radius: 0.5vw;
  border: 1px solid var(--text);
  background-color: var(--text);
  color: var(--bg);
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: clamp(8px, 1.3vw, 20px);
  margin: 1vh;
}

.btn-solid:active {
  background-color: var(--text-muted);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  font-size: clamp(8px, 1.3vw, 20px);
}

/* ========== LINKS ========== */
a {
  text-decoration: none;
  color: var(--text);
  font-weight: bold;
  border-bottom: 1px solid var(--border);
}

a:hover {
  border-bottom-color: #999;
}

.dashboard-legal-footer a {
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.dashboard-legal-footer a:hover {
  border-bottom-color: #999;
}

/* ========== FORM INPUTS ========== */
.email-input {
  padding: 1vh;
  border-radius: 0.6vw;
  border: 1px solid var(--border);
  width: 80%;
  max-width: 400px;
  margin: 1vh 0;
  font-size: clamp(8px, 2vw, 20px);
}

/* ========== CENTERED FORMS ========== */
.center-form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ========== FOOTER ========== */
.footer {
  position: fixed;
  bottom: 2vw;
  width: 100%;
  text-align: center;
  font-size: clamp(8px, 1vw, 12px);
  margin: 2vw 0;
}

/* ========== HEADER ========== */
#floating-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2.5em;
  background: #000;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
}

#floating-header .header-right {
  display: flex;
  gap: 1em;
  align-items: center;
  z-index: 1;
  pointer-events: auto; /* Re-enable interactivity */
  margin-right: 1vw;     /* Shift content left */
}

#floating-header .header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  font-size: clamp(12px, 1vw, 14px);
  white-space: nowrap;
  color: var(--text);
  pointer-events: none;
}

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  font-weight: bold;
  font-size: clamp(12px, 1vw, 14px);
  white-space: nowrap;
  color: var(--text);
  pointer-events: none;
}

.header-icon {
  font-size: 1.2em;
  color: var(--text);
}

#floating-header .header-right span {
  color: white;
  font-size: clamp(12px, 1vw, 14px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 20vw;
}

#floating-header .header-right button {
  all: unset;
  color: white;
  font-size: clamp(14px, 1.5vw, 18px);
  cursor: pointer;
  flex-shrink: 0;
}


/* ========== SIDEBAR ========== */

/* ========== SIDEBAR STYLING ========== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 20vw;
  height: 100vh;
  padding: 0 2vw 2vw 2vw;
  background-color: #000;
  color: #ccc;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease;
  z-index: 10;
  box-sizing: border-box;
  border: none;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-content {
  margin-top: 1em;
}

/* Font scaling for sidebar elements */
.sidebar h1,
.sidebar h2,
.sidebar h3,
.sidebar p,
.sidebar li,
.sidebar a {
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.4;
}

.sidebar p {
  color: #ccc;
}

.sidebar a {
  color: var(--text);
  text-decoration: none;
  margin: 0.5em 0;
  font-weight: normal;
  display: block;
  border: none;
}

.sidebar a:hover {
  text-decoration: none;
  border: none;
  color: var(--text-muted);
}

/* Sidebar buttons */
.sidebar-button-area {
  margin: 0;
  padding: 1vw 0 0 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1vw;
}

.sidebar-toggle,
.sidebar-reopen,
.sidebar-gear,
.sidebar-feed {
  all: unset;
  font-size: 2vw;
  cursor: pointer;
  z-index: 1000;
  display: block;
}

.sidebar-reopen,
.sidebar-gear,
.sidebar-feed {
  position: fixed;
  top: 1vw;
  color: var(--text);
  display: none;
}

.sidebar-reopen.visible,
.sidebar-gear.visible,
.sidebar-feed.visible {
  display: block;
}

.sidebar-reopen { left: 1.2vw; }
.sidebar-gear   { left: 4.2vw; }
.sidebar-feed   { left: 7.2vw; }

/* ========== FILTER BOX ========== */
.filter-box {
  background-color: #111;
  border-radius: 0.8em;
  padding: 1em;
  margin-bottom: 2em;
}

/* ========== SELECTS ========== */

.sidebar select,
.sidebar .select-wrapper select {
  appearance: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: clamp(10px, 1.2vw, 14px);
  padding: 0;
  margin: 0;
  cursor: pointer;
  position: relative;
  text-align: left;
}

.select-wrapper,
.dashboard-content .select-wrapper {
  position: relative;
  display: inline-block;
  margin: 0.3em 0 0.5em;
}

.select-wrapper select {
  appearance: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: clamp(10px, 1.2vw, 13px);
  padding: 0.4em 2em 0.4em 0;
  margin: 0;
  cursor: pointer;
  position: relative;
  width: 100%;
  text-align: right;
  box-sizing: border-box;
  outline: none;
  box-shadow: none;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  background-color: var(--bg);
  width: 100%;
  max-width: 100vw;
  padding: 4em 2vw 2vw 2vw;
  box-sizing: border-box;
  top-margin: 2.5em;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.sidebar-open .main-content,
.sidebar-open .dashboard-content {
  padding-left: 20vw;
}

.content-wrapper,
.dashboard-wrapper {
  width: 100%;
  margin: 0 auto;
  padding: 0 2vw;
  box-sizing: border-box;
  align-items: stretch;
}

.content-page {
  max-width: 60ch;
  padding: 5vh 5vw;
  text-align: left;
}

/* ========== DIGEST STYLES ========== */
.digest-card,
.dashboard-card {
  padding: 2vw 1.5vw;
  margin: 2vh 0vw;
  box-sizing: border-box;
  transition: box-shadow 0.2s ease;
}

.digest-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5vw;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  color: var(--text);
}

.digest-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body.dark-mode .digest-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.digest-card h2 {
  font-size: clamp(16px, 2vw, 24px);
  margin-bottom: 0.5em;
  text-align: left;
}

.digest-meta {
  font-size: clamp(8px, 1.3vw, 16px);
  color: var(--text-muted);
  margin-top: 1em;
}

.digest-tag {
  background: var(--tag-bg);
  border-radius: 0.4vw;
  padding: .2em 0.5em;
  font-size: clamp(8px, 1.2vw, 12px);
  color: var(--text);
  margin: 0.5em;
  display: inline-block;     /* ← ensures width fits content */
  max-width: fit-content;    /* ← optional, prevents stretching */
  white-space: nowrap;       /* ← keeps pills on one line */
}

.digest-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  margin-top: 1.5em;
}

.digest-link {
  font-size: clamp(8px, 1.3vw, 16px);
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.digest-link:hover {
  border-bottom-color: #999;
}

.active-tag {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0.5em 0;
  font-size: clamp(8px, 1.3vw, 16px);
  color: var(--text);
}

.active-tag button {
  all: unset;
  font-size: 1.2em;
  color: var(--text-subtle);
  cursor: pointer;
}

.active-tag button:hover {
  color: var(--text);
}

.filter-dropdown {
  display: flex;
  flex-direction: column;
  margin-top: 0.5em;
  gap: 0.5em;
}

.dropdown-option {
  all: unset;
  color: var(--text);
  font-size: clamp(13px, 1.2vw, 16px);
  cursor: pointer;
  padding: 0.2em 0;
}

.dropdown-option:hover {
  text-decoration: underline;
}

/* ========== DASHBOARD ========== */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5em;
  flex-wrap: wrap;
}

.setting-row label,
.setting-row span {
  font-size: clamp(8px, 1.3vw, 12px);
}

.dashboard-content select {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 0.3vw;
  padding: 0.4em 0.8em;
  font-size: clamp(8px, 1.3vw, 16px);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  margin-left: 1vw;
}

.dashboard-legal-footer {
  text-align: center;
  font-size: clamp(8px, 1vw, 12px);
  margin-top: 5vh;
}

/* ========== TOGGLES & MISC ========== */
.toggle-icon {
  all: unset;
  font-size: 2vw;
  cursor: pointer;
  color: var(--text);
  transition: color 0.2s ease;
  user-select: none;
}

.toggle-icon.off {
  color: var(--text-subtle);
}

.toggle-icon.on {
  color: var(--text);
}
