/* ==========================================================================
   VIKTOR STUS - OFFICIAL AUTHOR WEBSITE
   Modern Vanilla CSS - Mobile-First Architecture
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Light Theme (Default) */
  --bg-body: #fbfbf9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-muted: #f3f3ee;
  --bg-accent-soft: #f7f3ea;
  --bg-header: rgba(251, 251, 249, 0.92);

  --text-main: #242528;
  --text-muted: #62646a;
  --text-subtle: #898b92;
  --text-inverse: #ffffff;

  --primary: #9b2c2c;          /* Deep historic crimson / carmine */
  --primary-hover: #7b1d1d;
  --primary-soft: #faecec;
  --accent-gold: #c28828;      /* Antique gold / bronze */
  --accent-gold-soft: #fbf5e8;

  --border-light: #e5e5dd;
  --border-medium: #d1d1c7;
  --border-focus: #9b2c2c;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 35px rgba(0, 0, 0, 0.12);

  /* Typography */
  --font-serif: "Ibarra Real Nova", "Georgia", "Cambria", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing Scale */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;

  /* Layout */
  --container-max: 1200px;
  --container-reading: 780px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme Tokens */
[data-theme="dark"] {
  --bg-body: #141518;
  --bg-surface: #1d1e23;
  --bg-surface-elevated: #26272e;
  --bg-muted: #27282f;
  --bg-accent-soft: #25221b;
  --bg-header: rgba(20, 21, 24, 0.92);

  --text-main: #f0f0f2;
  --text-muted: #a6a8b1;
  --text-subtle: #73757f;
  --text-inverse: #141518;

  --primary: #e55353;
  --primary-hover: #ff6b6b;
  --primary-soft: #381f21;
  --accent-gold: #e2a84b;
  --accent-gold-soft: #3a2e19;

  --border-light: #2e3039;
  --border-medium: #3f424f;
  --border-focus: #e55353;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 35px rgba(0, 0, 0, 0.6);
}

/* System dark theme preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-body: #141518;
    --bg-surface: #1d1e23;
    --bg-surface-elevated: #26272e;
    --bg-muted: #27282f;
    --bg-accent-soft: #25221b;
    --bg-header: rgba(20, 21, 24, 0.92);

    --text-main: #f0f0f2;
    --text-muted: #a6a8b1;
    --text-subtle: #73757f;
    --text-inverse: #141518;

    --primary: #e55353;
    --primary-hover: #ff6b6b;
    --primary-soft: #381f21;
    --accent-gold: #e2a84b;
    --accent-gold-soft: #3a2e19;

    --border-light: #2e3039;
    --border-medium: #3f424f;
    --border-focus: #e55353;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 35px rgba(0, 0, 0, 0.6);
  }
}

/* --------------------------------------------------------------------------
   2. Modern Reset & Base Elements (Mobile-First)
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-body);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, picture, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.8vw, 2.35rem); }
h3 { font-size: clamp(1.3rem, 2.8vw, 1.8rem); }
h4 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); }
h5 { font-size: 1.1rem; }
h6 { font-size: 0.95rem; }

p {
  margin-bottom: 1.15rem;
}

p:last-child {
  margin-bottom: 0;
}

ul, ol {
  padding-left: 1.4rem;
  margin-bottom: 1.15rem;
}

li {
  margin-bottom: 0.4rem;
}

blockquote {
  border-left: 4px solid var(--accent-gold);
  padding: var(--space-sm) var(--space-lg);
  margin: var(--space-lg) 0;
  background-color: var(--bg-accent-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  background: var(--primary);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  z-index: 10000;
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-md);
  outline: 3px solid var(--accent-gold);
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   3. Containers & Global Layout (Mobile Base)
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  margin-left: auto;
  margin-right: auto;
}

.container-reading {
  max-width: var(--container-reading);
}

.site-main {
  flex: 1 0 auto;
}

.section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.section-alt {
  background-color: var(--bg-muted);
}

.section-header {
  margin-bottom: var(--space-xl);
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: var(--space-xs);
}

.section-title {
  margin-bottom: var(--space-xs);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   4. Header & Navigation (Mobile-First)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: border-color var(--transition-normal);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
}

.brand-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-gold));
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

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

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text-main);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  background-color: var(--bg-muted);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-medium);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
}

.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* Mobile Menu Toggle */
.mobile-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  background-color: var(--bg-muted);
  border: 1px solid var(--border-light);
}

.mobile-nav-toggle svg {
  width: 22px;
  height: 22px;
}

.icon-close { display: none; }
.mobile-nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.mobile-nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Primary Navigation - Mobile Drawer */
.primary-nav {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface);
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  transform: translateY(-110%);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--transition-slow), opacity var(--transition-normal), visibility var(--transition-normal);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.primary-nav.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-md);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav-link:hover, .nav-link.is-active {
  background-color: var(--bg-accent-soft);
  color: var(--primary);
  text-decoration: none;
}

.nav-link.is-active {
  border-left: 3px solid var(--primary);
}

/* Reading Progress Bar for Reviews & Long Articles */
.reading-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-gold), var(--primary));
  transition: width 0.1s ease-out;
  z-index: 1001;
}

/* --------------------------------------------------------------------------
   5. Hero Section (Mobile-First)
   -------------------------------------------------------------------------- */
.hero-section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  background: linear-gradient(180deg, var(--bg-accent-soft) 0%, var(--bg-body) 100%);
  border-bottom: 1px solid var(--border-light);
}

.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  text-align: center;
}

.hero-portrait-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
}

.hero-portrait-frame {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--bg-surface);
  box-shadow: var(--shadow-xl);
  background: var(--bg-muted);
}

.hero-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  border: 2px solid var(--bg-surface);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background-color: var(--accent-gold-soft);
  color: var(--accent-gold);
  border: 1px solid rgba(194, 136, 40, 0.25);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

.hero-title {
  margin-bottom: var(--space-sm);
  color: var(--text-main);
}

.hero-credo {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 620px;
  margin-bottom: var(--space-lg);
}

.hero-credo span {
  display: block;
}

.hero-credo .credo-accent {
  color: var(--primary);
  font-weight: 600;
  margin-top: 0.25rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  width: 100%;
  max-width: 480px;
  margin-bottom: var(--space-xl);
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.2rem;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-cta-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: var(--space-sm);
}

/* --------------------------------------------------------------------------
   6. Buttons & Inputs
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #fff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background-color: var(--bg-muted);
  color: var(--primary);
}

.btn-gold {
  background-color: var(--accent-gold);
  color: #fff;
}

.btn-gold:hover {
  background-color: #a8721c;
  color: #fff;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Form Controls */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: var(--space-xs);
}

.form-label .required {
  color: var(--primary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(155, 44, 44, 0.15);
  outline: none;
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* --------------------------------------------------------------------------
   7. Catalog, Search & Filter Controls (Mobile-First)
   -------------------------------------------------------------------------- */
.catalog-toolbar {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background-color: var(--bg-muted);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  background-color: var(--bg-surface);
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(155, 44, 44, 0.12);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  background: var(--bg-surface-elevated);
}

.search-clear-btn.is-visible {
  display: flex;
}

.filter-tabs-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.filter-tabs {
  display: flex;
  gap: var(--space-xs);
  list-style: none;
  padding: 0;
  margin: 0;
  min-width: max-content;
}

.filter-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background-color: var(--bg-muted);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.filter-tab-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-accent-soft);
}

.filter-tab-btn.is-active {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.filter-tab-count {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.72rem;
  border-radius: var(--radius-full);
  background-color: rgba(0, 0, 0, 0.08);
}

.filter-tab-btn.is-active .filter-tab-count {
  background-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.sort-select-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sort-select {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   8. Books Grid & Cards (Mobile-First)
   -------------------------------------------------------------------------- */
.books-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.book-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-medium);
}

.book-card-cover-link {
  position: relative;
  display: block;
  background: var(--bg-muted);
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.book-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.book-card:hover .book-card-cover {
  transform: scale(1.03);
}

.book-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(20, 21, 24, 0.85);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

.book-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: var(--space-md);
}

.book-card-genre {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 0.25rem;
}

.book-card-title {
  font-size: 1.25rem;
  line-height: 1.25;
  margin-bottom: var(--space-xs);
}

.book-card-title a {
  color: var(--text-main);
  text-decoration: none;
}

.book-card-title a:hover {
  color: var(--primary);
}

.book-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}

.no-results {
  text-align: center;
  padding: var(--space-3xl) var(--space-md);
  grid-column: 1 / -1;
  color: var(--text-muted);
}

.no-results svg {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-md);
  color: var(--text-subtle);
}

/* --------------------------------------------------------------------------
   9. Book Detail Page Layout (Mobile-First)
   -------------------------------------------------------------------------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  padding: var(--space-xs) 0;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  color: var(--text-subtle);
}

.book-detail-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.book-detail-media {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.book-detail-cover-box {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
}

.book-detail-cover {
  width: 100%;
  height: auto;
  display: block;
}

.book-detail-actions {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.book-detail-info {
  display: flex;
  flex-direction: column;
}

.book-detail-header {
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--space-md);
}

.book-meta-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xs);
  background-color: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
}

.book-meta-item {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border-light);
}

.book-meta-item:last-child {
  border-bottom: none;
}

.book-meta-label {
  color: var(--text-muted);
}

.book-meta-value {
  font-weight: 600;
  color: var(--text-main);
}

.book-synopsis-box {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   10. Reviews Page & Long-Form Reading Layout (Mobile-First)
   -------------------------------------------------------------------------- */
.reviews-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.reviews-sidebar {
  position: static;
  width: 100%;
}

.reviews-toc {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.toc-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-main);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.toc-link {
  display: block;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.toc-link:hover {
  background-color: var(--bg-accent-soft);
  color: var(--primary);
  text-decoration: none;
}

.toc-link.is-active {
  background-color: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

.reviews-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl);
}

.review-article {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 80px;
}

.review-header {
  margin-bottom: var(--space-lg);
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--space-md);
}

.review-meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.review-badge {
  background-color: var(--accent-gold-soft);
  color: var(--accent-gold);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.review-title {
  margin-bottom: var(--space-xs);
}

.review-subtitle {
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.05rem;
}

.review-body {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-main);
  text-align: left;
}

.review-footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   11. About Author Page Layout (Mobile-First)
   -------------------------------------------------------------------------- */
.author-profile-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: var(--space-2xl);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.author-profile-photo {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-md);
  border: 3px solid var(--border-light);
}

.author-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
  margin: var(--space-sm) 0;
}

.author-badge-pill {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background-color: var(--bg-muted);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.author-bio-text {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: var(--space-xl);
}

.timeline {
  position: relative;
  margin: var(--space-xl) 0;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background-color: var(--border-medium);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-lg);
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-xl) + 2px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 0 4px var(--bg-body);
}

.timeline-year {
  font-weight: 700;
  color: var(--accent-gold);
  font-size: 0.9rem;
}

.timeline-content {
  font-size: 0.95rem;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   12. Contact Form & Feedback Modal (Mobile-First)
   -------------------------------------------------------------------------- */
.contact-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  max-width: 640px;
  margin: 0 auto;
}

.form-alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  display: none;
}

.form-alert:empty {
  display: none !important;
}

.form-alert.is-success {
  display: block;
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

[data-theme="dark"] .form-alert.is-success {
  background-color: #064e3b;
  color: #a7f3d0;
  border-color: #047857;
}

.form-alert.is-error {
  display: block;
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

[data-theme="dark"] .form-alert.is-error {
  background-color: #7f1d1d;
  color: #fecaca;
  border-color: #991b1b;
}

/* --------------------------------------------------------------------------
   13. Footer (Mobile-First)
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding: var(--space-2xl) 0 var(--space-lg);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-col-brand .brand-title {
  margin-bottom: var(--space-xs);
}

.footer-credo {
  font-family: var(--font-serif);
  font-style: italic;
  margin-top: var(--space-xs);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-title {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-sm);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

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

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

.footer-bottom {
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  text-align: right;
  font-size: 0.82rem;
  color: var(--text-subtle);
}

/* --------------------------------------------------------------------------
   14. Toast & Lightbox / Modal
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  pointer-events: none;
}

.toast {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  animation: toastIn 0.25s ease-out;
  pointer-events: auto;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Back to Top Button */
.back-to-top-btn {
  position: fixed;
  bottom: var(--space-lg);
  left: var(--space-lg);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-md);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: all var(--transition-fast);
}

.back-to-top-btn.is-visible {
  display: flex;
}

.back-to-top-btn:hover {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   15. Progressive Enhancements: Media Queries (Min-Width Mobile-First)
   -------------------------------------------------------------------------- */

/* Small Tablets / Landscape Phones (640px+) */
@media (min-width: 640px) {
  .hero-cta-group {
    flex-direction: row;
    justify-content: center;
    width: auto;
  }

  .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .catalog-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .search-box {
    flex: 1 1 280px;
  }

  .book-meta-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-bottom {
    justify-content: flex-end;
  }
}

/* Tablets (768px+) */
@media (min-width: 768px) {
  :root {
    --container-max: 720px;
  }

  .hero-grid {
    flex-direction: row-reverse;
    justify-content: space-between;
    text-align: left;
  }

  .hero-content {
    align-items: flex-start;
    flex: 1;
  }

  .hero-cta-group {
    justify-content: flex-start;
  }

  .author-profile-box {
    flex-direction: row;
    text-align: left;
    gap: var(--space-xl);
  }

  .author-profile-photo {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .author-badges {
    justify-content: flex-start;
  }

  .book-detail-grid {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-2xl);
  }

  .book-detail-media {
    flex: 0 0 300px;
    position: sticky;
    top: 84px;
  }

  .book-detail-info {
    flex: 1;
  }

  .footer-grid {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Desktops (1024px+) */
@media (min-width: 1024px) {
  :root {
    --container-max: 960px;
  }

  .header-container {
    height: 72px;
  }

  .mobile-nav-toggle {
    display: none;
  }

  .primary-nav {
    position: static;
    flex-direction: row;
    background: transparent;
    padding: 0;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border-bottom: none;
    overflow-y: visible;
  }

  .nav-list {
    flex-direction: row;
    gap: var(--space-xs);
  }

  .nav-link {
    font-size: 0.95rem;
    padding: 0.5rem 0.85rem;
  }

  .nav-link.is-active {
    border-left: none;
    border-bottom: 2px solid var(--primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }

  .books-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Reviews 2-column sidebar layout */
  .reviews-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-2xl);
  }

  .reviews-sidebar {
    flex: 0 0 300px;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }

  .reviews-content {
    flex: 1;
    min-width: 0;
  }
}

/* Widescreen / Large Desktops (1280px+) */
@media (min-width: 1280px) {
  :root {
    --container-max: 1200px;
  }

  .books-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-portrait-wrapper {
    width: 260px;
    height: 260px;
  }
}

/* Print Styles */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .site-header,
  .site-footer,
  .catalog-toolbar,
  .theme-toggle-btn,
  .back-to-top-btn,
  .reviews-sidebar,
  .book-detail-actions {
    display: none !important;
  }

  .book-card, .review-article {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
}
