/* ===== Step 2: オープニングアニメーション用のCSS ===== */

/* ローディング画面が非表示になる時のスタイル */
#loadingScreen.is-hidden {
    opacity: 0;
    visibility: hidden;
}

/* メインコンテンツの初期状態（非表示） */
#mainContent {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in;
}

/* メインコンテンツが表示される時のスタイル */
#mainContent.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ===== SVGがその場で表示されるワイプアニメーション ===== */

/* ローディング画面の基本スタイル（変更なし） */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

#loadingScreen.is-hidden {
    opacity: 0;
    visibility: hidden;
}

/* 1. SVGのコンテナに、マスクを配置する土台として相対位置を指定 */
.svg-container {
    position: relative;
    /* ★重要：マスクを配置する基準点にする */
    width: 100%;
    transform: translateY(170px);
}

/* 2. SVGを覆い隠すための「マスク」を疑似要素で作成 */
.svg-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    /* ローディング画面の背景色と同じ色 */
}

/* ★★★ 変更点 ★★★
   JavaScriptによって親要素にこのクラスが付与されると、
   マスクのアニメーションが開始される
*/
.svg-container.is-animating::after {
    animation: wipe-mask 2.5s ease-in-out forwards;
}

/* 3. SVG本体からはアニメーション指定を削除 */
#loadingScreen svg {
    width: 100%;
    display: block;
    /* animationプロパティは不要なので削除しました */
}

/* 4. マスクを動かすためのアニメーションを定義 */
@keyframes wipe-mask {

    /* 開始時：マスクがSVGを完全に覆っている状態 */
    from {
        transform: translateX(0%);
    }

    /* 終了時：マスクが右に移動し、SVGが完全に見える状態 */
    to {
        transform: translateX(101%);
    }
}

/* ==========================================================================
   INDEX PAGE SPECIFIC STYLES
   ========================================================================== */

/* LAYOUT COMPONENTS
   ========================================================================== */
.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.layout__header {
    /*background-color: var(--color-bg-primary);*/
    /*padding: var(--space-8) 0 var(--space-6) 0; */
    position: absolute;
    z-index: 100;
    /*width: 50%;*/
    top: 0;
    left: 0;
}

.layout__main {

    position: relative;
}

/* INDEX HEADER COMPONENTS
   ========================================================================== */
.header {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: start;
    gap: var(--space-12);
    position: relative;

}

/* Logo */
.container.container__toplogo {
    padding: 52px 70px 0 55px;
}

.header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--color-text-primary);
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: var(--font-weight-bold);
    padding: 0;
}

.logo__img img {
    width: 183px;
}

.logo__icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--color-brand-gold), #E6B566);
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-3);
    position: relative;
}

.logo__icon::after {
    content: '🌿';
    font-size: var(--font-size-xl);
}

.logo__text {
    text-align: center;
}

.logo__brand {
    font-size: var(--font-size-xl);
    letter-spacing: 0.05em;
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

.logo__subtitle {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-normal);
    letter-spacing: 0.1em;
}

/* Navigation - 2 columns layout */
.nav {
    display: grid;
    grid-template-columns: 100px 100px;
    gap: var(--space-8);
    padding-top: var(--space-2);

}

.nav__column {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    line-height: 1;
}

.nav__link {
    color: var(--color-text-primary);
    text-decoration: none;
    /* font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
    letter-spacing: 0.025em;
    line-height: 1.2;*/

}

.nav__link img {
    height: 13px;
    object-fit: cover;
}

.nav__link:hover {
    color: var(--color-primary);
}

/* Social Links */
.social-links {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    padding-top: var(--space-6);
    grid-column: 2;
    grid-row: 2;
}

.social-links__link {
    color: #000000;
    font-size: var(--font-size-lg);
    transition: color var(--transition-fast);
    text-decoration: none;
}

.social-links__link img {
    width: 25px;
}

.social-links__link:hover {
    color: var(--color-primary);
}

/* CTA Button - Vertical */
.header__cta {
    display: none;
}

/* nline SECTION
   ========================================================================== */
.nline__wrap {
    max-width: calc(100vw - 52px);
    position: absolute;
    bottom: -1rem;
    left: 0;
    overflow: hidden;

}

.nline__wrap .container {
    padding: 0;
}

.nline__wrap img.nline_img {
    max-width: 100%;

    width: auto;
    overflow: hidden;
}

@media (max-width: 1200px) {


    .nline__wrap .container {
        padding: 1rem;
    }

}

@media (max-width: 768px) {

    .nline__wrap {
        max-width: 100vw;
        position: static;
        margin: 30px 0;
    }

    .nline__wrap img {
        max-width: 100vw;
    }
}

/* HERO SECTION
   ========================================================================== */
.hero {
    position: relative;
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    background-color: var(--color-bg-hero);
}

.hero__content {
    position: absolute;
    bottom: 0;
    left: var(--space-20);
    z-index: 2;
    width: auto;
    max-width: calc(54% - var(--space-12));
}

.hero__tagline {
    /*font-size: 1.8rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: 5px;*/
    line-height: 1;
    color: var(--color-text-primary);

    position: relative;
}

.hero__tagline img {
    width: 24vw;
}

/* Decorative curve line
.hero__tagline::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 0;
    width: 200px;
    height: 40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40'%3E%3Cpath d='M0,20 Q50,5 100,20 T200,20' stroke='%23000000' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat;
    background-size: contain;
}
*/

/* Image Slider */
.hero__slider {
    position: absolute;
    right: 52px;
    top: 20px;
    width: calc(54% - 52px);
    height: calc(100vh - 60px);
    overflow: hidden;
}

.slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider__track {
    display: flex;
    width: 600%;
    height: 100%;
    transition: transform 0.6s ease-in-out;
}

.slider__slide {
    width: calc(100% / 4);
    height: 100%;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slider__slide img {
    width: 70px;
}

.slider__slide:nth-child(1) {
    background-image: url('../img/item/nhf_top_hie_1006_1020.jpg');
}

.slider__slide:nth-child(2) {
    background-image: url('../img/item/nhf_top_hilecithin_1006_1020.jpg');
}

.slider__slide:nth-child(3) {
    background-image: url('../img/item/nhf_top_mela_1006_1020.jpg');
}

.slider__slide:nth-child(4) {
    background-image: url('../img/item/nhf_top_eyeg_1006_1020.jpg');
}

.slider__slide:nth-child(5) {
    background-image: url('../img/item/nhf_top_ratio_1006_1020.jpg');
}

/*
.slider__slide:nth-child(5) {
    background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><rect fill="%23f6f6f6" width="800" height="600"/><circle cx="400" cy="300" r="120" fill="%23ffffff" stroke="%23e0e0e0" stroke-width="2"/><rect x="350" y="200" width="100" height="150" rx="15" fill="%236f42c1"/><text x="400" y="230" text-anchor="middle" fill="white" font-size="12" font-weight="bold">PROTEIN</text></svg>');
}

.slider__slide:nth-child(6) {
    background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><rect fill="%23f1f1f1" width="800" height="600"/><circle cx="400" cy="300" r="120" fill="%23ffffff" stroke="%23e0e0e0" stroke-width="2"/><rect x="350" y="200" width="100" height="150" rx="15" fill="%23fd7e14"/><text x="400" y="230" text-anchor="middle" fill="white" font-size="12" font-weight="bold">CALCIUM</text></svg>');
}
*/
/* Slider Controls */
.slider__dots {
    position: absolute;
    bottom: var(--space-12);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-3);
    z-index: 10;
}

.slider__dot {
    width: 12px;
    height: 12px;
    border-radius: var(--border-radius-full);
    border: 1px solid #fff;
    background-color: rgba(255, 255, 255, 0);

    cursor: pointer;
    transition: all var(--transition-fast);
}

.slider__dot--active {
    background-color: #fff;
    transform: scale(1.2);
}

.slider__view-more {
    position: absolute;
    bottom: var(--space-12);
    right: var(--space-16);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
    z-index: 10;
    font-family: 'Oljzij Urwdin Medium';
    color: #fff;
    border-bottom: 1px solid #fff;
    line-height: 1.3;
}


.slider__view-more:hover {
    color: var(--color-primary);
}


.right-sidebar__top-copyright {
    /*color: #000000;
    font-size: 8px;
    letter-spacing: 0.1em;
    writing-mode: sideways-lr;
    -webkit-writing-mode: sideways-lr;
    -ms-writing-mode: sideways-lr;
    flex-grow: 1;*/
    text-decoration: none;


}

.right-sidebar__top-copyright img {
    width: 10px;
}

.top-copyright {
    position: absolute;
    bottom: -58px;
    right: 50px;
}

.top-copyright img {
    height: 14px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--color-text-primary);
    cursor: pointer;
}

/* RESPONSIVE
   =======================================================================
@media (max-width: 1200px) {
    .hero__slider {
        width: 50%;
    }

    .hero__content {
        position: relative;
        bottom: auto;
        left: auto;
        width: 100%;
        max-width: none;
        padding-left: 0;
        text-align: left;
    }

    .hero__tagline {
        font-size: var(--font-size-3xl);
    }
}
=== */
@media (max-width: 1180px) {
    /* .header {
        display: grid;
        grid-template-columns: auto;
        grid-template-rows: auto;
        align-items: start;
        gap: var(--space-12);
        position: relative;
    }
*/
}

@media (max-width: 768px) {

    .right-sidebar {
        display: none;
    }

    .top-copyright {
        display: none;
    }


    .layout__header {
        width: 100%;
        position: relative;
        left: 0;
        height: 75px;
    }

    .layout__main {
        /*height: calc(100vh - 75px);*/
        height: auto;
    }

    .header {
        grid-template-columns: 1fr auto auto;
        gap: var(--space-4);
        align-items: center;
        grid-template-rows: auto;
        margin: 0;

    }

    .nav {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .hero__slider {
        width: 50%;
    }

    .hero__content {
        width: 50%;
    }

    .header__cta {
        display: none;
    }

    .hero {
        position: relative;
        min-height: auto;
        display: flex;
        flex-direction: column-reverse;
        align-items: center;
        background-color: var(--color-bg-hero);
    }

    .hero__content {
        width: 100%;
        position: static;
        max-width: 100%;
        text-align: center;
    }

    .hero__slider {
        position: relative;
        width: 100%;
        height: 470px;
        right: 0;
        top: 0;

    }

    .slider__view-more {

        bottom: var(--space-12);
        right: var(--space-12);
    }

    /* Logo */
    .container.container__toplogo {
        padding: 14px 23px;
    }

    .logo__img img {
        width: 138px;
    }


    .logo__icon {
        width: 50px;
        height: 50px;
        font-size: var(--font-size-lg);
    }

    .logo__brand {
        font-size: var(--font-size-base);
    }

    .hero__tagline {
        font-size: var(--font-size-2xl);
        margin: 25px 0 0;
        letter-spacing: 2px;
        white-space: nowrap;
        text-align: center;
    }

    .hero__tagline img {
        width: 80vw;
    }

    .slider__slide:nth-child(1) {
        background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)),
            url('../img/item/item01_sp.png');
    }

    .slider__slide:nth-child(2) {
        background-image: url('../img/item/hi_leccitin_top.jpg');
    }

    .slider__slide:nth-child(3) {
        background-image: url('../img/item/nhf_mela_0812.jpg');
    }

    .slider__slide:nth-child(4) {
        background-image: url('../img/item/eyeguard_top.jpg');
    }

    .slider__slide:nth-child(5) {
        background-image: url('../img/item/ratiolutein_top.jpg');
    }


}

@media (max-height: 520px) {
    img.nline_img {
        opacity: 0;
    }
}