/* メインページのスタイル */

/* メインページコンテナ */
.main-page {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* メインページ上部ヘッダー */
.main-header { 
    display: flex; 
    align-items: flex-start;
    justify-content: center;
    gap: 70px; 
    padding: 45px 0 40px;
    width: 1550px;
}

.main-header .main-header-left {
    width: 460px;
    height: 156px;
    justify-content: center;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
    flex-shrink: 0;
}

.main-header .main-text-container {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.main-header .main-title { 
    margin: 0; 
    font-family: var(--font-base);
    font-size: 32px; 
    font-weight: 800; /* Bold */
    line-height: 1.3;
    color: var(--color-soft-black);
}

.main-header .main-subtitle { 
    margin: 0; 
    font-family: var(--font-base);
    font-size: 13px;
    font-weight: 500; /* Medium */
    line-height: 1.3;
    color: var(--color-soft-black);
}

.main-header .cta-start {
    background: var(--color-grad-pink-purple);
    border: none;
    border-radius: 25px;
    padding: 10px 18px;
    font-family: var(--font-base);
    font-size: 14px;
    font-weight: 800; /* Bold */
    line-height: 1.6;
    color: var(--color-soft-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    align-self: flex-start;
    /* transition: color 0.5s, text-shadow 0.5s, box-shadow 0.5s ease; */
    transition: box-shadow 0.5s ease, background 0.5s ease;
}

.main-header .cta-start:hover {
    box-shadow: 0 8px 20px rgba(233, 120, 170, 0.3);
    background: var(--color-grad-pink-purple-hover);
    /* background: linear-gradient(106deg, var(--color-main-purple) 13.77%, var(--color-main-pink) 86.23%); */
}


.main-header .main-header-right {
    flex: 1;
    min-width: 0;
    align-self: stretch; /* フィグマデザインに合わせて親の高さに調整 */
    height: 156px;
}

.main-header .main-hero-banner { 
    width: 100%;
    height: 100%;
    border-radius: 8px; 
    overflow: hidden; 
    background: #ddd; 
    position: relative; /* 画像位置制御のため */
}

.main-header .main-hero-banner .main-hero-banner-video {
    width: 100%; 
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* ツールバー */
.main-toolbar { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
    padding: 12px 4px 12px 0; 
    height: 58px;
    width: 1550px;
}

.main-toolbar .main-toolbar-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.main-toolbar .main-search-input { 
    position: relative;
    width: 380px;
    height: 34px;
}

.main-toolbar .main-search-input input { 
    width: 100%;
    height: 100%;
    border: 1px solid var(--color-gray-200); 
    border-radius: 25px;
    padding: 4px 38px 4px 14px; /* 左10px、右38px（ボタン分） */
    outline: none; 
    background: transparent;
    font-family: var(--font-base);
    font-size: 12px;
    font-weight: 500;
    line-height: 110%;
    color: var(--color-soft-black);
}

.main-toolbar .main-search-input input::placeholder {
    color: var(--color-gray-500);
}

.main-toolbar .main-search-input input:focus {
    border-color: var(--color-gray-200);
}

.main-toolbar .main-search-icon-box {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-100);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    padding: 0;
}

.main-toolbar .main-search-icon-box:hover {
    background: var(--color-gray-200);
}

.main-toolbar .main-search-icon-box:disabled {
    cursor: wait;
    opacity: 0.65;
}

.main-toolbar .main-search-icon-box svg {
    display: block;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; clip: rect(0 0 0 0); overflow: hidden; }

/* メイソンリーレイアウト */
.gallery-grid { 
    padding: 10px 0 80px;
    min-height: 200px;
    width: 1550px;
}

.gallery-grid.is-loading {
    min-height: auto;
    position: relative;
}

.gallery-grid.is-loading::before {
    content: '';
    position: absolute;
    inset: 10px 0 80px;
    z-index: 2;
    background: rgba(243, 244, 246, 0.32);
    pointer-events: auto;
}

.gallery-grid.is-loading > .home-card,
.gallery-grid.is-loading > .masonry-column,
.gallery-grid.is-loading > .gallery-grid-empty-message {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.gallery-grid-empty-message {
    font-family: var(--font-jp);
    font-size: 13px;
    color: var(--color-gray-500);
    text-align: center;
    padding: 200px 0 80px;
    line-height: 1.6;
}

.masonry-column {
    padding-bottom: 20px;
}

/* ... existing code ... */
.gallery-grid:has(+ .floating-cta:not(.hidden)) .masonry-column {
    padding-bottom: 218px;
}
/* ... existing code ... */

/* JavaScriptで動的にflexレイアウトが適用される */

.floating-cta {
    position: fixed;
    bottom: 0;
    /* left: 50%;
    transform: translateX(-50%); */
    width: 1570px; /* ギャラリー幅 + 20px */
    height: 218px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 0 48px; /* 上部120px、下部48px */
    background: linear-gradient(180deg, rgba(243,244,246,0) 0%, rgba(243,244,246,0.5) 29.808%, rgba(243,244,246,1) 59.615%);
    pointer-events: none; /* 背景はクリック不可 */
    z-index: 10;
}

.floating-cta .home-cta-button {
    appearance: none;
    pointer-events: auto; /* ボタンのみクリック可능 */
    padding: 12px 30px; /* フィグマに合わせたパディング */
    font-family: var(--font-base);
    font-size: 16px;
    font-weight: 700; /* Bold */
    line-height: 1.6;
    border-radius: 25px;
    background: var(--color-grad-pink-purple);
    color: var(--color-soft-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow: 0 6px 16px rgba(255, 110, 110, 0.35);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.floating-cta .home-cta-button:hover { 
    background: var(--color-grad-pink-purple-hover);
    transform: scale(1.1);
}

.main-header .cta-start.story-navigation-pending,
.main-header .cta-start.story-navigation-pending:hover {
    cursor: wait;
    box-shadow: 0 8px 20px rgba(233, 120, 170, 0.3);
    background: var(--color-grad-pink-purple-hover);
}

.floating-cta .home-cta-button.story-navigation-pending,
.floating-cta .home-cta-button.story-navigation-pending:hover {
    cursor: wait;
    background: var(--color-grad-pink-purple-hover);
    transform: scale(1.1);
}
