/* Portfolio Page Specific Styles */

/* ハンバーガーメニューとモバイルメニューのデフォルト非表示 */
.hamburger-menu,
.mobile-menu {
    display: none;
}

/* PC版で確実にハンバーガーメニューを非表示 */
@media (min-width: 769px) {
    .hamburger-menu,
    .mobile-menu {
        display: none !important;
    }
}

/* ハンバーガーメニュー対応 */
@media (max-width: 768px) {
    /* ハンバーガーメニューボタンをモバイルで表示 */
    .hamburger-menu {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 22px;
        background: transparent;
        border: none;
        cursor: pointer;
        position: absolute !important;
        top: 50% !important;
        right: 24px !important;
        transform: translateY(-50%) !important;
        z-index: 1001 !important;
    }
    
    /* ヘッダーの基準位置を統一 */
    header {
        position: relative !important;
    }
    
    header nav {
        position: relative !important;
    }

    .hamburger-menu span {
        display: block;
        height: 2px;
        width: 100%;
        background: #333;
        border-radius: 1px;
        transition: all 0.3s ease;
        transform-origin: center;
    }

    /* ハンバーガーメニューアニメーション */
    .hamburger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }

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

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

    /* モバイルメニューの基本設定とオープン時の表示 */
    .mobile-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(247, 243, 237, 0.98);
        backdrop-filter: blur(10px);
        z-index: 1000;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 70px;
        gap: 20px;
        transition: all 0.3s ease;
    }

    .mobile-menu.open {
        display: flex !important;
    }

    .mobile-menu a {
        color: #333;
        text-decoration: none;
        font-size: 1.5rem;
        font-weight: 500;
        padding: 15px 20px;
        transition: all 0.3s ease;
    }

    .mobile-menu a:hover {
        color: #666;
        transform: translateX(5px);
    }

    /* PC版ナビゲーションを非表示 */
    .nav-links {
        display: none !important;
    }
}

/* ヘッダー背景をポートフォリオページでも透過に */
header {
    background: transparent;
    backdrop-filter: blur(10px);
}

/* ロゴリンクのスタイルを統一 */
.logo a {
    text-decoration: none !important;
    color: inherit !important;
}

.logo a:visited {
    color: inherit !important;
    text-decoration: none !important;
}

.logo a:hover {
    color: inherit !important;
    text-decoration: none !important;
}

.logo a:active {
    color: inherit !important;
    text-decoration: none !important;
}

.portfolio-hero {
    height: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    padding: 80px 60px 20px 60px;
    background: #f7f3ed;
}

.portfolio-hero .hero-content h1 {
    font-size: 5rem;
    font-weight: 900;
    margin-bottom: 0;
    letter-spacing: -0.02em;
    color: #000;
}

.portfolio-hero .hero-content p {
    font-size: 1.3rem;
    color: #666;
    max-width: 800px;
    line-height: 1.6;
}

/* Main Portfolio Section */
.portfolio-main {
    padding: 0 60px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    min-height: 80vh;
}

.portfolio-nav {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    justify-content: flex-start;
}

.portfolio-btn {
    background: transparent;
    border: 1px solid #e5e5e5;
    color: #666;
    padding: 15px 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
    font-weight: 400;
}

.portfolio-btn.active {
    background: #000;
    color: #f9f6f1;
    border-color: #000;
}

.portfolio-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: #333;
}

/* 3D Gallery */
.portfolio-3d {
    width: 80vw;
    height: 90vh;
    position: absolute;
    top: -280px;
    left: 60%;
    transform: translateX(-50%);
    z-index: 1;
}

.three-gallery {
    width: 100%;
    height: 100%;
    background: #f7f3ed;
}

.gallery-controls {
    position: absolute;
    bottom: 15px;
    left: 60px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    text-align: center;
    backdrop-filter: blur(10px);
    z-index: 10;
}

/* Grid View */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.portfolio-item {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.portfolio-item img,
.portfolio-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.portfolio-item:hover img,
.portfolio-item:hover video {
    transform: scale(1.08);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.3));
    color: white;
    padding: 30px;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.portfolio-overlay h3 {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.portfolio-overlay p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Category View */
.portfolio-categories {
    width: 100%;
}

.category-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 50px;
    justify-content: center;
    flex-wrap: wrap;
}

.category-btn {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 12px 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 25px;
}

.category-btn.active {
    background: #000;
    color: white;
    border-color: #000;
}

.category-btn:hover {
    border-color: #333;
    color: #333;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* Stats Section */
.portfolio-stats {
    background: rgba(0, 0, 0, 0.02);
    padding: 100px 60px;
    text-align: center;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    color: #000;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 400;
    letter-spacing: 0.1em;
}

/* CTA Section */
.portfolio-cta {
    padding: 60px 60px;
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
}

.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #000;
}

.cta-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .portfolio-hero {
        height: auto;
        padding: 30px 20px 10px 20px;
    }
    
    .portfolio-hero .hero-content h1 {
        font-size: 3rem;
        margin-bottom: 0;
    }
    
    .portfolio-hero .hero-content p {
        font-size: 1rem;
    }
    
    .portfolio-main {
        padding: 20px 20px 0 20px;
    }
    
    .portfolio-nav {
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
        margin-bottom: 10px;
    }
    
    .portfolio-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .portfolio-3d {
        width: 100vw;
        height: 70vh;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 40px;
        top: 0;
    }
    
    .three-gallery {
        background: #f7f3ed;
    }
    
    .gallery-controls {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        padding: 10px 20px;
        font-size: 0.8rem;
        text-align: center;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .category-tabs {
        gap: 8px;
    }
    
    .category-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .portfolio-stats {
        padding: 80px 20px;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .portfolio-cta {
        padding: 40px 20px;
    }
    
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
}

/* Portfolio Modal */
.portfolio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 900px;
    max-height: 80vh;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: grid;
    grid-template-rows: 1fr auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: white;
}

.modal-media {
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-media img,
.modal-media video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-info {
    padding: 30px;
    background: white;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #000;
}

.modal-description {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
}

.modal-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #888;
}

@media (max-width: 768px) {
    .modal-content {
        max-height: 90vh;
        margin: 10px;
    }
    
    .modal-media {
        height: 250px;
    }
    
    .modal-info {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 1.4rem;
    }
    
    .modal-description {
        font-size: 0.9rem;
    }
}