/* =========================================
   レスポンシブ対応スタイルシート
   モバイルファースト設計
   ========================================= */

/* Tablet (768px以下) */
@media (max-width: 768px) {
    /* Typography */
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.35rem;
    }

    /* Section */
    .section {
        padding: 60px 0;
    }

    .section-title {
        margin-bottom: 40px;
    }

    /* Header */
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: flex-start;
        padding: 40px 20px;
        gap: 20px;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu a {
        font-size: 1.2rem;
        width: 100%;
        padding: 15px;
        border-bottom: 1px solid var(--gray-light);
    }

    .header-contact {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }

    .phone-number {
        font-size: 1.1rem;
        text-align: center;
        padding: 10px;
        background: var(--gray-light);
        border-radius: 5px;
    }

    .cta-button {
        width: 100%;
        text-align: center;
        padding: 15px;
    }

    .hamburger {
        display: flex;
    }

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

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

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

    /* Hero */
    .hero {
        height: 500px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 15px 30px;
    }

    /* Service Cards */
    .service-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Works Gallery */
    .works-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Contact Buttons */
    .contact-buttons {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .contact-btn {
        padding: 18px;
        font-size: 1rem;
    }

    /* Info Table */
    .info-table {
        font-size: 0.9rem;
    }

    .info-table th,
    .info-table td {
        padding: 10px;
        display: block;
        width: 100%;
    }

    .info-table th {
        background: var(--primary-color);
        border-bottom: none;
    }

    .info-table td {
        border-top: none;
        margin-bottom: 20px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Mobile (480px以下) */
@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 15px;
    }

    /* Typography */
    html {
        font-size: 13px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    /* Header */
    :root {
        --header-height: 70px;
    }

    .logo {
        font-size: 1.2rem;
    }

    /* Hero */
    .hero {
        height: 400px;
        padding: 20px;
    }

    .hero-content h1 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .hero-content p {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }

    /* Section */
    .section {
        padding: 40px 0;
    }

    /* Service Card */
    .service-card {
        padding: 30px 20px;
    }

    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    /* Work Item */
    .work-item img {
        height: 200px;
    }

    /* Form */
    .form-control {
        padding: 10px 12px;
    }

    .file-upload-area {
        padding: 30px 20px;
    }

    .file-upload-area i {
        font-size: 2.5rem;
    }

    .file-preview {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .file-preview-item img {
        height: 80px;
    }

    /* Button */
    .btn-submit {
        padding: 15px;
        font-size: 1.1rem;
    }

    /* Contact Button */
    .contact-btn {
        padding: 16px;
        font-size: 0.95rem;
    }

    .contact-btn i {
        font-size: 1.3rem;
    }
}

/* Desktop Large (1400px以上) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    .hero {
        height: 700px;
    }

    .hero-content h1 {
        font-size: 3.5rem;
    }

    .hero-content p {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .hamburger,
    .hero-buttons,
    .cta-button,
    .contact-btn,
    .btn-submit,
    .footer {
        display: none !important;
    }

    .hero {
        height: auto;
        margin-top: 0;
        padding: 40px 20px;
    }

    body {
        font-size: 12pt;
    }

    a {
        text-decoration: underline;
    }

    .section {
        page-break-inside: avoid;
    }
}

/* Accessibility - High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0052A3;
        --secondary-color: #CC5500;
        --text-color: #000000;
    }

    .form-control:focus {
        outline: 3px solid var(--primary-color);
    }

    .btn-primary,
    .btn-secondary,
    .cta-button {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1A1A1A;
        --text-color: #E0E0E0;
        --gray-light: #2A2A2A;
        --gray-medium: #404040;
    }

    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }

    .header {
        background: rgba(26, 26, 26, 0.98);
    }

    .service-card,
    .feature-item {
        background: var(--gray-light);
    }

    .form-control {
        background: var(--gray-light);
        color: var(--text-color);
        border-color: var(--gray-medium);
    }

    .info-table tr:nth-child(even) {
        background: var(--gray-light);
    }
}
