/* ==========================================================================
   POST HERO BLOCK — spb/post-hero
   4 layout variations: image-left, image-right, text-only, image-overlay
   ========================================================================== */

/* --------------------------------------------------------------------------
   SHARED BASE
   -------------------------------------------------------------------------- */

.wp-block-spb-post-hero {
    width: 100%;
    margin: 0 auto 2rem;
    font-family: var(--font-body-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    line-height: 1.4;
    box-sizing: border-box;
}

.wp-block-spb-post-hero *,
.wp-block-spb-post-hero *::before,
.wp-block-spb-post-hero *::after {
    box-sizing: border-box;
}

/* Image container */
.wp-block-spb-post-hero .post-hero__image {
    overflow: hidden;
}

.wp-block-spb-post-hero .post-hero__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Content container */
.wp-block-spb-post-hero .post-hero__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Category badge */
.wp-block-spb-post-hero .post-hero__category-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 0.35rem 0.9rem;
    background: var(--spb-accent, #6a8f6a);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    margin-bottom: 1.25rem;
}

/* Title */
.wp-block-spb-post-hero .post-hero__title {
    font-family: var(--wp--preset--font-family--heading, var(--font-heading-family, Georgia, 'Times New Roman', serif));
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 400;
    line-height: 1.15;
    margin: 0 0 1.25rem;
    color: inherit;
}

/* Date + author meta */
.wp-block-spb-post-hero .post-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wp-block-spb-post-hero .post-hero__by {
    font-weight: 400;
}

.wp-block-spb-post-hero .post-hero__author {
    text-decoration: none;
    color: inherit;
    font-weight: 600;
}

.wp-block-spb-post-hero .post-hero__author:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   RECIPE INFO BAR (inside post-hero)
   -------------------------------------------------------------------------- */

.wp-block-spb-post-hero .post-hero__info-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.wp-block-spb-post-hero .post-hero__info-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
    gap: 0.4rem;
}

.wp-block-spb-post-hero .post-hero__info-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    color: var(--spb-accent, #6a8f6a);
}

/* Reuse existing SVG icon masks from recipe-layout.css */
.wp-block-spb-post-hero .recipe-icon-servings {
    -webkit-mask: url('/wp-content/plugins/spicepilgrim-plugin/assets/icons/fork-knife.svg') no-repeat center / contain;
    mask: url('/wp-content/plugins/spicepilgrim-plugin/assets/icons/fork-knife.svg') no-repeat center / contain;
    background: currentColor;
}

.wp-block-spb-post-hero .recipe-icon-time {
    -webkit-mask: url('/wp-content/plugins/spicepilgrim-plugin/assets/icons/clock.svg') no-repeat center / contain;
    mask: url('/wp-content/plugins/spicepilgrim-plugin/assets/icons/clock.svg') no-repeat center / contain;
    background: currentColor;
}

.wp-block-spb-post-hero .recipe-icon-difficulty {
    -webkit-mask: url('/wp-content/plugins/spicepilgrim-plugin/assets/icons/chef-hat.svg') no-repeat center / contain;
    mask: url('/wp-content/plugins/spicepilgrim-plugin/assets/icons/chef-hat.svg') no-repeat center / contain;
    background: currentColor;
}

.wp-block-spb-post-hero .post-hero__info-label {
    font-weight: 600;
    color: var(--spb-accent, #6a8f6a);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.wp-block-spb-post-hero .post-hero__info-value {
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   VARIATION: IMAGE-LEFT / IMAGE-RIGHT — 50/50 split
   -------------------------------------------------------------------------- */

.wp-block-spb-post-hero--image-left,
.wp-block-spb-post-hero--image-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.wp-block-spb-post-hero--image-left .post-hero__image,
.wp-block-spb-post-hero--image-right .post-hero__image {
    height: 480px;
}

.wp-block-spb-post-hero--image-left .post-hero__content,
.wp-block-spb-post-hero--image-right .post-hero__content {
    background: #f0ede8;
    padding: 3rem;
    color: #1a1a1a;
}

.wp-block-spb-post-hero--image-left .post-hero__category-badge,
.wp-block-spb-post-hero--image-right .post-hero__category-badge {
    align-self: flex-start;
}

/* --------------------------------------------------------------------------
   VARIATION: TEXT-ONLY — full-width, centered text
   -------------------------------------------------------------------------- */

.wp-block-spb-post-hero--text-only {
    background: #f0ede8;
    text-align: center;
    color: #1a1a1a;
}

.wp-block-spb-post-hero--text-only .post-hero__content {
    padding: 4rem 2rem;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.wp-block-spb-post-hero--text-only .post-hero__category-badge {
    align-self: center;
}

.wp-block-spb-post-hero--text-only .post-hero__meta {
    justify-content: center;
}

.wp-block-spb-post-hero--text-only .post-hero__info-bar {
    justify-content: center;
}

/* --------------------------------------------------------------------------
   VARIATION: IMAGE-OVERLAY — full-width image + dark overlay + white text
   -------------------------------------------------------------------------- */

.wp-block-spb-post-hero--image-overlay {
    position: relative;
    min-height: 500px;
    color: #fff;
    overflow: hidden;
}

.wp-block-spb-post-hero--image-overlay .post-hero__image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.wp-block-spb-post-hero--image-overlay .post-hero__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, var(--post-hero-overlay-opacity, 0.25));
    z-index: 1;
}

.wp-block-spb-post-hero--image-overlay .post-hero__content {
    position: relative;
    z-index: 2;
    padding: 4rem 2rem;
    align-items: center;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    min-height: 500px;
}

.wp-block-spb-post-hero--image-overlay .post-hero__category-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    align-self: center;
}

.wp-block-spb-post-hero--image-overlay .post-hero__title {
    color: #fff;
}

.wp-block-spb-post-hero--image-overlay .post-hero__meta {
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
}

.wp-block-spb-post-hero--image-overlay .post-hero__author {
    color: #fff;
}

.wp-block-spb-post-hero.wp-block-spb-post-hero--image-overlay .post-hero__info-bar {
    justify-content: center;
}

.wp-block-spb-post-hero.wp-block-spb-post-hero--image-overlay .post-hero__info-icon {
    color: #fff;
}

.wp-block-spb-post-hero.wp-block-spb-post-hero--image-overlay .post-hero__info-label {
    color: #fff;
}

.wp-block-spb-post-hero.wp-block-spb-post-hero--image-overlay .post-hero__info-value {
    color: #fff;
}

/* --------------------------------------------------------------------------
   TEXT ALIGNMENT — applied to .post-hero__content
   -------------------------------------------------------------------------- */

.wp-block-spb-post-hero .post-hero__content--align-left {
    text-align: left;
    align-items: flex-start;
}

.wp-block-spb-post-hero .post-hero__content--align-left .post-hero__category-badge {
    align-self: flex-start;
}

.wp-block-spb-post-hero .post-hero__content--align-left .post-hero__meta,
.wp-block-spb-post-hero .post-hero__content--align-left .post-hero__info-bar {
    justify-content: flex-start;
}

.wp-block-spb-post-hero .post-hero__content--align-center {
    text-align: center;
    align-items: center;
}

.wp-block-spb-post-hero .post-hero__content--align-center .post-hero__category-badge {
    align-self: center;
}

.wp-block-spb-post-hero .post-hero__content--align-center .post-hero__meta,
.wp-block-spb-post-hero .post-hero__content--align-center .post-hero__info-bar {
    justify-content: center;
}

.wp-block-spb-post-hero .post-hero__content--align-right {
    text-align: right;
    align-items: flex-end;
}

.wp-block-spb-post-hero .post-hero__content--align-right .post-hero__category-badge {
    align-self: flex-end;
}

.wp-block-spb-post-hero .post-hero__content--align-right .post-hero__meta,
.wp-block-spb-post-hero .post-hero__content--align-right .post-hero__info-bar {
    justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   RESPONSIVE — stack image-left/right on mobile
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .wp-block-spb-post-hero--image-left,
    .wp-block-spb-post-hero--image-right {
        grid-template-columns: 1fr;
    }

    .wp-block-spb-post-hero--image-left .post-hero__image,
    .wp-block-spb-post-hero--image-right .post-hero__image {
        height: 400px;
    }

    .wp-block-spb-post-hero--image-left .post-hero__content,
    .wp-block-spb-post-hero--image-right .post-hero__content {
        padding: 2rem 1.5rem;
    }

    /* On mobile, content on top, image below for both left & right */
    .wp-block-spb-post-hero--image-left .post-hero__content,
    .wp-block-spb-post-hero--image-right .post-hero__content {
        order: 1;
    }

    .wp-block-spb-post-hero--image-left .post-hero__image,
    .wp-block-spb-post-hero--image-right .post-hero__image {
        order: 2;
    }

    .wp-block-spb-post-hero--text-only .post-hero__content {
        padding: 3rem 1.5rem;
    }

    .wp-block-spb-post-hero--image-overlay .post-hero__content {
        padding: 3rem 1.5rem;
        min-height: 400px;
    }

    .wp-block-spb-post-hero--image-overlay {
        min-height: 400px;
    }

    .wp-block-spb-post-hero .post-hero__info-bar {
        justify-content: center;
    }
}
