/* =====================================================
   Watchtowerlies — Main Stylesheet
   Light background · Black font · Responsive
   ===================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #1a1a1a;
  background-color: #f5f5f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Responsive embeds — YouTube iframes with fixed width/height attributes */
iframe {
  max-width: 100%;
}

.content-card iframe {
  display: block;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: none;
  border-radius: 4px;
}

a {
  color: #8b1a1a;
  text-decoration: none;
  overflow-wrap: break-word;
  word-break: break-word;
}

a:visited {
  color: #7a5c7a;
}

a:hover,
a:focus {
  color: #c0392b;
  text-decoration: underline;
}

ul, ol {
  margin: 0.75rem 0 0.75rem 1.5rem;
}

p {
  margin-bottom: 1rem;
}

address {
  font-style: normal;
}

/* --- Alert Banner --- */
.alert-banner {
  background-color: #4b0082;
  color: #ffffff;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.5;
}

.alert-banner a {
  color: #ffdd99;
  text-decoration: underline;
}

.alert-banner a:hover {
  color: #ffffff;
}

/* --- Header & Top Navigation --- */
header {
  background-color: #1a1a1a;
  color: #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.nav-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.site-logo {
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  color: #f0f0f0;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-logo:visited {
  color: #b06060;
}

.site-logo:hover {
  color: #ffdd99;
  text-decoration: none;
}

/* Top nav links */
.top-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.top-nav li a {
  display: block;
  padding: 0.45rem 0.75rem;
  color: #e0e0e0;
  font-size: 0.92rem;
  font-weight: bold;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.top-nav li a:hover,
.top-nav li a:focus {
  background-color: #333;
  color: #ffdd99;
  text-decoration: none;
}

.top-nav li a.active {
  background-color: #8b1a1a;
  color: #ffffff;
}

/* Language switcher pill */
.top-nav .lang-link a {
  background-color: #2a4a8b;
  color: #c8ddff;
  border-radius: 12px;
  padding: 0.3rem 0.8rem;
}

.top-nav .lang-link a:hover {
  background-color: #3a5aab;
  color: #ffffff;
}

/* --- Articles dropdown --- */
.top-nav .has-dropdown {
  position: relative;
}

.top-nav .has-dropdown > a::after {
  content: ' ▾';
  font-size: 0.7em;
  opacity: 0.75;
}

.top-nav .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #1a1a1a;
  min-width: 210px;
  border-top: 2px solid #8b1a1a;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  z-index: 200;
  list-style: none;
  padding: 0.4rem 0;
  border-radius: 0 0 4px 4px;
}

/* opened by JS (.open class) or keyboard (:focus-within) */
.top-nav .has-dropdown.open .dropdown,
.top-nav .has-dropdown:focus-within .dropdown {
  display: block;
}

.top-nav .dropdown li a {
  display: block;
  padding: 0.4rem 1rem;
  color: #e0e0e0;
  font-size: 0.92rem;
  font-weight: bold;
  white-space: nowrap;
  border-left: 3px solid transparent;
  border-radius: 0;
  transition: background-color 0.15s, border-color 0.15s;
}

.top-nav .dropdown li a:hover,
.top-nav .dropdown li a:focus {
  background-color: #2a2a2a;
  border-left-color: #8b1a1a;
  color: #ffdd99;
  text-decoration: none;
}

.top-nav .dropdown li a.active {
  border-left-color: #8b1a1a;
  color: #ffdd99;
  background-color: #2a2a2a;
}

/* --- Hamburger Button --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.hamburger:hover {
  background-color: #333;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #e0e0e0;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Hamburger open state (X) */
.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav overlay */
.mobile-nav {
  display: none;
  flex-direction: column;
  background-color: #1a1a1a;
  border-top: 1px solid #333;
  padding: 0.5rem 0 1rem;
  max-height: calc(100svh - 56px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  display: block;
  padding: 0.65rem 1.5rem;
  color: #e0e0e0;
  font-size: 1rem;
  font-weight: bold;
  border-bottom: 1px solid #2a2a2a;
  transition: background-color 0.15s;
}

.mobile-nav a:hover {
  background-color: #2a2a2a;
  color: #ffdd99;
  text-decoration: none;
}

/* Section label inside mobile nav */
.nav-section-label {
  display: block;
  padding: 0.5rem 1.5rem 0.2rem;
  font-size: 0.68rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #777;
  border-top: 1px solid #2a2a2a;
  margin-top: 0.25rem;
}

/* Article links in mobile nav are slightly smaller */
.mobile-nav a.article-link {
  font-size: 0.88rem;
  padding: 0.45rem 1.5rem;
}

/* --- Page Layout --- */
.page-wrapper {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

/* --- Sidebar Navigation --- */
.sidebar,
.page-wrapper > aside {
  width: 210px;
  flex-shrink: 0;
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem 0;
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 0.78rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  padding: 0 1rem 0.5rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 0.5rem;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav li a {
  display: block;
  padding: 0.45rem 1rem;
  color: #2a2a2a;
  font-size: 0.9rem;
  line-height: 1.4;
  border-left: 3px solid transparent;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.sidebar-nav li a:visited {
  color: #7a5c7a;
}

.sidebar-nav li a:hover,
.sidebar-nav li a:focus {
  background-color: #f5f0f0;
  border-left-color: #8b1a1a;
  color: #8b1a1a;
  text-decoration: none;
}

.sidebar-nav li a.active {
  background-color: #f5f0f0;
  border-left-color: #8b1a1a;
  color: #8b1a1a;
  font-weight: bold;
}

/* --- Main Content --- */
.page-wrapper > main,
.main-content {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

/* --- Article / Content Card --- */
.content-card {
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.content-card h1 {
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 1.9rem;
  font-weight: normal;
  color: #1a1a1a;
  margin-bottom: 0.25rem;
  line-height: 1.25;
}

.content-card h2 {
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: normal;
  color: #555;
  margin-bottom: 1.25rem;
}

.content-card h3 {
  font-size: 1.15rem;
  color: #1a1a1a;
  margin: 1.25rem 0 0.5rem;
}

.content-card p {
  color: #1a1a1a;
  margin-bottom: 1rem;
}

.content-card em {
  color: #4a4a4a;
}

/* Image floated right within article */
/* Standalone image without a figure wrapper (fallback) */
.article-image {
  float: right;
  clear: right;
  margin: 0 0 1.5rem 1.5rem;
  max-width: 280px;
  border-radius: 4px;
  border: 1px solid #ddd;
  cursor: zoom-in;
  transition: transform 0.2s;
}

.article-image:hover {
  transform: scale(1.03);
}

/* Figure wrapper for image + caption pairs */
figure.article-figure {
  float: right;
  clear: right;
  margin: 0 0 1.5rem 1.5rem;
  max-width: 280px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.3rem;
  background: #fafafa;
}

figure.article-figure img {
  width: 100%;
  display: block;
  border-radius: 4px;
  cursor: zoom-in;
  transition: transform 0.2s;
}

figure.article-figure:hover img {
  transform: scale(1.03);
}

figure.article-figure img + img {
  margin-top: 0.25rem;
}

figure.article-figure figcaption {
  font-size: 0.78rem;
  color: #555;
  text-align: center;
  padding: 0.3rem 0.25rem 0.1rem;
  line-height: 1.35;
  font-style: italic;
}

/* Double-size figure */
figure.article-figure--large {
  max-width: 560px;
}

/* Wide chart figure (85% of content width, centred) */
figure.article-figure--chart {
  float: none;
  clear: both;
  width: 85%;
  max-width: 85%;
  margin: 1.5rem auto;
}

/* Centered figure (overrides float) */
figure.article-figure--center {
  float: none;
  clear: both;
  margin: 1.5rem auto;
  display: block;
  text-align: center;
  max-width: 560px;
}

/* Centered image (no float) */
.article-image-center {
  display: block;
  margin: 0 auto 0.5rem;
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid #ddd;
  cursor: zoom-in;
  transition: transform 0.2s;
}

.article-image-center:hover {
  transform: scale(1.02);
}

/* --- Keyword Tags (replaces old image-based label divs) --- */
.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}

.keyword-tags span {
  display: inline-block;
  background-color: #1a1a1a;
  color: #f0f0f0;
  font-size: 0.72rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
}

/* --- Contact Page Specific --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.contact-info address a {
  color: #8b1a1a;
}

.quote-block {
  border-left: 4px solid #8b1a1a;
  padding: 0.75rem 1rem;
  background-color: #fdf5f5;
  color: #333;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.bug-notes {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 1rem;
}

.bug-notes u {
  font-weight: bold;
}

/* --- News / Nouvelles list spacing --- */
.news-list > div {
  margin-bottom: 0.3rem;
}
.news-list > div:has(> a) {
  margin-bottom: 1rem;
}

/* --- Nietzsche portrait on contact page --- */
.portrait-image {
  max-width: 160px;
  float: right;
  margin: -13rem 0 1rem 1.5rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* --- Footer --- */
footer {
  background-color: #1a1a1a;
  color: #999;
  text-align: center;
  padding: 1rem 1.25rem;
  font-size: 0.82rem;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  margin-top: auto;
}

footer a {
  color: #aaa;
}

footer a:hover {
  color: #ddd;
}

/* --- Divider within content --- */
.divider {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 1.5rem 0;
}

/* =====================================================
   RESPONSIVE — Tablet (≤900px)
   ===================================================== */
@media (max-width: 900px) {
  .page-wrapper {
    flex-direction: column;
  }

  .sidebar,
  .page-wrapper > aside {
    width: 100%;
    position: static;
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0;
  }

  .sidebar-title {
    width: 100%;
    border-bottom: 1px solid #eee;
    padding: 0.4rem 0.5rem;
    margin-bottom: 0.25rem;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    padding: 0.25rem;
    width: 100%;
  }

  .sidebar-nav li {
    flex: none;
  }

  .sidebar-nav li a {
    border-left: none;
    border-radius: 4px;
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    border: 1px solid transparent;
  }

  .sidebar-nav li a:hover,
  .sidebar-nav li a.active {
    border-color: #8b1a1a;
    background-color: #f5f0f0;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   RESPONSIVE — Mobile (≤768px)
   ===================================================== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .top-nav {
    display: none;
  }

  .page-wrapper {
    padding: 1rem 0.75rem;
  }

  .content-card {
    padding: 1.25rem 1rem;
  }

  .content-card h1 {
    font-size: 1.45rem;
  }

  .content-card h2 {
    font-size: 1.1rem;
  }

  .article-image {
    float: none;
    clear: none;
    margin: 0 auto 1.25rem;
    max-width: 100%;
  }

  figure.article-figure {
    float: none;
    clear: none;
    margin: 0 auto 1.25rem;
    max-width: 100%;
  }

  .portrait-image {
    float: none;
    margin: 0 auto 1rem;
    max-width: 130px;
  }

  .keyword-tags span {
    font-size: 0.65rem;
  }

  /* Stack media items vertically on mobile */
  .media-item {
    flex-direction: column;
  }

  .media-thumb {
    width: 100%;
    max-width: 200px;
  }

  /* Smaller gallery grid on mobile */
  .image-gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  /* Book grid tighter on mobile */
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  /* Prevent table overflow */
  .content-card table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- Figure / image caption --- */
figure {
  margin: 0 0 1.25rem 1.5rem;
  float: right;
  max-width: 280px;
}

figure img {
  border-radius: 4px;
  border: 1px solid #ddd;
  width: 100%;
}

figcaption {
  font-size: 0.8rem;
  color: #666;
  text-align: center;
  margin-top: 0.3rem;
  font-style: italic;
}

.image-caption {
  font-size: 0.8rem;
  color: #666;
  text-align: center;
  margin-top: -0.75rem;
  margin-bottom: 1rem;
  font-style: italic;
}

/* --- Media / Multimedia page --- */
.media-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.media-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  border-bottom: 1px solid #eee;
  padding-bottom: 1.5rem;
}

.media-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.media-thumb {
  flex-shrink: 0;
  width: 140px;
}

.media-thumb img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.media-desc {
  flex: 1;
  font-size: 0.95rem;
  color: #1a1a1a;
  line-height: 1.6;
}

.media-desc a {
  color: #8b1a1a;
}

/* --- Book / gallery grid --- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.book-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.book-item img {
  border: 1px solid #ddd;
  border-radius: 3px;
  width: 100%;
  max-width: 130px;
}

.book-item span {
  font-size: 0.75rem;
  color: #555;
  text-align: center;
  line-height: 1.3;
}

/* --- Image gallery (memes, subliminal, stickers) --- */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin: 1rem 0;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 0.5rem;
  background: #fafafa;
  cursor: zoom-in;
  transition: box-shadow 0.2s;
}

.gallery-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.gallery-item img {
  width: 100%;
  border-radius: 3px;
  object-fit: contain;
  transition: transform 0.2s;
}

.gallery-item:hover img {
  transform: scale(1.02);
}

.gallery-item span {
  font-size: 0.75rem;
  color: #555;
  text-align: center;
  line-height: 1.3;
}

/* Lightbox overlay */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 1rem;
}

.lightbox-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  display: block;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  opacity: 0.8;
}

.lightbox-close:hover {
  opacity: 1;
}

/* --- Links page --- */
.links-section {
  margin-bottom: 1.5rem;
}

.links-section h3 {
  font-size: 1rem;
  color: #555;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.3rem;
}

.links-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.links-section ul li {
  padding: 0.2rem 0;
  font-size: 0.9rem;
  word-break: break-all;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0 0.5rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #8b1a1a;
  background: #fff;
  transition: background 0.15s;
}

.pagination a:hover {
  background: #f5f0f0;
  text-decoration: none;
}

.pagination .current {
  background: #8b1a1a;
  color: #fff;
  border-color: #8b1a1a;
}

/* --- Inline content table (existing tables in articles) --- */
.content-card table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.content-card table th {
  background: #555;
  color: #fff;
  padding: 0.5rem 0.75rem;
  text-align: left;
  border: 1px solid #444;
}

.content-card table td {
  padding: 0.4rem 0.75rem;
  border: 1px solid #ddd;
  vertical-align: top;
  color: #1a1a1a;
}

.content-card table tr:nth-child(even) td {
  background: #f9f9f9;
}

/* --- Clearfix utility --- */
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}
