:root {
  /* === GEOMETRY === */
  --menu-width: 120px;
  --menu-breathing-room: 30px;
  --titlebar-height: 75px;
  --titlebar-height-mobile: 60px;
  --menu-btn-width: 90px;
  --zig-unit: 4px;
  --hover-lift: 4px;
  --label-lift: 3px;
  --titlebar-padding: 20px;

  /* === ANIMATION & MOTION === */
  --speed-hover: 0.15s;
}

body.darkmode {
  --color-bg-page: #0a0a0a;
  --color-menu-bg: #555555;
  --color-menu-breathing-room: #111;
  --color-title-bg: #333;
  --color-btn-bg: #111;
  --color-btn-text: #f0f0f0;
  --color-instagram: #333;
  --color-tiktok: #333;
  --color-youtube: #333;
}

body.darkmode .tear-here-logo img {
  filter: invert(1) drop-shadow(0 1px 1px rgba(255, 255, 255, 0.25));
  transition: filter 0.25s ease, transform 0.25s ease;
}

body.darkmode .tear-here-logo:hover img {
  filter: invert(1) drop-shadow(0 2px 2px rgba(255, 255, 255, 0.35));
}

body.darkmode .sauce-darkmode-btn,
body.darkmode .sauce-toggle-btn,
body.darkmode .sauce-toggle-btn social {
  color: white;
}

* {
  font-family: "Inter", sans-serif;
}
/* ============================================================
   CORE LAYOUT FIXES — REQUIRED FOR PAGE-SHELL BEHAVIOR
   ============================================================ */

/* Body should be full-height column layout (title-bar + page-shell) */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: 0;
  overflow: hidden;
  background: var(--color-bg-page);
  color: var(--color-btn-text);
}

/* ============================= */
/*  CORE LAYOUT (DESKTOP)        */
/* ============================= */

/* Body = vertical flex: title-bar + sauce menu + shell (via margins) */
body {
  margin: 0;
  background: var(--color-bg-page);
  color: var(--color-btn-text);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Page-shell sits UNDER the title bar and fills the remaining viewport.
   We will adjust its margins based on where the sauce menu is. */
.page-shell {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  /* default: assume VERTICAL menu on the left */
  margin-top: var(--titlebar-height);
  margin-left: calc(var(--menu-width) + var(--menu-breathing-room));
  height: calc(100vh - var(--titlebar-height));
}

/* Main content area inside shell */
#content.page-content {
  scroll-padding-top: var(--sauce-menu-offset);
  flex: 1 1 auto;
  overflow-y: auto;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;

  /* GLASSMORPHISM STYLES */
  background-color: rgba(100, 100, 100, 0.75);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;

  /* Animation */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hover State: Make it slightly more opaque */
.back-to-top:hover {
  background-color: rgba(150, 150, 150, 0.8);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.back-to-top:active {
  transform: scale(0.9);
}

/* Mobile: Move it up slightly so it doesn't block mobile-menu or logo links */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
}
/* ============================= */
/*  SAUCE MENU (DESKTOP)         */
/* ============================= */

/* Base (VERTICAL) – fixed sidebar under title bar on the left */
.sauce-menu-container {
  position: fixed;
  top: var(--titlebar-height);
  left: 0;
  width: calc(var(--menu-width) + var(--menu-breathing-room));
  height: calc(100vh - var(--titlebar-height));
  background: var(--color-menu-breathing-room);
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  justify-content: center;
  z-index: 1900;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* When menu is vertical, page-shell should sit to the RIGHT of it.
   NOTE: use ~ because .mobile-menu sits between them in DOM. */
.sauce-menu-container:not(.horizontal) ~ .page-shell {
  margin-top: var(--titlebar-height);
  margin-left: calc(var(--menu-width) + var(--menu-breathing-room));
  height: calc(100vh - var(--titlebar-height));
}

/* HORIZONTAL MODE – bar under the title bar spanning full width */
.sauce-menu-container.horizontal {
  top: var(--titlebar-height);
  left: 0;
  width: 100%;
  height: var(--saucemenu-horiz-height);
  background: var(--color-menu-bg);
  border-right: none;
  display: flex;
  justify-content: center;
  z-index: 1800;
  transition: all 0.15s ease;
  padding: 0 30px; /* matches your existing design */
}

/* When menu is horizontal:
   - page-shell goes FULL WIDTH
   - moves further down to clear the menu bar
   - height shrinks by menu bar height */
.sauce-menu-container.horizontal ~ .page-shell {
  margin-left: 0;
  margin-top: var(--titlebar-height);
  height: calc(100vh - var(--titlebar-height) - var(--saucemenu-horiz-height));
}

/* ======================= */
/* === SIDEBAR STATIC === */
/* ======================= */

/* === TOGGLE BUTTONS === */
.sauce-toggle-btn,
.sauce-darkmode-btn {
  position: absolute;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: black;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 3000;
  transition: background 0.15s ease, transform 0.15s ease;
}

.sauce-toggle-btn:hover,
.sauce-darkmode-btn:hover {
  background: transparent;
}

/* === Vertical layout === */
/* Bottom corners inside the sauce-menu */
.sauce-toggle-btn {
  bottom: 0px;
  left: 0px;
}

.sauce-darkmode-btn {
  bottom: 0px;
  right: 0px;
}

/* === Horizontal layout overrides === */

/* Shared geometry for both buttons */
.sauce-menu-container.horizontal .sauce-toggle-btn,
.sauce-menu-container.horizontal .sauce-darkmode-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 100%;
  align-content: center;
}

.mobile-menu {
  display: none !important;
}

/* === SAUCE MENU CONTAINER === */
.sauce-menu-container {
  position: fixed;
  top: var(--titlebar-height);
  left: 0;
  width: calc(var(--menu-width) + var(--menu-breathing-room));
  height: calc(100vh - var(--titlebar-height));
  background: var(--color-menu-bg);
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  justify-content: center;
  z-index: 1900;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* The menu itself */
.sauce-menu {
  position: relative;
  isolation: isolate; /* creates a new stacking context */
  width: var(--menu-width);
  height: 100%;
  background: var(--color-menu-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  z-index: 2000;
  border-radius: 6px;
}

/* === BUTTONS === */
.sauce-btn {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: calc(var(--menu-width) / 2 - var(--menu-breathing-room));
  cursor: pointer;
  border: none;
  background: transparent;
  overflow: visible;
  color: var(--color-btn-text);
  transition: color 0.3s ease, transform var(--speed-hover) ease;
  margin-top: calc(-2.3 * var(--zig-unit));

  --mask: conic-gradient(
      from 135deg at top,
      #0000,
      #000 1deg 89deg,
      #0000 90deg
    )
    50% / var(--zig-unit) 100% repeat-x;
  -webkit-mask: var(--mask);
  mask: var(--mask);
}

/* Each lower button sits above one above */
.sauce-btn:nth-child(1) {
  z-index: 8;
}
.sauce-btn:nth-child(2) {
  z-index: 9;
}
.sauce-btn:nth-child(3) {
  z-index: 10;
}
.sauce-btn:nth-child(4) {
  z-index: 11;
}
.sauce-btn:nth-child(5) {
  z-index: 12;
}
.sauce-btn:nth-child(6) {
  z-index: 13;
}
.sauce-btn:nth-child(7) {
  z-index: 14;
}
.sauce-btn:nth-child(8) {
  z-index: 15;
}
.sauce-btn:nth-child(9) {
  z-index: 16;
}
.sauce-btn:nth-child(10) {
  z-index: 17;
}
.sauce-btn:nth-child(11) {
  z-index: 18;
}
.sauce-btn:nth-child(12) {
  z-index: 19;
}
.sauce-btn:nth-child(13) {
  z-index: 20;
}
/*  sauce-break is nth-child(14): z-index: 21; */
.sauce-btn:nth-child(15) {
  z-index: 22;
}
.sauce-btn:nth-child(16) {
  z-index: 23;
}
.sauce-btn:nth-child(17) {
  z-index: 24;
}

/* Hover — extend bar upward slightly */
.sauce-btn:hover::before {
  height: 6px;
  opacity: 1;
  transform: translateY(1px);
}

/* === Background Fill Layer === */
.sauce-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-btn-bg);
  z-index: 0;
}

/* === LABEL (always visible now) === */
.sauce-btn span {
  position: relative;
  z-index: 2;
  font-weight: 400;
  color: var(--color-btn-text);
  font-size: 12px;
  text-transform: capitalize;
  transition: background 0.2s ease, color 0.2s ease,
    transform 0.25s var(--easing), opacity 0.25s var(--easing);
  padding: 0px 5px;
  border-radius: 3px;
  border: 2px solid transparent;
  clip-path: polygon(
    6% 100%,
    /* bottom left */ 94% 100%,
    /* bottom right */ 100% 0,
    /* top right taper */ 0 0 /* top left taper */
  );
  opacity: 1;
}

/* Hover: black text with white box */
.sauce-btn:hover span {
  background: white;
  color: black;
  border-color: white;
  transform: translateY(calc(-1 * var(--label-lift))) scale(1.05);
  padding: 0px 5px;
  opacity: 1;
}

/* Hover: lift up */
.sauce-btn:hover {
  transform: translateY(calc(-1 * var(--hover-lift)));
}

.sauce-btn.selected {
  transform: translateY(calc(-1 * var(--hover-lift))); /* stays lifted */
}

.sauce-btn:hover::after,
.sauce-btn.selected::after {
  background: var(--theme-color);
}

/* === SELECTED STATE === */
.sauce-btn.selected::after {
  background: var(--theme-color);
}
.sauce-btn.selected span {
  background: white;
  font-weight: 600;
  color: black;
  border-color: white;
  transform: translateY(calc(-1 * var(--label-lift)));
  padding: 0px 5px;
}

/* Tear Here SVG overlay (independent of label width) */
.sauce-btn.selected::before {
  content: "";
  position: absolute;
  top: 30%;
  right: 0px;
  width: 25px;
  height: 25px;
  transform: translateY(-50%);
  background: url("https://www.condimentpacket.com/images/tearhere.svg")
    no-repeat center / contain;
  opacity: 0.9;
  pointer-events: none;
  z-index: 3;
}

/* Make About / Donate / Contact always white with black text */
.sauce-btn.about::after,
.sauce-btn.donate::after,
.sauce-btn.contact::after {
  background: var(--theme-color) !important;
  transition: all 0.15s ease;
}

.sauce-btn.about span,
.sauce-btn.donate span,
.sauce-btn.contact span {
  color: black !important;
}

/* Hover: stay white, just lift a bit */
.sauce-btn.about:hover::after,
.sauce-btn.donate:hover::after,
.sauce-btn.contact:hover::after {
  background: var(--theme-color) !important;
  transition: all 0.15s ease;
}

/* === COLLAPSED (HORIZONTAL) MENU MODE === */
.sauce-menu-container.horizontal {
  top: var(--titlebar-height);
  left: 0;
  width: 100%;
  height: auto;
  background: var(--color-menu-bg);
  border-right: none;
  display: flex;
  justify-content: center;
  z-index: 1800;
  transition: all 0.15s ease;
  padding: 0 30px; /* reserves 30px on each end */
  box-shadow: 0px 4px 2px rgba(0, 0, 0, 0.5);
}

/* The menu becomes a horizontal row */
.sauce-menu-container.horizontal .sauce-menu {
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: stretch;
  width: 100vw; /* 90% of viewport width */
  margin: 0 auto;
  background: transparent;
  border-radius: 0;
  gap: 0;
  transition: all 0.15s ease;
}

/* Each button takes equal width within the 90vw space */
.sauce-menu-container.horizontal .sauce-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 3vw;
  max-height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: 12px;
  background: var(--theme-color);
  color: white;
  cursor: pointer;
  position: relative;
  border: none;
  transform-origin: bottom center !important;
  transition: all 0.15s ease;
  --mask: conic-gradient(
      from 135deg at top,
      #0000,
      #000 1deg 89deg,
      #0000 90deg
    )
    50% / var(--zig-unit) 100% repeat-x;
  -webkit-mask: var(--mask);
  mask: var(--mask);
}

/* Label text clean */
.sauce-menu-container.horizontal .sauce-btn span {
  font-size: 0.75vw;
  font-weight: 400;
  color: white;
  clip-path: none;
  border: none;
  background: none;
  transform: none;
  padding: 0;
  text-transform: capitalize;
  background: none;
  z-index: 2;
  position: relative;
}

/* === COLOR BAR (HORIZONTAL MENU ONLY) === */
.sauce-menu-container.horizontal .sauce-btn::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0.15vw;
  min-height: 3px;
  background: var(--theme-color);
  border-radius: 0;
  opacity: 0.9;
  z-index: 1;
  transition: none !important;
}

/* Hover — extend bar upward slightly */
.sauce-menu-container.horizontal .sauce-btn:hover::before {
}

/* Selected — keep bar visible and bright */
.sauce-menu-container.horizontal .sauce-btn.selected::before {
  content: "";
  position: absolute;
  top: 0.6vw;
  left: 5vw;
  width: 1vw;
  height: 1vw;
  transform: translateY(-50%);
  background: url("https://www.condimentpacket.com/images/tearhere.svg")
    no-repeat center / contain;
  pointer-events: none;
  z-index: 5; /* lift above hover backgrounds */
}

/* No vertical stack visuals in horizontal mode */
.sauce-menu-container.horizontal .sauce-break,
.sauce-menu-container.horizontal .social-row {
  display: none !important;
}

/* Hide separators & social row in horizontal view */
.sauce-menu-container.horizontal .sauce-break,
.sauce-menu-container.horizontal .social-row {
  display: none !important;
}

/* Hover rise + subtle brightness */
.sauce-menu-container.horizontal .sauce-btn:hover {
  transform: scaleY(1.16);
  transition: all 0.15s ease;
}

/* Selected state — mimic hover rise */
.sauce-menu-container.horizontal .sauce-btn.selected {
  transform: scaleY(1.16);
  transition: all 0.15s ease;
  overflow: visible !important;
}

/* Hover label lift (optional — same feel as vertical) */
.sauce-menu-container.horizontal .sauce-btn:hover span {
  color: black !important;
  transform: translateY(calc(0.4 * var(--label-lift))) scaleY(0.84);
  transition: all 0.05s ease;
  background: white;
  border-color: white;
  padding: 0px 5px;
  border-radius: 4px;
  clip-path: polygon(8% 100%, 92% 100%, 100% 0, 0 0);
}

/* Selected state — mimic hover rise */
.sauce-menu-container.horizontal .sauce-btn.selected span {
  color: black !important;
  font-weight: 700;
  transform: translateY(calc(0.4 * var(--label-lift))) scaleY(0.84);
  transition: all 0.05s ease;
  background: white;
  border-color: white;
  padding: 0px 5px;
  border-radius: 4px;
  clip-path: polygon(8% 100%, 92% 100%, 100% 0, 0 0);
}

/* Divider between sauce buttons and menu buttons */
.sauce-break {
  position: relative;
  width: 100%;
  height: 24px; /* adjust for spacing */
  background: var(--color-menu-bg);
  margin-top: 2px; /* tighten overlap if needed */
  z-index: 21; /* ensure it's on top */
  pointer-events: none; /* so it doesn’t block clicks */
}

/* Zigzag top that overlaps the last button */
.sauce-break::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  width: 100%;
  height: var(--zig-unit);
  background: var(--color-menu-bg);
  -webkit-mask: conic-gradient(
      from 135deg at top,
      #0000,
      #000 1deg 89deg,
      #0000 90deg
    )
    50% / var(--zig-unit) 100% repeat-x;
  mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg)
    50% / var(--zig-unit) 100% repeat-x;
  z-index: 10001; /* higher than buttons */
  pointer-events: none;
}

/* ======================= */
/* === TITLE BAR TOP === */
/* ======================= */

.title-bar {
  position: fixed;
  box-sizing: border-box;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--titlebar-height);
  background: var(--color-title-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--titlebar-padding);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 999;
}

/* === SVG "Tear Here" Logo === */
.tear-here-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.tear-here-logo img {
  height: 60px;
  width: auto;
  transition: transform 0.25s ease, filter 0.25s ease;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}
.tear-here-logo:hover img {
  transform: scale(1.06) rotate(-3deg);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}
/* 1. Force the left side (Logo) to only take up its natural width */
.title-brand {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-start;
  margin-right: 20px; /* Adds breathing room between the logo and the text */
}

/* 2. Make the text container fill the middle, but align the text to the left! */
.title-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-start; /* 🔥 Pushes the text against the logo */
  white-space: nowrap;
}

.archive-title-link {
  font-family: var(--font-heading, inherit);
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--general-black, #111);
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;

  /* Positioning context for the zigzag */
  position: relative;
  display: inline-block;
  width: max-content;
  line-height: 1;
  z-index: 1; /* Keeps the text in front */
}

.archive-title-link:hover {
  opacity: 0.7;
  color: var(--color-accent-alt, #666);
}

.archive-title-link:hover {
  opacity: 0.7;
  color: var(--color-accent-alt, #666);
}

/* 3. Force the right side (Search) to only take up its natural width */
.title-search {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
}

.title-spacer {
  width: calc(
    var(--menu-btn-width) * 3
  ); /* approximate combined width of buttons */
  flex: 0 0 auto;
  visibility: hidden; /* invisible but takes up space */
}
.title-search input {
  width: 85%;
  height: 38px;
  border-radius: 20px;
  border: none;
  outline: none;
  background: #222;
  color: #fff;
  padding: 0 12px;
  font-size: 14px;
  transition: background 0.3s ease;
}
.title-search input:focus {
  background: #333;
}

/* === ARCHIVE TOTAL === */
@media (max-width: 768px) {
  .archive-counter-pill {
    display: none;
  }
}
/* === SOCIAL BUTTON ROW === */
.social-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  background: var(--color-menu-bg);
  z-index: 25;
}

/* Base social buttons (rounded squares) */
.sauce-btn.social {
  width: 35px;
  height: 35px;
  margin: 0 4px;
  border-radius: 8px;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  --mask: none !important;
  transition: transform 0.05s ease, opacity 0.05s ease;
}

.sauce-btn.social:hover {
  transform: scale(1.1);
}

.sauce-btn.social.selected::before {
  background: none !important;
}
.sauce-btn.social.selected {
  transform: none !important;
}

/* Icons inside */
.sauce-btn.social img {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
}

/* Brand color backgrounds */
.sauce-btn.instagram {
  background: var(--color-instagram);
}
.sauce-btn.tiktok {
  background: var(--color-tiktok);
}
.sauce-btn.youtube {
  background: var(--color-youtube);
}

/* Remove zig mask and ::after background */
.sauce-btn.social::after {
  display: none !important;
}

/* =========================================
   VARIANT BADGE (BOTTOM PILL)
   ========================================= */
.thumb-wrap.has-variants {
  position: relative;
}

.thumb-wrap.has-variants::after {
  content: "";
  position: absolute;
  bottom: 4px; /* Lifted slightly so it floats inside the thumbnail */
  left: 50%;
  transform: translateX(-50%);

  /* Dimensions of the pill itself */
  width: 26px;
  height: 8px;
  border-radius: 4px;

  /* The dark transparent glass */
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);

  /* Draw exactly 3 distinct dots */
  background-image: radial-gradient(
      circle,
      rgba(255, 255, 255, 0.95) 1.5px,
      transparent 1.5px
    ),
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 1.5px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 1.5px, transparent 1.5px);

  /* Position them: Left, Center, Right */
  background-position: 4px center, center center, calc(100% - 4px) center;

  /* Give each dot a tiny strict bounding box so they don't warp */
  background-size: 4px 4px;
  background-repeat: no-repeat;

  pointer-events: none;
}

/* ========================= */
/* === MOBILE LAYOUT FIX === */
/* ========================= */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  /* --- Hide all desktop-only UI --- */
  .title-search,
  .title-spacer,
  .sauce-break,
  .sauce-menu-container {
    display: none !important;
  }

  /* Disable hover/white-box reactions for sauce buttons */
  .sauce-btn:hover,
  .sauce-btn:focus,
  .sauce-btn.selected {
    transform: none !important;
    background: var(--theme-color) !important;
  }

  .sauce-btn:hover span,
  .sauce-btn:focus span,
  .sauce-btn.selected span {
    background: none !important;
    color: black !important;
    border: none !important;
    transform: none !important;
  }

  /* --- Mobile Title Bar --- */
  .title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between; /* 🔥 Pushes the two items to opposite sides */
    height: var(--titlebar-height-mobile);
    background: var(--color-title-bg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    padding: 0;
  }

  /* 1. The text anchors to the left */
  .title-center {
    order: 1;
    display: flex;
    justify-content: flex-start;
    padding-left: 10px; /* Gives it a nice margin from the screen edge */
  }

  /* 2. The Tear Here logo/hamburger anchors to the right */
  .title-brand {
    order: 2;
    display: flex;
    justify-content: flex-end;
    margin-right: 0px;
  }

  .tear-here-logo {
    margin-right: 15px;
    margin-left: 0;
    cursor: pointer;
  }

  .tear-here-logo img {
    height: 42px;
    width: auto;
    transition: transform 0.25s ease;
  }

  .tear-here-logo:active img {
    transform: scale(0.95);
  }

  /* --- Mobile Menu (starts hidden) --- */
  .mobile-menu {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
    height: calc(100dvh - 60px); /*orig - 60px*/
    background: black;
    overflow: auto;
    position: fixed;
    top: 60px;
    left: 0;
    transform: translateY(-100%);
    transition: transform 0.4s ease;
    z-index: 1500;
  }

  .mobile-menu::after {
    content: "";
    position: absolute;

    /* Size */
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #aaa;

    /* Horizontal Center */
    left: 50%;
    transform: translateX(-50%);

    bottom: 25px; /*half height of the mobile menu bottom-padding*/
    margin-bottom: -2px;

    /* Safety */
    pointer-events: none;
    z-index: 9999;
  }

  /* active state when toggled */
  .mobile-menu.active {
    transform: translateY(0);
  }

  .sauce-menu-container:not(.horizontal) ~ .page-shell {
    margin-top: var(--titlebar-height);
    margin-left: 0;
    height: calc(100vh - var(--titlebar-height));
  }

  /* --- Internal Layout Rows --- */
  .mobile-row {
    width: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    display: flex; /* use flex so items stack properly in flow */
    position: relative;
  }

  .mobile-title-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    background: black;
    box-sizing: border-box;
  }
  /* --- Top row (About, Donate, Contact) --- */
  .mobile-title-wrapper .menu-buttons {
    flex: 0 0 auto;
    position: static;
    display: flex !important;
    flex-direction: row; /* 🔥 force horizontal layout */
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    left: 0;
    padding: 0px 16px;
    margin-top: 8px;
    margin-bottom: 4px;
    box-sizing: border-box;
    background: black;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .title-bar .menu-buttons {
    display: none !important;
  }

  /* --- Search row --- */
  .mobile-title-wrapper .title-search {
    flex: 0 0 auto;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 4px 16px 20px 16px;
    margin: 0;
    box-sizing: border-box;
    background: black;
  }

  .mobile-title-wrapper .title-search input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 20px;
    border: none;
    outline: none;
    background: #222222;
    color: white;
    box-sizing: border-box;
  }

  /* --- Sauce menu section --- */
  .sauce-menu {
    flex: 1 1 auto; /* <--- THIS is key */
    width: 100%;
    display: flex !important;
    flex-direction: column;
    -webkit-overflow-scrolling: touch; /* smooth on iOS */
    background: black;
    padding-bottom: 50px; /* gives cushion above Safari bar */
    scroll-behavior: smooth;
  }

  .sauce-menu .sauce-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center !important;
    padding-left: 0 !important;
    border: none;
    font-weight: 500;
    color: black;
    text-transform: capitalize;
    font-size: 18px;
    background: var(--theme-color) !important;
    position: relative;
    cursor: pointer;
    margin-top: calc(-1 * var(--zig-unit));
  }

  .sauce-menu .sauce-btn span {
    font-size: 18px;
    font-weight: 500;
    background: none !important;
    color: black !important;
    border: none !important;
    transform: none !important;
    padding: 2px 6px 8px 0px;
    clip-path: none !important;
  }

  /* Remove the overlay layer that darkens them on desktop */
  .sauce-menu .sauce-btn::after {
    display: none !important;
  }

  .sauce-btn.about,
  .sauce-btn.donate,
  .sauce-btn.contact {
    margin: 4px 6px; /* space between them */
    -webkit-mask: none !important;
    justify-content: center !important;
    padding-left: 0px !important;
    border-radius: 20px;
    background: var(--theme-color);
    transform: none !important;
    transition: none !important;
    color: black !important;
    margin: 0 !important;
    height: 35px;
  }

  .sauce-btn.about span,
  .sauce-btn.donate span,
  .sauce-btn.contact span {
    color: black !important;
    font-weight: 500 !important;
    font-size: 16px;
  }

  /* === Mobile Social Buttons === */
  .social-row {
    justify-content: center;
    display: none;
    gap: 20px;
    padding: 12px 0 28px 0;
    background: black;
    border-top: none;
  }

  /*.sauce-btn.social {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    transform: none !important;
    transition: none !important;
  }
  
  .sauce-btn.social img {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
  }*/

  /* === Disable all hover, focus, or selected effects for About / Donate / Contact on mobile === */
  .sauce-btn.about:hover,
  .sauce-btn.about:focus,
  .sauce-btn.about.selected,
  .sauce-btn.donate:hover,
  .sauce-btn.donate:focus,
  .sauce-btn.donate.selected,
  .sauce-btn.contact:hover,
  .sauce-btn.contact:focus,
  .sauce-btn.contact.selected {
    transform: none !important;
    box-shadow: none !important;
    background: var(--theme-color) !important;
  }

  /* Disable inner label reactions */
  .sauce-btn.about:hover span,
  .sauce-btn.about:focus span,
  .sauce-btn.about.selected span,
  .sauce-btn.donate:hover span,
  .sauce-btn.donate:focus span,
  .sauce-btn.donate.selected span,
  .sauce-btn.contact:hover span,
  .sauce-btn.contact:focus span,
  .sauce-btn.contact.selected span {
    background: none !important;
    border: none !important;
    transform: none !important;
    color: black !important;
    font-weight: 500 !important;
    font-size: 16px;
  }

  /* === Disable all hover, focus, or selected effects for About / Donate / Contact on mobile === */
  body .sauce-btn.about:hover,
  body .sauce-btn.about:focus,
  body .sauce-btn.about.selected,
  body .sauce-btn.donate:hover,
  body .sauce-btn.donate:focus,
  body .sauce-btn.donate.selected,
  body .sauce-btn.contact:hover,
  body .sauce-btn.contact:focus,
  body .sauce-btn.contact.selected {
    transform: none !important;
    box-shadow: none !important;
    background: var(--theme-color) !important;
    transition: none !important;
  }

  body .sauce-btn.about:hover span,
  body .sauce-btn.about:focus span,
  body .sauce-btn.about.selected span,
  body .sauce-btn.donate:hover span,
  body .sauce-btn.donate:focus span,
  body .sauce-btn.donate.selected span,
  body .sauce-btn.contact:hover span,
  body .sauce-btn.contact:focus span,
  body .sauce-btn.contact.selected span {
    background: none !important;
    border: none !important;
    color: black !important;
    transform: none !important;
    font-weight: 500 !important;
    font-size: 16px;
    transition: none !important;
  }

  /* Remove desktop overlay layer completely */
  body .sauce-btn.about::after,
  body .sauce-btn.donate::after,
  body .sauce-btn.contact::after {
    display: none !important;
  }
}

/* News posts */
.news-post {
  --post-accent: transparent;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.news-card {
  display: flex;
  flex-direction: column;
  background-color: var(--light-gray);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 8px;

  /* Tint the background using modern color-mix (supported in all current browsers) */
  background-image: linear-gradient(
    color-mix(in srgb, var(--post-accent), transparent 85%),
    color-mix(in srgb, var(--post-accent), transparent 85%)
  );
  transition: background 0.3s ease;
}
.news-row {
  display: flex;
  width: 100%;
}
.news-header {
  display: flex;
  justify-content: space-between;
}

.newsHeaderLEFT,
.newsHeaderRIGHT {
  background-color: var(--dark-gray);
  /* Layer the accent color on top of the base gray */
  background-image: linear-gradient(var(--post-accent), var(--post-accent));
  /* 'multiply' preserves the darkness of the base color (perfect for dark mode) */
  background-blend-mode: multiply;

  color: white;
  font-size: min(4.5vw, 12px);
  margin: 0;
  transition: background 0.3s ease;
}

.newsHeaderLEFT {
  width: 50%;
  border-radius: var(--radius-sm) 0 0 0;
  padding: 0 0 0 8px;
  text-align: left;
}

.newsHeaderRIGHT {
  width: 51%;
  border-radius: 0 var(--radius-sm) 0 0;
  padding: 0 8px 0 0;
  text-align: right;
}
.mainpageseparatorTEXT {
  width: 100%;
  color: black;
  text-align: left;
  font-size: min(12px, 2.5vw);
  padding: 0 0 0 8px;
  box-sizing: border-box;
  margin: 0;
}

.news-chunk .news-image {
  max-width: 30%;
  height: auto;
  object-fit: contain;
}

.news-chunk.half {
  width: 50%;
}

.news-chunk.full {
  width: 100%;
}

.news-image-row,
.news-linkbox {
  display: flex;
  flex-direction: row;
  border-radius: var(--radius-sm);
  background: black;
  padding: 8px;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 768px) {
  .news-card,
  .news-row {
    display: block;
  }

  .news-card {
    padding: 8px;
  }

  .news-chunk.half,
  .news-chunk.full,
  .news-chunk {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  .mainpageseparatorTEXT {
    padding: 8px 0 0 0;
  }
}

/* =========================================
   HOME STATS FLYOUT & DASHBOARD
========================================= */

.stat-card {
  cursor: pointer;
  /* 1. THE UN-HOVER: Slower, easing gently back into place */
  transition: transform 0.25s ease, box-shadow 0.4s ease;
  position: relative;
}

.stat-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  z-index: 2;
  /* 2. THE HOVER: Extremely snappy and eager */
  transition: transform 0.05s ease-out, box-shadow 0.05s ease-out;
}

.stat-card::after {
  content: "\f0da";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  bottom: 5px;
  right: 5px;
  opacity: 0.2;
  font-size: 0.8rem;
  transition: opacity 0.2s;
}

.stat-card:hover::after {
  opacity: 0.8;
}

/* Kill the arrow completely on mobile screens! */
@media (max-width: 768px) {
  .stat-card::after {
    display: none !important;
    content: none !important;
  }
}

.stats-flyout-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.stats-flyout-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.stats-flyout-panel {
  background: #1a1a1a;
  color: #fff;
  width: 90%;
  max-width: 450px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  transform: translateY(30px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}

.stats-flyout-overlay.active .stats-flyout-panel {
  transform: translateY(0);
}

.stats-flyout-header {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-flyout-header h3 {
  margin: 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-flyout-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s;
}

.stats-flyout-close:hover {
  color: #fff;
}

.stats-flyout-content {
  padding: 8px 8px 8px 8px;
  overflow-y: auto;
  font-family: sans-serif;
  overscroll-behavior: contain;
}

.stat-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.stat-bar-label {
  width: 90px;
  font-size: 0.85rem;
  text-align: left;
  padding-right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-bar-track {
  flex: 1;
  height: 10px;
  background: #000;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.stat-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease;
}

.stat-bar-pct {
  width: 45px;
  font-size: 0.8rem;
  text-align: right;
  margin-left: 10px;
  color: #aaa;
  font-variant-numeric: tabular-nums;
}

.stat-placeholder {
  text-align: center;
  color: #888;
  padding: 20px 0;
  line-height: 1.5;
  font-style: italic;
}

/* Extracted from the inline JS loop! */
.stat-hover-row:hover .stat-bar-row {
  background: rgba(255, 255, 255, 0.05);
}
