/*
 * 全ページ共通のグローバルレイアウトCSS
 * ヘッダー、フッター、基本レイアウトなど
 */

/* ==========================================================================
   ヘッダーナビゲーション
   ========================================================================== */

/*!
 * Hamburgers
 * @description Tasty CSS-animated hamburgers
 * @author Jonathan Suh @jonsuh
 * @site https://jonsuh.com/hamburgers
 * @link https://github.com/jonsuh/hamburgers
 */
.hamburger {
    padding: 13px 10px;
    display: inline-block;
    cursor: pointer;
    transition-property: opacity, filter;
    transition-duration: 0.15s;
    transition-timing-function: linear;
    font: inherit;
    color: inherit;
    text-transform: none;
    background-color: transparent;
    border: 0;
    margin: 0;
    overflow: visible;
}

.hamburger:hover {
    background: var(--main-color);
}

.hamburger:hover .hamburger-inner,
.hamburger:hover .hamburger-inner::before,
.hamburger:hover .hamburger-inner::after,
.hamburger.is-active:hover .hamburger-inner,
.hamburger.is-active:hover .hamburger-inner::before,
.hamburger.is-active:hover .hamburger-inner::after {
    background: var(--white-color);
}

.hamburger.is-active .hamburger-inner,
.hamburger.is-active .hamburger-inner::before,
.hamburger.is-active .hamburger-inner::after {
    background-color: var(--main-color);
}

.hamburger-box {
    position: relative;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -2px;
}

.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after {
    width: 25px;
    height: 3px;
    background-color: var(--main-color);
    border-radius: 4px;
    position: absolute;
    transition-property: transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.hamburger-inner::before, .hamburger-inner::after {
    content: "";
    display: block;
}

.hamburger-inner::before {
    top: -10px;
}

.hamburger-inner::after {
    bottom: -10px;
}

/* Spin Animation */
.hamburger--spin .hamburger-inner {
    transition-duration: 0.22s;
    transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

.hamburger--spin .hamburger-inner::before {
    transition: top 0.1s 0.25s ease-in, opacity 0.1s ease-in;
}

.hamburger--spin .hamburger-inner::after {
    transition: bottom 0.1s 0.25s ease-in, transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

.hamburger--spin.is-active .hamburger-inner {
    transform: rotate(225deg);
    transition-delay: 0.12s;
    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}

.hamburger--spin.is-active .hamburger-inner::before {
    top: 0;
    opacity: 0;
    transition: top 0.1s ease-out, opacity 0.1s 0.12s ease-out;
}

.hamburger--spin.is-active .hamburger-inner::after {
    bottom: 0;
    transform: rotate(-90deg);
    transition: bottom 0.1s ease-out, transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* メインナビゲーションのレイアウト */
.main-navigation {
    position: fixed;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: transparent;
    transition: all 0.3s ease;
}

/* スクロール時の背景 */
.main-navigation.scrolled {
    background: rgb(255 255 255 / 50%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #c7c7c7;
}

.nav-container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas: "left center right";
    align-items: center;
    justify-content: space-between;
}

/* 常に表示される固定メニュー */
.always-visible-menu {
    grid-area: left;
    display: flex;
    align-items: center;
}

.always-menu-list {
    display: flex;
    /* display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 50px;
    transition: grid-template 0.3s ease; */
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
    /* 
    &:has(> .always-menu-item:nth-of-type(1):hover) {
        grid-template-columns: 3fr 1fr 1fr 1fr;
    }

    &:has(> .always-menu-item:nth-of-type(2):hover) {
        grid-template-columns: 1fr 3fr 1fr 1fr;
    }

    &:has(> .always-menu-item:nth-of-type(3):hover) {
        grid-template-columns: 1fr 1fr 3fr 1fr;
    }

    &:has(> .always-menu-item:hover) {
        grid-template-rows: 280px;
    }

    &:has(.always-menu-item:hover) .always-menu-item:not(:hover) {
        opacity: 0.5;
    }
}

.always-menu-item {
    min-width: 60px;
    color: #ecf0f1;
    text-underline-offset: 4px;
    font-size: 1.2rem;
    text-align: center;
    overflow: hidden;
    transition: opacity 0.8s;

    img {
        mix-blend-mode: lighten;
    } */
}

.always-menu-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.always-menu-link:hover {
    color: var(--active-color);
    border: 1px solid var(--active-color);
    background: var(--white-color);
}

/* サイトブランディング */
.site-branding {
    grid-area: center;
    text-align: center;
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.site-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-title a:hover {
    color: #3498db;
}

.site-logo img {
    max-height: 50px;
    width: auto;
}

/* ハンバーガーメニューエリア */
.menu-toggle {
    grid-area: right;
    display: block;
    z-index: 1001;
    justify-self: end;
    background: var(--white-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    border: 3px solid var(--main-color);
    transition: all 0.3s ease;
}

/* メインメニューラッパー */
.nav-menu-wrapper {
    grid-area: right;
    display: flex;
    justify-content: flex-end;
    /* デスクトップ表示時はハンバーガーメニュー背面に隠す */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.nav-menu-wrapper.active {
    opacity: 1;
    visibility: visible;
}

.nav-menu {
    flex-direction: column;
    gap: 0;
    background-color: #fff;
    border-radius: 15px;
    padding: 30px 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    list-style: none;
    margin: 0;
}

.nav-menu li {
    position: relative;
    border-bottom: 1px solid #f1f2f3;
}

.nav-menu li:last-child {
    border-bottom: none;
}

.nav-menu a {
    display: block;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 0;
    padding: 20px 30px;
    white-space: nowrap;
    text-align: center;
    font-size: 1.1rem;
}

.nav-menu a:hover,
.nav-menu a:focus {
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

/* 現在のページのハイライト */
.nav-menu .current_page_item a,
.nav-menu .current-menu-item a {
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.15);
}

/* ドロップダウンメニュー（モバイル用に調整） */
.nav-menu .menu-item-has-children>a::after {
    content: '+';
    font-size: 1.2rem;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.nav-menu .menu-item-has-children.active>a::after {
    content: '−';
    transform: none;
}

.nav-menu .sub-menu {
    position: static;
    background-color: #f8f9fa;
    box-shadow: none;
    border-radius: 0;
    min-width: 200px;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 1000;
}

.nav-menu .menu-item-has-children.active .sub-menu {
    max-height: 300px;
}

.nav-menu .sub-menu li {
    width: 100%;
}

.nav-menu .sub-menu a {
    padding: 15px 40px;
    border-radius: 0;
    border-bottom: 1px solid #e1e1e1;
    font-size: 1rem;
    background-color: transparent;
}

.nav-menu .sub-menu li:last-child a {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.nav-menu .sub-menu li:first-child a {
    border-radius: 8px 8px 0 0;
}

/* ==========================================================================
   フッター
   ========================================================================== */

.site-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
}

/* フッターウィジェット */
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-widget h4 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-widget p,
.footer-widget li {
    color: #bdc3c7;
    line-height: 1.6;
}

.footer-widget a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-widget a:hover {
    color: #3498db;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
}

.footer-widget ul li {
    margin-bottom: 8px;
}

/* フッターメニュー */
.footer-menu {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.footer-menu a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-menu a:hover {
    color: #3498db;
}

/* フッターコピーライト */
.footer-copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    margin-top: 30px;
    color: #95a5a6;
    font-size: 0.9rem;
}

/* ==========================================================================
   レスポンシブデザイン
   ========================================================================== */

/* タブレット・モバイル対応 */
@media (max-width: 1280px) {
    .nav-container {
        padding: 0 15px;
        grid-template-areas: "left center right";
    }

    /* サイトタイトルのモバイル調整 */
    .site-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 600px) {
    .always-visible-menu {
        display: none;
    }

    .footer-menu {
        flex-direction: column;
        gap: 10px;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
    }

    .nav-container {
        padding: 0 10px;
    }

    .site-title {
        font-size: 1.2rem;
    }

    .nav-menu {
        max-width: 280px;
        padding: 25px 0;
    }

    .nav-menu a {
        padding: 18px 25px;
        font-size: 1rem;
    }
}

/* ==========================================================================
   共通コンポーネント
   ========================================================================== */

/* ページネーション */
.pagination-wrapper {
    margin: 40px 0;
    text-align: center;
}

.pagination-list {
    display: inline-flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pagination-item {
    margin: 0;
}

.pagination-item a,
.pagination-item span {
    display: block;
    padding: 12px 16px;
    background-color: #fff;
    color: #2c3e50;
    text-decoration: none;
    border: 1px solid #e1e1e1;
    border-left: none;
    transition: all 0.3s ease;
}

.pagination-item:first-child a,
.pagination-item:first-child span {
    border-left: 1px solid #e1e1e1;
}

.pagination-item a:hover {
    background-color: #3498db;
    color: #fff;
}

.pagination-item .current {
    background-color: #3498db;
    color: #fff;
    font-weight: 600;
}

/* コンテンツが見つからない場合 */
.no-content {
    text-align: center;
    padding: 60px 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    margin: 40px 0;
}

.no-content-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.no-content-message {
    font-size: 1.1rem;
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 30px;
}

.no-content-button {
    display: inline-block;
    background-color: #3498db;
    color: #fff;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.no-content-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* アニメーション効果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.nav-menu-wrapper.active .nav-menu {
    animation: fadeInUp 0.4s ease;
}

.nav-menu-wrapper.active .nav-menu li {
    animation: fadeInUp 0.4s ease;
    animation-fill-mode: both;
}

.nav-menu-wrapper.active .nav-menu li:nth-child(1) {
    animation-delay: 0.1s;
}

.nav-menu-wrapper.active .nav-menu li:nth-child(2) {
    animation-delay: 0.2s;
}

.nav-menu-wrapper.active .nav-menu li:nth-child(3) {
    animation-delay: 0.3s;
}

.nav-menu-wrapper.active .nav-menu li:nth-child(4) {
    animation-delay: 0.4s;
}

.nav-menu-wrapper.active .nav-menu li:nth-child(5) {
    animation-delay: 0.5s;
}