:root {
  --baywatch-red: #D20000;
  --baywatch-red-hover: #B00000;
  --sandstone: #786E64;
  --sandy-beach: #A6988A;
  --dusk: #231F20;
  --dusk-light: #2d2a2b;
  --dark-bg: #212529;
  --white: #FFFFFF;
  --off-white: #F4FAFF;
  --sandstone-light: #F0ECE8;
  --light-gray: #E8E4E0;
  --border-light: #E0DCD8;
  --coin-gold: #C4A24E;
  --coin-gold-light: #D4B76A;
  --success-green: #4A8B5C;
  --text-primary: #212529;
  --font-body: 'Avenir Next', -apple-system, sans-serif;
  --font-display: 'Playfair Display', serif;
}

#category-page {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

#category-page h1 { font-family: var(--font-body); font-weight: 600; }
#category-page h2, #category-page h3 { font-family: var(--font-display); font-style: italic; font-weight: 400; }
#category-page h4 { font-family: var(--font-body); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }

.blog-category-bar {
  background: var(--white); border-bottom: 1px solid var(--light-gray);
  padding: 0 40px; display: flex; align-items: center; gap: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.blog-category-bar a {
  font-size: 13px; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px;
  color: var(--sandstone); padding: 16px 16px; white-space: nowrap; transition: all 0.2s;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.blog-category-bar a:hover { color: var(--dusk); }
.blog-category-bar a.active { color: var(--baywatch-red); border-bottom-color: var(--baywatch-red); }

.cluster-header {
  padding: 60px 40px 40px; background: var(--sandstone-light); margin-bottom: 0;
  text-align: center;
}
.cluster-header h4 { font-size: 11px; color: var(--sandstone); letter-spacing: 2px; margin-bottom: 8px; }
.cluster-header h1 { font-size: 42px; font-weight: 600; color: var(--dusk); margin-bottom: 12px; }
.cluster-header p { font-size: 16px; line-height: 1.6; color: var(--sandstone); max-width: 600px; margin: 0 auto 20px; }
.cluster-stats { display: flex; gap: 24px; justify-content: center; }
.cluster-stats span { font-size: 13px; font-weight: 600; color: var(--sandy-beach); }
.cluster-stats strong { color: var(--dusk); }

.blog-layout {
  max-width: 1200px; margin: 0 auto; padding: 40px 40px;
  display: grid; grid-template-columns: 1fr 320px; gap: 48px;
}
.blog-main { min-width: 0; }
.sidebar { 
  position: sticky; 
  top: 100px; 
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.sidebar:hover {
  overflow-y: auto;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--sandy-beach);
  border-radius: 2px;
}

.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filter-pill {
  padding: 8px 18px; font-size: 13px; font-weight: 600; border: 1.5px solid var(--border-light);
  color: var(--sandstone); background: transparent; cursor: pointer; transition: all 0.2s;
  border-radius: 0; font-family: var(--font-body);
}
.filter-pill:hover { border-color: var(--dusk); color: var(--dusk); }
.filter-pill.active { background: var(--dusk); border-color: var(--dusk); color: white; }

.sort-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.sort-bar .result-count { font-size: 14px; color: var(--sandstone); }
.sort-bar .result-count strong { color: var(--dusk); }
.sort-dropdown {
  padding: 8px 14px; border: 1px solid var(--border-light); border-radius: 0;
  font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--dusk);
  background: white; cursor: pointer; outline: none;
}

.card-img-wrap {
  width: 100%;
  overflow: hidden;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-grid { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 40px}
.article-card:first-child{
  flex-basis: 100%;
  width: 100%;
}
.article-card { cursor: pointer; transition: transform 0.2s; text-decoration: none; color: inherit; display: block; flex-basis:calc((100% - 24px ) / 2) }
.article-card:hover { transform: translateY(-2px); }
.card-img-wrap { position: relative; overflow: hidden; margin-bottom: 14px; aspect-ratio: 16/10; }
.card-img-placeholder {
  width: 100%; height: 100%; transition: transform 0.4s ease;
  background: linear-gradient(135deg, #2a2523, #1a1817, #2a2523);
  display: flex; align-items: center; justify-content: center;
}
.card-img-placeholder span { color: rgba(255,255,255,0.12); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }
.card-cat {
  position: absolute; top: 12px; left: 12px;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
  padding: 3px 8px; background: var(--baywatch-red); color: white;
}
.card-cat.gold { background: var(--coin-gold); color: var(--dusk); }
.card-cat.vip { background: var(--dusk); color: var(--coin-gold); }
.card-read-time {
  position: absolute; bottom: 10px; right: 10px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 3px;
  background: rgba(0,0,0,0.7); color: white;
}
.card-title {
  font-family: var(--font-body); font-size: 17px; font-weight: 600; line-height: 1.35;
  color: var(--dusk); margin-bottom: 6px;
}
.card-excerpt {
  font-size: 14px; line-height: 1.5; color: var(--sandstone); margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-size: 12px; color: var(--sandy-beach); font-weight: 500; }
.card-meta .author { color: var(--sandstone); font-weight: 600; }

.load-more-wrap { text-align: center; margin-bottom: 48px; }
.load-more-btn {
  padding: 14px 48px; background: transparent; border: 1.5px solid var(--dusk);
  color: var(--dusk); font-family: var(--font-body); font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; transition: all 0.2s;
  border-radius: 0;
}
.load-more-btn:hover { background: var(--dusk); color: white; }

.rabbit-hole {
  background: var(--sandstone-light); padding: 32px; margin-bottom: 48px;
}
.rabbit-hole h4 { font-size: 11px; letter-spacing: 2px; color: var(--sandstone); margin-bottom: 16px; }
.rabbit-links { display: flex; flex-wrap: wrap; gap: 10px; }
.rabbit-link {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: var(--white); border: 1px solid var(--border-light);
  font-size: 14px; font-weight: 600; color: var(--dusk); transition: all 0.2s; cursor: pointer;
}
.rabbit-link:hover { border-color: var(--baywatch-red); color: var(--baywatch-red); }
.rabbit-link .arrow { font-size: 16px; color: var(--sandy-beach); transition: color 0.2s; }
.rabbit-link:hover .arrow { color: var(--baywatch-red); }

.sidebar-widget-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px;
  color: var(--sandstone); margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--light-gray);
}
.sidebar-search { display: flex; margin-bottom: 32px; }
.sidebar-search input {
  flex: 1; height: 44px; padding: 0 14px; border: 1px solid #CBCBCB; border-right: none;
  border-radius: 0; font-family: var(--font-body); font-size: 13px; outline: none;
}
.sidebar-search input:focus { border-color: var(--baywatch-red); }
.sidebar-search button {
  width: 44px; height: 44px; background: var(--baywatch-red); border: none; border-radius: 0;
  color: white; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.sidebar-search button:hover { background: var(--baywatch-red-hover); }

.vip-upsell {
  margin-bottom: 30px;
  background: var(--dusk); padding: 28px 24px; color: white; position: relative; overflow: hidden;
}
.vip-upsell .vip-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px;
  color: var(--coin-gold); margin-bottom: 12px;
}
.vip-upsell h3 {
  font-family: var(--font-display); font-style: italic; font-size: 24px; font-weight: 400;
  color: var(--white); margin-bottom: 10px; line-height: 1.3;
}
.vip-upsell p { font-size: 13px; line-height: 1.55; color: rgba(255,255,255,0.65); margin-bottom: 18px; }
.vip-upsell .vip-perks { list-style: none; margin-bottom: 20px; padding: 0; }
.vip-upsell .vip-perks li {
  font-size: 13px; color: rgba(255,255,255,0.8); padding: 5px 0 5px 20px; position: relative;
}
.vip-upsell .vip-perks li::before {
  content: '✓'; position: absolute; left: 0; color: var(--coin-gold); font-weight: 700;
}
.vip-btn {
  display: block; width: 100%; padding: 14px; text-align: center;
  background: var(--baywatch-red); color: white; font-family: var(--font-body);
  font-size: 14px; font-weight: 700; text-transform: uppercase; border: none;
  border-radius: 0; cursor: pointer; transition: background 0.2s;
}
.vip-btn:hover { background: var(--baywatch-red-hover); }

.sidebar-cats { list-style: none; padding: 0; }
.sidebar-cats li { border-bottom: 1px solid var(--sandstone-light); }
.sidebar-cats li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; font-size: 14px; font-weight: 500; color: var(--dusk); transition: color 0.2s;
}
.sidebar-cats li a:hover { color: var(--baywatch-red); }
.sidebar-cats li a.active { color: var(--baywatch-red); }
.sidebar-cats li a .count { font-size: 12px; color: var(--sandy-beach); font-weight: 600; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.tag-cloud a {
  font-size: 12px; font-weight: 600; padding: 6px 12px; background: var(--sandstone-light);
  color: var(--sandstone); transition: all 0.2s;
}
.tag-cloud a:hover { background: var(--baywatch-red); color: white; }

.newsletter-box { background: var(--sandstone-light); padding: 24px; }
.newsletter-box h4 { font-size: 11px; letter-spacing: 2px; color: var(--sandstone); margin-bottom: 6px; }
.newsletter-box h3 { font-family: var(--font-display); font-style: italic; font-size: 22px; color: var(--dusk); margin-bottom: 10px; }
.newsletter-box p { font-size: 13px; color: var(--sandstone); line-height: 1.5; margin-bottom: 14px; }
.newsletter-box input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid #CBCBCB; border-radius: 0; font-family: var(--font-body); font-size: 13px; margin-bottom: 10px; outline: none; }
.newsletter-box button { width: 100%; height: 44px; background: var(--dusk); color: white; border: none; border-radius: 0; font-family: var(--font-body); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; }
.newsletter-box button:hover { background: var(--baywatch-red); }

.footer-cta { background: var(--dark-bg); padding: 80px 40px; text-align: center; color: white; }
.footer-cta h3 { font-family: var(--font-display); font-style: italic; font-size: 42px; color: white; margin-bottom: 12px; }
.footer-cta p { font-size: 16px; color: rgba(255,255,255,0.6); margin-bottom: 28px; max-width: 500px; margin-left: auto; margin-right: auto; }
.footer-cta .btn-join { background: var(--baywatch-red); color: white; padding: 16px 40px; font-size: 16px; text-transform: uppercase; font-weight: 700; border: none; border-radius: 0; cursor: pointer; font-family: var(--font-body); display: inline-block; }
.footer-cta .btn-join:hover { background: var(--baywatch-red-hover); }

@media (max-width: 900px) {
  .blog-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .article-grid { grid-template-columns: 1fr; }
}
