/* ========================================
   Hero
======================================== */

.mast-hero {
    box-sizing: border-box;
    display: flex;
    align-items: center;

    min-height: clamp(340px, 32vw, 460px);

    margin: 0;
    padding: 56px 0;

    color: #fff;
    background-color: #20252a;

    background-image:
        linear-gradient(
            rgba(0, 0, 0, .40),
            rgba(0, 0, 0, .40)
        ),
        url("../images/mast-hero.jpg");

    background-size: cover;
    background-position: center 48%;
    background-repeat: no-repeat;
}


.mast-hero .mast-hero__title {
    margin: 0;
    padding: 0;

    border: 0;
    background: none;
    box-shadow: none;

    color: inherit;

    font-size: clamp(28px, 3.1vw, 44px);
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: .04em;

    overflow-wrap: anywhere;
}


.mast-hero__title::before,
.mast-hero__title::after {
    content: none;
}


.mast-hero .mast-hero__title,
.mast-hero .mast-hero__subtitle {
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}


.mast-hero .mast-hero__subtitle {
    margin: 20px 0 0;

    color: inherit;

    font-size: clamp(16px, 1.7vw, 24px);
    line-height: 1.7;
    letter-spacing: .05em;
}


/* ========================================
   TOP Section Rhythm
======================================== */

.home .entry-body {
    --mast-section-gap: 72px;
}


.home .entry-body
> :is(
    .mast-message,
    .mast-business,
    .mast-news,
    .mast-contact
) {
    display: flow-root;

    margin-top: 0;
    margin-bottom: 0;
}


.home .entry-body
> :is(
    .mast-message,
    .mast-business,
    .mast-news,
    .mast-contact
)
+ :is(
    .mast-message,
    .mast-business,
    .mast-news,
    .mast-contact
) {
    margin-top: var(--mast-section-gap);
}


/* セクション内部のmarginが外側余白に加算されるのを防止 */

.home .entry-body
> :is(
    .mast-message,
    .mast-business,
    .mast-news,
    .mast-contact
)
> :first-child {
    margin-top: 0;
}


.home .entry-body
> :is(
    .mast-message,
    .mast-business,
    .mast-news,
    .mast-contact
)
> :last-child {
    margin-bottom: 0;
}


/* Section dividers: follow each section's content width.
   Keep the shared outer margin and heading styles unchanged. */
.home .entry-body > :is(.mast-business, .mast-news, .mast-contact) {
    border-top: 1px solid #d9dee2;
    padding-top: clamp(20px, 2.4vw, 28px);
}


/* ========================================
   Message
======================================== */

.home .mast-message {
    --mast-message-width: 760px;
    --mast-message-title-gap: 32px;
    --mast-message-paragraph-gap: 18px;
    --mast-message-leading: 2;

    text-align: left;
}


/* Message title */

.home .mast-message > h2.wp-block-heading {
    max-width: var(--mast-message-width);

    margin: 0;
    /* VK's margin-bottom: 0 !important must not cancel the title gap. */
    padding: 0 0 var(--mast-message-title-gap);

    border: 0;
    background: none;
    box-shadow: none;

    color: #0071a1;

    text-align: left;

    font-size: clamp(28px, 3vw, 38px);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .01em;

    overflow-wrap: anywhere;
}


.home .mast-message > h2.wp-block-heading::before,
.home .mast-message > h2.wp-block-heading::after {
    content: none;
}


/* Message body: outrank Lightning's container/flow paragraph spacing. */

.home .mast-message > p.wp-block-paragraph {
    box-sizing: border-box;

    max-width: var(--mast-message-width);

    margin: 0 0 var(--mast-message-paragraph-gap);

    text-align: left;

    line-height: var(--mast-message-leading);

    overflow-wrap: anywhere;
}


.home .mast-message > p.wp-block-paragraph:last-child {
    margin-bottom: 0;
}


/* ========================================
   Shared TOP Section Headings
======================================== */

/*
   WordPress側：
   English
   <br>
   日本語

   という既存H2をそのまま使用。
*/

.home .entry-body
> :is(
    .mast-business,
    .mast-news,
    .mast-contact
)
> h2.wp-block-heading {

    width: 100%;
    max-width: none;

    margin: 0 0 clamp(24px, 2.6vw, 32px);
    padding: 0;

    border: 0;
    background: none;
    box-shadow: none;

    text-align: left;

    /* 管理画面側の保存済み文字色を上書き */
    color: #2b2b2b !important;

    font-size: clamp(24px, 2.5vw, 30px);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .04em;
}


/* 英字部分 */

.home .entry-body
> :is(
    .mast-business,
    .mast-news,
    .mast-contact
)
> h2.wp-block-heading::first-line {

    color: #0071a1;

    font-size: clamp(14px, 1.4vw, 16px);
    font-weight: 400;
    letter-spacing: .08em;
}


/* Lightning / VK側の見出し装飾を除去 */

.home .entry-body
> :is(
    .mast-business,
    .mast-news,
    .mast-contact
)
> h2.wp-block-heading::before,
.home .entry-body
> :is(
    .mast-business,
    .mast-news,
    .mast-contact
)
> h2.wp-block-heading::after {
    content: none;
}


/* ========================================
   Business
======================================== */

.mast-business {
}


/* ========================================
   News
======================================== */

.mast-news {
}


/* ========================================
   Contact
======================================== */

.mast-contact {
}


/* ========================================
   Tablet
======================================== */

@media (min-width: 768px) and (max-width: 992px) {

    .home .entry-body {
        --mast-section-gap: 56px;
    }


    .home .mast-message {
        --mast-message-width: 680px;
        --mast-message-title-gap: 28px;
        --mast-message-paragraph-gap: 16px;
        --mast-message-leading: 1.95;
    }

}


/* ========================================
   Mobile
======================================== */

@media (max-width: 767px) {

    /* Hero */

    .mast-hero {
        min-height: 300px;

        padding: 40px 0;

        background-position: 58% center;
    }

    .mast-hero__inner {
        padding-right: 24px;
        padding-left: 24px;
    }

    .mast-hero .mast-hero__title {
        font-size: clamp(24px, 5.4vw, 32px);
    }

    .mast-hero .mast-hero__subtitle {
        margin-top: 16px;
        font-size: 16px;
    }


    /* Section Rhythm */

    .home .entry-body {
        --mast-section-gap: 44px;
    }


    /* Message */

    .home .mast-message {
        --mast-message-width: 100%;
        --mast-message-title-gap: 22px;
        --mast-message-leading: 1.9;
        --mast-message-paragraph-gap: 12px;
    }

    .home .mast-message > h2.wp-block-heading {
        font-size: clamp(26px, 7vw, 32px);
    }


    /* Shared Section Headings */

    .home .entry-body
    > :is(
        .mast-business,
        .mast-news,
        .mast-contact
    )
    > h2.wp-block-heading {

        margin-bottom: 24px;

        font-size: 24px;
    }

}
.home .mast-business .mast-business-card-link {
    margin-block: 0;
    padding-top: 16px;
    text-align: right;
}
.home .mast-business .mast-business-card-link a {
    display: inline-block;
    padding: 8px 0;
    border: 0;
    border-radius: 0;
    color: #0071a1;
    background: none;
    box-shadow: none;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    text-underline-offset: .2em;
}
.home .mast-business .mast-business-card-link a::after {
    content: " →";
}
.home .mast-business .mast-business-card-link a:hover,
.home .mast-business .mast-business-card-link a:focus-visible {
    color: #0b4778;
    text-decoration: underline;
}
.home .mast-business .mast-business-card-link a:focus-visible {
    outline: 2px solid #0b4778;
    outline-offset: 3px;
}

/* Stretch the existing desktop cards; auto margin absorbs differing copy lengths. */
@media (min-width: 993px) {
    .home .mast-business .wp-block-columns:has(.mast-business-card-link) {
        align-items: stretch;
    }
    .home .mast-business .wp-block-column:has(> .mast-business-card-link) {
        display: flex;
        flex-direction: column;
        align-self: stretch;
    }
    .home .mast-business .wp-block-column > .mast-business-card-link {
        margin-block-start: auto;
    }
}

/* One natural-height card per row at Lightning's tablet/mobile breakpoint. */
@media (max-width: 992px) {
    .home .mast-business .wp-block-columns:has(.mast-business-card-link) {
        flex-direction: column;
    }
    .home .mast-business .wp-block-column:has(> .mast-business-card-link) {
        /* Core uses !important on its responsive column flex-basis. */
        flex-basis: auto !important;
        width: 100%;
    }
}
