/* ==========================================================================
   HERO OFFSET VARIABLE AND BACKGROUND GLOW
   ========================================================================== */

/* Space above the hero (match the height of the transparent menu) */
html body .post_header_wrap_style_style-3 { --m15-top: 200px; }

/* Soft orange glow with top and bottom fade (no visible box).
   Layers, top to bottom: top fade, bottom fade, glow top right,
   glow bottom left, solid base colour. */
html body .page_content_wrap:has(.post_item_single) {
  background:
    linear-gradient(to bottom, #070707 0, rgba(7,7,7,0) 240px),
    linear-gradient(to top, #070707 0, rgba(7,7,7,0) 260px),
    radial-gradient(ellipse 900px 640px at 100% 0%,
      rgba(255,81,33,.15) 0%, rgba(255,81,33,.08) 35%,
      rgba(255,81,33,.03) 60%, transparent 80%),
    radial-gradient(ellipse 760px 520px at 0% 100%,
      rgba(255,81,33,.10) 0%, rgba(255,81,33,.045) 40%, transparent 80%),
    #070707 !important;
}


/* ==========================================================================
   KEYFRAMES
   ========================================================================== */
@keyframes m15-rise {
  from { opacity: 0; translate: 0 22px; }
  to   { opacity: 1; translate: 0 0; }
}


/* ==========================================================================
   CATEGORY LABELS
   ========================================================================== */
html body :is(.post_header_wrap_style_style-3, .related_wrap, .post_item_single) :is(.post_meta_categories, .post_categories) a {
  pointer-events: none;
  cursor: default;
  text-decoration: none;
  background: none !important;
  padding: 0 !important;
  color: #ff5233 !important;
}


/* ==========================================================================
   HERO: title on top, wide rounded photo below
   ========================================================================== */
html body .post_header_wrap.post_header_wrap_style_style-3 {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  position: relative !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: var(--m15-top) 24px 0 !important;
  background: none !important;

  &::before, &::after { display: none !important; }

  /* Title + meta (after the photo in the HTML; moved to the top visually) */
  .post_header {
    order: 1;
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: none !important;
    text-align: center !important;
  }
  .post_header .content_wrap {
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: none !important;
    border-radius: 0 !important;
    text-align: center !important;
  }

  .post_meta_categories {
    display: block;
    width: 100%;
    margin: 0 0 18px !important;
    padding: 0 !important;
    text-align: center !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3em;
    text-transform: uppercase;
    animation: m15-rise 1.2s cubic-bezier(.22,.61,.36,1) .10s both;
  }
  .post_title {
    display: block;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    margin: 0 auto 28px !important;   /* auto left/right keeps it centred */
    padding: 0 !important;
    text-align: center !important;
    font-size: clamp(32px, 4.4vw, 56px) !important;
    line-height: 1.1 !important;
    font-weight: 600;
    color: #fff;
    animation: m15-rise 1.2s cubic-bezier(.22,.61,.36,1) .30s both;
  }
  .post_meta_other {
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 13px;
    color: #9a9a9a;
    animation: m15-rise 1.2s cubic-bezier(.22,.61,.36,1) .50s both;

    &::after { display: none !important; }
  }

  /* Hero photo */
  .post_featured {
    order: 2;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 1120px;
    height: clamp(300px, 52vh, 520px) !important;
    margin: 56px auto 0 !important;
    border-radius: 20px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: 0 30px 90px rgba(255,81,33,.16);
    animation: m15-rise 1.4s cubic-bezier(.22,.61,.36,1) .70s both;
  }
  .post_featured .sc_parallax_wrap { height: 100% !important; }
}


/* ==========================================================================
   SHARE BUTTONS
   ========================================================================== */
html body .page_content_wrap a.social_item {
  display: inline-grid !important;
  place-items: center;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  translate: none !important;
  animation: none !important;
  width: 46px;
  height: 46px;
  box-sizing: border-box;
  overflow: hidden;
  background: transparent !important;
  border: 1px solid #2a2a2a !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  color: #fff !important;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;

  &::before, &::after { display: none !important; }

  .social_icon {
    background: none !important;
    color: inherit !important;
    transform: none !important;
    animation: none !important;

    &::before, &::after { display: none !important; }
  }
  .social_icon * { background: none !important; color: inherit !important; }

  &:hover {
    background: #ff5233 !important;
    border-color: #ff5233 !important;
    color: #111 !important;
  }
}


/* ==========================================================================
   "YOU MAY ALSO LIKE": cards styled like the blog page
   ========================================================================== */
html body .related_wrap {

  .related_wrap_title {
    margin: 0 0 36px !important;
    font-size: clamp(26px, 2.6vw, 34px) !important;
    font-weight: 600;
    color: #fff;
  }

  /* Grid: reset the theme's float / width on every child */
  .posts_container {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 32px;
    margin: 0 !important;
    width: 100% !important;

    &::before, &::after { display: none !important; }

    > * {
      width: auto !important;
      max-width: none !important;
      margin: 0 !important;
      padding: 0 !important;
      float: none !important;
    }
  }

  /* Card */
  .posts_container :is(.related_item, .post_item) {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    background: #121212;
    border: 1px solid #232323;
    border-radius: 16px;
    overflow: hidden;
    transition: border-color .5s ease, transform .6s cubic-bezier(.22,.61,.36,1);
    animation: m15-rise 1.2s cubic-bezier(.22,.61,.36,1) both;

    &:hover { border-color: #ff5233; transform: translateY(-3px); }

    /* Image hover transition is intentionally not set here, so the
       theme's own image hover stays in effect */
    .post_featured {
      position: relative !important;
      width: auto !important;
      margin: 0 !important;
      padding: 0 !important;
    }
    .post_featured img {
      display: block;
      width: 100% !important;
      height: auto !important;
      aspect-ratio: 16/10 !important;
      object-fit: cover;
    }

    /* Text blocks get side padding; first gets top, last gets bottom */
    > :not(.post_featured) { margin: 0; padding-left: 24px; padding-right: 24px; }
    > .post_featured + *   { padding-top: 20px; }
    > :last-child          { padding-bottom: 26px; }

    .post_title {
      font-size: 22px !important;
      line-height: 1.3 !important;
      margin: 0 0 8px !important;
    }
  }
}


/* ==========================================================================
   FADE-IN ON SCROLL
   ========================================================================== */
html body .page_content_wrap :is(.post_item_single > .post_footer, .comments_wrap, .related_wrap .related_wrap_title) {
  animation: m15-rise 1.2s cubic-bezier(.22,.61,.36,1) both;
}

@supports (animation-timeline: view()) {
  html body .page_content_wrap :is(.post_item_single > .post_footer, .comments_wrap, .related_wrap .related_wrap_title),
  html body .related_wrap .posts_container :is(.related_item, .post_item) {
    animation: m15-rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
}


/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* ---------- 8.1 TABLET (max 1024px) ---------- */
@media (max-width: 1024px) {
  html body .post_header_wrap_style_style-3 { --m15-top: 150px; }
  html body .post_header_wrap.post_header_wrap_style_style-3 .post_featured { margin-top: 44px !important; }
  html body .related_wrap .posts_container { gap: 24px; }
}

/* ---------- 8.2 MOBILE (max 700px): single column ---------- */
@media (max-width: 700px) {
  html body .post_header_wrap_style_style-3 { --m15-top: 110px; }
  html body .post_header_wrap.post_header_wrap_style_style-3 {
    .post_featured { margin-top: 32px !important; border-radius: 16px; }
    .post_title { margin-bottom: 20px !important; }
  }
  html body .related_wrap .posts_container { grid-template-columns: minmax(0,1fr); gap: 20px; }
  html body .related_wrap .posts_container :is(.related_item, .post_item) > :not(.post_featured) {
    padding-left: 18px; padding-right: 18px;
  }
  html body .related_wrap .posts_container :is(.related_item, .post_item) .post_title { font-size: 19px !important; }
}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html body .post_header_wrap_style_style-3 *,
  html body .related_wrap *,
  html body .page_content_wrap :is(.post_item_single > .post_footer, .comments_wrap) {
    animation: none !important;
  }
}