/*
 * Gutenberg compatibility for the original SEVAK Home composition.
 *
 * The public PHP template remains the visual source of truth. These rules do
 * not redesign it: they only neutralise block wrappers and restore the same
 * measurements, spacing and responsive behaviour for editable Home content.
 */

.gutenberg-home {
    overflow: hidden;
}

.gutenberg-home > .wp-block-group,
.gutenberg-home > .wp-block-sevakart-selected-works {
    margin-block-start: 0;
}

.gutenberg-home > .hero,
.gutenberg-home > .wp-block-sevakart-selected-works,
.gutenberg-home > .about-preview {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: none !important;
    width: var(--page) !important;
}

/* Hero: exact counterpart of the original front-page.php section. */
.gutenberg-home .hero.wp-block-group {
    align-items: center;
    display: grid;
    gap: min(7vw, 100.8px);
    grid-template-columns: minmax(300px, .8fr) minmax(440px, 1.4fr);
    min-height: 690px;
    padding: 52px min(3vw, 43.2px);
}

.gutenberg-home .hero > .hero__copy,
.gutenberg-home .hero > .hero__artwork {
    margin: 0 !important;
    max-width: none !important;
    min-width: 0;
    width: 100%;
}

.gutenberg-home .hero > .hero__copy {
    max-width: 520px !important;
}

.gutenberg-home .hero__copy > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.gutenberg-home .hero__copy > .eyebrow {
    margin-bottom: 16px !important;
    margin-top: 0 !important;
}

.gutenberg-home .hero__copy > h1 {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.gutenberg-home .hero__copy > .hero__intro {
    margin-bottom: 42px !important;
    margin-top: 28px !important;
}

.gutenberg-home .hero__copy > .text-link {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.gutenberg-home .hero__artwork {
    justify-self: stretch;
}

.gutenberg-home .hero__artwork .wp-block-image {
    aspect-ratio: 4 / 3;
    background: transparent;
    margin: 0;
    max-height: none;
    max-width: none !important;
    overflow: hidden;
    width: 100% !important;
}

.gutenberg-home .hero__artwork .wp-block-image a {
    display: block;
    height: 100%;
    width: 100%;
}

.gutenberg-home .hero__artwork .wp-block-image img {
    display: block;
    height: 100% !important;
    object-fit: cover;
    width: 100% !important;
}

.gutenberg-home .hero__caption {
    margin: 12px 0 0 !important;
    max-width: none !important;
    width: 100%;
}

/* Studio: retain the original full-width two-column statement. */
.gutenberg-home .statement-section.wp-block-group {
    display: grid;
    gap: 0;
    grid-template-columns: 1fr 1fr;
    margin: 0 !important;
    max-width: none !important;
    min-height: 520px;
    width: 100% !important;
}

.gutenberg-home .statement-section > .statement-section__media,
.gutenberg-home .statement-section > .statement-section__copy {
    margin: 0 !important;
    max-width: none !important;
    min-width: 0;
    width: 100% !important;
}

.gutenberg-home .statement-section__media {
    min-height: 520px;
    overflow: hidden;
    padding: 0 !important;
}

.gutenberg-home .statement-section__media > .statement-section__image-block {
    height: 100% !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

.gutenberg-home .statement-section__image-block img {
    display: block;
    height: 100% !important;
    object-fit: cover !important;
    object-position: 50% 52%;
    width: 100% !important;
}

.gutenberg-home .statement-section__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: min(9vw, 130px);
}

.gutenberg-home .statement-section__copy > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.gutenberg-home .statement-section__copy > .eyebrow {
    margin-bottom: 16px !important;
    margin-top: 0 !important;
}

.gutenberg-home .statement-section__copy > h2 {
    margin: 0 !important;
}

.gutenberg-home .statement-section__quote.wp-block-quote {
    border: 0;
    margin: 28px 0 34px !important;
    padding: 0;
}

.gutenberg-home .statement-section__copy > p.text-link {
    align-self: flex-start;
    color: inherit;
    font-size: 11px;
    margin: 0 !important;
    max-width: none;
}

/* Artist: reproduce the original label / text / portrait three-column grid. */
.gutenberg-home .about-preview.wp-block-group {
    align-items: start;
    display: grid;
    gap: min(5vw, 72px);
    grid-template-areas: "label copy media";
    grid-template-columns: minmax(110px, .55fr) minmax(320px, 1.15fr) minmax(280px, .8fr);
    padding: 100px 0;
}

.gutenberg-home .about-preview > .eyebrow {
    grid-area: label;
    margin: 0 0 16px !important;
}

.gutenberg-home .about-preview > .about-preview__copy,
.gutenberg-home .about-preview > .about-preview__media {
    margin: 0 !important;
    min-width: 0;
    width: 100% !important;
}

.gutenberg-home .about-preview__copy {
    grid-area: copy;
    max-width: 760px !important;
    padding-top: min(3vw, 43.2px);
}

.gutenberg-home .about-preview__copy > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.gutenberg-home .about-preview__copy > h2 {
    margin: 0 !important;
}

.gutenberg-home .about-preview__copy > p:not(.text-link) {
    margin: 24px 0 32px !important;
}

.gutenberg-home .about-preview__copy > p.text-link {
    color: inherit;
    font-size: 11px;
    margin: 0 !important;
    max-width: none;
}

.gutenberg-home .about-preview__media {
    aspect-ratio: 3 / 4;
    grid-area: media;
    max-width: none !important;
    overflow: hidden;
    padding: 0 !important;
}

.gutenberg-home .about-preview__media > .about-preview__image-block {
    height: 100% !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

.gutenberg-home .about-preview__image-block img {
    display: block;
    height: 100% !important;
    object-fit: cover !important;
    object-position: 50% 38%;
    width: 100% !important;
}

/* Gutenberg buttons and paragraph wrappers should look like original markup. */
.gutenberg-home .contact-band > .eyebrow {
    margin: 0 0 16px !important;
}

.gutenberg-home .contact-band > h2 {
    margin: 0 auto !important;
}

.gutenberg-home .contact-band > p:not(.eyebrow) {
    margin: 22px auto 32px !important;
}

.gutenberg-home .contact-band > .wp-block-buttons {
    margin: 0 auto !important;
}

.gutenberg-home .contact-band .wp-block-button__link {
    background: var(--green);
    border: 1px solid var(--green);
    border-radius: 0;
    color: #fff;
    font-size: 11px;
    letter-spacing: .12em;
    padding: 16px 28px;
    text-transform: uppercase;
}

/* The editor uses the same layout language at a practical editing scale. */
.editor-styles-wrapper .wp-block-group.hero {
    display: grid;
    gap: 7vw;
    grid-template-columns: minmax(300px, .8fr) minmax(440px, 1.4fr);
}

.editor-styles-wrapper .wp-block-group.about-preview {
    display: grid;
    gap: 5vw;
    grid-template-columns: minmax(110px, .55fr) minmax(320px, 1.15fr) minmax(280px, .8fr);
}

.editor-styles-wrapper .hero__artwork .wp-block-image,
.editor-styles-wrapper .statement-section__media .wp-block-image,
.editor-styles-wrapper .about-preview__media .wp-block-image {
    height: 100%;
    margin: 0;
    width: 100%;
}

.editor-styles-wrapper .hero__artwork img,
.editor-styles-wrapper .statement-section__media img,
.editor-styles-wrapper .about-preview__media img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

@media (min-width: 1440px) {
    .gutenberg-home .statement-section.wp-block-group {
        height: 706px;
        min-height: 0;
        overflow: hidden;
    }

    .gutenberg-home .statement-section > .statement-section__media,
    .gutenberg-home .statement-section > .statement-section__copy,
    .gutenberg-home .statement-section__media > .statement-section__image-block {
        height: 100% !important;
        min-height: 0;
    }
}

@media (max-width: 900px) {
    .gutenberg-home .hero.wp-block-group,
    .gutenberg-home .statement-section.wp-block-group {
        grid-template-columns: 1fr;
    }

    .gutenberg-home .hero.wp-block-group {
        gap: 38px;
        padding: 50px 0;
    }

    .gutenberg-home .hero > .hero__copy {
        max-width: 650px !important;
    }

    .gutenberg-home .statement-section__copy {
        padding: 70px 7vw;
    }

    .gutenberg-home .statement-section__media {
        aspect-ratio: 16 / 9;
        min-height: 0;
    }

    .gutenberg-home .about-preview.wp-block-group {
        gap: 28px;
        grid-template-areas:
            "label"
            "media"
            "copy";
        grid-template-columns: 1fr;
    }

    .gutenberg-home .about-preview__media {
        max-width: 760px !important;
    }

    .gutenberg-home .about-preview__copy {
        padding-top: 12px;
    }

    .editor-styles-wrapper .wp-block-group.hero,
    .editor-styles-wrapper .wp-block-group.about-preview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .gutenberg-home .hero.wp-block-group {
        min-height: 0;
    }

    .gutenberg-home .statement-section__media {
        min-height: 0;
    }

    .gutenberg-home .statement-section__copy {
        padding: 60px 22px;
    }

    .gutenberg-home .about-preview.wp-block-group {
        padding: 72px 0;
    }
}
