/* Article Page Styles
 * Hero section uses cover image as background with glass container overlays
 * Follows the same glassmorphic pattern as trip headers (trips/css/trip_headers.css)
 */

/* ===================================
   Article Hero Section
   =================================== */

.article-hero {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: flex-end;
  padding: 3rem 0;
  background:
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.75) 0%,
      rgba(0, 0, 0, 0.4) 50%,
      rgba(0, 0, 0, 0.2) 100%
    ),
    var(--article-hero-image, var(--neutral-light))
      var(--article-hero-position, 50% 50%) / cover no-repeat;
}

/* Fallback when no hero image is set */
.article-hero--no-image {
  min-height: auto;
  padding: 4rem 0;
  background: var(--neutral-light);
  align-items: center;
}

.article-hero__container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* ===================================
   Glass Container for Title Section
   =================================== */

.article-hero__title-glass {
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  background: rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.article-hero__title-glass h1 {
  font-size: 2.75rem;
  color: #fff;
  margin: 0 0 0.5rem;
  line-height: 1.2;
  font-weight: 700;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
}

.article-hero__title-glass .article-subtitle {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  line-height: 1.4;
  font-weight: 400;
}

/* No-image variant: dark text on light background */
.article-hero--no-image .article-hero__title-glass {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: none;
  border: none;
  box-shadow: none;
  padding: 2rem 0;
}

.article-hero--no-image .article-hero__title-glass h1 {
  color: var(--primary-color);
  text-shadow: none;
}

.article-hero--no-image .article-hero__title-glass .article-subtitle {
  color: #666;
}

/* ===================================
   Meta Info (Glass Pill Badges)
   =================================== */

.article-hero__meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.article-meta-badge {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Author badge - clickable link to profile */
a.article-author-badge {
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
  cursor: pointer;
}

a.article-author-badge:hover {
  background: rgba(0, 0, 0, 0.7);
}

.article-author-avatar {
  width: 4rem;
  height: auto;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}
.authored-by-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
}

.article-author-display-name {
  font-size: 1.5rem;
  font-weight: 600;
}

.article-author-avatar-fallback {
  font-size: 1.4rem;
}

/* No-image variant */
.article-hero--no-image a.article-author-badge:hover {
  background: rgba(0, 0, 0, 0.1);
}

.article-hero--no-image .article-author-avatar {
  border-color: rgba(0, 0, 0, 0.15);
}

.article-hero--no-image .article-meta-badge {
  background: rgba(0, 0, 0, 0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #666;
}

/* ===================================
   Category Badges
   =================================== */

.article-hero__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.category-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--neutral-dark);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ===================================
   Article Content Area
   =================================== */

.article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
  border-radius: 16px;
  margin-top: -2rem;
  position: relative;
  z-index: 3;
}

.article-intro {
  font-size: 1.2rem;
  color: #333;
  line-height: 1.8;
  margin-bottom: 2rem;
  font-weight: 400;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
}

/* ===================================
   Body Content Typography
   =================================== */

.article-intro h2,
.article-body h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.article-intro h3,
.article-body h3 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
}

.article-intro h4,
.article-body h4 {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.article-intro p,
.article-body p {
  margin-bottom: 1.5rem;
}

.article-intro ul,
.article-body ul {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
  list-style-type: disc;
}

.article-intro ol,
.article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
  list-style-type: decimal;
}

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

.article-intro blockquote,
.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #555;
  font-size: 1.15rem;
}

.article-intro a,
.article-body a {
  color: var(--primary-color);
  text-decoration: underline;
}

.article-intro a:hover,
.article-body a:hover {
  color: var(--brand-blue);
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-body code {
  background: var(--neutral-light);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95em;
  color: #e83e8c;
}

.article-body pre {
  background: var(--neutral-dark);
  color: #f8f8f2;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2rem 0;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 768px) {
  .article-hero {
    min-height: 400px;
    padding: 2rem 0;
  }

  .article-hero__title-glass {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .article-hero__title-glass h1 {
    font-size: 2rem;
  }

  .article-hero__title-glass .article-subtitle {
    font-size: 1.1rem;
  }

  .article-content {
    padding: 2rem 1rem;
  }
}

@media (max-width: 480px) {
  .article-hero {
    min-height: 350px;
  }

  .article-hero__title-glass h1 {
    font-size: 1.75rem;
  }

  .article-hero__meta {
    gap: 0.5rem;
  }

  .article-meta-badge {
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
  }
}

/* ===================================
   Fallback for browsers without backdrop-filter
   =================================== */

@supports not (backdrop-filter: blur(8px)) {
  .article-hero__title-glass {
    background: rgba(0, 0, 0, 0.7);
  }

  .article-meta-badge {
    background: rgba(0, 0, 0, 0.7);
  }
}
