/*
 * Single Post Layout — Hello Elementor Child v2.2
 * CTA styles live in cta.css, pull-quote styles in quotes.css.
 */

body.single-post {
    --hec-content-width: 740px;
    --hec-content-wide: 960px;

    font-family: var(--hec-font-body);
    color: var(--hec-text);
    background: var(--hec-bg);
    -webkit-font-smoothing: antialiased;
}

/* Progress bar */
.hec-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--hec-accent);
    z-index: 99999;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* Hero */
.hec-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: var(--hec-hero-height, 70vh);
    min-height: 450px;
    max-height: 700px;
    overflow: hidden;
    margin-bottom: var(--hec-section-gap);
}

.hec-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 6s ease-out;
}

.hec-hero:hover .hec-hero__img {
    transform: scale(1.03);
}

.hec-hero__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.35) 50%, rgba(0,0,0,0.6) 100%);
}

.hec-hero__kicker {
    font-family: var(--hec-font-body);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--hec-accent);
    margin-bottom: 1.25rem;
    opacity: 0;
    transform: translateY(20px);
    animation: hecHeroFadeUp 0.8s 0.3s ease forwards;
}

.hec-hero__title {
    font-family: var(--hec-font-heading);
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    font-weight: 600;
    color: #fff;
    line-height: 1.15;
    max-width: 800px;
    margin: 0;
    letter-spacing: -0.01em;
    opacity: 0;
    transform: translateY(30px);
    animation: hecHeroFadeUp 0.8s 0.5s ease forwards;
}

.hec-hero__divider {
    width: 60px;
    height: 2px;
    background: var(--hec-accent);
    margin: 1.5rem auto 0;
    opacity: 0;
    animation: hecHeroFadeUp 0.8s 0.7s ease forwards;
}

@keyframes hecHeroFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Site main */
body.single-post .site-main {
    max-width: var(--hec-content-width);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

/* Content */
body.single-post .page-content {
    font-size: 1.1rem;
    line-height: 1.85;
    font-weight: 300;
    color: var(--hec-text);
}

body.single-post .page-content > p {
    margin-bottom: 1.7rem;
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

body.single-post .page-content p strong {
    font-weight: 500;
    color: var(--hec-text);
}

body.single-post .page-content a {
    color: var(--hec-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.25s ease;
}

body.single-post .page-content a:hover {
    color: var(--hec-accent-dark);
}

/* Section headings */
body.single-post .page-content h3 {
    font-family: var(--hec-font-heading);
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 600;
    color: var(--hec-text);
    text-align: center;
    margin: var(--hec-section-gap) auto 1.5rem;
    padding-top: var(--hec-section-gap);
    position: relative;
    letter-spacing: 0.01em;
    line-height: 1.25;
}

body.single-post .page-content h3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--hec-accent);
}

body.single-post .page-content h3:first-of-type {
    padding-top: 0;
    margin-top: 0;
}

body.single-post .page-content h3:first-of-type::before {
    display: none;
}

/* Images — centered horizontally, break out symmetrically when wider than content */
body.single-post .page-content > p img:not(.hec-hero__img),
body.single-post .page-content > img:not(.hec-hero__img),
body.single-post .page-content > figure > img:not(.hec-hero__img) {
    max-width: calc(100% + 3rem);
    height: auto;
    display: block;
    margin: 2.5rem auto;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.4s ease, box-shadow 0.4s ease, filter 0.5s ease;
}

body.single-post .page-content > p img:not(.hec-hero__img):hover,
body.single-post .page-content > img:not(.hec-hero__img):hover,
body.single-post .page-content > figure > img:not(.hec-hero__img):hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 50px rgba(0,0,0,0.15);
}

/* Reset gallery + figure styling that shouldn't inherit content image rules */
body.single-post .hec-gallery,
body.single-post .hec-gallery * {
    box-shadow: none !important;
}

body.single-post .hec-gallery__item {
    margin: 0 !important;
    cursor: default !important;
}

body.single-post .hec-gallery__item img {
    margin: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: default;
}

/* Figures (image blocks with captions) also center */
body.single-post .page-content figure {
    margin: 2.5rem auto;
    max-width: calc(100% + 3rem);
    text-align: center;
}

body.single-post .page-content figure img {
    margin: 0 auto;
}

body.single-post .page-content figure figcaption {
    font-family: var(--hec-font-body);
    font-size: 0.85rem;
    color: var(--hec-text);
    opacity: 0.6;
    text-align: center;
    margin-top: 0.75rem;
    font-style: italic;
}

/* Lightbox */
.hec-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hec-lightbox.active { opacity: 1; visibility: visible; }

.hec-lightbox img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.5);
    transform: scale(0.92);
    transition: transform 0.35s ease;
}

.hec-lightbox.active img { transform: scale(1); }

.hec-lightbox__close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 1.8rem;
    color: #fff;
    opacity: 0.7;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.hec-lightbox__close:hover { opacity: 1; }

.hec-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: #fff;
    opacity: 0.6;
    cursor: pointer;
    background: none;
    border: none;
    padding: 1rem;
    transition: opacity 0.2s ease;
    user-select: none;
}

.hec-lightbox__nav:hover { opacity: 1; }
.hec-lightbox__nav--prev { left: 1rem; }
.hec-lightbox__nav--next { right: 1rem; }

.hec-lightbox__counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.5);
    font-family: var(--hec-font-body);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

/* Scroll reveal */
.hec-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.hec-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Tags */
body.single-post .post-tags {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--hec-border);
    font-size: 0.85rem;
    color: var(--hec-text);
    opacity: 0.75;
}

body.single-post .post-tags a,
body.single-post .tag-links a {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    margin: 0.25rem 0.3rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--hec-accent);
    border: 1px solid var(--hec-accent);
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.25s ease;
}

body.single-post .post-tags a:hover,
body.single-post .tag-links a:hover {
    background: var(--hec-accent);
    color: #fff;
}

/* Post navigation */
.hec-post-nav {
    width: calc(100% + 3rem);
    margin-left: -1.5rem;
    margin-top: var(--hec-section-gap);
    padding-top: var(--hec-section-gap);
    border-top: 1px solid var(--hec-border);
}

.hec-post-nav__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.hec-post-nav__link {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0;
    text-decoration: none;
    color: var(--hec-text);
    transition: color 0.25s ease;
    min-height: 4rem;
}

.hec-post-nav__link:not(.hec-post-nav__link--empty):hover {
    color: var(--hec-accent);
}

.hec-post-nav__link--prev {
    text-align: left;
    align-items: flex-start;
}

.hec-post-nav__link--next {
    text-align: right;
    align-items: flex-end;
}

.hec-post-nav__link--empty {
    pointer-events: none;
}

.hec-post-nav__label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--hec-font-body);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--hec-text);
    opacity: 0.65;
    transition: opacity 0.25s ease, color 0.25s ease, gap 0.3s ease;
}

.hec-post-nav__link--prev:hover .hec-post-nav__label,
.hec-post-nav__link--next:hover .hec-post-nav__label {
    gap: 0.85rem;
    color: var(--hec-accent);
    opacity: 1;
}

.hec-post-nav__title {
    font-family: var(--hec-font-heading);
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.005em;
    color: inherit;
}

/* Responsive */
@media (max-width: 768px) {
    .hec-hero {
        min-height: 350px;
    }

    body.single-post .site-main {
        padding: 0 1.25rem 3rem;
    }

    body.single-post .page-content > p img:not(.hec-hero__img),
    body.single-post .page-content > img:not(.hec-hero__img),
    body.single-post .page-content > figure > img:not(.hec-hero__img) {
        width: calc(100% + 2.5rem);
        margin-left: -1.25rem;
    }

    .hec-lightbox__nav { display: none; }

    .hec-post-nav {
        width: calc(100% + 2.5rem);
        margin-left: -1.25rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        box-sizing: border-box;
    }

    .hec-post-nav__inner {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .hec-post-nav__link--next {
        text-align: left;
        align-items: flex-start;
        padding-top: 1.5rem;
        border-top: 1px solid var(--hec-border);
    }

    .hec-post-nav__link--empty {
        display: none;
    }

    .hec-post-nav__title {
        max-width: 100%;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }
}

@media (max-width: 480px) {
    .hec-hero__title { font-size: 1.8rem; }
    body.single-post .page-content { font-size: 1rem; line-height: 1.75; }
    body.single-post .page-content h3 { font-size: 1.35rem; }
}
