/*
Theme Name:   Hello Elementor Child
Theme URI:    https://eyecareforkids.com.au
Description:  Hello Elementor child theme for Eye Care For Kids. Adds a custom Gutenberg blog post template that can be selected from the post editor template dropdown.
Author:       Digital Autopilot
Author URI:   https://digitalautopilot.com.au
Template:     hello-elementor
Version:      1.0.0
Text Domain:  hello-elementor-child
*/

:root {
    --ec4k-navy: #06162F;
    --ec4k-green: #90C442;
    --ec4k-green-dark: #7AAA38;
    --ec4k-pink: #CC3366;
    --ec4k-bg: #F1FBF1;
    --ec4k-white: #FFFFFF;
    --ec4k-text: #06162F;
    --ec4k-meta: #6B7280;
    --ec4k-border: #E5E7EB;
    --ec4k-content-width: 720px;
    --ec4k-sidebar-width: 300px;
    --ec4k-wrapper-max: 1200px;
}

/* ============================================
   BASE RESET FOR TEMPLATE
   ============================================ */
.ec4k-blog-post {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ec4k-text);
    background: var(--ec4k-white);
    line-height: 1.7;
}

.ec4k-blog-post * {
    box-sizing: border-box;
}

/* Kill any default top spacing so featured image sits flush against the Elementor header */
.ec4k-blog-post .ec4k-hero {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ============================================
   HERO with article header overlaid
   Uses absolute positioning for the content layer to guarantee it sits on
   top of the image regardless of stacking context quirks.
   ============================================ */
.ec4k-hero {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 460px;
    max-height: 680px;
    overflow: hidden;
    background-color: var(--ec4k-navy);
}

.ec4k-hero__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
    margin: 0;
}

.ec4k-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(6, 22, 47, 0.45) 0%,
        rgba(6, 22, 47, 0.6) 50%,
        rgba(6, 22, 47, 0.55) 100%
    );
}

.ec4k-hero__content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    padding: 48px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero variant for posts with no featured image: solid navy gradient */
.ec4k-hero--no-image {
    height: 420px;
    min-height: 420px;
    background: linear-gradient(135deg, #06162F 0%, #1a2d4f 100%);
}

.ec4k-hero--no-image .ec4k-hero__overlay {
    display: none;
}

/* ============================================
   ARTICLE HEADER (sits inside hero, inverse colours)
   All selectors scoped under .ec4k-hero to win specificity battles against
   parent theme h1/h2 rules and any Elementor-injected heading styles.
   ============================================ */
.ec4k-hero .ec4k-article-header {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    text-align: center;
}

.ec4k-hero .ec4k-article-header__meta {
    justify-content: center;
}

.ec4k-hero .ec4k-article-header__category {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ec4k-navy);
    background: var(--ec4k-green);
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 20px;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.ec4k-hero .ec4k-article-header__category:hover {
    transform: translateY(-1px);
    color: var(--ec4k-navy);
}

.ec4k-hero .ec4k-article-header__title,
.ec4k-blog-post .ec4k-hero h1.ec4k-article-header__title {
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    line-height: 1.1;
    color: #ffffff;
    margin: 0 0 24px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}

.ec4k-hero .ec4k-article-header__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.ec4k-hero .ec4k-article-header__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
}

.ec4k-hero .ec4k-article-header__author {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.ec4k-hero .ec4k-article-header__author:hover {
    opacity: 0.85;
    color: #ffffff;
}

.ec4k-hero .ec4k-article-header__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.ec4k-hero .ec4k-article-header__meta-divider {
    color: rgba(255, 255, 255, 0.4);
}

.ec4k-hero .ec4k-article-header time {
    color: rgba(255, 255, 255, 0.85);
}


/* ============================================
   MAIN LAYOUT: CONTENT + SIDEBAR
   ============================================ */
.ec4k-layout {
    max-width: var(--ec4k-wrapper-max);
    margin: 0 auto;
    padding: 40px 24px 80px;
    display: grid;
    grid-template-columns: var(--ec4k-content-width) var(--ec4k-sidebar-width);
    gap: 60px;
    justify-content: center;
}

/* Modifier used by the author bio container to share the grid layout but with
   tighter vertical spacing (the bio has its own border-top + margin treatment). */
.ec4k-layout--bio {
    padding-top: 0;
    padding-bottom: 0;
}

.ec4k-content {
    min-width: 0;
}

.ec4k-sidebar {
    min-width: 0;
}

/* ============================================
   CONTENT TYPOGRAPHY (the_content output)
   ============================================ */
.ec4k-content {
    font-size: 18px;
    line-height: 1.75;
}

.ec4k-content > p {
    margin: 0 0 24px;
}

.ec4k-content > p:first-of-type {
    font-size: 20px;
    line-height: 1.6;
    color: var(--ec4k-navy);
    font-weight: 400;
}

.ec4k-content h2 {
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ec4k-navy);
    margin: 48px 0 20px;
    letter-spacing: -0.3px;
}

.ec4k-content h3 {
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ec4k-navy);
    margin: 36px 0 16px;
}

.ec4k-content h4 {
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ec4k-navy);
    margin: 32px 0 12px;
}

.ec4k-content a {
    color: var(--ec4k-navy);
    text-decoration: underline;
    text-decoration-color: var(--ec4k-green);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.ec4k-content a:hover {
    color: var(--ec4k-green-dark);
}

.ec4k-content strong {
    color: var(--ec4k-navy);
    font-weight: 600;
}

.ec4k-content ul,
.ec4k-content ol {
    margin: 0 0 24px;
    padding-left: 28px;
}

.ec4k-content ul li,
.ec4k-content ol li {
    margin-bottom: 10px;
}

.ec4k-content ul li::marker {
    color: var(--ec4k-green);
}

.ec4k-content blockquote {
    border-left: 4px solid var(--ec4k-green);
    background: var(--ec4k-bg);
    padding: 24px 28px;
    margin: 32px 0;
    font-size: 20px;
    font-style: italic;
    color: var(--ec4k-navy);
    border-radius: 0 8px 8px 0;
}

.ec4k-content blockquote p:last-child {
    margin-bottom: 0;
}

.ec4k-content img,
.ec4k-content .wp-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 32px 0;
    display: block;
}

.ec4k-content figure {
    margin: 32px 0;
}

.ec4k-content figcaption {
    font-size: 14px;
    color: var(--ec4k-meta);
    text-align: center;
    margin-top: 8px;
}

/* Gutenberg core Table of Contents block (WP 6.6+) */
.ec4k-content .wp-block-table-of-contents,
.ec4k-content .wp-block-yoast-seo-table-of-contents {
    background: var(--ec4k-bg);
    border-left: 4px solid var(--ec4k-green);
    padding: 24px 28px;
    margin: 32px 0;
    border-radius: 0 8px 8px 0;
}

.ec4k-content .wp-block-table-of-contents ul,
.ec4k-content .wp-block-yoast-seo-table-of-contents ul {
    padding-left: 20px;
    margin: 0;
}

.ec4k-content .wp-block-table-of-contents a,
.ec4k-content .wp-block-yoast-seo-table-of-contents a {
    text-decoration: none;
    font-size: 16px;
}

.ec4k-content .wp-block-table-of-contents a:hover {
    text-decoration: underline;
}

/* ============================================
   AUTHOR BIO BLOCK
   ============================================ */
.ec4k-author-bio {
    max-width: var(--ec4k-content-width);
    margin: 56px auto 0;
    padding: 32px 0 0;
    border-top: 1px solid var(--ec4k-border);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.ec4k-author-bio__avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
}

.ec4k-author-bio__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ec4k-author-bio__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ec4k-meta);
    margin: 0 0 4px;
}

.ec4k-author-bio__name {
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--ec4k-navy);
    margin: 0 0 8px;
}

.ec4k-author-bio__description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--ec4k-text);
    margin: 0;
}

/* ============================================
   SIDEBAR
   ============================================ */
.ec4k-sidebar-inner {
    position: sticky;
    top: 120px;
}

/* Each widget renders as its own boxed card to match the default CTA styling */
.ec4k-sidebar .widget {
    background: var(--ec4k-white);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 32px rgba(6, 22, 47, 0.08);
    padding: 24px 26px;
    margin-bottom: 24px;
}

.ec4k-sidebar .widget:last-child {
    margin-bottom: 0;
}

.ec4k-sidebar .widget-title,
.ec4k-sidebar h2.widget-title,
.ec4k-sidebar h3.widget-title {
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ec4k-meta);
    margin: 0 0 16px;
}

.ec4k-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ec4k-sidebar ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--ec4k-border);
}

.ec4k-sidebar ul li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ec4k-sidebar ul li:first-child {
    padding-top: 0;
}

.ec4k-sidebar a {
    color: var(--ec4k-navy);
    text-decoration: none;
    font-size: 15px;
}

.ec4k-sidebar a:hover {
    color: var(--ec4k-green-dark);
}

/* ============================================
   DEFAULT SIDEBAR CTA
   Shown when no widgets are configured in the Blog Sidebar widget area.
   ============================================ */
.ec4k-sidebar-cta {
    background: var(--ec4k-white);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 32px rgba(6, 22, 47, 0.08);
    border-top: 5px solid var(--ec4k-green);
    padding: 28px 26px 26px;
    position: relative;
}

.ec4k-sidebar-cta__icon {
    width: 48px;
    height: 48px;
    background: var(--ec4k-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--ec4k-green-dark);
}

.ec4k-sidebar-cta__icon svg {
    width: 26px;
    height: 26px;
}

.ec4k-sidebar-cta__title {
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--ec4k-navy);
    margin: 0 0 10px;
    line-height: 1.25;
    letter-spacing: -0.2px;
}

.ec4k-sidebar-cta__text {
    font-size: 14px;
    color: var(--ec4k-meta);
    line-height: 1.55;
    margin: 0 0 20px;
}

.ec4k-sidebar-cta__bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.ec4k-sidebar-cta__bullets li {
    position: relative;
    padding: 0 0 0 28px;
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--ec4k-navy);
    line-height: 1.4;
    border: none;
}

.ec4k-sidebar-cta__bullets li:last-child {
    margin-bottom: 0;
}

.ec4k-sidebar-cta__bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    width: 18px;
    height: 18px;
    background-color: var(--ec4k-green);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 11px;
}

.ec4k-sidebar-cta__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ec4k-green);
    color: var(--ec4k-white);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 20px;
    border-radius: 100px;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s ease, transform 0.15s ease;
    width: 100%;
    line-height: 1.2;
}

.ec4k-sidebar-cta__button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.ec4k-sidebar-cta__button:hover {
    background: var(--ec4k-green-dark);
    color: var(--ec4k-white);
    transform: translateY(-1px);
}

.ec4k-sidebar-cta__button:hover svg {
    transform: translateX(3px);
}

.ec4k-sidebar-cta__phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--ec4k-meta);
    text-decoration: none;
    transition: color 0.15s ease;
}

.ec4k-sidebar-cta__phone svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.ec4k-sidebar-cta__phone:hover {
    color: var(--ec4k-navy);
}

/* ============================================
   RELATED POSTS
   ============================================ */
.ec4k-related {
    background: var(--ec4k-bg);
    padding: 64px 24px;
    margin-top: 80px;
}

.ec4k-related__inner {
    max-width: var(--ec4k-wrapper-max);
    margin: 0 auto;
}

.ec4k-related__title {
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--ec4k-navy);
    margin: 0 0 32px;
    text-align: center;
}

.ec4k-related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.ec4k-related-card {
    background: var(--ec4k-white);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.ec4k-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(6, 22, 47, 0.12);
}

.ec4k-related-card__image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--ec4k-border);
}

.ec4k-related-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ec4k-related-card:hover .ec4k-related-card__image img {
    transform: scale(1.04);
}

.ec4k-related-card__body {
    padding: 20px 22px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ec4k-related-card__category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ec4k-green-dark);
    margin: 0 0 8px;
}

.ec4k-related-card__title {
    font-family: 'Nunito', 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ec4k-navy);
    margin: 0 0 12px;
}

.ec4k-related-card__date {
    font-size: 13px;
    color: var(--ec4k-meta);
    margin-top: auto;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .ec4k-layout {
        grid-template-columns: 1fr;
        max-width: var(--ec4k-content-width);
        gap: 48px;
    }

    .ec4k-sidebar-inner {
        position: static;
    }

    .ec4k-related__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ec4k-hero {
        height: auto;
        min-height: 420px;
        max-height: none;
    }

    .ec4k-hero--no-image {
        min-height: 320px;
    }

    .ec4k-hero__content {
        padding: 32px 20px;
    }

    .ec4k-article-header__title {
        font-size: clamp(26px, 7vw, 36px);
        margin-bottom: 18px;
    }

    .ec4k-article-header__meta {
        gap: 10px;
        font-size: 13px;
    }

    .ec4k-article-header__category {
        font-size: 11px;
        padding: 5px 12px;
    }

    .ec4k-content {
        font-size: 17px;
    }

    .ec4k-content > p:first-of-type {
        font-size: 18px;
    }

    .ec4k-content h2 {
        font-size: 26px;
        margin: 36px 0 16px;
    }

    .ec4k-content h3 {
        font-size: 21px;
    }

    .ec4k-layout {
        padding: 48px 20px 60px;
    }

    .ec4k-related {
        padding: 48px 20px;
    }

    .ec4k-related__grid {
        grid-template-columns: 1fr;
    }

    .ec4k-author-bio {
        flex-direction: column;
        text-align: left;
        gap: 16px;
    }
}
