/* ============================================
   CUORE DI LUNA - Responsive Styles
   ============================================ */

/* ==================== LARGE SCREENS (1200px+) ==================== */
@media (min-width: 1400px) {
    :root {
        --container-max: 1320px;
    }

    .pietre-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==================== DESKTOP (992px - 1199px) ==================== */
@media (max-width: 1199px) {
    :root {
        --space-2xl: 4rem;
        --space-3xl: 6rem;
    }

    .filosofia-grid {
        gap: var(--space-xl);
    }

    .filosofia-content {
        padding-right: var(--space-md);
    }

    .chi-siamo-content {
        gap: var(--space-xl);
    }

    .contatti-grid {
        gap: var(--space-xl);
    }
}

/* ==================== TABLET (768px - 991px) ==================== */
@media (max-width: 991px) {
    :root {
        --space-2xl: 3rem;
        --space-3xl: 5rem;
    }

    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: var(--space-lg);
        gap: var(--space-md);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu a {
        font-size: 1rem;
        padding: var(--space-sm);
    }

    .nav-toggle {
        display: flex;
    }

    /* Hero */
    .hero-content {
        padding: var(--space-md);
    }

    /* Filosofia */
    .filosofia-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .filosofia-content {
        padding-right: 0;
        order: 2;
    }

    .filosofia-image {
        order: 1;
    }

    .image-placeholder {
        min-height: 300px;
    }

    /* Chakra Carousel */
    .chakra-carousel {
        max-width: 500px;
        height: 350px;
    }

    .chakra-item {
        width: 120px;
    }

    .chakra-circle {
        width: 80px;
        height: 80px;
    }

    .detail-body {
        grid-template-columns: 1fr;
    }

    /* Pietre Grid */
    .pietre-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-buttons {
        justify-content: flex-start;
    }

    /* Collezioni */
    .collezione-card {
        flex: 0 0 calc(100% - var(--space-md));
    }

    /* Chi Siamo */
    .chi-siamo-content {
        grid-template-columns: 1fr;
    }

    .story-image {
        position: relative;
        top: 0;
    }

    .image-placeholder.large {
        min-height: 350px;
    }

    .values-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Contatti */
    .contatti-grid {
        grid-template-columns: 1fr;
    }

    .contatti-info {
        padding-top: 0;
    }
}

/* ==================== MOBILE LANDSCAPE (576px - 767px) ==================== */
@media (max-width: 767px) {
    :root {
        --space-xl: 2rem;
        --space-2xl: 2.5rem;
        --space-3xl: 4rem;
        --container-padding: 1rem;
    }

    /* Typography */
    .section-description {
        font-size: 1rem;
    }

    /* Hero */
    .hero {
        min-height: 100svh;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-cta {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    /* Filosofia */
    .filosofia-values {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-lg);
    }

    /* Chakra */
    .chakra-carousel-container {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .carousel-arrow {
        display: none;
    }

    .chakra-carousel {
        height: 300px;
        max-width: 100%;
    }

    .chakra-item {
        width: 100px;
    }

    .chakra-circle {
        width: 70px;
        height: 70px;
    }

    .chakra-name {
        font-size: 1rem;
    }

    .chakra-detail-content {
        padding: var(--space-md);
    }

    .detail-title {
        font-size: 1.5rem;
    }

    /* Pietre */
    .pietre-filters {
        overflow-x: auto;
        padding-bottom: var(--space-sm);
    }

    .filter-buttons {
        flex-wrap: nowrap;
        padding-bottom: var(--space-xs);
    }

    .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .pietre-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* Collezioni */
    .collezione-card {
        flex: 0 0 100%;
    }

    .collezione-content {
        padding: var(--space-md);
    }

    .collezione-name {
        font-size: 1.5rem;
    }

    /* Quiz */
    .quiz-content {
        padding: var(--space-lg);
    }

    .quiz-btn {
        width: 100%;
        justify-content: center;
    }

    .result-actions {
        flex-direction: column;
    }

    /* Chi Siamo */
    .values-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .value-card {
        padding: var(--space-md);
    }

    /* Contatti */
    .contatti-form-container {
        padding: var(--space-lg);
    }

    .info-card {
        padding: var(--space-lg);
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-lg);
    }

    .footer-nav {
        justify-content: center;
        gap: var(--space-md);
    }

    .footer-social {
        justify-content: center;
    }
}

/* ==================== MOBILE PORTRAIT (max-width: 575px) ==================== */
@media (max-width: 575px) {
    :root {
        --space-lg: 1.5rem;
        --space-xl: 1.75rem;
        --space-2xl: 2rem;
        --space-3xl: 3rem;
    }

    /* Navigation */
    .nav-container {
        padding: var(--space-sm) var(--container-padding);
    }

    .nav-logo {
        font-size: 1.25rem;
    }

    .nav-menu {
        top: 56px;
        padding: var(--space-md);
    }

    /* Hero */
    .hero-content {
        padding: var(--space-sm);
    }

    .hero-cta {
        width: 100%;
        justify-content: center;
    }

    .scroll-indicator {
        bottom: 1rem;
    }

    /* Section Headers */
    .section-header {
        margin-bottom: var(--space-xl);
    }

    /* Filosofia */
    .filosofia-values {
        gap: var(--space-md);
    }

    .value-item {
        min-width: 80px;
    }

    .value-icon {
        width: 40px;
        height: 40px;
    }

    .value-icon svg {
        width: 20px;
        height: 20px;
    }

    /* Chakra */
    .chakra-carousel {
        height: 250px;
    }

    .chakra-item {
        width: 90px;
    }

    .chakra-circle {
        width: 60px;
        height: 60px;
    }

    .chakra-number {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
    }

    .detail-header {
        margin-bottom: var(--space-md);
    }

    .info-item {
        flex-direction: column;
        gap: var(--space-xs);
    }

    /* Pietre */
    .pietra-content {
        padding: var(--space-sm);
    }

    .pietra-name {
        font-size: 1.1rem;
    }

    .pietra-description {
        font-size: 0.85rem;
    }

    /* Quiz */
    .quiz-content {
        padding: var(--space-md);
    }

    .quiz-illustration {
        max-width: 100px;
    }

    .result-stone {
        font-size: 2rem;
    }

    .image-placeholder.result {
        min-height: 180px;
    }

    /* Contatti */
    .contatti-form-container {
        padding: var(--space-md);
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .info-card {
        padding: var(--space-md);
    }

    .info-item {
        flex-direction: row;
    }

    .info-icon {
        width: 40px;
        height: 40px;
    }

    .info-icon svg {
        width: 18px;
        height: 18px;
    }

    /* Footer */
    .footer-nav {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .footer-disclaimer small {
        font-size: 0.75rem;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-body {
        padding: var(--space-md);
    }
}

/* ==================== EXTRA SMALL (max-width: 360px) ==================== */
@media (max-width: 360px) {
    :root {
        --container-padding: 0.75rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .chakra-carousel {
        height: 220px;
    }

    .chakra-circle {
        width: 50px;
        height: 50px;
    }

    .chakra-name {
        font-size: 0.9rem;
    }
}

/* ==================== LANDSCAPE ORIENTATION ==================== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-3xl) 0;
    }

    .scroll-indicator {
        display: none;
    }
}

/* ==================== HIGH DPI SCREENS ==================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    .image-placeholder {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }

    .main-nav,
    .scroll-indicator,
    .hero-particles,
    .carousel-arrow,
    .collezioni-nav,
    .quiz-section,
    .modal,
    .footer-social {
        display: none !important;
    }

    section {
        page-break-inside: avoid;
        padding: 2rem 0;
    }

    .hero {
        min-height: auto;
        padding: 2rem 0;
    }

    .pietre-grid,
    .values-grid {
        display: block;
    }

    .pietra-card,
    .value-card {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* ==================== DARK MODE PREFERENCE ==================== */
@media (prefers-color-scheme: dark) {
    /*
     * Note: This site uses a light theme by design.
     * If you want to add dark mode support in the future,
     * uncomment and customize the rules below.
     */
    /*
    :root {
        --bg-primary: #1a1a1f;
        --bg-secondary: #242428;
        --bg-accent: #2d2d33;
        --text-primary: #f5f0e8;
        --text-secondary: #a0a0b0;
    }
    */
}

/* ==================== ACCESSIBILITY ==================== */

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    background: var(--accent-gold);
    color: white;
    z-index: 9999;
    border-radius: var(--radius-md);
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 1rem;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
    }

    .filter-btn,
    .option-btn {
        border-width: 2px;
    }
}
