/**
 * Blacksunset.ee Blog — Custom Styles
 * 
 * Dark minimalist aesthetic matching brand identity
 * Mobile-first, performance-optimized
 */

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --bs-black: #0a0a0a;
  --bs-dark: #141414;
  --bs-gray-900: #1a1a1a;
  --bs-gray-800: #2a2a2a;
  --bs-gray-700: #3a3a3a;
  --bs-gray-400: #8a8a8a;
  --bs-gray-300: #b0b0b0;
  --bs-white: #f5f5f5;
  --bs-accent: #ffffff;
  --bs-highlight: #e8e8e8;
  --bs-font-heading: 'Inter', -apple-system, sans-serif;
  --bs-font-body: 'Inter', -apple-system, sans-serif;
  --bs-max-width: 1200px;
  --bs-content-width: 720px;
  --bs-radius: 2px;
  --bs-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   PAGE CANVAS + READABILITY SAFETY
   ============================================================ */
body.single-post #main,
body.single-post .blog-post-custom {
  background: var(--bs-black) !important;
}

body.single-post .blog-post-custom .post-layout,
body.single-post .blog-post-custom .post-body {
  background: transparent;
}

body.single-post .blog-post-custom .post-content,
body.single-post .blog-post-custom .post-content p,
body.single-post .blog-post-custom .post-content li,
body.single-post .blog-post-custom .post-content blockquote,
body.single-post .blog-post-custom .article-summary {
  color: var(--bs-gray-300);
}

body.single-post .blog-post-custom .post-content a,
body.single-post .blog-post-custom .post-content a:visited {
  color: var(--bs-white);
  opacity: 1;
  text-decoration-color: rgba(245, 245, 245, 0.75);
}

body.single-post .blog-post-custom .post-content .products .product-small .name,
body.single-post .blog-post-custom .post-content .products .product-small .woocommerce-loop-product__title,
body.single-post .blog-post-custom .post-content .products .product-small .price,
body.single-post .blog-post-custom .post-content .products .product-small .amount {
  color: var(--bs-white) !important;
  opacity: 1 !important;
}

body.single-post .blog-post-custom .post-content .products .product-small .category,
body.single-post .blog-post-custom .post-content .products .product-small .product-cat {
  color: var(--bs-gray-400) !important;
  opacity: 1 !important;
}


/* ============================================================
   HERO SECTION
   ============================================================ */
.post-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  background: var(--bs-black);
  overflow: hidden;
}

.post-hero__image {
  position: absolute;
  inset: 0;
}

.post-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.post-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--bs-black) 0%,
    rgba(10, 10, 10, 0.7) 40%,
    transparent 100%
  );
}

.post-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 3rem 1.5rem 2.5rem;
}

.post-hero__content .container {
  max-width: var(--bs-max-width);
  margin: 0 auto;
}

/* Breadcrumbs */
.post-breadcrumbs ol {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.post-breadcrumbs li:not(:last-child)::after {
  content: '\2014';
  margin-left: 0.5rem;
  color: var(--bs-gray-700);
}

.post-breadcrumbs a {
  color: var(--bs-gray-400);
  text-decoration: none;
  transition: color var(--bs-transition);
}

.post-breadcrumbs a:hover {
  color: var(--bs-white);
}

.post-breadcrumbs li:last-child {
  color: var(--bs-gray-300);
}

/* Category badge */
.post-category a {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bs-black);
  background: var(--bs-white);
  padding: 0.25rem 0.75rem;
  text-decoration: none;
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Title */
.post-title {
  font-family: var(--bs-font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--bs-white);
  margin: 0 0 1.5rem;
  max-width: 800px;
  letter-spacing: -0.02em;
}

/* Meta */
.post-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--bs-gray-400);
}

.post-meta__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-meta__author img {
  border-radius: 50%;
  width: 32px;
  height: 32px;
}

.post-meta__author-name {
  color: var(--bs-white);
  font-weight: 500;
}

.post-meta__readtime::before {
  content: '\00B7';
  margin-right: 0.5rem;
}


/* ============================================================
   POST LAYOUT — Content + Sidebar
   ============================================================ */
.post-layout {
  max-width: var(--bs-max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.post-layout__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .post-layout__grid {
    grid-template-columns: 1fr 260px;
    gap: 4rem;
  }
}


/* ============================================================
   KEY TAKEAWAY BOX
   ============================================================ */
.key-takeaway {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bs-gray-900);
  border-left: 3px solid var(--bs-white);
  margin-bottom: 2.5rem;
}

.key-takeaway__icon {
  flex-shrink: 0;
  color: var(--bs-gray-400);
  margin-top: 0.15rem;
}

.key-takeaway__content strong {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bs-gray-400);
  margin-bottom: 0.5rem;
}

.key-takeaway__content p {
  color: var(--bs-white);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}


/* ============================================================
   ARTICLE BODY
   ============================================================ */
.post-content {
  color: var(--bs-gray-300);
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: var(--bs-content-width);
}

.post-content h2 {
  font-family: var(--bs-font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--bs-white);
  margin: 3rem 0 1rem;
  letter-spacing: -0.01em;
  scroll-margin-top: 100px;
}

.post-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--bs-highlight);
  margin: 2rem 0 0.75rem;
  scroll-margin-top: 100px;
}

.post-content p {
  margin: 0 0 1.5rem;
}

.post-content a {
  color: var(--bs-white);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity var(--bs-transition);
}

.post-content a:hover {
  opacity: 0.7;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: var(--bs-radius);
}

.post-content blockquote {
  border-left: 3px solid var(--bs-gray-700);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  color: var(--bs-gray-300);
  font-style: italic;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.5rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

/* Code blocks */
.post-content pre {
  background: var(--bs-gray-900);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: var(--bs-radius);
  font-size: 0.9rem;
}

.post-content code {
  background: var(--bs-gray-800);
  padding: 0.15em 0.4em;
  border-radius: 2px;
  font-size: 0.9em;
}


/* ============================================================
   RELATED PRODUCTS
   ============================================================ */
.related-products {
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--bs-gray-800);
}

.related-products h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--bs-white);
  margin-bottom: 1.5rem;
}

.related-products__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}

.product-card {
  display: block;
  text-decoration: none;
  background: var(--bs-gray-900);
  border-radius: var(--bs-radius);
  overflow: hidden;
  transition: transform var(--bs-transition);
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-card__image img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.product-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bs-white);
  padding: 0.75rem 1rem 0.25rem;
  margin: 0;
}

.product-card__price {
  display: block;
  font-size: 0.85rem;
  color: var(--bs-gray-400);
  padding: 0 1rem 0.75rem;
}


/* ============================================================
   FAQ SECTION
   ============================================================ */
.faq-section {
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--bs-gray-800);
}

.faq-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--bs-white);
  margin-bottom: 1.5rem;
}

.faq-item {
  border-bottom: 1px solid var(--bs-gray-800);
}

.faq-item__trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1.25rem 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.faq-item__trigger h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bs-highlight);
  margin: 0;
  padding-right: 1rem;
}

.faq-item__icon {
  color: var(--bs-gray-400);
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: transform var(--bs-transition);
}

.faq-item__trigger[aria-expanded="true"] .faq-item__icon {
  transform: rotate(45deg);
}

.faq-item__answer {
  color: var(--bs-gray-300);
  line-height: 1.7;
  padding-bottom: 1.25rem;
}

.faq-item__answer[hidden] {
  display: none !important;
}

.faq-item__answer p {
  margin: 0 0 0.75rem;
}


/* ============================================================
   AUTHOR BOX
   ============================================================ */
.author-box {
  display: flex;
  gap: 1.25rem;
  padding: 2rem;
  background: var(--bs-gray-900);
  border-radius: var(--bs-radius);
  margin: 3rem 0;
}

.author-box__avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.author-box__label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bs-gray-400);
}

.author-box__name {
  font-size: 1.1rem;
  margin: 0.25rem 0 0.5rem;
}

.author-box__name a {
  color: var(--bs-white);
  text-decoration: none;
}

.author-box__bio {
  color: var(--bs-gray-300);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.author-box__links a {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--bs-gray-400);
  text-decoration: underline;
}


/* ============================================================
   TABLE OF CONTENTS (Sticky Sidebar)
   ============================================================ */
.post-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .post-sidebar {
    display: block;
  }
}

.post-toc {
  position: sticky;
  top: 100px;
}

.post-toc__title {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bs-gray-400);
  margin: 0 0 1rem;
  font-weight: 600;
}

.post-toc__nav a {
  display: block;
  font-size: 0.85rem;
  color: var(--bs-gray-400);
  text-decoration: none;
  padding: 0.35rem 0 0.35rem 1rem;
  border-left: 2px solid var(--bs-gray-800);
  transition: all var(--bs-transition);
  line-height: 1.4;
}

.post-toc__nav a:hover,
.post-toc__nav a.active {
  color: var(--bs-white);
  border-left-color: var(--bs-white);
}

.post-toc__nav a[data-level="3"] {
  padding-left: 2rem;
  font-size: 0.8rem;
}

/* Sidebar newsletter */
.post-sidebar__newsletter {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--bs-gray-900);
  border-radius: var(--bs-radius);
}

.post-sidebar__newsletter h4 {
  font-size: 0.9rem;
  color: var(--bs-white);
  margin: 0 0 0.5rem;
}

.post-sidebar__newsletter p {
  font-size: 0.8rem;
  color: var(--bs-gray-400);
  line-height: 1.5;
  margin: 0;
}


/* ============================================================
   RELATED POSTS SECTION
   ============================================================ */
.related-posts {
  background: var(--bs-dark);
  padding: 4rem 1.5rem;
}

.related-posts .container {
  max-width: var(--bs-max-width);
  margin: 0 auto;
}

.related-posts__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--bs-white);
  margin: 0 0 2rem;
}

.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.related-card__link {
  display: block;
  text-decoration: none;
  background: var(--bs-gray-900);
  border-radius: var(--bs-radius);
  overflow: hidden;
  transition: transform var(--bs-transition);
}

.related-card__link:hover {
  transform: translateY(-4px);
}

.related-card__image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.related-card__content {
  padding: 1.25rem;
}

.related-card__category {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bs-gray-400);
}

.related-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--bs-white);
  margin: 0.5rem 0;
  line-height: 1.3;
}

.related-card__date {
  font-size: 0.8rem;
  color: var(--bs-gray-400);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1023px) {
  .blog-post-custom .post-layout__grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  .blog-post-custom .post-sidebar {
    display: none !important;
  }

  .blog-post-custom .post-content {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .post-hero {
    min-height: 40vh;
  }
  
  .post-hero__content {
    padding: 2rem 1rem 1.5rem;
  }
  
  .post-meta {
    gap: 0.75rem;
    font-size: 0.8rem;
  }
  
  .post-layout {
    padding: 2rem 1rem;
  }
  
  .author-box {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  
  .related-products__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .related-posts__grid {
    grid-template-columns: 1fr;
  }

}
