/* ==========================================================================
   Single post
   1. Hero (featured image + title + excerpt overlaid)
   2. Meta bar (date · reading time · share)
   3. Article content (prose)
   4. Responsive
   ========================================================================== */

.single {
  --single-measure: 46rem;              /* reading width for meta + prose */
  --single-ink: #f5f2ea;
  --single-ink-dim: rgba(245, 242, 234, 0.88);
  --single-ink-mute: #a8a49a;           /* ~7.3:1 on --primary — AA for body text */
  --single-hairline: rgba(245, 242, 234, 0.15);
  --single-radius: 12px;
  /* Break long unbroken strings (URLs, pasted tokens) instead of overflowing */
  overflow-wrap: break-word;
}

/* ==========================================================================
   1. Hero
   ========================================================================== */

.single-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  width: 100%;                          /* lock width so aspect-ratio + max-height
                                          crop the height rather than shrink us */
  aspect-ratio: 1672 / 941;             /* matches the reference photo */
  min-height: 60vh;
  max-height: 88vh;
  overflow: hidden;
  /* Fallback ground when a post has no featured image */
  background: linear-gradient(150deg, var(--wp--preset--color--surface-alt), var(--wp--preset--color--primary));
}

/* wp:post-featured-image renders <figure class="wp-block-post-featured-image ..."> */
.single-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
}

.single-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bottom-weighted scrim: near-solid where the text sits, clearing toward the
   top, with a faint vignette up top so the header stays legible. */
.single-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(22, 21, 17, 0.97) 0%,
    rgba(22, 21, 17, 0.90) 14%,
    rgba(22, 21, 17, 0.66) 30%,
    rgba(22, 21, 17, 0.30) 50%,
    rgba(22, 21, 17, 0.08) 72%,
    rgba(22, 21, 17, 0.30) 100%
  );
}

.single-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1.5rem, 5vw, 4rem);
}

/* Contextual selector so it outranks theme.json's .wp-block-post-title rule */
.single-hero .single-hero__title {
  margin: 0;
  max-width: 20ch;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5.5vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: -0.012em;
  color: var(--single-ink);
  text-wrap: balance;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 14px 50px rgba(0, 0, 0, 0.55);
}

.single-hero__excerpt {
  margin: clamp(1rem, 2.2vw, 1.6rem) 0 0;
  max-width: 42ch;
}

.single-hero__excerpt p {
  margin: 0;
  font-family: var(--wp--preset--font-family--accent-italic);
  font-style: italic;
  font-size: clamp(1.05rem, 1.9vw, 1.4rem);
  line-height: 1.5;
  color: rgba(245, 242, 234, 0.94);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.7);
}

/* Hide the block's "Read more" affordance and any empty excerpt node */
.single-hero__excerpt .wp-block-post-excerpt__more-text,
.single-hero__excerpt .wp-block-post-excerpt__more-link {
  display: none;
}
.single-hero__excerpt:empty,
.single-hero__excerpt p:empty {
  display: none;
}

/* ==========================================================================
   2. Meta bar
   ========================================================================== */

.single-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.5rem;
  max-width: var(--single-measure);
  margin: clamp(2rem, 5vw, 3.25rem) auto clamp(2rem, 5vw, 3rem);
  padding: 0 clamp(1.25rem, 5vw, 2rem) 1.25rem;
  border-bottom: 1px solid var(--single-hairline);
  color: var(--single-ink-mute);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.single-meta__facts {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.single-meta__date {
  font-variant-numeric: lining-nums;
}

.single-meta__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

/* --- Share --------------------------------------------------------------- */

.single-share {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.single-share__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.single-share__list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.single-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--single-ink-mute);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.single-share__btn:hover {
  color: var(--single-ink);
  background: rgba(245, 242, 234, 0.08);
}

.single-share__btn:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 2px;
}

.single-share__icon {
  display: block;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.single-share__icon--pinterest {
  -webkit-mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@v16/icons/pinterest.svg');
  mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@v16/icons/pinterest.svg');
}
.single-share__icon--x {
  -webkit-mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@v16/icons/x.svg');
  mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@v16/icons/x.svg');
}
.single-share__icon--facebook {
  -webkit-mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@v16/icons/facebook.svg');
  mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@v16/icons/facebook.svg');
}
.single-share__icon--link {
  -webkit-mask-image: url('https://cdn.jsdelivr.net/npm/@tabler/icons@3.31.0/icons/outline/link.svg');
  mask-image: url('https://cdn.jsdelivr.net/npm/@tabler/icons@3.31.0/icons/outline/link.svg');
}

.single-share__status {
  font-size: 0.8rem;
  color: var(--wp--preset--color--accent);
  min-width: 0;
}

/* ==========================================================================
   3. Article content
   ========================================================================== */

.single-body {
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.single-content {
  max-width: var(--single-measure);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2rem);
}

.single-content > * {
  margin-block: 1.5em;
}
.single-content > :first-child {
  margin-top: 0;
}

.single-content p,
.single-content li {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--single-ink-dim);
}

.single-content :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--wp--preset--font-family--display);
  line-height: 1.25;
  color: var(--single-ink);
  margin-top: 2em;
}
.single-content h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 400;
}
.single-content h2 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  font-weight: 400;
}
.single-content h3 {
  font-size: 1.4rem;
  font-weight: 600;
}
.single-content h4 {
  font-size: 1.15rem;
  font-weight: 600;
}
.single-content h5 {
  font-size: 1rem;
  font-weight: 600;
}
.single-content h6 {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.single-content a {
  color: var(--wp--preset--color--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-thickness 0.12s ease;
}
.single-content a:hover {
  text-decoration-thickness: 2px;
}

.single-content strong {
  color: var(--single-ink);
}

/* Editorial drop cap — only when the article opens with a paragraph */
.single-content > p:first-child::first-letter {
  float: left;
  margin: 0.06em 0.09em 0 0;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 600;
  font-size: 3.6em;
  line-height: 0.76;
  color: var(--wp--preset--color--accent);
}

.single-content blockquote {
  margin-inline: 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--wp--preset--color--accent);
  font-family: var(--wp--preset--font-family--accent-italic);
  font-style: italic;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  line-height: 1.5;
  color: var(--single-ink);
}
.single-content blockquote p {
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.single-content :is(img, .wp-block-image img) {
  border-radius: var(--single-radius);
}

.single-content figure {
  margin-inline: 0;
}
.single-content figcaption {
  margin-top: 0.6rem;
  font-family: var(--wp--preset--font-family--accent-italic);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--single-ink-mute);
  text-align: center;
}

.single-content ul,
.single-content ol {
  padding-left: 1.4rem;
}
.single-content li {
  margin-block: 0.5em;
}

.single-content hr {
  border: 0;
  border-top: 1px solid rgba(245, 242, 234, 0.22);
}

.single-content ::selection {
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--primary);
}

/* Full-bleed blocks the author may use inside the content keep their edges */
.single-content .alignwide,
.single-content .alignfull {
  border-radius: 0;
}

/* Visually-hidden label helper (parent theme also ships one; keep a local copy) */
.single .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   4. Responsive
   ========================================================================== */

@media (max-width: 700px) {
  .single-hero {
    aspect-ratio: auto;
    min-height: 82vh;
    max-height: none;
  }
  .single-hero .single-hero__title {
    font-size: clamp(2rem, 8.5vw, 2.9rem);
  }
  .single-meta {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .single-share__btn,
  .single-content a {
    transition: none;
  }
}
