/*
 * Page Layout — Hello Elementor Child
 * For WordPress Pages using the default template (not Elementor Canvas/Full Width).
 *
 * Shares .hec-hero styles with single posts when a featured image is set.
 * When there's no featured image, uses .hec-page__header for a simple centered title.
 */

body.page {
    --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;
}

/* ========================================================================
   HERO (when featured image is set) — inherit from single-post.css
   The .hec-hero class is defined globally; we only need to ensure body.page
   gets access to the animations.
   ======================================================================== */
body.page .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);
}

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

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

body.page .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%);
}

body.page .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;
}

body.page .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;
}

body.page .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;
}

/* Ensure keyframes exist (in case single-post.css didn't load on this page) */
@keyframes hecHeroFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================================================
   SIMPLE PAGE HEADER (when no featured image)
   ======================================================================== */
.hec-page__header {
    max-width: 860px;
    margin: 0 auto;
    padding: clamp(4rem, 10vw, 8rem) var(--hec-gutter) clamp(2rem, 5vw, 4rem);
    text-align: center;
}

.hec-page__title {
    font-family: var(--hec-font-heading);
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    font-weight: 500;
    color: var(--hec-text);
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.01em;
}

.hec-page__divider {
    width: 60px;
    height: 2px;
    background: var(--hec-accent);
    margin: 1.75rem auto 0;
}

/* ========================================================================
   SITE MAIN + CONTENT
   ======================================================================== */
body.page .site-main {
    max-width: var(--hec-content-width);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

/* Override site-main padding when a hero is present (hero needs to escape via 100vw) */
body.page .site-main.hec-page {
    max-width: none;
    padding: 0;
}

body.page .site-main.hec-page .hec-article {
    max-width: var(--hec-content-width);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

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

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

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

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

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

/* Headings */
body.page .page-content h2,
body.page .page-content h3 {
    font-family: var(--hec-font-heading);
    font-weight: 600;
    color: var(--hec-text);
    text-align: center;
    margin: var(--hec-section-gap) auto 1.5rem;
    line-height: 1.25;
    letter-spacing: 0.01em;
    position: relative;
    padding-top: var(--hec-section-gap);
}

body.page .page-content h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

body.page .page-content h3 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
}

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

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

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

/* Images */
body.page .page-content img {
    width: calc(100% + 3rem);
    max-width: var(--hec-content-width);
    margin-left: -1.5rem;
    height: auto;
    display: block;
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.1);
    filter: grayscale(var(--hec-image-grayscale));
    transition: transform 0.4s ease, box-shadow 0.4s ease, filter 0.5s ease;
}

body.page .page-content img:hover {
    filter: grayscale(0);
}

/* Lists */
body.page .page-content ul,
body.page .page-content ol {
    max-width: 65ch;
    margin: 1.5rem auto;
    padding-left: 1.5rem;
}

body.page .page-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* WordPress pagination for long pages */
.hec-page-links {
    max-width: 65ch;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--hec-border);
    font-size: 0.85rem;
    color: var(--hec-text);
    opacity: 0.7;
    text-align: center;
}

.hec-page-links a {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    margin: 0 0.2rem;
    color: var(--hec-accent);
    text-decoration: none;
    border: 1px solid var(--hec-border);
    border-radius: 4px;
    transition: all 0.25s ease;
}

.hec-page-links a:hover {
    border-color: var(--hec-accent);
}

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

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

    body.page .site-main.hec-page .hec-article {
        padding: 0 1.25rem 3rem;
    }

    body.page .page-content img {
        width: calc(100% + 2.5rem);
        margin-left: -1.25rem;
    }

    .hec-page__header {
        padding: 4rem 1.25rem 2rem;
    }
}

@media (max-width: 480px) {
    body.page .hec-hero__title,
    body.page .hec-page__title {
        font-size: 1.8rem;
    }

    body.page .page-content {
        font-size: 1rem;
        line-height: 1.75;
    }
}
