/**
 * Blog Single — Single Post View Styles
 *
 * Targets singular WordPress blog posts rendered by Astra's single.php.
 * Applies a dark card-on-halftone treatment matching the blog archive
 * aesthetic, with the article content contained in a card container
 * inspired by the unlock-hero's gate-box / drop-card design language.
 *
 * @package RobotGirl Studios
 */

/* ── Section Container ────────────────────────────────────────────
   Dark background with halftone dot overlay (injected via JS using
   the global .halftone-light class). Uses .single-post body class. */
.single-post .site-content {
  background: var(--ink);
  position: relative;
  overflow: hidden;
}

/* Override global .halftone-light::before z-index so dots render
   above --ink background but below positioned content. */
.single-post .site-content.halftone-light::before {
  z-index: 0;
}

.single-post .ast-container {
  position: relative;
  z-index: 1;
  width: 100%;
}

@media (min-width: 922px) {
  .ast-narrow-container .site-content > .ast-container {
    max-width: 900px;
  }
}

.single-post #primary {
  width: 100%;
  max-width: 100%;
  margin: 2rem 0 5rem;
}

/* ── Breadcrumbs ─────────────────────────────────────────────────
   Dark-themed breadcrumbs matching the archive pattern. */
.single-post .ast-breadcrumbs-wrapper {
  margin: 0 0 1.5rem;
  padding: 0;
}

.single-post .ast-breadcrumbs-wrapper .trail-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.single-post .ast-breadcrumbs-wrapper .trail-items li {
  display: inline-block;
  font-size: 0.92em;
}

.single-post .ast-breadcrumbs-wrapper a {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 0.92em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid-light);
  text-decoration: none;
  transition: color 0.15s;
}

.single-post .ast-breadcrumbs-wrapper a:hover {
  color: var(--accent);
}

.single-post .ast-breadcrumbs-wrapper .trail-end {
  font-family: "Montserrat", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.single-post .ast-breadcrumbs-wrapper .trail-items li::after {
  content: "/";
  color: var(--mid);
  padding: 0 0.4em;
}

.single-post .ast-breadcrumbs-wrapper .trail-items li:last-child::after {
  content: none;
}

/* ── Article Card Container ──────────────────────────────────────
   Inspired by unlock-hero's .gate-box / .drop-card aesthetic.
   #1a1a1a background, #2e2e2e border, signature accent shadow. */
.single-post .ast-article-single {
  background: #1a1a1a;
  border: 2px solid #2e2e2e;
  padding: 2.5rem;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    5px 5px 0 var(--accent);
  width: 100%;
  max-width: 100%;
}

/* ── Featured Image ──────────────────────────────────────────────
   16:9 aspect ratio, bleeds to card edges, border-bottom, hover scale. */
.single-post .ast-article-single .post-thumb-img-content {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: -2.5rem -2.5rem 0;
  border-bottom: 2px solid #2e2e2e;
}

.single-post .ast-article-single .post-thumb-img-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.single-post .ast-article-single:hover .post-thumb-img-content img {
  transform: scale(1.03);
}

/* When no featured image, remove negative margin offset from card */
.single-post .ast-article-single .post-thumb-img-content:empty {
  display: none;
}

/* ── Entry Header — Category Tags ────────────────────────────────
   Styled like the archive's category appearance. */
.single-post .cat-links {
  display: block;
  margin-top: 1.5rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.single-post .cat-links a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

.single-post .cat-links a:hover {
  filter: brightness(1.2);
}

/* ── Entry Title ─────────────────────────────────────────────────
   White, massive, uppercase — matching the archive header style. */
.single-post .entry-title {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.05;
  color: #fff;
  margin: 0.5rem 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

/* Accent decorative bar under the title */
.single-post .entry-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 5px;
  background: var(--accent);
  margin: 0.7rem 0 0;
}

/* ── Entry Meta ──────────────────────────────────────────────────
   Author + date row, same styling as archive meta. */
.single-post .entry-meta {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 1.5rem;
}

.single-post .entry-meta a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

.single-post .entry-meta a:hover {
  filter: brightness(1.2);
}

.single-post .entry-meta .posted-on .published {
  color: var(--accent);
}

.single-post .entry-meta .posted-by .author-name {
  color: var(--mid-light);
}

/* ── Entry Content — Body Typography ─────────────────────────────
   Full content area — paragraphs, headings, links, media. */
.single-post .entry-content {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.8;
  color: #cccccc;
}

.single-post .entry-content h1,
.single-post .entry-content h2,
.single-post .entry-content h3,
.single-post .entry-content h4,
.single-post .entry-content h5,
.single-post .entry-content h6 {
  color: #fff;
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.single-post .entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.single-post .entry-content a:hover {
  filter: brightness(1.2);
}

.single-post .entry-content p {
  margin-bottom: 1.5em;
}

/* Blockquotes */
.single-post .entry-content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1.25rem;
  color: var(--mid-light);
  font-style: italic;
  margin: 1.5em 0;
}

/* Content images */
.single-post .entry-content img {
  max-width: 100%;
  height: auto;
  border: 2px solid #2e2e2e;
}

/* WP block image with captions */
.single-post .entry-content .wp-block-image figcaption {
  font-size: 0.78rem;
  color: var(--mid);
  text-align: center;
  margin-top: 0.5rem;
}

/* Pullquotes / full-width blocks — stretch beyond card padding */
.single-post .entry-content .alignfull {
  margin-left: calc(-2.5rem);
  margin-right: calc(-2.5rem);
  max-width: calc(100% + 5rem);
}

.single-post .entry-content .alignwide {
  margin-left: calc(-1.25rem);
  margin-right: calc(-1.25rem);
  max-width: calc(100% + 2.5rem);
}

/* Tables */
.single-post .entry-content table {
  border-collapse: collapse;
  width: 100%;
  color: #cccccc;
}

.single-post .entry-content th,
.single-post .entry-content td {
  border: 1px solid #2e2e2e;
  padding: 0.75rem;
}

.single-post .entry-content th {
  background: #111;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
}

/* Code / pre blocks */
.single-post .entry-content code,
.single-post .entry-content pre {
  background: #111;
  color: var(--mid-light);
  border: 1px solid #2e2e2e;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

.single-post .entry-content pre {
  padding: 1rem;
  overflow-x: auto;
}

/* WP lists */
.single-post .entry-content ul,
.single-post .entry-content ol {
  padding-left: 1.5rem;
  color: #cccccc;
}

.single-post .entry-content li {
  margin-bottom: 0.5em;
}

/* ── Post Navigation ─────────────────────────────────────────────
   Previous / next links, dark-themed. */
.single-post .post-navigation {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #2e2e2e;
}

.single-post .post-navigation .nav-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.single-post .post-navigation .nav-links a {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid-light);
  text-decoration: none;
  transition: color 0.15s;
  max-width: 45%;
}

.single-post .post-navigation .nav-links a:hover {
  color: var(--accent);
}

.single-post .post-navigation .nav-previous a::before {
  content: "← ";
}

.single-post .post-navigation .nav-next a::after {
  content: " →";
}

/* ── Comments Section ────────────────────────────────────────────
   Full dark-themed comments area. */
.single-post .comments-area {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #2e2e2e;
}

.single-post .comments-title {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 1.2rem;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.single-post .comment-list {
  list-style: none;
  padding: 0;
}

.single-post .comment {
  background: #111;
  border: 1px solid #2e2e2e;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.single-post .comment-author .fn {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  color: #fff;
}

.single-post .comment-author .avatar {
  border: 1px solid #2e2e2e;
  margin-right: 0.5rem;
}

.single-post .comment-metadata {
  font-size: 0.72rem;
  color: var(--mid);
}

.single-post .comment-metadata a {
  color: var(--mid);
  text-decoration: none;
}

.single-post .comment-content {
  color: #cccccc;
  font-size: 0.88rem;
  line-height: 1.7;
}

.single-post .reply a {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: filter 0.15s;
}

.single-post .reply a:hover {
  filter: brightness(1.2);
}

/* Comment form */
.single-post .comment-respond {
  background: #111;
  border: 1px solid #2e2e2e;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.single-post .comment-reply-title {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 1rem;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.single-post .comment-form label {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid-light);
  display: block;
  margin-bottom: 0.3rem;
}

.single-post .comment-form input,
.single-post .comment-form textarea {
  background: #1a1a1a;
  border: 2px solid #2e2e2e;
  color: #cccccc;
  padding: 0.75em 1em;
  font-family: "Montserrat", sans-serif;
  font-size: 0.88rem;
  width: 100%;
  transition: border-color 0.2s;
}

.single-post .comment-form input:focus,
.single-post .comment-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.single-post .form-submit input#submit.submit {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 0;
  padding: 0.85em 2em;
  line-height: 1.3;
  cursor: pointer;
  width: auto;
  background: var(--accent);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.2) !important;
  color: var(--ink);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease-in-out;
}

.single-post .form-submit input#submit.submit:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(255, 255, 255, 0.2) !important;
  background: var(--paper-light);
  border-color: var(--ink) !important;
  color: var(--ink) !important;
}

p.comment-form-cookies-consent {
  display: flex;
  align-items: center;
}

input#wp-comment-cookies-consent {
  width: 0.85rem;
  height: 0.85rem;
}
.single-post .comment-form label {
  margin-bottom: 0;
}

/* ── Responsive: ≤ 900px — reduce card padding ───────────────── */
@media (max-width: 900px) {
  .single-post .ast-article-single {
    padding: 1.5rem;
  }

  .single-post .ast-article-single .post-thumb-img-content {
    margin: -1.5rem -1.5rem 0;
  }

  .single-post .entry-content .alignfull {
    margin-left: calc(-1.5rem);
    margin-right: calc(-1.5rem);
    max-width: calc(100% + 3rem);
  }

  .single-post .entry-content .alignwide {
    margin-left: calc(-0.75rem);
    margin-right: calc(-0.75rem);
    max-width: calc(100% + 1.5rem);
  }
}

/* ── Responsive: ≤ 768px — full-bleed card, tighter padding ──── */
@media (max-width: 768px) {
  .single-post .ast-container {
    max-width: 100%;
    padding: 0;
  }

  .single-post #primary {
    margin: 1rem 0 3rem;
  }

  .single-post .ast-article-single {
    padding: 1.25rem;
    border-left: none;
    border-right: none;
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.6),
      3px 3px 0 var(--accent);
  }

  .single-post .ast-article-single .post-thumb-img-content {
    margin: -1.25rem -1.25rem 0;
  }

  .single-post .entry-title {
    font-size: clamp(1.4rem, 6vw, 2rem);
  }

  .single-post .entry-content .alignfull {
    margin-left: calc(-1.25rem);
    margin-right: calc(-1.25rem);
    max-width: calc(100% + 2.5rem);
  }

  .single-post .post-navigation .nav-links {
    flex-direction: column;
  }

  .single-post .post-navigation .nav-links a {
    max-width: 100%;
  }

  .single-post .comment-respond {
    padding: 1.25rem;
  }
}
