/* ==========================================================================
   KYPLAIN.CA /HOME — MODERN ENGINEERING JOURNAL & BLOG DESIGN SYSTEM
   ========================================================================== */

/* ──────────────────────────────────────────────────────────────────────────
   THEME 1 — MORNING  (06:00–11:59)  "Caffeine & Dawn"
   Fresh, frosty, sunrise-orange accents — for converting caffeine into spells
   ────────────────────────────────────────────────────────────────────────── */
[data-theme="morning"] {
  --bg-primary: #f0f4f3;
  --bg-base: #f0f4f3;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #e2ebe7;
  --bg-glass: rgba(240, 244, 243, 0.92);
  --bg-glass-card: rgba(255, 255, 255, 0.98);
  --bg-input: #ffffff;

  --border-subtle: #cbd5d1;
  --border-strong: #94a39e;
  --border-focus: #ea580c;

  --text-main: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-link: #d97706;

  --accent-color: #ea580c;
  --accent-primary: #ea580c;
  --accent-secondary: #d97706;
  --accent-glow: rgba(234, 88, 12, 0.18);
  --accent-gradient: linear-gradient(135deg, #ea580c 0%, #d97706 100%);

  --tag-bg: rgba(234, 88, 12, 0.10);
  --tag-text: #c2410c;
  --tag-border: rgba(234, 88, 12, 0.28);

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 20px rgba(234, 88, 12, 0.22);

  --code-bg: #0f172a;
  --code-text: #fbbf24;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

/* ──────────────────────────────────────────────────────────────────────────
   THEME 2 — AFTERNOON  (12:00–17:59)  "High-Leverage Daylight"
   Clean white, sharp sky-blue — maximum reading clarity for long-form writing
   ────────────────────────────────────────────────────────────────────────── */
[data-theme="afternoon"],
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.94);
  --bg-glass-card: rgba(255, 255, 255, 0.98);
  --bg-input: #ffffff;

  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-link: #2563eb;

  --accent-color: #2563eb;
  --accent-primary: #2563eb;
  --accent-secondary: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.16);
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);

  --tag-bg: rgba(37, 99, 235, 0.08);
  --tag-text: #1d4ed8;
  --tag-border: rgba(37, 99, 235, 0.22);

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.20);

  --code-bg: #0f172a;
  --code-text: #60a5fa;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

/* ──────────────────────────────────────────────────────────────────────────
   THEME 3 — EVENING  (18:00–21:59)  "Golden Hour & Dusk"
   Warm mauve/purple, parchment text, amber accents — reduced blue-light dusk
   ────────────────────────────────────────────────────────────────────────── */
[data-theme="evening"] {
  --bg-primary: #252229;
  --bg-base: #252229;
  --bg-surface: #302b35;
  --bg-surface-elevated: #1d1b20;
  --bg-glass: rgba(37, 34, 41, 0.90);
  --bg-glass-card: rgba(48, 43, 53, 0.88);
  --bg-input: rgba(37, 34, 41, 0.95);

  --border-subtle: rgba(248, 250, 252, 0.14);
  --border-strong: rgba(248, 250, 252, 0.26);
  --border-focus: #f97316;

  --text-main: #f8fafc;
  --text-primary: #f8fafc;
  --text-secondary: #e2d9c8;
  --text-muted: #a89f91;
  --text-link: #fb923c;

  --accent-color: #f97316;
  --accent-primary: #f97316;
  --accent-secondary: #ea580c;
  --accent-glow: rgba(249, 115, 22, 0.25);
  --accent-gradient: linear-gradient(135deg, #f97316 0%, #ea580c 100%);

  --tag-bg: rgba(249, 115, 22, 0.16);
  --tag-text: #fdba74;
  --tag-border: rgba(249, 115, 22, 0.32);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 22px rgba(249, 115, 22, 0.30);

  --code-bg: #151318;
  --code-text: #fdba74;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

/* ──────────────────────────────────────────────────────────────────────────
   THEME 4 — NIGHT  (22:00–05:59)  "Warlock's Terminal"
   Deep midnight blue, neon green/purple glows — for the kernel-tinkering hours
   ────────────────────────────────────────────────────────────────────────── */
[data-theme="night"],
[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-base: #090d16;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #020617;
  --bg-glass: rgba(9, 13, 22, 0.90);
  --bg-glass-card: rgba(15, 23, 42, 0.88);
  --bg-input: rgba(9, 13, 22, 0.95);

  --border-subtle: rgba(168, 85, 247, 0.18);
  --border-strong: rgba(168, 85, 247, 0.35);
  --border-focus: #a855f7;

  --text-main: #f8fafc;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-link: #c084fc;

  --accent-color: #a855f7;
  --accent-primary: #a855f7;
  --accent-secondary: #10b981;
  --accent-glow: rgba(168, 85, 247, 0.30);
  --accent-gradient: linear-gradient(135deg, #a855f7 0%, #10b981 100%);

  --tag-bg: rgba(168, 85, 247, 0.15);
  --tag-text: #d8b4fe;
  --tag-border: rgba(168, 85, 247, 0.32);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.50);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.60);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 28px rgba(168, 85, 247, 0.40);

  --code-bg: #000000;
  --code-text: #34d399;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

/* Fallback :root — defaults to afternoon palette so pre-JS render looks right */
:root {
  --bg-primary: #ffffff;
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.94);
  --bg-glass-card: rgba(255, 255, 255, 0.98);
  --bg-input: #ffffff;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #2563eb;
  --text-main: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-link: #2563eb;
  --accent-color: #2563eb;
  --accent-primary: #2563eb;
  --accent-secondary: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.16);
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --tag-bg: rgba(37, 99, 235, 0.08);
  --tag-text: #1d4ed8;
  --tag-border: rgba(37, 99, 235, 0.22);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.20);
  --code-bg: #0f172a;
  --code-text: #60a5fa;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

:root {
  --accent: var(--accent-primary, #0284c7);
}

/* Base Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Reading Progress Bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent-gradient);
  width: 0%;
  z-index: 1000;
  transition: width 0.1s linear;
}

/* Header & Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color 0.4s ease, background-color 0.4s ease;
}

.nav-container {
  max-width: 1480px;
  width: 92vw;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-md);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.brand-widget:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md), 0 0 12px var(--accent-glow);
  transform: translateY(-1px);
}

.widget-weather {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  user-select: none;
}

.widget-weather .weather-icon {
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.widget-weather .weather-temp {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: -0.02em;
}

.widget-separator {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
}

.widget-datetime {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  user-select: none;
}

.widget-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.widget-date {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
  box-shadow: var(--shadow-glow);
}

/* Live Market Quota Scrolling Marquee */
.market-ticker-wrap {
  flex: 1;
  max-width: 640px;
  min-width: 220px;
  height: 36px;
  overflow: hidden;
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  margin: 0 0.5rem;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  cursor: default;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.market-ticker-wrap:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.market-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 1.4rem;
  white-space: nowrap;
  will-change: transform;
  animation: marquee-scroll 34s linear infinite;
  padding-left: 0.75rem;
}

.market-ticker-wrap:hover .market-ticker-track {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.ticker-symbol {
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  letter-spacing: -0.01em;
}

.ticker-symbol-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.ticker-price {
  color: var(--text-primary);
  font-weight: 700;
}

.ticker-change {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.38rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
}

.ticker-change.positive {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.ticker-change.negative {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.ticker-divider {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-strong);
  opacity: 0.5;
  margin-left: 0.35rem;
}

@media (max-width: 1024px) {
  .market-ticker-wrap {
    max-width: 400px;
  }
}

@media (max-width: 768px) {
  .market-ticker-wrap {
    max-width: 280px;
    height: 32px;
    margin: 0 0.25rem;
  }
  .ticker-item {
    font-size: 0.72rem;
    gap: 0.35rem;
  }
}

@media (max-width: 480px) {
  .market-ticker-wrap {
    display: none;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-link-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-surface-elevated);
  transform: translateY(-1px);
}

.nav-link-ticket {
  color: var(--accent-primary);
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.08);
}

.nav-link-ticket:hover {
  background: rgba(14, 165, 233, 0.16);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

@media (max-width: 768px) {
  .nav-link-btn {
    display: none;
  }
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.theme-toggle-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--border-strong);
  transform: scale(1.05);
}

/* Main Content Layout */
.main-wrapper {
  max-width: 1480px;
  width: 92vw;
  margin: 0 auto;
  padding: 1.25rem 1.25rem;
  flex: 1;
}

.main-layout-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .main-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* Section Navigation Tabs */
.main-nav-tabs {
  display: flex;
  gap: 0.6rem;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.main-tab-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.main-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.main-tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  background: var(--bg-surface);
}

/* Right Profile Sidebar Card */
.profile-sidebar-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-avatar-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto;
  padding: 3px;
  background: var(--accent-gradient);
  box-shadow: var(--shadow-glow);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--bg-surface-elevated);
}

.profile-header-info {
  text-align: center;
}

.profile-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.profile-role-badge {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
  font-size: 0.76rem;
  font-weight: 700;
}

.profile-bio {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  text-align: center;
}

.profile-stack-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.profile-stack-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
}

.profile-stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.stack-tag-pill {
  font-size: 0.74rem;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
}

.profile-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid var(--border-subtle);
}

.profile-btn-primary {
  background: var(--accent-gradient);
  color: #ffffff !important;
  border: none;
  box-shadow: var(--shadow-sm);
}

.profile-btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.profile-btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.profile-btn-secondary:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.profile-btn-ticket {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  color: #ffffff !important;
  border: none;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.profile-btn-ticket:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}

/* Portfolio Cards Grid */
.portfolios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ── Gallery Controls & Sub-Navigation ───────────────────── */
.gallery-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.gallery-view-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: fit-content;
}

.gallery-view-btn {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gallery-view-btn:hover {
  color: var(--text-primary);
}

.gallery-view-btn.active {
  background: var(--accent-primary);
  color: #070a12;
  box-shadow: 0 2px 10px rgba(0, 229, 255, 0.35);
}

/* ── Album Deep-Dive Hero Card ─────────────────────────────── */
.gallery-album-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.gallery-back-btn {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-back-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateX(-2px);
}

.gallery-album-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.5rem 0 0.35rem;
}

.gallery-album-hero-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.85rem;
}

.gallery-album-hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.gallery-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--accent-primary);
}

/* ── Gallery Under Construction Notice Banner ─────────────── */
.gallery-construction-banner {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(234, 179, 8, 0.4);
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.08) 0%, rgba(245, 158, 11, 0.04) 100%);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(234, 179, 8, 0.08);
  position: relative;
  overflow: hidden;
}

.gallery-construction-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #eab308 0%, #f59e0b 100%);
}

.gallery-construction-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(234, 179, 8, 0.16);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.gallery-construction-icon {
  font-size: 1.35rem;
  animation: construction-pulse 2.5s ease-in-out infinite;
}

@keyframes construction-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(3deg); }
}

.gallery-construction-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.gallery-construction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gallery-construction-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gallery-construction-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(234, 179, 8, 0.2);
  color: #ca8a04;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

[data-theme="night"] .gallery-construction-badge,
[data-theme="evening"] .gallery-construction-badge {
  color: #fde047;
}

.gallery-construction-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ── Gallery Albums Grid ─────────────────────────────────── */
.gallery-albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.gallery-album-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.gallery-album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  border-color: var(--accent-primary);
}

.gallery-album-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #090c10;
}

.gallery-album-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-album-card:hover .gallery-album-cover-img {
  transform: scale(1.05);
}

.gallery-album-count-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.gallery-album-body {
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.4rem;
}

.gallery-album-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
}

.gallery-album-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: auto;
}

.gallery-album-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Gallery Photos Grid ─────────────────────────────────── */
.gallery-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.15rem;
}

.gallery-photo-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.gallery-photo-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border-color: var(--accent-primary);
}

.gallery-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-photo-card:hover .gallery-photo-img {
  transform: scale(1.06);
}

.gallery-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.85rem;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.gallery-photo-card:hover .gallery-photo-overlay {
  opacity: 1;
}

.gallery-photo-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 2px;
}

.gallery-photo-caption {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.gallery-photo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ── Lightbox Fullscreen Slideshow Modal ──────────────────── */
.gallery-lightbox-card {
  position: relative;
  max-width: 960px;
  width: 94vw;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-lightbox-close:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: #ef4444;
  transform: scale(1.1);
}

.gallery-lightbox-media-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 340px;
  max-height: 68vh;
  overflow: hidden;
}

.gallery-lightbox-img-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-height: 68vh;
}

.gallery-lightbox-img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  display: block;
}

.gallery-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-arrow-prev {
  left: 12px;
}

.gallery-arrow-next {
  right: 12px;
}

.gallery-nav-arrow:hover {
  background: var(--accent-primary);
  color: #070a12;
  border-color: var(--accent-primary);
  transform: translateY(-50%) scale(1.1);
}

.gallery-lightbox-info-bar {
  padding: 1rem 1.35rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.gallery-lightbox-details {
  flex: 1;
  min-width: 200px;
}

.gallery-lightbox-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.gallery-lightbox-caption {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.gallery-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-like-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ff6b6b;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.gallery-like-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  transform: scale(1.05);
}

/* ── Gallery Empty State ─────────────────────────────────── */
.gallery-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2rem;
  gap: 0.75rem;
  text-align: center;
}

.gallery-empty-icon {
  font-size: 2.8rem;
  opacity: 0.6;
}

.gallery-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.gallery-empty-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}


.portfolio-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.portfolio-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.portfolio-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.portfolio-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.portfolio-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
}

.portfolio-card-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
  line-height: 1.3;
}

.portfolio-card-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

.portfolio-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.portfolio-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Hero Section */
.hero-section {
  text-align: left;
  margin-bottom: 1.25rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--tag-text);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.45rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 1100px;
  line-height: 1.55;
  font-weight: 500;
}

/* ── Hero Badges & Studio 4-Pillar Services Grid ──────────────────────── */
.hero-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.hero-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--tag-text);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.studio-availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #10b981;
  font-size: 0.76rem;
  font-weight: 600;
}

.studio-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: studioPulseDot 2s infinite ease-in-out;
}

@keyframes studioPulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-services-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.hero-service-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hero-service-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md), 0 0 16px var(--accent-glow);
}

.hero-service-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.hero-service-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-service-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
}

.hero-service-desc {
  font-size: 0.79rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* ── Studio Contact & Operations Hub (Sidebar) ────────────────────────── */
.studio-contact-hub {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.studio-contact-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.studio-contact-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.studio-contact-row:hover {
  border-color: var(--accent-primary);
  background: var(--bg-surface-elevated);
  transform: translateX(2px);
  color: var(--accent-primary);
}

.studio-contact-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.studio-contact-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
}

.studio-contact-label {
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-weight: 600;
}

.studio-contact-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  word-break: break-all;
}

.studio-hours-row {
  border-style: dashed;
}
.studio-hours-row:hover {
  transform: none;
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

/* Search & Filter Controls */
.controls-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-wrap: wrap;
}

.search-bar-wrapper {
  position: relative;
  min-width: 280px;
  max-width: 400px;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.category-filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}

.filter-pill {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.32rem 0.8rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-pill.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

/* Featured Lead Post */
.featured-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.featured-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 16px var(--accent-glow);
  border-color: var(--accent-primary);
}

.featured-content {
  padding: 1rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.featured-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  background: var(--accent-gradient);
  color: #ffffff;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: fit-content;
  box-shadow: var(--shadow-sm);
}

.featured-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0.1rem 0;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.featured-card:hover .featured-title {
  color: var(--text-link);
}

.featured-excerpt {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.25rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.featured-read-btn {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.tag-badge {
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--tag-text);
  padding: 0.18rem 0.5rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Post Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.post-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card-banner {
  height: 6px;
  width: 100%;
}

.card-body {
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 0.55rem;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.post-card:hover .card-title {
  color: var(--text-link);
}

.card-excerpt {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.read-more-link {
  color: var(--text-link);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  background: var(--bg-glass-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* Newsletter & RSS Subscription Empty State */
.empty-blog-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.newsletter-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--tag-bg);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--tag-border);
}

.empty-blog-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.empty-blog-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 1.75rem auto;
  line-height: 1.6;
}

.newsletter-box {
  width: 100%;
  max-width: 460px;
  margin-bottom: 1.25rem;
}

.newsletter-input-row {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.newsletter-input-row:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.newsletter-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
}

.newsletter-input::placeholder {
  color: var(--text-muted);
}

.newsletter-btn {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.newsletter-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.newsletter-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.newsletter-status {
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-align: center;
}

.newsletter-status-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.newsletter-status-error {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.newsletter-rss-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.rss-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #d97706;
  border-radius: 20px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.78rem;
  transition: all 0.2s ease;
}

.rss-badge:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
  transform: translateY(-1px);
}

/* Article Reader Modal / Full Page View */
.article-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  overflow-y: auto;
  padding: 2rem 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.article-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.article-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  max-width: 1140px;
  width: 100%;
  margin: auto;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.article-header {
  padding: 2.5rem 2.5rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.article-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.article-close-btn:hover {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
}

.article-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 1rem 0 1.25rem;
  color: var(--text-primary);
}

.article-author-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gradient);
  padding: 2px;
  object-fit: cover;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.author-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Article Content Body */
.article-body {
  padding: 2.5rem;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.article-body h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 2rem 0 1rem;
  color: var(--text-primary);
}

.article-body h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.article-body ul,
.article-body ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-secondary);
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body blockquote {
  border-left: 4px solid var(--accent-primary);
  background: var(--bg-surface-elevated);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.75rem 0;
  font-style: italic;
  color: var(--text-primary);
}

.article-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}

.article-body p code {
  background: var(--bg-surface-elevated);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--code-text);
  font-size: 0.88rem;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.article-body figure {
  margin: 1.75rem 0;
}

.article-body figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
  text-align: center;
}

.article-body .live-preview-callout,
.article-body .article-callout {
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
}

.article-body .article-callout ul,
.article-body .article-callout ol {
  margin: 0.75rem 0 0 1.25rem;
  color: var(--text-primary);
}

.article-body .article-callout li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.article-body .callout-critical {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.article-body .callout-warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.article-body .callout-success {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.article-footer {
  padding: 1.5rem 2.5rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.share-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.share-btn:hover {
  border-color: var(--border-strong);
  background: var(--accent-gradient);
  color: #fff;
}

/* Reader Thumbs Up / Down Rating Widget */
.article-rating-card {
  margin-top: 2.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.article-rating-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.article-rating-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-rating-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.rating-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.25rem;
  border-radius: 30px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.rating-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.rating-btn-up:hover {
  border-color: #10b981;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.rating-btn-up.active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.16);
  color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.rating-btn-down:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.rating-btn-down.active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.rating-icon {
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}

.rating-btn:active .rating-icon {
  transform: scale(1.25);
}

.rating-feedback-msg {
  font-size: 0.82rem;
  font-weight: 600;
  color: #10b981;
  min-height: 18px;
  transition: all 0.2s ease;
}

/* Card rating preview badge */
.card-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  padding: 2.5rem 1.5rem 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-newsletter-wrap {
  max-width: 480px;
  margin: 0 auto 1.75rem auto;
}

.footer-newsletter-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}

.footer-newsletter-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.15rem;
  line-height: 1.5;
}

.footer-newsletter-box {
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-link);
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .featured-card {
    border-radius: var(--radius-lg);
  }

  .hero-title {
    font-size: 2.2rem;
  }
}

@media (max-width: 640px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }

  .article-header,
  .article-body,
  .article-footer {
    padding: 1.5rem;
  }

  .article-title {
    font-size: 1.6rem;
  }

  .nav-container {
    padding: 0.75rem 1rem;
  }
}

/* Contact Modal Form Popup */
.contact-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  margin: auto;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
}

.contact-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.contact-modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.contact-modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 600px) {
  .form-row-2col {
    grid-template-columns: 1fr;
  }
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.contact-btn-cancel {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.contact-btn-cancel:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.contact-btn-submit {
  background: var(--accent-gradient);
  border: none;
  color: #ffffff;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all 0.2s ease;
}

.contact-btn-submit:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.contact-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   PETITION BANNER — OpenMedia / Net Neutrality
   ========================================================================== */

.petition-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0.65rem 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-md, 12px);
  text-decoration: none;
  border: 1px solid rgba(234, 88, 12, 0.35);
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.09) 0%, rgba(217, 119, 6, 0.07) 100%);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
}

.petition-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.petition-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.2);
  border-color: rgba(234, 88, 12, 0.55);
}

.petition-banner-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
  animation: petition-pulse 2.4s ease-in-out infinite;
}

@keyframes petition-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.petition-banner-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.petition-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: #c2410c;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.petition-banner-desc {
  font-size: 11px;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.petition-banner-cta {
  font-size: 11px;
  font-weight: 700;
  color: #ea580c;
  margin-top: 3px;
  letter-spacing: 0.02em;
}

/* -- Afternoon / Light theme ------------------------------------------------ */
[data-theme="afternoon"] .petition-banner,
[data-theme="light"] .petition-banner {
  border-color: rgba(37, 99, 235, 0.3);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.07) 0%, rgba(29, 78, 216, 0.05) 100%);
}
[data-theme="afternoon"] .petition-banner:hover,
[data-theme="light"] .petition-banner:hover {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.18);
}
[data-theme="afternoon"] .petition-banner-title,
[data-theme="light"] .petition-banner-title {
  color: #1d4ed8;
}
[data-theme="afternoon"] .petition-banner-cta,
[data-theme="light"] .petition-banner-cta {
  color: #2563eb;
}

/* -- Evening theme ---------------------------------------------------------- */
[data-theme="evening"] .petition-banner {
  border-color: rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.09) 0%, rgba(109, 40, 217, 0.06) 100%);
}
[data-theme="evening"] .petition-banner:hover {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.2);
}
[data-theme="evening"] .petition-banner-title {
  color: #a78bfa;
}
[data-theme="evening"] .petition-banner-cta {
  color: #8b5cf6;
}

/* -- Night theme ------------------------------------------------------------ */
[data-theme="night"] .petition-banner {
  border-color: rgba(20, 184, 166, 0.3);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.09) 0%, rgba(13, 148, 136, 0.06) 100%);
}
[data-theme="night"] .petition-banner:hover {
  border-color: rgba(20, 184, 166, 0.55);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.2);
}
[data-theme="night"] .petition-banner-title {
  color: #5eead4;
}
[data-theme="night"] .petition-banner-cta {
  color: #14b8a6;
}

/* ==========================================================================
   HOMEPAGE LIVE VISUAL STUDIO & ELEMENT INSPECTOR (ADMIN & MODERATOR ONLY)
   ========================================================================== */

/* ── Floating Studio Dock ──────────────────────────────────────────────── */
.live-studio-dock {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 12, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 40px;
  padding: 6px 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75), 0 0 24px rgba(0, 229, 255, 0.18);
  user-select: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 95vw;
}

.live-studio-dock.dock-minimized {
  left: auto;
  right: 22px;
  transform: none;
  border-radius: 30px;
  padding: 6px 10px;
  background: rgba(8, 12, 20, 0.94);
}

.studio-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  margin-right: 4px;
}

.studio-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #00e5ff;
}

.studio-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.studio-user-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
}

.studio-user-role {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.studio-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.studio-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

.studio-btn.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border-color: #00e5ff;
  color: #38bdf8;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.35);
}

.studio-btn-save {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-color: #34d399;
  color: #ffffff;
}

.studio-btn-save:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.45);
}

.studio-btn-save.dirty {
  animation: studioPulseSave 2s infinite;
}

@keyframes studioPulseSave {
  0%, 100% { box-shadow: 0 0 0 rgba(245, 158, 11, 0); }
  50% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.7); }
}

.studio-btn-admin {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.studio-btn-admin:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818cf8;
  color: #ffffff;
}

.studio-btn-minimize {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.studio-btn-minimize:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* ── In-Place Editable Content Highlights ─────────────────────────────── */
body.studio-edit-mode-active [contenteditable="true"] {
  outline: 2px dashed rgba(0, 229, 255, 0.5) !important;
  outline-offset: 4px;
  border-radius: 4px;
  cursor: text !important;
  transition: outline 0.15s ease, background 0.15s ease;
}

body.studio-edit-mode-active [contenteditable="true"]:hover {
  outline: 2px dashed #00e5ff !important;
  background: rgba(0, 229, 255, 0.05) !important;
}

body.studio-edit-mode-active [contenteditable="true"]:focus {
  outline: 2px solid #00e5ff !important;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4) !important;
  background: rgba(0, 229, 255, 0.08) !important;
}

/* ── Element Inspector Bounding Boxes ─────────────────────────────────── */
#inspector-hover-box {
  position: absolute;
  pointer-events: none;
  border: 2px solid #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  z-index: 9998;
  border-radius: 4px;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
  transition: all 0.05s ease-out;
  display: none;
}

#inspector-tag-badge {
  position: absolute;
  top: -24px;
  left: 0;
  background: #0284c7;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

#inspector-selected-box {
  position: absolute;
  pointer-events: none;
  border: 2px solid #10b981;
  background: rgba(16, 185, 129, 0.16);
  z-index: 9997;
  border-radius: 4px;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.45);
  display: none;
}

/* ── Live Inspector Slide-Up Drawer ───────────────────────────────────── */
.live-inspector-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 380px;
  max-height: 80vh;
  z-index: 9999;
  background: #070a12;
  border-top: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(100%);
  color: #f1f5f9;
}

.live-inspector-drawer.drawer-open {
  transform: translateY(0);
}

.inspector-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #0d121d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.inspector-target-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-target-pill {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
}

.inspector-dim-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #94a3b8;
}

.inspector-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspector-mini-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.inspector-mini-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.inspector-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  padding: 4px 8px;
  cursor: pointer;
  line-height: 1;
}

.inspector-close-btn:hover {
  color: #ef4444;
}

.inspector-tabs-nav {
  display: flex;
  background: #090e17;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 12px;
}

.inspector-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inspector-tab-btn:hover {
  color: #e2e8f0;
}

.inspector-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}

.inspector-body-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

.inspector-pane {
  display: none;
  height: 100%;
}

.inspector-pane.active {
  display: block;
}

/* ── Inspector Controls & Forms ───────────────────────────────────────── */
.inspector-prop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.inspector-control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inspector-control-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inspector-input,
.inspector-select {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 6px;
  color: #f3f4f6;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.inspector-input:focus,
.inspector-select:focus {
  border-color: #38bdf8;
}

.inspector-color-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspector-color-picker {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #374151;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.inspector-code-block {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
}

.inspector-toast {
  position: fixed;
  top: 70px;
  right: 24px;
  z-index: 10001;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #00e5ff;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: studioFadeIn 0.25s ease;
}

@keyframes studioFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Store & Marketplace Section ────────────────────────────────────────── */
.store-hero-banner {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.store-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 70%);
  pointer-events: none;
}

.store-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.store-hero-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.store-hero-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 900px;
  margin-bottom: 1.25rem;
}

.store-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.store-kijiji-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  transition: all 0.2s ease;
}

.store-kijiji-profile-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
  color: #ffffff;
}

.store-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-decoration: none;
  transition: all 0.2s ease;
}

.store-call-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-surface);
}

.store-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.store-count-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-surface-elevated);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.store-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.store-item-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.store-item-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg), 0 0 20px var(--accent-glow);
}

.store-card-img-wrap {
  width: 100%;
  height: 220px;
  background: #0f172a;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.store-item-card:hover .store-card-img {
  transform: scale(1.05);
}

.store-price-tag {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
}

.store-card-body {
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.store-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.store-card-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.store-condition-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.store-condition-pill.condition-new {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.store-condition-pill.condition-used {
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.store-condition-pill.condition-excellent {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.store-condition-pill.condition-parts {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.store-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
  line-height: 1.3;
}

.store-card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

.store-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border-subtle);
  margin-bottom: 0.85rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.store-location-chip, .store-stock-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.store-card-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.store-card-btn-kijiji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(2, 132, 199, 0.3);
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.store-card-btn-kijiji:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.store-card-btn-inquire {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.store-card-btn-inquire:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-surface);
}

/* ── Sidebar Featured / Latest Store Item Widget ─────────────── */
.sidebar-latest-store-section {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-store-live-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.sidebar-featured-store-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 0.6rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.sidebar-featured-store-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.16);
}

.sidebar-store-img-wrap {
  position: relative;
  width: 100%;
  height: 150px;
  overflow: hidden;
  background: var(--bg-surface);
}

.sidebar-store-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.sidebar-featured-store-card:hover .sidebar-store-img {
  transform: scale(1.05);
}

.sidebar-store-price-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-store-content {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-store-cond-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.72rem;
}

.sidebar-store-cond-pill {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.sidebar-store-loc {
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-store-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0;
}

.sidebar-store-item-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-store-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 0.35rem;
}

.sidebar-store-btn-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-store-btn-view:hover {
  background: #0369a1;
  color: #ffffff;
}

.sidebar-store-btn-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-store-btn-all:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}