/**
 * Single Post Page Styles
 *
 * This file contains layout-specific styling only.
 * Typography and colors are managed via global utility classes.
 */

/* ============================================
   Featured Image
   ============================================ */

.post-featured-image-wrapper {
  width: 100%;
  overflow: hidden;
  background-color: var(--bs-primary-900);
}

.post-featured-image {
  width: 100%;
  height: 33.125rem; /* Default height */
}

.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================
   Navigation
   ============================================ */

.btn-go-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  height: 2.5rem; /* 40px */
  min-width: 6.875rem;
  background-color: var(--bs-primary-100); /* #CBF4EA */
  color: var(--bs-primary-500); /* #007457 */
  border-radius: 1rem; /* 16px */
  border: none;
  text-decoration: none;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  line-height: 1.2;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-go-back:hover {
  background-color: var(--bs-primary-50);
  transform: translateY(-0.125rem);
  color: var(--bs-primary-500);
}

.btn-go-back:active,
.btn-go-back.active {
  background-color: var(--bs-primary-100);
  transform: translateY(0);
  color: var(--bs-primary-500);
}

.btn-go-back:focus {
  outline: 0.125rem solid var(--bs-primary-500);
  outline-offset: 0.125rem;
}

.btn-go-back:disabled,
.btn-go-back.disabled {
  background-color: var(--bs-primary-50);
  color: var(--bs-primary-400);
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   Layout
   ============================================ */

.post-sidebar {
  position: sticky;
  top: var(--space-10);
}

.post-logo img {
  max-height: 2.5rem;
  width: auto;
}

/* ============================================
   Post Entry Content (CMS Overrides)
   ============================================ */

.post-entry-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
  padding-top: var(--space-20);
}

/* Heading Scaling */
.post-entry-content h1,
.post-entry-content h2,
.post-entry-content h3,
.post-entry-content h4 {
  font-family: var(--font-family-sans);
  line-height: var(--line-height-heading);
  margin-top: 0;
  margin-bottom: 0;
  color: var(--bs-primary-50);
}

.post-entry-content h1 {
  font-size: var(--font-size-h1);
}
.post-entry-content h2 {
  font-size: var(--font-size-h2);
}
.post-entry-content h3 {
  font-size: var(--font-size-h3);
  color: var(--bs-primary-100);
}
.post-entry-content h4 {
  font-size: var(--font-size-h4);
  color: var(--bs-primary-100);
}

/* Highlighted Intro - Handles first child p or h3 */
.post-entry-content > *:first-child {
  font-size: var(--font-size-lg-fluid);
  line-height: 1.4;
  color: var(--bs-primary-25);
  font-weight: 300;
}

.post-entry-content div:empty,
.post-entry-content p:empty,
.post-entry-content span:empty,
.post-entry-content strong:empty,
.post-entry-content em:empty,
.post-entry-content b:empty,
.post-entry-content i:empty,
.post-entry-content a:empty,
.post-entry-content li:empty,
.post-entry-content h1:empty,
.post-entry-content h2:empty,
.post-entry-content h3:empty,
.post-entry-content h4:empty,
.post-entry-content h5:empty,
.post-entry-content h6:empty,
.post-entry-content blockquote:empty,
.post-entry-content figure:empty,
.post-entry-content table:empty,
.post-entry-content ul:empty,
.post-entry-content ol:empty {
  display: none;
}

.post-entry-content p {
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--bs-primary-100);
  margin-bottom: 1rem;
}

/* WordPress Core Elements Styling */
.post-entry-content p img,
.post-entry-content img {
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.post-entry-content .aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.post-entry-content .alignnone {
  margin: 0;
}

/* Figure support from CMS */
.post-entry-content figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-9);
}

.post-entry-content figcaption {
  font-size: var(--font-fontSize-sm);
  color: var(--bs-primary-100);
  opacity: 0.8;
}

/* Blockquote - Quote styling from Figma */
.post-entry-content blockquote {
  padding: 0.5rem var(--space-14);
  border-left: 0.125rem solid var(--bs-success);
  margin: 0;
}

.post-entry-content blockquote p {
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--bs-primary-50);
}

/* List Styling */
.post-entry-content ul,
.post-entry-content ol {
  padding-left: var(--space-11);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: 1rem;
}

.post-entry-content li {
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--bs-primary-100);
}

/* Global Formatting Utilities within Content */
.post-entry-content a {
  text-decoration: underline;
  color: inherit;
}
.post-entry-content a:hover {
  color: var(--bs-success);
}

.post-entry-content strong,
.post-entry-content b {
  font-weight: var(--font-weight-semibold);
  color: var(--bs-primary-50);
}

.post-content-end-mark {
  display: flex;
  justify-content: end;
  margin-top: var(--space-20);
  width: 0.9375rem;
  height: 0.9375rem;
  background-color: var(--bs-primary-400);
  margin-left: auto;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Large Desktop (1200px and up) */
@media (min-width: 1199.98px) {
  .single-post-page-section {
    padding: var(--space-23) 0;
  }
}

/* Tablet (992px to 1199.98px) */
@media (max-width: 1199.98px) and (min-width: 992px) {
  .single-post-page-section {
    padding: var(--space-22) 0;
  }

  .post-featured-image {
    height: 30rem;
  }
}

/* Tablet (768px to 991.98px) */
@media (max-width: 991.98px) {
  .single-post-page-section {
    padding: var(--space-20) 0;
  }

  .post-featured-image {
    height: 23.75rem;
  }

  .post-sidebar {
    position: static;
    margin-bottom: var(--space-11);
  }

  .post-entry-content {
    gap: var(--space-11);
    padding-top: var(--space-11);
  }

  .post-entry-content h1 {
    font-size: var(--font-size-h2);
  }

  .post-entry-content h2 {
    font-size: var(--font-size-h3);
  }

  .post-entry-content h3 {
    font-size: var(--font-size-2xl);
  }

  .btn-go-back {
    margin-bottom: var(--space-7);
  }
}

/* Mobile (576px to 767.98px) */
@media (max-width: 767.98px) {
  .single-post-page-section {
    padding: var(--space-17) 0;
  }

  .post-featured-image {
    height: 17.5rem;
  }

  .post-entry-content {
    gap: var(--space-9);
  }

  .post-entry-content h1 {
    font-size: var(--font-size-3xl);
  }

  .post-entry-content h2 {
    font-size: var(--font-size-2xl);
  }

  .post-entry-content h3 {
    font-size: var(--font-size-xl);
  }
}

/* Small Mobile (up to 575.98px) */
@media (max-width: 575.98px) {
  .single-post-page-section {
    padding: var(--space-14) 0;
  }

  .post-featured-image {
    height: 13.75rem;
  }

  .post-sidebar {
    gap: var(--space-7);
  }

  .post-logo img {
    max-height: 1.875rem;
  }

  .btn-go-back {
    width: 100%;
    justify-content: center;
    font-size: var(--font-size-sm);
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .btn-go-back {
    transition: none;
  }

  .btn-go-back:hover {
    transform: none;
  }
}
