/**
 * トップページ専用（spec.md 準拠）
 * カラースキーム：メイン #e0f2f2 / 本文 #333333 / 補足 #666666 / アクセント #4fa3a3
 * デザイン方針：清潔感・安心感・可読性優先
 */

/* --- 変数（spec 3.1 カラースキーム） --- */
.front-page-main {
    --fp-main: #e0f2f2;
    --fp-text: #333333;
    --fp-text-muted: #666666;
    --fp-accent: #4fa3a3;
    --fp-accent-hover: #3d8282;
    --fp-bg: #e0f2f2;
    --fp-card-bg: #ffffff;
    --fp-border: rgba(79, 163, 163, 0.2);
    --fp-ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --fp-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* --- ヘッダー（spec：メインカラー #e0f2f2 使用） --- */
body .fp-header {
    background-color: var(--fp-main);
    background-image: url('../images/page-front/header-back.png') !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: cover !important;
    box-shadow: 0 1px 0 rgba(51, 51, 51, 0.08);
    transition: transform 0.4s var(--fp-ease-out-expo), background 0.3s ease;
}

body .fp-header .fp-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}

body .fp-header .site-branding .site-title,
body .fp-header .site-branding .site-title a {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--fp-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

body .fp-header .site-branding .site-title a:hover {
    color: var(--fp-accent);
}

body .fp-header .site-branding .custom-logo-link img {
    max-height: 38px;
    width: auto;
}

body .fp-header .fp-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 28px;
    justify-content: flex-end;
}

body .fp-header .fp-nav a {
    color: var(--fp-text);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 8px 0;
    position: relative;
    transition: color 0.25s ease;
}

body .fp-header .fp-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 4px;
    width: 0;
    height: 2px;
    background: var(--fp-accent);
    transition: width 0.55s var(--fp-ease-out-expo);
}

body .fp-header .fp-nav a:hover {
    color: var(--fp-accent);
}

body .fp-header .fp-nav a:hover::after {
    width: 100%;
}

@media (max-width: 767px) {
    body .fp-header .fp-nav {
        display: none;
    }
    body .fp-header.fp-header-scrolled .fp-nav {
        display: flex !important;
    }
}

/* --- スクロール時：シンプルヘッダー（左にロゴ・右にメニュー、装飾なし） --- */
body .fp-header.fp-header-scrolled {
    background-image: none !important;
    background-color: #ffffff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    height: 64px;
}

body .fp-header.fp-header-scrolled .fp-header-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-left: 20px;
    padding-right: 20px;
}

body .fp-header.fp-header-scrolled .fp-header-wave {
    display: none;
}

body .fp-header.fp-header-scrolled .fp-header-logo {
    max-height: 66px;
    width: auto;
    height: auto;
}

body .fp-header.fp-header-scrolled .fp-header-branding {
    flex-shrink: 0;
    justify-content: flex-start;
    width: auto;
}

body .fp-header.fp-header-scrolled .fp-nav {
    display: flex !important;
    margin-left: auto;
    margin-top: -25px;
    width: auto;
    max-width: none;
    flex: 1 1 auto;
    justify-content: flex-end !important;
    gap: 10px;
}

body .fp-header.fp-header-scrolled .fp-nav .fp-nav-divider {
    display: none;
}

body .fp-header.fp-header-scrolled .fp-nav .fp-nav-icon {
    display: none !important;
}

body .fp-header.fp-header-scrolled .fp-nav .fp-nav-item {
    flex-direction: row;
    padding: 8px 18px;
    min-width: 0;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    color: var(--fp-text);
}

/* spec 6.2 アクセシビリティ：文字サイズ14px以上 */
/* 固定ヘッダー分だけ上に余白を確保（ロゴ＋メニュー＋波線） */
.front-page-main {
    padding-top: 200px;
    background: var(--fp-bg);
    font-size: 1rem;
    color: var(--fp-text);
}

/* ========== ヒーロー ========== */
.fp-hero {
    position: relative;
    width: 100%;
    min-height: 92vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ヒーロー背景：静止画像（top-back.png） */
.fp-hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('../images/page-front/top-back.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(1.08) contrast(1.02);
}

.fp-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(185deg, rgba(6, 9, 12, 0.07) 0%, rgba(6, 9, 12, 0.2) 55%, rgba(6, 9, 12, 0.3) 100%);
    pointer-events: none;
}

.fp-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: min(1200px, 100%);
    padding: 48px 24px;
}

/* ヒーロー登場アニメーション（ゆっくり上に） */
.fp-animate-hero {
    opacity: 0;
    transform: translateY(56px);
    animation: fpHeroReveal 2.8s var(--fp-ease-out-expo) 0.5s forwards;
}

@keyframes fpHeroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fp-hero-tagline {
    margin: 0;
    font-size: clamp(3.4rem, 12vw, 9.5rem);
    font-weight: 800;
    position: relative;
    display: inline-block;
    letter-spacing: 0.1em;
    line-height: 1.08;
    text-indent: 0.1em;
    color: #f8fffd;
    -webkit-text-stroke: 3px #3f8f8f;
    text-shadow:
        0 8px 0 #3f8f8f,
        0 16px 22px rgba(15, 69, 69, 0.34),
        0 0 20px rgba(210, 246, 246, 0.45);
    animation:
        fpHeroReveal 2.8s var(--fp-ease-out-expo) 0.5s forwards,
        fpHeroTaglineFloat 3.6s ease-in-out 3.3s infinite,
        fpHeroTaglinePop 2.4s ease-in-out 3.3s infinite;
}

.fp-hero-tagline::before,
.fp-hero-tagline::after {
    position: absolute;
    top: -0.65em;
    font-size: clamp(1.2rem, 2vw, 2rem);
    line-height: 1;
    pointer-events: none;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.fp-hero-tagline::before {
    content: '★';
    left: -1.25em;
    color: #9ad9d9;
    animation: fpHeroDecoBob 1.5s ease-in-out 3.2s infinite;
}

.fp-hero-tagline::after {
    content: '♪';
    right: -1.1em;
    color: #b9ecec;
    animation: fpHeroDecoBob 1.5s ease-in-out 3.95s infinite;
}

@keyframes fpHeroTaglineFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(-1deg);
    }
}

@keyframes fpHeroTaglinePop {
    0%, 55%, 100% {
        text-shadow:
            0 8px 0 #3f8f8f,
            0 16px 22px rgba(15, 69, 69, 0.34),
            0 0 20px rgba(210, 246, 246, 0.45);
    }
    25% {
        text-shadow:
            0 10px 0 #3f8f8f,
            0 18px 24px rgba(15, 69, 69, 0.38),
            0 0 30px rgba(198, 242, 242, 0.85);
    }
}

@keyframes fpHeroDecoBob {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 0.9;
    }
    50% {
        transform: translateY(-8px) scale(1.12) rotate(-10deg);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fp-hero-tagline,
    .fp-hero-tagline::before,
    .fp-hero-tagline::after {
        animation: none !important;
    }
}

/* スクロールインジケーター */
.fp-hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

@media (max-width: 767px) {
    .fp-hero {
        min-height: 88vh;
    }
    .fp-hero-tagline {
        font-size: clamp(2.5rem, 14vw, 5.4rem);
        letter-spacing: 0.06em;
        -webkit-text-stroke: 2px #3f8f8f;
        text-shadow:
            0 5px 0 #3f8f8f,
            0 12px 18px rgba(15, 69, 69, 0.3);
    }
    .fp-hero-tagline::before {
        left: -0.95em;
    }
    .fp-hero-tagline::after {
        right: -0.85em;
    }
    .fp-hero-scroll {
        bottom: 28px;
    }
}

/* ========== セクション共通 ========== */
.fp-section {
    padding: 88px 24px;
}

.fp-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ========== モットー：園児はわが子 ========== */
.fp-motto {
    position: relative;
    background: var(--fp-bg);
    overflow: hidden;
}

/* ① 薄いモチーフ（小さな円の繰り返し） */
.fp-motto::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    background-image: radial-gradient(circle at center, rgba(79, 163, 163, 0.12) 1.5px, transparent 1.5px);
    background-size: 28px 28px;
}

/* ③ グラデーション（ややはっきり） */
.fp-motto::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        165deg,
        rgba(200, 232, 232, 0.85) 0%,
        rgba(255, 255, 255, 0.7) 35%,
        rgba(230, 248, 248, 0.9) 60%,
        rgba(180, 220, 222, 0.9) 100%
    );
}

.fp-motto-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
    max-width: 1800px;
}

.fp-motto-left {
    flex: 1 1 50%;
    min-width: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 4枚の写真：添付画像どおり十字配置・親の幅いっぱいまで大きく表示 */
.fp-motto-photos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 0;
    width: 100%;
    max-width: 700px;
    aspect-ratio: 1;
}

.fp-motto-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transform: scale(0.88);
    transition: transform 0.4s var(--fp-ease-out-expo);
}

.fp-motto-left.is-visible .fp-motto-photo {
    opacity: 1;
    transform: scale(1);
    animation: fpMottoPhotoPop 0.65s var(--fp-ease-out-expo) forwards,
               fpMottoPhotoFloat 4s ease-in-out 0.9s infinite;
}

.fp-motto-left.is-visible .fp-motto-photo--top   { animation-delay: 0.1s, 0.9s; }
.fp-motto-left.is-visible .fp-motto-photo--right { animation-delay: 0.22s, 1.3s; }
.fp-motto-left.is-visible .fp-motto-photo--bottom { animation-delay: 0.34s, 1.7s; }
.fp-motto-left.is-visible .fp-motto-photo--left  { animation-delay: 0.46s, 2.1s; }

.fp-motto-photo:hover {
    transform: scale(1.06);
}

.fp-motto-left.is-visible .fp-motto-photo:hover {
    animation-play-state: paused;
    transform: scale(1.06);
}

/* クリック時：上下軸（縦方向）でくるくる回転して減速しながら止まる */
.fp-motto-photo--spin {
    animation: fpMottoPhotoSpin 2s cubic-bezier(0.33, 1, 0.68, 1) forwards !important;
}

@keyframes fpMottoPhotoSpin {
    0% {
        transform: scale(1) rotateY(0deg);
    }
    25% {
        transform: scale(1.02) rotateY(720deg); /* 最初の25%で2回転（速い） */
    }
    100% {
        transform: scale(1) rotateY(1080deg);   /* 残り75%で1回転（だんだん遅く止まる） */
    }
}

@keyframes fpMottoPhotoPop {
    0% { opacity: 0; transform: scale(0.88); }
    70% { transform: scale(1.04); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fpMottoPhotoFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.02); }
}

.fp-motto-photo--top {
    grid-column: 2;
    grid-row: 1;
}

.fp-motto-photo--right {
    grid-column: 3;
    grid-row: 2;
}

.fp-motto-photo--bottom {
    grid-column: 2;
    grid-row: 3;
}

.fp-motto-photo--left {
    grid-column: 1;
    grid-row: 2;
}

.fp-motto-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.fp-motto-right {
    flex: 1 1 45%;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
}

/* 園児はわが子ロゴ：2倍サイズ */
.fp-motto-logo {
    max-width: 100%;
    width: 440px;
    height: auto;
    object-fit: contain;
}

/* 園児はわが子の説明文：2倍サイズ */
.fp-motto-desc {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--fp-text);
    max-width: 520px;
}

.fp-motto-desc p {
    margin: 0 0 1.1em;
}

.fp-motto-desc p:last-child {
    margin-bottom: 0;
}

/* 強：リード文（1行目） */
.fp-motto-desc-lead {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--fp-text);
    margin-bottom: 1.35em !important;
    letter-spacing: 0.02em;
}

/* 中：キーワードを太字で強調 */
.fp-motto-desc strong {
    font-weight: 700;
    color: var(--fp-accent);
}

/* 弱：締めの一文（やや細く） */
.fp-motto-desc-end {
    font-size: 0.95em;
    font-weight: 500;
    color: var(--fp-text-muted);
}

@media (max-width: 767px) {
    .fp-motto-inner {
        flex-direction: column;
        gap: 40px;
    }
    .fp-motto-left {
        order: 1;
    }
    .fp-motto-right {
        order: 2;
        align-items: center;
        text-align: center;
    }
    .fp-motto-desc {
        text-align: center;
        font-size: 1.5rem;
    }
    .fp-motto-photos {
        width: min(780px, 96vw);
    }
    .fp-motto-logo {
        width: min(640px, 100%);
    }
}

/* ========== 会社概要・事業内容・社会貢献ナビ ========== */
.fp-company-links {
    background: #e0f2f2;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
}

.fp-company-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    grid-template-rows: repeat(2, minmax(380px, 1fr));
    gap: 6px;
    width: 100%;
    max-width: none;
}

.fp-company-tile {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 12px;
    text-decoration: none;
    color: #ffffff;
    min-height: 380px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    transform: translateY(16px);
    opacity: 0;
    transition:
        transform 0.7s var(--fp-ease-out-expo),
        box-shadow 0.4s ease,
        opacity 0.7s var(--fp-ease-out-expo);
}

.fp-company-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.15));
    mix-blend-mode: multiply;
    pointer-events: none;
}

.fp-company-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

/* ホバー時：薄い白色が中心から広がる */
.fp-company-tile-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.22);
    pointer-events: none;
    transform: scale(0);
    transform-origin: center;
    transition: transform 0.5s var(--fp-ease-out-expo);
}

.fp-company-tile:hover .fp-company-tile-overlay {
    transform: scale(1);
}

.fp-company-tile-label {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    letter-spacing: 0.25em;
    text-indent: 0.25em;
    font-weight: 600;
    text-align: center;
    text-shadow:
        0 0 12px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.35);
}

.fp-company-tile--about {
    grid-column: 1;
    grid-row: 1 / span 2;
    background-image: url('../images/page-front/building.jpg');
    background-size: 100% auto;
    background-position: center;
}

.fp-company-tile--business {
    grid-column: 2;
    grid-row: 1;
    background-image: url('../images/page-front/zigyounaiyou.jpg');
}

.fp-company-tile--contribution {
    grid-column: 2;
    grid-row: 2;
    background-image: url('../images/page-front/syakaikouken.JPG');
}

.fp-company-tile.fp-animate-in.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.fp-company-tile:hover {
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
    transform: translateY(-4px);
}

@media (max-width: 960px) {
    .fp-company-grid {
        grid-template-columns: 1.2fr 1fr;
    }
}

@media (max-width: 767px) {
    .fp-company-links {
        padding-top: 32px;
    }
    .fp-company-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }
    .fp-company-tile {
        min-height: 320px;
    }
    .fp-company-tile--about,
    .fp-company-tile--business,
    .fp-company-tile--contribution {
        grid-column: 1;
        grid-row: auto;
    }
}

/* ========== 創立者の思い ========== */
.fp-founder {
    background: url('../images/page-front/history-back.png') no-repeat right center / cover;
    min-height: 620px;
    display: flex;
    align-items: center;
    padding: 64px 24px 72px;
}

.fp-founder-inner {
    position: relative;
    max-width: 52%;
    padding: 0 40px 0 0;
    opacity: 0;
    z-index: 2;
    transition: opacity 1s ease-out 0.15s;
}

.fp-founder.is-visible .fp-founder-inner {
    opacity: 1;
}

.fp-founder-title {
    font-family: 'iwata-kyokasho', 'Yu Mincho', '游明朝', 'Hiragino Mincho ProN', serif;
    font-size: clamp(2.15rem, 5.2vw, 2.95rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--fp-text);
    margin: 0 0 28px;
    line-height: 1.45;
}

.fp-founder-body {
    font-family: 'iwata-kyokasho', 'Yu Mincho', '游明朝', 'Hiragino Mincho ProN', serif;
    color: var(--fp-text);
    line-height: 2;
    letter-spacing: 0.06em;
}

.fp-founder-lead {
    font-size: clamp(1.35rem, 3vw, 1.65rem);
    font-weight: 700;
    margin: 0 0 20px;
}

.fp-founder-text {
    font-size: clamp(1.2rem, 2.6vw, 1.4rem);
    margin: 0;
}

/* フィルムノイズ＋フィルムグレイン（創立者の思いセクションのみ） */
.fp-founder {
    position: relative;
    overflow: hidden;
}

/* フィルムグレイン（粒状の質感） */
.fp-founder::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.22;
    mix-blend-mode: screen;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0 0.4 0.6 0.8 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 150px 150px;
}

.fp-founder::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.28;
    mix-blend-mode: screen;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 80px 80px;
    animation: fpFilmNoise 0.25s steps(8) infinite;
}

.fp-founder-inner {
    position: relative;
    z-index: 2;
}

@keyframes fpFilmNoise {
    0% { transform: translate(0, 0); opacity: 0.28; }
    20% { transform: translate(-3px, 2px); opacity: 0.35; }
    40% { transform: translate(2px, -3px); opacity: 0.25; }
    60% { transform: translate(-2px, -2px); opacity: 0.32; }
    80% { transform: translate(3px, 1px); opacity: 0.27; }
    100% { transform: translate(0, 0); opacity: 0.28; }
}

@media (max-width: 900px) {
    .fp-founder {
        background-position: 60% center;
        min-height: 480px;
    }
    .fp-founder-inner {
        max-width: 100%;
        padding: 0;
    }
}

@media (max-width: 600px) {
    .fp-founder {
        min-height: 420px;
        padding: 48px 20px 56px;
    }
}

.fp-section-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--fp-text);
    margin: 0 0 48px;
    text-align: center;
    position: relative;
}

.fp-section-title-text {
    position: relative;
    z-index: 1;
}

.fp-section-title-line {
    display: block;
    width: 8rem;
    height: 3px;
    margin: 12px auto 0;
    background: var(--fp-accent);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 2s var(--fp-ease-out-expo);
}

.fp-section-title.is-visible .fp-section-title-line {
    transform: scaleX(1);
}

/* スクロールイン用：ゆっくり上に上がってくる */
.fp-animate-in {
    opacity: 0;
    transform: translateY(72px);
    transition: opacity 2.2s var(--fp-ease-out-expo), transform 2.2s var(--fp-ease-out-expo), box-shadow 0.5s ease, border-color 0.5s ease;
}

.fp-animate-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== 導入文（spec 1. 目的） ========== */
.fp-intro {
    background: var(--fp-bg);
}

.fp-intro-body {
    max-width: 640px;
    margin: 0 auto;
}

.fp-intro-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--fp-text);
    margin: 0 0 1em;
}

.fp-intro-text-sub {
    color: var(--fp-text-muted);
    margin-bottom: 0;
}

/* ========== コンテンツナビ（spec 4. グローバルメニュー） ========== */
.fp-nav-section {
    background: #fff;
}

.fp-nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.fp-nav-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 16px 20px;
    background: var(--fp-card-bg);
    border: 1px solid var(--fp-border);
    border-radius: 8px;
    color: var(--fp-text);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.fp-nav-card:hover {
    background: var(--fp-main);
    border-color: var(--fp-accent);
    color: var(--fp-accent);
}

.fp-nav-card-accent {
    background: var(--fp-accent);
    border-color: var(--fp-accent);
    color: #fff;
}

.fp-nav-card-accent:hover {
    background: var(--fp-accent-hover);
    border-color: var(--fp-accent-hover);
    color: #fff;
}

@media (max-width: 767px) {
    .fp-nav-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .fp-nav-cards {
        grid-template-columns: 1fr;
    }
}

/* ========== 幼児教育事業（保育園＋その他） ========== */
.fp-education {
    background: var(--fp-bg) url('../images/page-front/hoiku-back.png') repeat;
    position: relative;
}

/* 幼児教育セクション左下の装飾画像 */
.fp-education-deco {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    object-fit: contain;
}

.fp-education-deco--left {
    bottom: 0;
    left: 0;
    width: 400px;
    height: auto;
    max-height: 400px;
    transform-origin: bottom left;
    animation: fpDecoGrowIn 8.2s ease-out forwards;
}

/* ノートPC幅では左下装飾がサービスカードに重ならないように調整 */
@media (max-width: 1366px) and (min-width: 768px) {
    .fp-education-deco--left {
        width: 320px;
        left: -24px;
        bottom: -8px;
    }
}

@media (max-width: 1100px) and (min-width: 768px) {
    .fp-education-deco--left {
        width: 280px;
        left: -36px;
        bottom: -16px;
    }
}

@keyframes fpDecoGrowIn {
    0% {
        transform: translateX(-180px) scale(0.4);
        opacity: 0.6;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.fp-subtitle {
    font-size: clamp(2.35rem, 4.5vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--fp-text);
    margin: 56px 0 24px;
    text-align: center;
    line-height: 1.35;
}

.fp-subtitle:first-of-type {
    margin-top: 0;
}

/* 運営保育園：左右に旗装飾 */
.fp-subtitle--flags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.fp-subtitle-flag {
    display: block;
    height: 80px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    object-position: center;
}

.fp-subtitle-flag--right {
    transform: scaleX(-1);
}

.fp-subtitle--flags .fp-subtitle-text {
    flex-shrink: 0;
    font-size: inherit;
    font-weight: inherit;
}

/* 保育園4つ：パズルピース風（並び順：寒川・大和・首里・つきみ野） */
.fp-puzzle-svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.fp-nursery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    align-items: start;
}

/* パズルレイアウト：4枚がつながって見える（大きめ表示） */
.fp-nursery-grid--puzzle {
    gap: 0;
    grid-template-columns: repeat(4, 1fr);
    max-width: 1160px;
    margin: 0 auto;
    --fp-puzzle-overlap: 36px;
}

.fp-nursery-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    background: transparent;
    transition: transform 0.4s var(--fp-ease-out-expo);
}

.fp-nursery-card::before {
    display: none;
}

.fp-nursery-card:hover {
    transform: translateY(-4px);
}

/* パズルカード：角丸クリップ＋パステル背景（大きめ） */
.fp-nursery-card--puzzle {
    position: relative;
    min-height: 420px;
    padding: 28px 10px 32px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 左右ピース：クリップの非対称を補正して内容を中央に */
.fp-nursery-card--first {
    clip-path: url(#fp-puzzle-first);
    padding-left: 10px;
    padding-right: 28px;
}

.fp-nursery-card--mid {
    margin-left: calc(-1 * var(--fp-puzzle-overlap));
    clip-path: url(#fp-puzzle-mid);
}

.fp-nursery-card--last {
    margin-left: calc(-1 * var(--fp-puzzle-overlap));
    clip-path: url(#fp-puzzle-last);
    padding-left: 28px;
    padding-right: 10px;
}

.fp-nursery-puzzle-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 0;
    opacity: 0.97;
}

/* かわいいパステル：やわらかいグラデ＋軽いテクスチャ感 */
.fp-nursery-card--puzzle:nth-child(1) .fp-nursery-puzzle-bg {
    background: linear-gradient(165deg, #c8e8f0 0%, #b0dce8 50%, #9ed4e0 100%);
}
.fp-nursery-card--puzzle:nth-child(2) .fp-nursery-puzzle-bg {
    background: linear-gradient(165deg, #d0f0d0 0%, #b8e8c0 50%, #a8e0b0 100%);
}
.fp-nursery-card--puzzle:nth-child(3) .fp-nursery-puzzle-bg {
    background: linear-gradient(165deg, #f8e0e8 0%, #f0d0dc 50%, #e8c0d0 100%);
}
.fp-nursery-card--puzzle:nth-child(4) .fp-nursery-puzzle-bg {
    background: linear-gradient(165deg, #f8f0c8 0%, #f0e8b8 50%, #e8e0a8 100%);
}

.fp-nursery-card--puzzle .fp-nursery-img-wrap,
.fp-nursery-card--puzzle .fp-nursery-label {
    position: relative;
    z-index: 1;
}

/* パズル：写真の円を同じサイズに（左右のパディング差で小さくならないように） */
.fp-nursery-card--puzzle .fp-nursery-img-wrap {
    width: 260px;
    max-width: 260px;
    min-width: 260px;
    flex-shrink: 0;
}

.fp-nursery-img-wrap {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    border: 4px solid #a8d5a8;
    box-sizing: border-box;
}

/* パズル用：円の枠を各ピースのパステルに合わせたかわいいトーン */
.fp-nursery-card--puzzle .fp-nursery-img-wrap {
    border-width: 5px;
    border-style: solid;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        inset 0 0 0 2px rgba(255, 255, 255, 0.6);
    transition: box-shadow 0.4s var(--fp-ease-in-out), transform 0.4s var(--fp-ease-out-expo);
}

.fp-nursery-card--puzzle:nth-child(1) .fp-nursery-img-wrap {
    border-color: #7ec4d4;
    box-shadow: 0 6px 24px rgba(126, 196, 212, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.7);
    /* 寒川：clip-path 内でも鮮明に描画 */
    transform: translateZ(0);
    backface-visibility: hidden;
    isolation: isolate;
}
.fp-nursery-card--puzzle:nth-child(2) .fp-nursery-img-wrap {
    border-color: #8ed49e;
    box-shadow: 0 6px 24px rgba(142, 212, 158, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}
.fp-nursery-card--puzzle:nth-child(3) .fp-nursery-img-wrap {
    border-color: #e8a0b0;
    box-shadow: 0 6px 24px rgba(232, 160, 176, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}
.fp-nursery-card--puzzle:nth-child(4) .fp-nursery-img-wrap {
    border-color: #e8d080;
    box-shadow: 0 6px 24px rgba(232, 208, 128, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.7);
    /* つきみ野：clip-path 内でも鮮明に描画 */
    transform: translateZ(0);
    backface-visibility: hidden;
    isolation: isolate;
}

/* 通常レイアウト時のみ（パズルでない場合） */
.fp-nursery-card:not(.fp-nursery-card--puzzle):nth-child(1) .fp-nursery-img-wrap { border-color: #a8d5a8; }
.fp-nursery-card:not(.fp-nursery-card--puzzle):nth-child(2) .fp-nursery-img-wrap { border-color: #7ec8c8; }
.fp-nursery-card:not(.fp-nursery-card--puzzle):nth-child(3) .fp-nursery-img-wrap { border-color: #f5b2c1; }
.fp-nursery-card:not(.fp-nursery-card--puzzle):nth-child(4) .fp-nursery-img-wrap { border-color: #c7ceea; }

.fp-nursery-img-wrap::after {
    display: none;
}

.fp-nursery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--fp-ease-out-expo);
    /* clip-path 内でも常に鮮明に描画されるようレイヤーを昇格 */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.fp-nursery-card:hover .fp-nursery-img {
    transform: translateZ(0) scale(1.05);
}

/* パズル：ホバーで円がふんわり光る */
.fp-nursery-card--puzzle:hover:nth-child(1) .fp-nursery-img-wrap {
    box-shadow: 0 10px 32px rgba(126, 196, 212, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}
.fp-nursery-card--puzzle:hover:nth-child(2) .fp-nursery-img-wrap {
    box-shadow: 0 10px 32px rgba(142, 212, 158, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}
.fp-nursery-card--puzzle:hover:nth-child(3) .fp-nursery-img-wrap {
    box-shadow: 0 10px 32px rgba(232, 160, 176, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}
.fp-nursery-card--puzzle:hover:nth-child(4) .fp-nursery-img-wrap {
    box-shadow: 0 10px 32px rgba(232, 208, 128, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.fp-nursery-label {
    display: block;
    width: 100%;
    max-width: 200px;
    margin-top: 16px;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--fp-text);
    text-align: center;
    background: repeating-linear-gradient(
        -45deg,
        #f5e6d3 0,
        #f5e6d3 2px,
        #faf0e6 2px,
        #faf0e6 4px
    );
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: color 0.3s ease, box-shadow 0.3s ease;
}

.fp-nursery-card--puzzle .fp-nursery-label {
    width: 260px;
    max-width: 260px;
    min-width: 260px;
    box-sizing: border-box;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1.45;
    padding: 18px 18px;
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
}

.fp-nursery-card--puzzle:nth-child(1) .fp-nursery-label { background: rgba(184, 224, 232, 0.98); color: #0d3a44; }
.fp-nursery-card--puzzle:nth-child(2) .fp-nursery-label { background: rgba(197, 232, 197, 0.98); color: #124212; }
.fp-nursery-card--puzzle:nth-child(3) .fp-nursery-label { background: rgba(245, 208, 216, 0.98); color: #4a1f2c; }
.fp-nursery-card--puzzle:nth-child(4) .fp-nursery-label { background: rgba(245, 232, 184, 0.98); color: #3d3508; }

.fp-nursery-label::before {
    display: none;
}

.fp-nursery-card:hover .fp-nursery-label {
    color: var(--fp-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (max-width: 900px) {
    .fp-nursery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .fp-nursery-grid--puzzle {
        grid-template-columns: repeat(2, 1fr);
        max-width: 560px;
    }
    .fp-nursery-card--puzzle { min-height: 380px; }
    .fp-nursery-card--mid.fp-nursery-card--puzzle:nth-child(2),
    .fp-nursery-card--last.fp-nursery-card--puzzle {
        margin-left: 0;
    }
    .fp-nursery-card--puzzle:nth-child(2) { clip-path: url(#fp-puzzle-last); }
    .fp-nursery-card--puzzle:nth-child(3) { clip-path: url(#fp-puzzle-first); }
    .fp-nursery-card--puzzle:nth-child(4) { clip-path: url(#fp-puzzle-last); }
}

@media (max-width: 480px) {
    .fp-nursery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .fp-nursery-grid--puzzle {
        grid-template-columns: 1fr;
        max-width: 280px;
    }
    .fp-nursery-card--puzzle { clip-path: none; margin-left: 0; border-radius: 16px; overflow: hidden; }
    .fp-nursery-card--puzzle .fp-nursery-puzzle-bg { border-radius: 16px; }
    .fp-nursery-card--puzzle .fp-nursery-img-wrap {
        width: 100%;
        min-width: 0;
        max-width: 260px;
    }
    .fp-nursery-card--puzzle .fp-nursery-label {
        width: 100%;
        min-width: 0;
        max-width: 260px;
    }
    .fp-section {
        padding: 56px 20px;
    }
}

.fp-services-grid {
    margin-top: 48px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
}

.fp-service-card {
    display: block;
    position: relative;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    overflow: visible;
    background: var(--fp-card-bg);
    border: 1px solid var(--fp-border);
    box-shadow: 0 8px 24px rgba(79, 163, 163, 0.08);
    transition: transform 0.8s var(--fp-ease-out-expo), box-shadow 0.8s ease, border-color 0.5s ease;
}

/* その他取り組み：色玉（左・赤／中央・茶／右・緑）が順にはじけて表示 */
.fp-service-card.fp-animate-in {
    transform: scale(0);
    transition: none;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.fp-service-card.fp-animate-in.is-visible {
    animation: fpServicePop 2.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.fp-service-card.fp-animate-in.is-visible:nth-child(1) { --fp-service-border: #c62828; animation-delay: 0s; border-width: 4px; }
.fp-service-card.fp-animate-in.is-visible:nth-child(2) { --fp-service-border: #6d4c41; animation-delay: 0.8s; border-width: 4px; }
.fp-service-card.fp-animate-in.is-visible:nth-child(3) { --fp-service-border: #43a047; animation-delay: 1.6s; border-width: 4px; }

.fp-service-card.fp-animate-in::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    z-index: 2;
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.fp-service-card.fp-animate-in:nth-child(1)::before { background: #e53935; }
.fp-service-card.fp-animate-in:nth-child(2)::before { background: #795548; }
.fp-service-card.fp-animate-in:nth-child(3)::before { background: #66bb6a; }

.fp-service-card.fp-animate-in.is-visible::before {
    animation: fpBallBurst 2.2s ease-out forwards;
}

.fp-service-card.fp-animate-in.is-visible:nth-child(1)::before { animation-delay: 0s; }
.fp-service-card.fp-animate-in.is-visible:nth-child(2)::before { animation-delay: 0.8s; }
.fp-service-card.fp-animate-in.is-visible:nth-child(3)::before { animation-delay: 1.6s; }

/* 円のトップに葉を表示（はじけたあとで表示） */
.fp-service-leaf {
    position: absolute;
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 80px;
    background: url('leaf.png') no-repeat center / contain;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
}

/* 画像を円形にクリップ（カードは overflow: visible で葉をはみ出させる） */
.fp-service-img-wrap {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
}

.fp-service-card.fp-animate-in.is-visible .fp-service-leaf {
    animation: fpServiceImgReveal 2.2s forwards;
}

.fp-service-card.fp-animate-in.is-visible:nth-child(1) .fp-service-leaf { animation-delay: 0s; }
.fp-service-card.fp-animate-in.is-visible:nth-child(2) .fp-service-leaf { animation-delay: 0.8s; }
.fp-service-card.fp-animate-in.is-visible:nth-child(3) .fp-service-leaf { animation-delay: 1.6s; }

/* 球の間はコンテンツ（画像）を隠す */
.fp-service-card.fp-animate-in .fp-service-img {
    opacity: 0;
}

.fp-service-card.fp-animate-in.is-visible .fp-service-img {
    animation: fpServiceImgReveal 2.2s forwards;
}

.fp-service-card.fp-animate-in.is-visible:nth-child(1) .fp-service-img { animation-delay: 0s; }
.fp-service-card.fp-animate-in.is-visible:nth-child(2) .fp-service-img { animation-delay: 0.8s; }
.fp-service-card.fp-animate-in.is-visible:nth-child(3) .fp-service-img { animation-delay: 1.6s; }

/* カードは一瞬で表示。球の間は背景・枠線・影も非表示。はじけたあと枠線は各色 */
@keyframes fpServicePop {
    0% {
        opacity: 0;
        transform: scale(0);
        background-color: transparent;
        border-width: 0;
        border-color: transparent;
        box-shadow: none;
    }
    8% {
        opacity: 1;
        transform: scale(1);
        background-color: transparent;
        border-width: 0;
        border-color: transparent;
        box-shadow: none;
    }
    55% {
        background-color: transparent;
        border-width: 0;
        border-color: transparent;
        box-shadow: none;
    }
    100% {
        opacity: 1;
        transform: scale(1);
        background-color: var(--fp-card-bg);
        border-width: 4px;
        border-color: var(--fp-service-border, var(--fp-border));
        box-shadow: 0 8px 24px rgba(79, 163, 163, 0.08);
    }
}

/* 色玉：最初は非表示→小さく出現→待ってからはじける */
@keyframes fpBallBurst {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    5% {
        transform: scale(0.5);
        opacity: 1;
    }
    50% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* はじけたあとで画像を表示 */
@keyframes fpServiceImgReveal {
    0%, 50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.fp-service-card:hover {
    transform: scale(1.06);
    box-shadow: 0 20px 48px rgba(79, 163, 163, 0.14);
    border-color: rgba(79, 163, 163, 0.4);
}

.fp-service-card.fp-animate-in.is-visible:nth-child(1):hover { border-color: #e53935; }
.fp-service-card.fp-animate-in.is-visible:nth-child(2):hover { border-color: #795548; }
.fp-service-card.fp-animate-in.is-visible:nth-child(3):hover { border-color: #43a047; }

.fp-service-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--fp-ease-out-expo);
}

.fp-service-card:hover .fp-service-img {
    transform: scale(1.08);
}

@media (max-width: 767px) {
    .fp-services-grid {
        gap: 28px;
    }
    .fp-service-card {
        width: 180px;
        height: 180px;
    }
}
