/* ヘッダー */
.navbar {
    height: 80px;
    padding: 15px 64px;
    background: linear-gradient(135deg, #c40000 0%, #8b0000 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.9);
}

/* ハンバーガーメニュー */
.hamburger {
    display: none;
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    z-index: 1301;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 0;
}

.hamburger:hover:not(.active) {
    transform: translateY(-50%) scale(1.05);
}

.hamburger span {
    display: block;
    width: 30px;
    height: 3px;
    margin: 4px 0;
    background: #fff;
    border-radius: 2px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* ハンバーガー開閉時のアニメーション（360度回転してからX形に変形） */
.hamburger.active {
    animation: hamburger-rotate 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

/* 閉じる時のアニメーション */
.hamburger:not(.active) {
    animation: hamburger-rotate-back 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7.5px, 7.5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7.5px, -7.5px);
}

/* 回転アニメーション定義 */
@keyframes hamburger-rotate {
    0% {
        transform: translateY(-50%) rotate(0deg);
    }

    100% {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* 逆回転アニメーション定義（閉じる時） */
@keyframes hamburger-rotate-back {
    0% {
        transform: translateY(-50%) rotate(360deg);
    }

    100% {
        transform: translateY(-50%) rotate(0deg);
    }
}

/* メニュー展開時のオーバーレイ */
.navbar-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.32);
    z-index: 1100;
    pointer-events: auto;
}

.navbar-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.navbar-links,
.sns-icons {
  display: flex;
  list-style: none;
  gap: 2rem;
  padding: 0;
  margin: 0;
}

.navbar-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;          /* ← 上下paddingは消す */
  height: 50px;             /* ← 高さだけで中央寄せ */
  font-weight: bold;
  font-size: 1rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
}

.navbar-links a:hover,
.navbar-links a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.navbar-links a:hover {
    transform: translateY(-2px);
}

/* ================================================================
   レスポンシブデザイン統合セクション
   ================================================================ */

/* モバイル対応（768px以下） */
@media (max-width: 768px) {
    /* PC版のナビゲーションを完全に無効化 */
    .navbar-links,
    .sns-icons,
    .desktop-only {
        display: none !important;
    }

    /* モバイル専用要素はメニューが開くまで非表示 */
    .mobile-only {
        display: none !important;
    }

    .hamburger {
        display: flex;
    }

    .navbar {
        position: relative;
        height: 60px;
        padding: 0 24px;
    }

    /* PC版のナビゲーションを隠す */
    .navbar-menu:not(.active) {
        display: none;
    }

    .navbar-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: #000;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1250;
        backdrop-filter: blur(10px);
        transition: left 0.4s ease-out;
        opacity: 0;
        display: flex;
        overflow-y: auto;
    }

    .navbar-menu.active {
        left: 0;
        opacity: 1;
    }

    .navbar-menu.active .navbar-links {
        flex-direction: column;
        gap: 2rem;
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: 300px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .navbar-menu.active .navbar-links a {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        padding: 12px 24px;
        text-align: center;
        width: 100%;
        opacity: 0;
        transform: translateY(-20px);
        animation: slide-in-from-top 0.5s ease-out forwards;
        color: #fff;
        text-decoration: none;
    }

    /* モバイル版SNSアイコン */
    .navbar-menu.active .social-icons {
        display: flex !important;
        flex-flow: row wrap;
        justify-content: center;
        gap: 44px;
        max-width: 220px;
        margin: 0 auto;
        margin-top: 32px;
        padding-top: 32px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        opacity: 0;
        transform: translateY(-20px);
        animation: slide-in-from-top 0.5s ease-out forwards;
        animation-delay: 0.7s;
    }

    .navbar-menu.active .social-icon {
        width: 32px;
        height: 32px;
    }

    .navbar-menu.active .navbar-links li:nth-child(1) a { 
        animation-delay: 0.3s; 
        height: 100%;
    }

    .navbar-menu.active .navbar-links li:nth-child(2) a { 
        animation-delay: 0.4s; 
        height: 100%;
    }

    .navbar-menu.active .navbar-links li:nth-child(3) a { 
        animation-delay: 0.5s; 
        height: 100%;
    }

    .navbar-menu.active .navbar-links li:nth-child(4) a { 
        animation-delay: 0.6s; 
        height: 100%;
    }

    .navbar-menu.active .navbar-links a:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    /* モバイル専用ボタン（ログイン/ログアウト等）の表示制御 */
    .navbar-menu.active .navbar-links .mobile-only {
        display: block !important;
        width: 100%;
        opacity: 0;
        transform: translateY(-20px);
        animation: slide-in-from-top 0.5s ease-out forwards;
        animation-delay: 0.7s;
    }

    /* モバイル版ログイン/ログアウトボタンを通常のリンクスタイルに */
    .navbar-menu.active .btn-login,
    .navbar-menu.active .btn-logout,
    .navbar-menu.active .btn-register {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px 24px;
        font-size: 1.2rem;
        text-decoration: none;
        width: 100%;
        background: transparent;
        color: #fff !important;
        border: none;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .navbar-menu.active .btn-login:hover,
    .navbar-menu.active .btn-logout:hover,
    .navbar-menu.active .btn-register:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .navbar-menu.active .sns-icons {
        gap: 3rem;
        margin: 2rem 0 0;
        padding: 0;
        justify-content: center;
        align-items: center;
        flex-direction: row;
        display: flex !important;
        width: 100%;
    }

    .navbar-menu.active .sns-icons a {
        font-size: 1.5rem;
        width: 50px;
        height: 50px;
        color: #fff;
        text-decoration: none;
        opacity: 0;
        transform: translateY(20px);
        animation: slide-in-from-bottom 0.5s ease-out forwards;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .navbar-menu.active .sns-icons li:nth-child(1) a { animation-delay: 0.7s; }

    .navbar-menu.active .sns-icons li:nth-child(2) a { animation-delay: 0.8s; }

    .navbar-menu.active .sns-icons li:nth-child(3) a { animation-delay: 0.9s; }

    /* メニューが閉じられるときのアニメーションリセット */
    .navbar-menu:not(.active) .navbar-links a {
        animation: none;
        opacity: 0;
        transform: translateY(-20px);
    }

    .navbar-menu:not(.active) .sns-icons a {
        animation: none;
        opacity: 0;
        transform: translateY(20px);
    }
}

/* 横向きモバイル対応 */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .navbar-menu.active .navbar-links {
        margin-top: 100px; 
    }
}



@keyframes slide-in-from-top {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in-from-bottom {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SNSアイコン（公式単色ロゴ使用 - ブランドガイドライン準拠） */
.social-icons {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-left: 32px;
    margin-right: 32px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0.9;
}

/* ナビゲーションアクション（ログイン/ログアウトボタン） */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 16px;
}

.social-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.social-icon:hover {
    opacity: 1;
    transform: translateY(-1px);
}

/* ログイン/ログアウト/会員登録ボタン */
.btn-login,
.btn-logout,
.btn-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

/* ログインボタン */
.btn-login {
    background: linear-gradient(135deg, #1e90ff, #0056b3);
    color: #fff;
    border-color: #1e90ff;
}

.btn-login:hover {
    background: linear-gradient(135deg, #0056b3, #003d82);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.3);
}

/* ログアウトボタン */
.btn-logout {
    background: linear-gradient(135deg, #dc3545, #a71d2a);
    color: #fff;
    border-color: #dc3545;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #a71d2a, #7a1520);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* 会員登録ボタン */
.btn-register {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: #fff;
    border-color: #28a745;
}

.btn-register:hover {
    background: linear-gradient(135deg, #1e7e34, #155724);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* モバイル版ボタンのスタイル調整 */
.btn-login.mobile,
.btn-logout.mobile,
.btn-register.mobile {
    width: 100%;
    padding: 14px 24px;
    font-size: 1.1rem;
    justify-content: center;
}

/* 新しいヘッダー画像セクション */
.header-image-section {
    width: 100%;
    overflow: hidden;
}

.header-image {
    width: 100%;
    height: auto;
    display: block;
}
