/* ============================================
   Article List Page & Article Detail Page
   ============================================ */

/* --- Articles Page Header --- */
.page-header {
  padding: calc(80px + var(--space-4xl)) 0 var(--space-3xl);
  background: var(--color-midnight);
  position: relative;
  overflow: hidden;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, var(--color-snow));
  z-index: 2;
}

.page-header__bg-pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 80%, rgba(255, 87, 34, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 90% 20%, rgba(184, 212, 227, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.page-header__inner {
  position: relative;
  z-index: 3;
}

.page-header__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--color-white);
  margin-bottom: var(--space-md);
}

.page-header__desc {
  font-size: 1.05rem;
  color: var(--color-glacier);
  max-width: 500px;
}

/* --- Filter Bar --- */
.filter-bar {
  padding: var(--space-xl) 0;
  position: sticky;
  top: 64px;
  z-index: 100;
  background: var(--color-snow);
  border-bottom: 1px solid var(--color-border-light);
}

.filter-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.filter-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: var(--space-xs) 0;
}

.filter-tags::-webkit-scrollbar {
  display: none;
}

.filter-tag {
  padding: 0.5rem 1.1rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-tag:hover {
  border-color: var(--color-navy);
  color: var(--color-text);
}

.filter-tag--active {
  background: var(--color-midnight);
  border-color: var(--color-midnight);
  color: var(--color-white);
}

.filter-tag--active:hover {
  background: var(--color-midnight);
  border-color: var(--color-midnight);
  color: #fff;
}

.filter-count {
  font-family: var(--font-accent);
  font-size: 0.85rem;
  color: var(--color-text-light);
  white-space: nowrap;
}

/* --- Articles Grid --- */
.articles-grid {
  padding: var(--space-3xl) 0 var(--space-5xl);
}

.articles-grid__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-3xl) 0;
}

.pagination__btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-accent);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.pagination__btn:hover {
  border-color: var(--color-navy);
  color: var(--color-text);
}

.pagination__btn--active {
  background: var(--color-midnight);
  border-color: var(--color-midnight);
  color: var(--color-white);
}

.pagination__btn--nav {
  width: auto;
  padding: 0 var(--space-lg);
  gap: var(--space-sm);
}

.pagination__ellipsis {
  width: 44px;
  text-align: center;
  font-family: var(--font-accent);
  color: var(--color-text-light);
}

/* --- Article Detail --- */
.article-detail {
  padding-top: 80px;
}

/* Article Hero */
.article-hero {
  position: relative;
  height: 60vh;
  min-height: 400px;
  max-height: 600px;
  overflow: hidden;
}

.article-hero__image {
  position: absolute;
  inset: 0;
}

.article-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(10, 22, 40, 0.2) 0%,
    rgba(10, 22, 40, 0.7) 100%
  );
}

.article-hero__meta {
  position: absolute;
  bottom: var(--space-3xl);
  left: 0;
  right: 0;
  z-index: 2;
}

.article-hero__meta-inner {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.article-hero__category {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--color-orange);
  color: var(--color-white);
  font-family: var(--font-accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
}

.article-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--color-white);
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.article-hero__info {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  font-family: var(--font-accent);
  font-size: 0.82rem;
  color: var(--color-glacier);
}

.article-hero__info-divider {
  width: 3px;
  height: 3px;
  background: var(--color-glacier);
  border-radius: 50%;
}

/* Article Body */
.article-body {
  padding: var(--space-3xl) 0 var(--space-4xl);
}

.article-content {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.article-content h2 {
  font-size: 1.6rem;
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-lg);
  padding-left: var(--space-lg);
  border-left: 3px solid var(--color-orange);
}

.article-content h3 {
  font-size: 1.25rem;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.article-content p {
  margin-bottom: var(--space-lg);
  font-size: 1.08rem;
  line-height: 2;
}

.article-content img {
  border-radius: var(--radius-lg);
  margin: var(--space-2xl) 0;
}

/* --- Article Content Inline Links --- */
.article-content a:not([class]) {
  color: #1a56db;
  text-decoration: underline;
  text-decoration-color: rgba(26, 86, 219, 0.3);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.article-content a:not([class]):hover {
  color: var(--color-orange, #d4553a);
  text-decoration-color: var(--color-orange, #d4553a);
}

.article-content a:not([class]):visited {
  color: #1e40af;
}

.article-content blockquote {
  border-left: 3px solid var(--color-glacier);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-2xl) 0;
  background: var(--color-cream);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.article-content blockquote p {
  font-style: italic;
  color: var(--color-text);
  margin-bottom: 0;
}

/* Article Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0 var(--space-xl);
  font-size: 0.95rem;
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}

/* Tighter spacing for table wrappers (overflow-x divs) */
.article-content div[style*="overflow-x"] {
  margin-top: 0.25rem;
  margin-bottom: var(--space-md);
}

.article-content div[style*="overflow-x"] table {
  margin-top: 0;
  margin-bottom: 0;
}

/* Bold pseudo-headings (p > strong used as sub-section titles) should have tighter bottom margin */
.article-content p:has(> strong:first-child:last-child) {
  margin-bottom: var(--space-sm);
}

.article-content th,
.article-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light, #e5e7eb);
}

.article-content th {
  background: var(--color-midnight, #0a1628);
  color: var(--color-white, #fff);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.article-content tbody tr:nth-child(even) {
  background: var(--color-cream, #f8f5f0);
}

.article-content tbody tr:hover {
  background: var(--color-glacier, #b8d4e3);
  background: rgba(184, 212, 227, 0.2);
}

.article-content td {
  color: var(--color-text, #333);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .article-content table {
    font-size: 0.85rem;
  }

  .article-content th,
  .article-content td {
    padding: 0.5rem 0.65rem;
  }
}

/* Image Gallery */
.article-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin: var(--space-2xl) 0;
}

.article-gallery__item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: transform var(--transition-base);
}

.article-gallery__item:hover {
  transform: scale(0.98);
}

.article-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-gallery__item--wide {
  grid-column: span 2;
  aspect-ratio: 16 / 7;
}

/* Related Articles (legacy grid) */
.related-articles {
  padding: var(--space-4xl) 0;
  background: var(--color-cream);
}

.related-articles__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

/* Related Article Cards (inline card style) */
.related-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: var(--space-xl) 0;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border-light, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.related-card:hover {
  border-color: var(--color-orange, #d4553a);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.related-card__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-cream, #f8f5f0);
  border-radius: var(--radius-md, 8px);
}

.related-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.related-card__title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text, #1a1a2e);
  line-height: 1.3;
}

.related-card__desc {
  font-size: 0.8rem;
  color: var(--color-text-secondary, #666);
  line-height: 1.4;
}

/* Full-height page layout (prevents white bar below footer) */
html {
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.article-detail {
  flex: 1;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .articles-grid__list {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-articles__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .articles-grid__list {
    grid-template-columns: 1fr;
  }

  .filter-bar__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-tags {
    width: 100%;
    max-width: 100%;
  }

  .article-gallery {
    grid-template-columns: 1fr;
  }

  .article-gallery__item--wide {
    grid-column: span 1;
  }

  .related-articles__grid {
    grid-template-columns: 1fr;
  }

  .related-cards {
    grid-template-columns: 1fr;
  }

  .article-hero {
    height: 50vh;
  }
}

/* ============================================
   Article Component Redesign (TOC, Read More, CTA, Related)
   ============================================ */

/* --- Table of Contents --- */
.article-toc {
  background: linear-gradient(135deg, #faf8f5 0%, #f3ede4 100%);
  border: 1px solid rgba(184, 160, 128, 0.3);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  margin: 2rem 0 2.5rem;
}

.article-toc h2 {
  font-size: 1.05rem !important;
  margin-top: 0 !important;
  margin-bottom: 1.25rem !important;
  padding-left: 0 !important;
  border-left: none !important;
  color: var(--color-text, #1a1a2e);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(184, 160, 128, 0.25);
}

.article-toc h2::before {
  content: '\1F4CB';
  font-size: 1.15rem;
}

.article-toc ol {
  list-style: none;
  counter-reset: toc-counter;
  padding: 0;
  margin: 0;
}

.article-toc ol li {
  counter-increment: toc-counter;
  margin-bottom: 0.35rem;
}

.article-toc ol li:last-child {
  margin-bottom: 0;
}

.article-toc ol li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text, #333);
  font-size: 0.95rem;
  line-height: 1.45;
  transition: all 0.2s ease;
}

.article-toc ol li a::before {
  content: counter(toc-counter);
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-midnight, #0a1628);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  font-family: var(--font-accent);
}

.article-toc ol li a:hover {
  background: rgba(184, 160, 128, 0.15);
  color: var(--color-orange, #d4553a);
}

/* --- Read More Button --- */
.read-more-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #faf8f5 0%, #fff 100%);
  border: 1px solid var(--color-border-light, #e5e7eb);
  border-left: 4px solid var(--color-orange, #d4553a);
  border-radius: 0 10px 10px 0;
  text-decoration: none;
  color: inherit;
  margin: 1.5rem 0;
  transition: all 0.25s ease;
}

.read-more-btn:hover {
  box-shadow: 0 4px 16px rgba(212, 85, 58, 0.12);
  transform: translateX(4px);
  background: #fff;
}

.read-more-btn__inner {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.read-more-btn__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-orange, #d4553a);
  font-family: var(--font-accent);
}

.read-more-btn__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text, #1a1a2e);
  line-height: 1.4;
}

.read-more-btn__arrow {
  font-size: 1.3rem;
  color: var(--color-orange, #d4553a);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.read-more-btn:hover .read-more-btn__arrow {
  transform: translateX(4px);
}

/* --- CTA Section --- */
.article-cta {
  background: linear-gradient(135deg, #f8f5f0 0%, #f0ebe2 100%);
  border: 1px solid rgba(184, 160, 128, 0.3);
  padding: 2.25rem 2rem;
  border-radius: 12px;
  margin-top: 2rem;
  text-align: center;
}

.article-cta__image {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1.25rem;
}

.article-cta p {
  margin-bottom: 0.75rem !important;
}

.article-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: var(--color-orange, #d4553a);
  color: #fff !important;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.25s ease;
  margin-top: 0.5rem;
}

.article-cta__btn:hover {
  background: #c04a32;
  box-shadow: 0 4px 16px rgba(212, 85, 58, 0.3);
  transform: translateY(-2px);
}

/* --- Inline CTA link (booking, contact) --- */
.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1.1rem;
  background: var(--color-orange, #d4553a);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.cta-link:hover {
  background: #c04a32;
  box-shadow: 0 2px 8px rgba(212, 85, 58, 0.3);
}

/* --- Related Article Cards (image-style) --- */
.related-cards--image {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: var(--space-xl, 1.5rem) 0;
}

.related-card--image {
  display: flex;
  flex-direction: column;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border-light, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
}

.related-card--image:hover {
  border-color: var(--color-orange, #d4553a);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  transform: translateY(-3px);
}

.related-card__thumb {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.related-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.related-card__thumb-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

.related-card__thumb-cat {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.2rem 0.55rem;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.related-card__content {
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.related-card__content-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text, #1a1a2e);
  line-height: 1.35;
}

.related-card__content-desc {
  font-size: 0.8rem;
  color: var(--color-text-secondary, #666);
  line-height: 1.5;
}

.related-card__content-more {
  font-size: 0.78rem;
  color: var(--color-orange, #d4553a);
  font-weight: 600;
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .related-cards--image {
    grid-template-columns: 1fr;
  }

  .related-card__thumb {
    height: 110px;
  }

  .read-more-btn {
    padding: 0.85rem 1.15rem;
  }

  .article-toc {
    padding: 1.25rem 1.5rem;
  }
}
