/* =========================================
   Home hero: the film plate and its water-drop opening (js/home-hero.js).
   Without JavaScript, with reduced motion and whenever the film cannot play, the film's
   last frame and the copy are shown as they are. Other page heroes keep their styles.
   ========================================= */
.home-page .hero {
    isolation: isolate;
    position: relative;
    display: block;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    margin-top: 0;
    padding: 0;
    overflow: hidden;
    background: #e8f1ef;
}
.home-page .hero__bg {
    inset: 0;
    z-index: 0;
    background: url("../assets/video/home-hero-last.jpg") center / cover no-repeat;
    opacity: 1;
    animation: none;
    transform: none;
    transition: none;
}
/* Phones held upright have a film of their own (js/home-hero.js); this is its last frame. */
@media (max-width: 767px) and (orientation: portrait) {
    .home-page .hero__bg { background-image: url("../assets/video/home-hero-sp-last.jpg"); }
}
.home-page .hero__media {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: none;
    overflow: hidden;
}
.home-page .hero.has-video .hero__media { display: block; }
.home-page .hero__video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
}
/* Keeps the white navigation readable over the bright hospital scenes. */
.home-page .hero__scrim {
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    height: 180px;
    pointer-events: none;
    background: linear-gradient(rgba(14, 38, 36, .34), rgba(14, 38, 36, 0));
}
.home-page .hero__shade {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(100deg, rgba(14, 38, 36, .6) 0%, rgba(14, 38, 36, .32) 38%, rgba(14, 38, 36, 0) 64%),
        linear-gradient(0deg, rgba(14, 38, 36, .32) 0%, rgba(14, 38, 36, 0) 38%);
}
.home-page .hero__content {
    position: absolute;
    z-index: 4;
    left: clamp(20px, 7vw, 120px);
    top: 50%;
    transform: translateY(-44%);
    width: auto;
    max-width: min(92vw, 900px);
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    color: #fff;
    text-align: left;
}
.home-page .hero__content::before { content: none; }
.home-page .hero__title {
    margin: 0;
    color: inherit;
    font-family: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
    font-size: clamp(30px, 5.4vw, 78px);
    font-weight: 600;
    line-height: 1.38;
    letter-spacing: .08em;
    white-space: nowrap;
    text-shadow: 0 2px 24px rgba(10, 30, 28, .35);
}
.home-page .hero__title-line {
    display: block;
    color: inherit;
    white-space: nowrap;
    opacity: 1;
    transform: none;
    animation: none;
}
.home-page .hero__char { display: inline-block; will-change: transform; }
.home-page .hero__text {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: clamp(12px, 1.6vw, 22px);
    color: inherit;
    font-family: "Cormorant Garamond", "Times New Roman", serif;
    font-size: clamp(16px, 1.7vw, 24px);
    font-style: italic;
    line-height: 1.5;
    letter-spacing: .08em;
    white-space: nowrap;
    text-shadow: 0 1px 14px rgba(10, 30, 28, .35);
    opacity: .92;
    transform: none;
    animation: none;
}
.home-page .hero__text::before {
    content: "";
    flex: none;
    width: clamp(28px, 4vw, 60px);
    height: 1px;
    background: currentColor;
    opacity: .8;
}
/* Portrait screens: the copy moves below the faces in the film, so the shade gathers there too
   (on the final frame the copy sits over the building's white roof). */
@media (max-aspect-ratio: 3/4) {
    .home-page .hero__content { top: auto; bottom: 24%; transform: none; }
    .home-page .hero__shade {
        background:
            linear-gradient(100deg, rgba(14, 38, 36, .42) 0%, rgba(14, 38, 36, .18) 50%, rgba(14, 38, 36, 0) 82%),
            linear-gradient(0deg, rgba(14, 38, 36, .5) 0%, rgba(14, 38, 36, .36) 32%, rgba(14, 38, 36, 0) 58%);
    }
}
/* Upright phones end on their own film: the hospital under two thirds of sky. The copy sits
   high in the sky, clear of the roof, with a soft band of shade behind it. */
@media (max-width: 767px) and (orientation: portrait) {
    .home-page .hero__content { top: auto; bottom: 51%; transform: none; }
    .home-page .hero__shade {
        background:
            linear-gradient(100deg, rgba(14, 38, 36, .4) 0%, rgba(14, 38, 36, .16) 55%, rgba(14, 38, 36, 0) 85%),
            linear-gradient(0deg, rgba(14, 38, 36, 0) 32%, rgba(14, 38, 36, .34) 52%, rgba(14, 38, 36, .3) 68%, rgba(14, 38, 36, 0) 88%);
    }
}

/* Scene label (bottom left) while the film runs. */
.home-page .hero__scene {
    position: absolute;
    z-index: 5;
    left: clamp(20px, 3vw, 40px);
    bottom: clamp(20px, 3vw, 34px);
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    font-size: 12px;
    letter-spacing: .18em;
    text-shadow: 0 1px 10px rgba(10, 30, 28, .4);
    opacity: 0;
    pointer-events: none;
}
.home-page .hero__scene-no { min-width: 2.2em; font-family: "Cormorant Garamond", serif; font-size: 17px; font-style: italic; }
.home-page .hero__scene-rule { position: relative; width: clamp(48px, 6vw, 84px); height: 1px; overflow: hidden; background: rgba(255, 255, 255, .35); }
.home-page .hero__scene-rule i { position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; }
.home-page .hero__scene-label em { margin-right: 10px; font-family: "Cormorant Garamond", serif; font-size: 15px; font-style: italic; }

/* SKIP while the opening runs, then a button to watch it again. */
.home-page .hero__skip,
.home-page .hero__replay {
    position: absolute;
    z-index: 5;
    right: 18px;
    bottom: max(20px, env(safe-area-inset-bottom));
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 999px;
    font: 500 12px/1.2 "Zen Kaku Gothic New", sans-serif;
    letter-spacing: .12em;
    cursor: pointer;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.home-page .hero__skip { border: 0; background: rgba(255, 255, 255, .62); color: #1c4a46; }
/* Watch again: a round button with a repeat mark (its name is in aria-label). */
.home-page .hero__replay {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .14);
    color: #fff;
}
.home-page .hero__replay svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 1px 4px rgba(10, 30, 28, .45));
}
.home-page .hero__replay:hover { background: rgba(255, 255, 255, .26); }
.home-page .hero__skip[hidden],
.home-page .hero__replay[hidden] { display: none; }
.home-page .hero__skip:focus-visible,
.home-page .hero__replay:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.home-page .hero__skip:focus-visible { outline-color: #1c4a46; }
@media (max-width: 600px) {
    .home-page .hero__scene-label em { display: none; }
    .home-page .hero__replay { right: 12px; }
}

/* The opening is staged inside the loader: its white veil opens from the drop's ripple. */
#loading[data-owner="home-hero"] { background: transparent; }
.loading__veil {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse at 50% 45%, #ffffff 0%, #f4f9f8 62%, #e8f1ef 100%);
}
.loading__drop {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}
.loading__drop .ripple { fill: none; stroke: #2b6a64; opacity: 0; }

/* These attributes are set by the head script before the hero can paint. */
:is([data-home-intro="waiting"], [data-home-intro="playing"]) .home-page .hero__scrim,
:is([data-home-intro="waiting"], [data-home-intro="playing"]) .home-page .hero__shade,
:is([data-home-intro="waiting"], [data-home-intro="playing"]) .home-page .hero__text,
:is([data-home-intro="waiting"], [data-home-intro="playing"]) .home-page .hero__char { opacity: 0; }
:is([data-home-intro="waiting"], [data-home-intro="playing"]) .home-page .hero__title-line:not(.is-split) { visibility: hidden; }
/* The navigation appears with the film; a keyboard user reaching it sees it at once. */
[data-home-header="hidden"] .home-page .header:not(:focus-within) { opacity: 0; pointer-events: none; }
/* While the loader covers the screen the hero is still at the top, so a fixed SKIP sits
   exactly where the hero's own one stays afterwards, above the loader. */
[data-home-intro="waiting"] .home-page .hero__skip { position: fixed; z-index: 10001; }

/* The cue appears only once the opening sequence has finished. */
.home-page .hero__scroll {
    z-index: 5;
    bottom: max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 80px;
    min-height: 64px;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .2em;
    text-shadow: 0 1px 6px #00384880;
    opacity: 1;
    visibility: visible;
    animation: none;
    transition: opacity 900ms var(--reveal-ease), transform 900ms var(--reveal-ease);
}
.home-page .hero__scroll::after { height: 24px; margin: 0; }
.home-page .hero__scroll:focus-visible { outline: 1px solid #fff; outline-offset: 4px; border-radius: 3px; }
:is([data-home-intro="waiting"], [data-home-intro="playing"]) .hero__scroll {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: none;
}
/* Pop-up cards overshoot to 101% for a moment; clip it so the page never becomes wider than
   the screen (on phones that would shift the zoom and with it the fixed tab bar). */
body.home-page { overflow-x: clip; }

/* Scroll reveal: blocks that sit side by side appear one after another.
   Stacked blocks reveal as they arrive, without a position-based delay. */
@media (min-width: 1101px) {
    .home-page .news-boxes-row > .news-box:nth-child(2) { --reveal-delay: var(--reveal-stagger); }
    .home-page .news-boxes-row > .news-box:nth-child(3) { --reveal-delay: calc(var(--reveal-stagger) * 2); }
}
@media (min-width: 701px) {
    .home-page .topics__grid > li:nth-child(2) { --reveal-delay: var(--reveal-stagger); }
    .home-page .topics__grid > li:nth-child(3) { --reveal-delay: calc(var(--reveal-stagger) * 2); }
}
@media (min-width: 1200px) {
    .home-page .concept-directory.fade-in-blur { --reveal-delay: var(--reveal-stagger); }
}
.home-page #important-news { scroll-margin-top: calc(var(--header-height) + 16px); }
.home-page #important-news:focus { outline: none; }

/* One spacious recruitment panel, with links to each open position. */
.home-recruit {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(230px, .8fr) minmax(0, 2fr);
    align-items: center;
    gap: clamp(28px, 4vw, 64px);
    margin: 0 0 64px;
    padding: clamp(28px, 4vw, 52px);
    border: 0;
    border-left: 6px solid currentColor;
    border-radius: 2px;
    background: transparent;
    color: var(--color-main);
}
.home-recruit__eyebrow { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .18em; }
.home-recruit h2 { margin-bottom: 12px; font-size: clamp(26px, 2.5vw, 36px); letter-spacing: .04em; }
.home-recruit__copy { font-size: 16px; line-height: 1.8; }
.home-recruit__link { display: inline-flex; align-items: center; gap: 20px; min-height: 48px; margin-top: 24px; padding: 8px 0; border-bottom: 1px solid currentColor; font-size: 18px; font-weight: 700; }
.home-recruit__link span { font-size: 22px; }
.home-recruit__jobs { min-width: 0; padding-left: clamp(24px, 3vw, 44px); }
.home-recruit .recruit-status-banner__heading { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; font-size: 15px; }
.home-recruit .recruit-status-banner__heading::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.home-recruit .recruit-status-banner__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.home-recruit .recruit-status-banner__list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 100%; min-height: 56px; padding: 14px 16px; border: 0; border-left: 2px solid currentColor; border-radius: 2px; background: transparent; color: inherit; font-weight: 700; line-height: 1.7; overflow-wrap: anywhere; }
.home-recruit .recruit-status-banner__list a:hover { background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.home-recruit .recruit-data-message { color: inherit; }
.home-recruit .recruit-data-retry { border-color: currentColor; border-radius: 2px; background: transparent; color: inherit; }
.home-recruit a:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
@media (max-width: 1000px) {
    .home-recruit { grid-template-columns: 1fr; gap: 24px; }
    .home-recruit__jobs { padding: 0; }
}
@media (max-width: 600px) {
    .home-recruit { padding: 24px 20px; }
    .home-recruit .recruit-status-banner__list { grid-template-columns: 1fr; }
}

/* Keep actual content and decorative pseudo-elements inside their own columns. */
.home-page .news-col-title,
.home-page .news-card-item { width: 100%; }
.home-page .news-col-title { gap: 12px; flex-wrap: wrap; padding-left: 0; }
.home-page .news-title-wrap { min-width: 0; }
.home-page .news-list-link { flex-shrink: 0; padding-right: 3px; }
.home-page .news-box,
.home-page .news-col { min-width: 0; }
.home-page .news-card-content { overflow-wrap: anywhere; }
.home-page .section-tab-design .container.news-box::before {
    left: clamp(16px, 4vw, 40px);
    right: 0;
    width: auto;
}
.home-page .access__map,
.home-page .access__info { min-width: 0; flex-basis: 300px; }
.home-page .concept-about .concept-link,
.home-page .concept-department__link { font-size: 18px; min-height: 48px; }
.home-page .access__doctors-link { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 24px; padding: 12px 24px; border: 1px solid var(--color-main); border-radius: 2px; color: var(--color-main); font-size: 18px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.home-page .access__doctors-link:hover { background: var(--color-main); color: #fff; }
.home-page .access__doctors-link:focus-visible { outline: 3px solid var(--color-main); outline-offset: 4px; }

@media (max-width: 1279px) {
    .home-page .mainContents__list::after { left: 25px; right: 0; width: auto; }
}
@media (min-width: 768px) and (max-width: 1199px) {
    .home-page .header__inner { gap: 20px; padding-inline: 20px; }
    .home-page .header__logo { flex-shrink: 0; }
    .home-page .header__list { gap: clamp(12px, 1.4vw, 16px); }
    .home-page .header__link { font-size: 13px; white-space: nowrap; }
    .home-page .header__item--cta .btn { padding: 12px 16px; font-size: 13px; white-space: nowrap; }
}
@media (max-width: 767px) {
    .home-page .hero__title { font-size: min(8vw, 36px); }
    .home-page .hero__text { gap: 10px; font-size: min(4.4vw, 18px); }
    .home-page .news-col-title-en { display: block; margin-left: 0; margin-top: 4px; font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
    /* The hero opens on its final frame with the copy in place; no loader is shown. */
    .home-page #loading { display: none; }
    .home-page .hero__scroll { transition: none; }
}
