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

/* ==========================================================================
   タブレット (769px - 1024px) - ハンバーガーメニュー
   ========================================================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* セクション余白（hero-section以外） */
    .philosophy-section,
    .service-section,
    .creator-section,
    .works-section,
    .news-section,
    .contact-section,
    .footer-section {
        padding: 60px 40px;
    }
    
    .philosophy-section .container,
    .service-section .container,
    .creator-section .container,
    .works-section .container,
    .news-section .container,
    .contact-section .container,
    .footer-section .container {
        padding: 0;
    }
    
    /* カードを1列配置 */
    .service-cards,
    .works-cards-grid,
    .news-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }
    
    /* サービスカード系の確実な1列配置 */
    .fan-marketing-section .cards-grid,
    .service-section .service-cards {
        display: flex !important;
        flex-direction: column;
        gap: 40px;
    }
    
    .service-card,
    .fan-service-card {
        margin-bottom: 0;
    }
    
    
    /* タブレット用モバイルメニュー - スマホと同じ仕様 */
    .header-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        transition: left 0.3s ease;
        z-index: 1999;
    }
    
    .header-nav.mobile-open {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 10px;
        padding: 30px 20px 40px 20px;
        height: auto;
        max-height: 100%;
        overflow-y: visible;
    }
    
    .nav-item {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 10px;
        margin: 2px 0;
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        padding: 25px 20px;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 15px;
        border-radius: 10px;
        margin: 5px 0;
        transition: all 0.3s ease;
        background: transparent;
        min-height: 60px;
        display: flex;
        width: calc(100% - 40px);
    }
    
    .nav-main,
    .nav-sub {
        white-space: nowrap;
    }
    
    .nav-link:hover,
    .nav-link:active {
        background: rgba(255, 105, 180, 0.1);
        transform: translateX(5px);
    }
    
    .nav-link:active {
        transform: scale(0.98) translateX(5px);
    }
    
    .nav-main {
        color: #333;
        font-size: 1.3rem;
        margin-bottom: 0;
        font-weight: 600;
    }
    
    .nav-sub {
        color: #666;
        font-size: 0.95rem;
        font-weight: 400;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* 浮遊ボタンをスマホと同じ表示に */
    .floating-buttons {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        transform: none;
        flex-direction: row;
        gap: 0;
        background: transparent;
        backdrop-filter: none;
        padding: 0;
        border-top: none;
    }
    
    .floating-btn {
        flex: 1;
        flex-direction: column;
        gap: 6px;
        padding: 12px 8px;
        min-width: auto;
        border-radius: 0;
        text-align: center;
        font-size: 0.75rem;
        border-right: 1px solid rgba(255,255,255,0.3);
    }
    
    /* 個別の色設定を維持 */
    .creator-btn {
        background: linear-gradient(135deg, #FF69B4, #FF1493);
        color: white;
    }
    
    .employee-btn {
        background: #666666;
        color: white;
    }
    
    .contact-btn {
        background: #28a745;
        color: white;
    }
    
    .floating-btn:last-child {
        border-right: none;
    }
    
    .floating-btn:hover {
        background: linear-gradient(45deg, #FF1493, #FF69B4);
        transform: translateY(-2px);
    }
}

/* ==========================================================================
   タブレット (768px - 991px)
   ========================================================================== */
@media (max-width: 991px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .section {
        padding: var(--spacing-xxxl) 0;
    }
    
    .section-title {
        font-size: var(--font-size-xxxl);
    }
    
    .service-header {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    .service-left,
    .service-right {
        width: 100%;
    }
    
    .service-image {
        text-align: center;
    }
    
    .service-image img {
        width: 250px;
        height: 250px;
    }
    
    .service-cards {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .creator-bg-circle {
        right: -300px;
        width: 400px;
        height: 400px;
    }
    
    .works-cards,
    .news-cards {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
}

/* ==========================================================================
   スマートフォン (768px以下)
   ========================================================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .header-nav ul {
        gap: var(--spacing-md);
    }
    
    .header-nav a {
        font-size: var(--font-size-md);
    }
    
    .logo-text {
        font-size: var(--font-size-xl);
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-lg);
        min-height: auto;
        padding: var(--spacing-lg) var(--spacing-md);
        width: 100%;
        max-width: 100%;
    }
    
    .hero-text {
        width: 100%;
        max-width: 90%;
        margin: 0 auto;
        padding: var(--spacing-md);
    }
    
    .hero-section {
        height: 70vh;
        min-height: 400px;
        max-height: 600px;
    }
    
    .hero-background {
        background-position: left top;
    }
    
    .hero-background::before {
        background-position: left top;
    }
    
    .hero-background::after {
        background-position: left bottom;
    }
    
    
    .philosophy {
        height: 300px;
    }
    
    .philosophy-circle {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .philosophy-content {
        width: 90%;
        text-align: center;
        margin: 0 auto;
    }
    
    /* トップページのみtext-align: leftに変更 */
    body:not(.philosophy-page):not(.service-page):not(.news-page):not(.works-page):not(.creators-page) .philosophy-content {
        text-align: left;
    }
    
    .philosophy-content h2 {
        font-size: var(--font-size-xxl);
    }
    
    .section-title {
        font-size: var(--font-size-xxxl);
    }
    
    .creator-carousel {
        height: 200px;
    }
    
    .creator-slide img {
        width: 120px;
        height: 150px;
    }
    
    .creator-slide.active img,
    .creator-slide:nth-child(3) img {
        width: 150px;
        height: 180px;
    }
    
    .contact-options-full {
        flex-direction: column;
        margin-top: var(--spacing-xxxl);
    }
    
    .contact-option-half {
        width: 100%;
    }
    
    .contact-option-half h3 {
        font-size: var(--font-size-xxl);
    }
    
    .contact-option-half p {
        font-size: var(--font-size-lg);
    }
    
    .footer .container {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    .footer-info {
        margin-left: 0;
    }
}

/* ==========================================================================
   小型スマートフォン (480px以下)
   ========================================================================== */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .header {
        padding: var(--spacing-sm) 0;
    }
    
    .header .container {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .logo-text {
        font-size: var(--font-size-lg);
        padding: var(--spacing-xs) var(--spacing-sm);
        border-radius: var(--border-radius-sm);
    }
    
    .header-nav ul {
        gap: var(--spacing-sm);
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-nav a {
        font-size: var(--font-size-sm);
        padding: var(--spacing-xs) var(--spacing-sm);
        background: rgba(255, 255, 255, 0.1);
        border-radius: var(--border-radius-sm);
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    .section-title {
        font-size: var(--font-size-xxl);
        margin-bottom: var(--spacing-lg);
    }
    
    .hero-section {
        height: 100vh;
        min-height: 400px;
    }
    
    
    .philosophy-content h2 {
        font-size: 2.5rem;
    }
    
    .philosophy-content p {
        font-size: 0.75rem;
    }
    
    .service-intro p:first-child {
        font-size: var(--font-size-xl);
    }
    
    .service-intro p:last-child {
        font-size: var(--font-size-md);
    }
    
    .card-content {
        padding: var(--spacing-lg);
    }
    
    .card-title {
        font-size: var(--font-size-lg);
    }
    
    .card-description {
        font-size: var(--font-size-sm);
    }
    
    /* ボタングループのモバイル対応 */
    .button-group:not(.vertical) {
        flex-direction: column;
        max-width: 100%;
    }
    
    .button-group:not(.vertical) .custom-btn {
        flex-direction: row;
        text-align: left;
        padding: var(--spacing-md) var(--spacing-lg);
        gap: var(--spacing-md);
        justify-content: flex-start;
    }
    
    .custom-btn {
        font-size: var(--font-size-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .contact-recruit h3 {
        font-size: var(--font-size-xxl);
    }
    
    .contact-recruit p {
        font-size: var(--font-size-lg);
    }
}

/* ==========================================================================
   極小デバイス (320px以下)
   ========================================================================== */
@media (max-width: 320px) {
    .container {
        padding: 0 var(--spacing-xs);
    }
    
    .section {
        padding: var(--spacing-lg) 0;
    }
    
    .section-title {
        font-size: var(--font-size-xl);
    }
    
    .logo-text {
        font-size: var(--font-size-md);
        padding: 2px 4px;
        border-radius: var(--border-radius-sm);
    }
    
    .header-nav a {
        font-size: var(--font-size-xs);
        padding: 2px 4px;
    }
    
    .hero-section {
        height: 100vh;
        min-height: 350px;
    }
    
    
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--font-size-sm);
    }
}

/* ==========================================================================
   印刷用スタイル
   ========================================================================== */
@media print {
    .header {
        position: static !important;
        background: white !important;
        color: black !important;
        border-bottom: 2px solid #333;
    }
    
    .logo-text {
        color: black !important;
        background: transparent !important;
        border: 2px solid #333 !important;
    }
    
    .header-nav a {
        color: black !important;
    }
    
    .hero-bg-svg {
        display: none;
    }
    
    .hero-text {
        color: black !important;
    }
    
    .section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .card,
    .service-card,
    .works-card,
    .news-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   ハイコントラストモード
   ========================================================================== */
@media (prefers-contrast: high) {
    .header {
        border-bottom: 3px solid white;
    }
    
    .logo-text {
        border-width: 3px;
        font-weight: var(--font-weight-black);
    }
    
    .header-nav a {
        font-weight: var(--font-weight-bold);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* ==========================================================================
   モーション軽減設定
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
    
    .creator-carousel-track {
        animation: none;
    }
    
    .hover-lift:hover,
    .hover-scale:hover {
        transform: none;
    }
}

/* ==========================================================================
   方向変更対応
   ========================================================================== */
@media (orientation: portrait) {
    .header-nav ul {
        flex-wrap: wrap;
    }
}

@media (orientation: landscape) and (max-width: 767px) {
    .header .container {
        flex-direction: row;
    }
    
    .header-nav ul {
        flex-wrap: nowrap;
    }
    
    .hero-section {
        min-height: 500px;
        height: 100vh;
    }
}

/* ==========================================================================
   ホバーが利用できないタッチデバイス
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
    .header-nav a:hover,
    .btn:hover,
    .card:hover,
    .custom-btn:hover {
        opacity: 1;
        transform: none;
    }
    
    .header-nav a:active,
    .btn:active,
    .custom-btn:active {
        opacity: 0.7;
        transform: scale(0.95);
    }
}