/**
 * The Black Captain - Maritime Lübeck Design
 * Inspired by: Captain's cabin elegance + Hanseatic heritage + 2025 warm minimalism
 */

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

:root {
  /* Captain's Cabin Color Palette - Warm & Rich */
  --wood-dark: #3E2723;        /* Deep mahogany */
  --wood-medium: #5D4037;      /* Rich walnut */
  --wood-light: #6D4C41;       /* Warm teak */

  /* Lübeck Hanseatic Colors */
  --lubeck-red: #B71C1C;       /* Lübeck flag red */
  --lubeck-red-light: #C62828;
  --lubeck-white: #FFF8DC;     /* Warm white/cornsilk */

  /* Nautical Brass & Copper Accents */
  --brass: #B8860B;            /* Dark goldenrod brass */
  --copper: #CD7F32;           /* Warm copper */
  --bronze: #8B7355;           /* Antique bronze */

  /* Elegant Neutrals - Warm Minimalism */
  --parchment: #F5F5DC;        /* Beige/old maps */
  --cream: #FAF0E6;            /* Linen */
  --sand: #E8DCC4;             /* Warm sand */
  --taupe: #D4C4B0;            /* Soft taupe */

  /* Text Colors */
  --text-primary: #2C1810;     /* Deep brown-black */
  --text-secondary: #5D4037;   /* Medium wood tone */
  --text-light: #8D6E63;       /* Light warm gray */

  /* Background & Borders */
  --bg-primary: #FFF8DC;       /* Warm white */
  --bg-secondary: #F5F5DC;     /* Subtle parchment */
  --border-light: #D4C4B0;     /* Soft taupe */
  --border-medium: #B8A898;    /* Medium border */
  --border-dark: #8B7355;      /* Dark bronze */

  /* Legacy variable aliases for compatibility */
  --bg: var(--bg-primary);
  --text: var(--text-primary);
  --text-light: var(--text-secondary);
  --border: var(--border-light);
  --accent: var(--lubeck-red);
  --accent-hover: var(--brass);

  /* Typography */
  --font-display: 'Playfair Display', 'Georgia', 'Garamond', serif;
  --font-serif: 'Georgia', 'Cambria', 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;

  /* Spacing - Generous & Elegant */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  /* Layout */
  --max-width: 800px;
  --reading-width: 720px;

  /* Decorative */
  --shadow-subtle: 0 2px 8px rgba(62, 39, 35, 0.08);
  --shadow-medium: 0 4px 16px rgba(62, 39, 35, 0.12);
  --shadow-strong: 0 8px 24px rgba(62, 39, 35, 0.16);
}

/* Dark mode - Night in the Captain's Cabin */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1A1410;          /* Deep night wood */
    --bg-secondary: #2C1810;        /* Darker mahogany */
    --text-primary: #E8DCC4;        /* Warm sand text */
    --text-secondary: #D4C4B0;      /* Taupe */
    --text-light: #B8A898;          /* Light border */
    --border-light: #3E2723;        /* Dark wood */
    --border-medium: #5D4037;       /* Medium wood */
    --border-dark: #6D4C41;         /* Light wood */
    --brass: #DAA520;               /* Brighter brass for visibility */
    --lubeck-red: #E53935;          /* Brighter red */
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.5);

    /* Legacy aliases for dark mode */
    --bg: var(--bg-primary);
    --text: var(--text-primary);
    --border: var(--border-light);
    --accent: var(--lubeck-red);
    --accent-hover: var(--brass);
  }
}

/* Typography - Elegant & Readable */
body {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.8;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(184, 134, 11, 0.02) 2px,
      rgba(184, 134, 11, 0.02) 4px
    );
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
  color: var(--wood-dark);
  letter-spacing: -0.02em;
}

@media (prefers-color-scheme: dark) {
  h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
  }
}

h1 {
  font-size: 2.75rem;
  margin-top: 0;
  color: var(--lubeck-red);
  text-shadow: 0 2px 4px rgba(183, 28, 28, 0.1);
  border-bottom: 3px double var(--brass);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: 2rem;
  border-bottom: 2px solid var(--border-medium);
  padding-bottom: var(--space-xs);
  color: var(--wood-medium);
  position: relative;
}

@media (prefers-color-scheme: dark) {
  h2 {
    color: var(--text-primary);
  }
}

/* Table of Contents */
.toc {
  background: rgba(184, 134, 11, 0.05);
  border: 2px solid var(--border-light);
  border-left: 4px solid var(--brass);
  border-radius: 8px;
  padding: var(--space-md);
  margin-bottom: var(--space-xl);
  margin-left: 2rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  position: relative;
}

.toc::before {
  content: '⚓';
  position: absolute;
  left: -2rem;
  top: var(--space-md);
  font-size: 1.2rem;
  color: var(--brass);
}

.toc details {
  margin: 0;
}

.toc summary {
  cursor: pointer;
  color: var(--wood-dark);
  margin-bottom: var(--space-sm);
}

@media (prefers-color-scheme: dark) {
  .toc summary {
    color: var(--text-primary);
  }
}

.toc summary::-webkit-details-marker {
  color: var(--brass);
}

.toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc li {
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border-light);
}

.toc li:last-child {
  border-bottom: none;
}

.toc li li {
  padding-left: var(--space-md);
  border-bottom: none;
  font-size: 0.9em;
}

.toc ul ul {
  padding-left: var(--space-lg);
  margin-top: var(--space-xs);
  list-style: none;
}

.toc > ul > li {
  font-weight: 600;
}

.toc ul ul li {
  font-weight: 400;
}

.toc a {
  color: var(--text-secondary);
  border: none;
}

.toc a:hover {
  color: var(--lubeck-red);
  border: none;
}

h3 {
  font-size: 1.5rem;
  color: var(--wood-medium);
}

@media (prefers-color-scheme: dark) {
  h3 {
    color: var(--text-primary);
  }
}

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--lubeck-red);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
  position: relative;
}

a:hover {
  color: var(--brass);
  border-bottom-color: var(--brass);
}

/* Navigation - Captain's Bridge */
.main-nav {
  background: linear-gradient(to bottom, var(--bg-secondary), var(--bg-primary));
  border-bottom: 3px solid var(--brass);
  box-shadow: var(--shadow-subtle);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-xl);
  font-family: var(--font-sans);
  position: relative;
}

.main-nav::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--lubeck-red);
  opacity: 0.3;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--lubeck-red);
  border: none;
  text-shadow: 0 1px 2px rgba(183, 28, 28, 0.1);
  letter-spacing: 0.02em;
  position: relative;
}

.site-title:hover {
  color: var(--brass);
  border-bottom: none;
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.nav-links a:hover {
  color: var(--lubeck-red);
  background: rgba(184, 134, 11, 0.1);
  border-bottom: none;
}

/* Language Selector - Brass Instrument */
.lang-selector {
  background: linear-gradient(135deg, var(--brass) 0%, var(--copper) 100%);
  color: white;
  border: 2px solid var(--bronze);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1em;
  padding-right: 2.5rem;
  box-shadow: 0 2px 4px rgba(139, 115, 85, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.lang-selector:hover {
  background: linear-gradient(135deg, var(--copper) 0%, var(--brass) 100%);
  border-color: var(--brass);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(139, 115, 85, 0.4);
}

.lang-selector:focus {
  outline: 3px solid var(--lubeck-red);
  outline-offset: 2px;
}

.lang-selector option {
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0.5rem;
}

/* Container - Ship's Hull */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-xl);
  background: var(--bg-primary);
  position: relative;
}

/* Hero Images for Posts */
.post-hero-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: var(--space-xl);
  border: 3px solid var(--border-light);
  box-shadow: var(--shadow-medium);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-hero-image:hover {
  box-shadow: var(--shadow-strong);
}

/* Post Styles - Captain's Log Entries */
.post-header {
  margin-bottom: var(--space-xl);
  border-bottom: 3px double var(--brass);
  padding-bottom: var(--space-md);
  background: linear-gradient(to right, transparent, rgba(184, 134, 11, 0.05), transparent);
  padding: var(--space-md);
  margin-left: calc(-1 * var(--space-md));
  margin-right: calc(-1 * var(--space-md));
  box-shadow: var(--shadow-subtle);
}

.post-title {
  margin-bottom: var(--space-sm);
}

.post-date {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-light);
  font-style: italic;
  letter-spacing: 0.05em;
}

.post-date::before {
  content: '📅 ';
  opacity: 0.7;
}

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

.post-content img {
  max-width: 100%;
  height: auto;
  margin: var(--space-lg) 0;
  border-radius: 8px;
  border: 3px solid var(--border-light);
  box-shadow: var(--shadow-medium);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-content img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-strong);
}

.post-content blockquote {
  border-left: 4px solid var(--brass);
  background: rgba(184, 134, 11, 0.05);
  padding: var(--space-md);
  padding-left: var(--space-lg);
  margin: var(--space-lg) 0;
  font-style: italic;
  color: var(--text-secondary);
  border-radius: 0 4px 4px 0;
  position: relative;
}

.post-content blockquote::before {
  content: '"';
  position: absolute;
  left: 0.5rem;
  top: 0;
  font-size: 3rem;
  color: var(--brass);
  opacity: 0.3;
  font-family: var(--font-display);
  line-height: 1;
}

.post-content ul,
.post-content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.post-content li {
  margin-bottom: var(--space-xs);
  line-height: 1.8;
}

.post-content li::marker {
  color: var(--brass);
  font-weight: bold;
}

/* Post List (Homepage) - Ship's Manifest */
.post-list {
  max-width: var(--reading-width);
}

.site-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-style: italic;
  border-left: 5px solid var(--brass);
  background: rgba(184, 134, 11, 0.05);
  padding: var(--space-md);
  padding-left: var(--space-lg);
  border-radius: 0 4px 4px 0;
  box-shadow: var(--shadow-subtle);
}

/* Latest Story (Homepage) */
.latest-story {
  max-width: var(--reading-width);
}

.latest-label {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brass);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.latest-label::before {
  content: '⚓';
}

.latest-story h1 {
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

.latest-story .post-date {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: var(--space-xl);
}

.story-content {
  margin-bottom: var(--space-xl);
}

.archive-notice {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  text-align: center;
}

.archive-notice p {
  font-family: var(--font-sans);
  font-size: 1rem;
  margin: 0;
}

.archive-notice a {
  color: var(--lubeck-red);
  font-weight: 600;
}

/* Post Previews */
.post-preview {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--border-light);
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-subtle);
  transition: all 0.3s ease;
  border-left: 4px solid var(--lubeck-red);
}

@media (prefers-color-scheme: dark) {
  .post-preview {
    background: var(--bg-secondary);
  }
}

.post-preview:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
  border-left-color: var(--brass);
}

.post-preview:last-child {
  border-bottom: 2px solid var(--border-light);
}

.post-preview h2 {
  margin-top: 0;
  margin-bottom: var(--space-sm);
  border: none;
  font-size: 1.75rem;
}


.post-preview h2 a {
  color: var(--wood-dark);
  border: none;
}

@media (prefers-color-scheme: dark) {
  .post-preview h2 a {
    color: var(--text-primary);
  }
}

.post-preview h2 a:hover {
  color: var(--lubeck-red);
}

.post-preview time {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: var(--space-sm);
  background: var(--bg-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.post-preview time::before {
  content: '⚓ ';
  opacity: 0.6;
}

.post-preview p {
  color: var(--text-secondary);
  margin-bottom: 0;
  margin-top: var(--space-sm);
}

/* Archive - Ship's Logbook */
.archive {
  max-width: var(--reading-width);
}

.archive-list {
  list-style: none;
  padding: 0;
  background: white;
  border-radius: 8px;
  padding: var(--space-lg);
  box-shadow: var(--shadow-subtle);
  border: 2px solid var(--border-light);
}

@media (prefers-color-scheme: dark) {
  .archive-list {
    background: var(--bg-secondary);
  }
}

.archive-list li {
  margin-bottom: var(--space-md);
  display: flex;
  gap: var(--space-md);
  align-items: baseline;
  padding: var(--space-sm);
  border-left: 3px solid var(--brass);
  padding-left: var(--space-md);
  transition: all 0.3s ease;
}

.archive-list li:hover {
  background: rgba(184, 134, 11, 0.05);
  border-left-color: var(--lubeck-red);
  padding-left: calc(var(--space-md) + 4px);
}

.archive-list time {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-light);
  min-width: 110px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.archive-list a {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  color: var(--wood-dark);
}

@media (prefers-color-scheme: dark) {
  .archive-list a {
    color: var(--text-primary);
  }
}

.archive-list a:hover {
  color: var(--lubeck-red);
}

/* Footer - Ship's Stern */
.main-footer {
  border-top: 3px double var(--brass);
  background: linear-gradient(to top, var(--bg-secondary), var(--bg-primary));
  margin-top: var(--space-xl);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-light);
  box-shadow: inset 0 4px 8px rgba(62, 39, 35, 0.05);
  position: relative;
}

.main-footer::before {
  content: '⚓';
  display: block;
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
  opacity: 0.4;
  color: var(--brass);
}

.main-footer p {
  margin: 0;
  font-style: italic;
  letter-spacing: 0.02em;
}

.footer-links {
  margin-top: var(--space-sm);
  font-size: 0.8rem;
}

.footer-links a {
  color: var(--text-light);
  margin: 0 var(--space-sm);
}

/* Knowledge Base Sections */
.knowledge-base {
  max-width: var(--reading-width);
}

.section-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-style: italic;
  border-left: 5px solid var(--brass);
  background: rgba(184, 134, 11, 0.05);
  padding: var(--space-md);
  padding-left: var(--space-lg);
  border-radius: 0 4px 4px 0;
}

.kb-article {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-subtle);
  border-left: 4px solid var(--brass);
  transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
  .kb-article {
    background: var(--bg-secondary);
  }
}

.kb-article:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

.kb-article:last-child {
  border-bottom: none;
}

.kb-article h2 {
  margin-top: 0;
  margin-bottom: var(--space-sm);
  border: none;
  font-size: 1.6rem;
}


.kb-article .subtitle {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-light);
  margin-top: calc(-1 * var(--space-sm));
  margin-bottom: var(--space-sm);
}

/* Ship's Crew Page */
.crew-roster {
  max-width: var(--reading-width);
}

.crew-roster .intro {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-style: italic;
  border-left: 5px solid var(--brass);
  background: rgba(184, 134, 11, 0.05);
  padding: var(--space-md);
  padding-left: var(--space-lg);
  border-radius: 0 4px 4px 0;
}

.character-section {
  margin-bottom: var(--space-xl);
}

.character-section h2 {
  font-size: 1.8rem;
  margin-bottom: var(--space-lg);
  color: var(--lubeck-red);
}

.character-card {
  background: white;
  border: 2px solid var(--border-light);
  border-left: 4px solid var(--brass);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  border-radius: 8px;
  box-shadow: var(--shadow-subtle);
  transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
  .character-card {
    background: var(--bg-secondary);
  }
}

.character-card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
  border-left-color: var(--lubeck-red);
}

.character-card h3 {
  margin-top: 0;
  margin-bottom: var(--space-xs);
  font-size: 1.4rem;
  color: var(--wood-dark);
}

@media (prefers-color-scheme: dark) {
  .character-card h3 {
    color: var(--text-primary);
  }
}

.character-role {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--brass);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.character-description {
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.7;
}

.character-appearances,
.character-link {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: var(--space-xs);
}

.character-appearances:last-child,
.character-link:last-child {
  margin-bottom: 0;
}

.crew-footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 3px double var(--brass);
  text-align: center;
}

.crew-footer p {
  color: var(--text-light);
  font-style: italic;
}

/* Support the Captain (Ko-fi) */
.support-captain {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.1) 0%, rgba(184, 134, 11, 0.03) 100%);
  border: 3px double var(--brass);
  border-radius: 8px;
  text-align: center;
  box-shadow: var(--shadow-subtle);
}

@media (prefers-color-scheme: dark) {
  .support-captain {
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.15) 0%, rgba(218, 165, 32, 0.05) 100%);
  }
}

.support-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.kofi-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--brass) 0%, var(--copper) 100%);
  color: white !important;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--bronze);
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(139, 115, 85, 0.3);
}

.kofi-button:hover {
  background: linear-gradient(135deg, var(--copper) 0%, var(--brass) 100%);
  transform: translateY(-2px);
  border: 2px solid var(--brass);
  box-shadow: 0 4px 8px rgba(139, 115, 85, 0.4);
}

.kofi-icon {
  font-size: 1.2rem;
}

/* Responsive - Mobile Navigation */
@media (max-width: 768px) {
  body {
    font-size: 18px;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.6rem;
  }


  h3 {
    font-size: 1.3rem;
  }

  .nav-container {
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-start;
  }

  .nav-links {
    flex-wrap: wrap;
    width: 100%;
  }

  .post-header {
    margin-left: 0;
    margin-right: 0;
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  .post-preview {
    padding: var(--space-md);
  }

  .archive-list li {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .archive-list time {
    min-width: auto;
  }
}

/* Print Styles - Clean Document */
@media print {
  .main-nav,
  .main-footer,
  .lang-selector,
  .support-captain {
    display: none;
  }

  body {
    font-size: 12pt;
    background: white;
    background-image: none;
  }

  h1, h2, h3 {
    color: black;
  }

  .toc {
    display: none;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  .post-content img {
    max-width: 100%;
    page-break-inside: avoid;
  }

  .post-preview,
  .archive-list,
  .kb-article,
  .character-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* Captain's Daily Vision - AI Generated Image */
.captains-vision {
  margin-bottom: var(--space-xl);
  text-align: center;
}

.vision-image {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 8px;
  border: 3px solid var(--brass);
  box-shadow: var(--shadow-medium);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vision-image:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-strong);
}

.vision-caption {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: var(--space-sm);
}

/* Translation Help Popup (Bottom Left) */
.translate-popup {
  position: fixed;
  bottom: 20px;
  left: 20px;
  max-width: 360px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--parchment) 100%);
  border: 2px solid var(--brass);
  border-left: 4px solid var(--brass);
  border-radius: 8px;
  padding: var(--space-md);
  box-shadow: var(--shadow-strong);
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  font-family: var(--font-sans);
}

.translate-popup.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.translate-popup.staying {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-color-scheme: dark) {
  .translate-popup {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  }
}

.translate-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-light);
}

.translate-popup-title {
  font-weight: 700;
  color: var(--brass);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.translate-popup-title::before {
  content: '🌐';
}

.translate-popup-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-light);
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.translate-popup-close:hover {
  color: var(--lubeck-red);
}

.translate-popup-content {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.translate-popup-content p {
  margin-bottom: var(--space-sm);
}

.translate-popup-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-sm) 0;
}

.translate-popup-list li {
  margin-bottom: var(--space-xs);
  padding-left: 1rem;
  position: relative;
  font-size: 0.8rem;
}

.translate-popup-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--brass);
}

.translate-popup-tip {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 0 !important;
}

@media (max-width: 480px) {
  .translate-popup {
    bottom: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
  }
}

/* What's New Notification Popup */
.whats-new-popup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 320px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--parchment) 100%);
  border: 2px solid var(--brass);
  border-left: 4px solid var(--lubeck-red);
  border-radius: 8px;
  padding: var(--space-md);
  box-shadow: var(--shadow-strong);
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  font-family: var(--font-sans);
}

.whats-new-popup.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.whats-new-popup.staying {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-color-scheme: dark) {
  .whats-new-popup {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-color: var(--brass);
  }
}

.whats-new-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-light);
}

.whats-new-title {
  font-weight: 700;
  color: var(--lubeck-red);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.whats-new-title::before {
  content: '⚓';
}

.whats-new-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-light);
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.whats-new-close:hover {
  color: var(--lubeck-red);
}

.whats-new-content {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.whats-new-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.whats-new-list li {
  margin-bottom: var(--space-xs);
  padding-left: 1rem;
  position: relative;
}

.whats-new-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--brass);
}

.whats-new-list a {
  color: var(--wood-dark);
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .whats-new-list a {
    color: var(--text-primary);
  }
}

.whats-new-list a:hover {
  color: var(--lubeck-red);
}

.whats-new-footer {
  margin-top: var(--space-sm);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border-light);
  font-size: 0.75rem;
  color: var(--text-light);
  font-style: italic;
}

@media (max-width: 480px) {
  .whats-new-popup {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* Footnotes */
.footnotes {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footnotes-separator {
  margin-bottom: var(--space-lg);
  opacity: 0.4;
}

.footnotes-list {
  padding-left: var(--space-lg);
  margin: 0;
}

.footnote-item {
  margin-bottom: var(--space-md);
  line-height: 1.7;
  padding-left: var(--space-xs);
}

.footnote-item p {
  margin: 0;
}

.footnote-item::marker {
  color: var(--brass);
  font-weight: bold;
}

/* Footnote reference in text */
.footnote-ref {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
}

.footnote-ref a {
  color: var(--brass);
  text-decoration: none;
  border: none;
  font-weight: 600;
  padding: 0 2px;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.footnote-ref a:hover {
  color: var(--lubeck-red);
  background: rgba(184, 134, 11, 0.1);
}

/* Footnote backref (return arrow) */
.footnote-backref {
  color: var(--brass);
  text-decoration: none;
  border: none;
  margin-left: var(--space-xs);
  font-size: 0.9em;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.footnote-backref:hover {
  opacity: 1;
  color: var(--lubeck-red);
}

/* Target highlighting when clicking footnote link */
.footnote-item:target {
  background: rgba(184, 134, 11, 0.1);
  border-left: 3px solid var(--brass);
  padding-left: calc(var(--space-xs) + var(--space-sm));
  margin-left: calc(-1 * var(--space-sm) - 3px);
  border-radius: 0 4px 4px 0;
}

.footnote-ref a:target {
  background: rgba(184, 134, 11, 0.2);
  outline: 2px solid var(--brass);
  outline-offset: 1px;
}

/* Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus states for keyboard navigation */
a:focus,
button:focus,
select:focus {
  outline: 3px solid var(--lubeck-red);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Lübeck-Specific Decorative Elements */

/* Seven Stars of Lübeck (representing the seven church spires) */
.post-list > h1::after {
  content: '✦ ✦ ✦ ✦ ✦ ✦ ✦';
  display: block;
  text-align: center;
  color: var(--brass);
  font-size: 0.6rem;
  margin-top: var(--space-sm);
  letter-spacing: 0.5em;
  opacity: 0.5;
}

/* Hanseatic Gable Pattern - Subtle brick texture */
.container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background:
    linear-gradient(90deg,
      var(--lubeck-red) 0%,
      var(--lubeck-red) 50%,
      transparent 50%,
      transparent 100%
    );
  background-size: 4px 4px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 1000;
}

/* Compass Rose decoration */
.archive > h1::before {
  content: '🧭';
  display: inline-block;
  margin-right: var(--space-sm);
  font-size: 1.2em;
  vertical-align: middle;
}

/* Maritime rope divider */
hr {
  border: none;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--brass),
    var(--brass) 10px,
    var(--bronze) 10px,
    var(--bronze) 20px
  );
  margin: var(--space-lg) 0;
  border-radius: 2px;
  opacity: 0.6;
}

/* Hanseatic merchant seal effect on first letter of posts */
.post-content > p:first-of-type::first-letter {
  font-size: 3.5em;
  line-height: 0.9;
  float: left;
  margin: 0.1em 0.1em 0 0;
  font-family: var(--font-display);
  color: var(--lubeck-red);
  font-weight: bold;
}

/* Subtle wood grain effect */
@media (min-width: 769px) {
  .post-preview,
  .archive-list,
  .kb-article,
  .character-card {
    background-image:
      linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.9),
        rgba(245, 245, 220, 0.95)
      );
  }

  @media (prefers-color-scheme: dark) {
    .post-preview,
    .archive-list,
    .kb-article,
    .character-card {
      background-image:
        linear-gradient(
          to bottom,
          rgba(44, 24, 16, 0.9),
          rgba(26, 20, 16, 0.95)
        );
    }
  }
}

