/**
 * Single blog post layout — hero, article, sidebar.
 * Loaded only on singular posts (see enqueue-scripts.php).
 */

/* -------------------------------------------------------------------------
   Hero — full width, parallax layer + mask (parallax transform via JS)
   ------------------------------------------------------------------------- */

.single-post-hero {
  position: relative;
  width: 100%;
  min-height: clamp(280px, 36vw, 380px);
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 2rem;
}

.single-post-hero__parallax-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.single-post-hero__parallax-inner {
  position: absolute;
  left: 0;
  top: -12%;
  width: 100%;
  height: 124%;
  margin: 0;
  background-color: var(--prussian_blue);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  will-change: transform;
  filter: blur(5px);
  --webkit-filter: blur(5px);
  transform: translate3d(0, 0, 0) scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  .single-post-hero__parallax-inner {
    filter: blur(2px);
    transform: translate3d(0, 0, 0) scale(1.04);
  }
}

.single-post-hero__mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0, 19, 28, 0.92) 0%,
    rgba(3, 52, 73, 0.75) 45%,
    rgba(3, 121, 155, 0.55) 100%
  );
  pointer-events: none;
}

.single-post-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 2.5rem 0 2.75rem;
  color: var(--white);
}

.single-post-hero__title {
  font-family: "century-gothic", sans-serif;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  text-transform: uppercase;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.single-post-hero .breadcrumb-list {
  color: rgba(255, 255, 255, 0.95);
}

.single-post-hero .breadcrumb-item a {
  color: var(--white);
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.single-post-hero .breadcrumb-item.active {
  opacity: 0.95;
  max-width: 100%;
  word-break: break-word;
}

/* Yoast / Rank Math breadcrumb wrappers inside hero */
.single-post-hero .yoast-breadcrumb,
.single-post-hero .rank-math-breadcrumb {
  font-size: 0.9rem;
  margin: 0;
}

.single-post-hero .yoast-breadcrumb a,
.single-post-hero .rank-math-breadcrumb a {
  color: var(--white);
}

/* -------------------------------------------------------------------------
   Article + sidebar
   ------------------------------------------------------------------------- */

.single-post-wrap {
  padding: 3rem 0 4rem;
  background-color: var(--white);
}

.single-post-main {
  min-width: 0;
}

.single-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(3, 52, 73, 0.12);
  font-size: 0.95rem;
  color: var(--gray);
}

.single-post-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.single-post-meta__item a {
  color: var(--cerulean);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.single-post-meta__item a:hover {
  border-bottom-color: var(--cerulean);
}

.single-post-meta__item i {
  color: var(--prussian_blue);
  opacity: 0.85;
}

.single-post-featured {
  margin-bottom: 2rem;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 19, 28, 0.08);
}

.single-post-featured img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

.single-post-body {
  line-height: 1.65;
  color: #222;
}

.single-post-body > *:first-child {
  margin-top: 0;
}

.single-post-body h2,
.single-post-body h3,
.single-post-body h4 {
  color: var(--prussian_blue);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

/*
 * In-page anchors / TOC: scroll-margin lets native scrollIntoView() clear sticky header.
 * Tune clamp if announcement bar or header height changes a lot.
 */
.single-post-body h2 {
  scroll-margin-top: clamp(7.5rem, 22vh, 15rem);
  font-size: 1.65rem;
}

.single-post-body p {
  margin-bottom: 1rem;
}

.single-post-body ul,
.single-post-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.single-post-body ul li {
  list-style: disc;
  margin-bottom: 0.35rem;
}

.single-post-pager {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(3, 52, 73, 0.08);
}

.single-post-tags {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(3, 52, 73, 0.12);
}

.single-post-tags__label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--prussian_blue);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.single-post-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.single-post-tags__list a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
  background: var(--light-gray);
  color: var(--prussian_blue);
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.single-post-tags__list a:hover {
  background: var(--light_cyan);
  color: var(--cerulean);
}

.single-post-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(3, 52, 73, 0.08);
}

.single-post-nav a {
  color: var(--cerulean);
  text-decoration: none;
  font-weight: 600;
  max-width: 48%;
}

.single-post-nav a:hover {
  text-decoration: underline;
}

.single-post-related {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #f3f3f3
}

.single-post-related__title {
  font-size: 1.35rem;
  color: var(--prussian_blue);
  font-weight: 700;
  margin: 0 0 1.25rem;
  text-transform: uppercase;
}

.single-post-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.single-post-related__card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  overflow: hidden;
  background: var(--light-gray);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.single-post-related__card:hover {
  box-shadow: 0 12px 28px rgba(0, 19, 28, 0.12);
  transform: translateY(-2px);
}

.single-post-related__thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--prussian_blue);
}

.single-post-related__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.single-post-related__card-body {
  padding: 1rem;
}

.single-post-related__card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--prussian_blue);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.single-post-comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(3, 52, 73, 0.1);
}

/* Sidebar */
.single-post-sidebar {
  position: sticky;
  top: 1.5rem;
}

.single-post-sidebar__box {
  background: var(--light-gray);
  border-radius: 4px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.5rem;
}

.single-post-sidebar__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--prussian_blue);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.single-post-sidebar .search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.single-post-sidebar .search-form .search-field {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(3, 52, 73, 0.2);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.95rem;
}

.single-post-sidebar .search-form .search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 2.75rem;
  padding: 0.55rem 0.65rem;
  background: var(--cerulean);
  color: var(--white);
  border: none;
  border-radius: 3px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.single-post-sidebar .search-form .search-submit .fas,
.single-post-sidebar .search-form .search-submit .fa-search {
  font-size: 1rem;
  line-height: 1;
}

.single-post-sidebar .search-form .search-submit:hover {
  background: var(--prussian_blue);
  color: var(--white);
}

.single-post-sidebar__categories ul,
.single-post-sidebar__categories ul.children,
.single-post-sidebar__categories ul ul {
  list-style: none;
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.single-post-sidebar__categories li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid rgba(3, 52, 73, 0.08);
  list-style: none;
  list-style-type: none;
}

.single-post-sidebar__categories li:last-child {
  border-bottom: none;
}

.single-post-sidebar__categories a {
  display: block;
  padding: 0.55rem 0;
  color: var(--prussian_blue);
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.single-post-sidebar__categories a:hover {
  color: var(--cerulean);
  padding-left: 0.25rem;
}

/* Table of contents (filled by single-post.js) */
.single-post-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.single-post-toc__list li {
  margin: 0 0 0.35rem;
  padding: 0;
  line-height: 1.35;
}

.single-post-toc__list li:last-child {
  margin-bottom: 0;
}

.single-post-toc__list a {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--prussian_blue);
  text-decoration: none;
  border-left: 3px solid transparent;
  padding-left: 0.65rem;
  margin-left: -0.65rem;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.single-post-toc__list a:hover {
  color: var(--cerulean);
  border-left-color: var(--cerulean);
}

.single-post-toc__list a.is-active {
  color: var(--cerulean);
  font-weight: 600;
  border-left-color: var(--cerulean);
  background: rgba(0, 166, 201, 0.08);
}

.single-post-toc__list a.is-active:hover {
  color: var(--prussian_blue);
  border-left-color: var(--cerulean);
}

.single-post-sidebar__ad {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    -45deg,
    rgba(3, 52, 73, 0.04),
    rgba(3, 52, 73, 0.04) 8px,
    rgba(3, 52, 73, 0.07) 8px,
    rgba(3, 52, 73, 0.07) 16px
  );
  border: 2px dashed rgba(3, 52, 73, 0.2);
  border-radius: 4px;
  color: var(--gray);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

@media (max-width: 991px) {
  .single-post-sidebar {
    position: static;
    margin-top: 2.5rem;
  }

  .single-post-nav a {
    max-width: 100%;
  }
}

.sticky-sidebar {
  position: sticky;
  top: 8.5rem;
}

#main-content {
  overflow-x: unset;
}

.single-post-body a {
  color: var(--cerulean);
  text-decoration: underline;
}

.wp-block-image :where(figcaption) {
    text-align: center;
    font-size: .9rem;
}