/**
 * Violin Academy — Responsive Styles
 *
 * Optimiert für Mobile Performance & PageSpeed Score
 *
 * @package Violin_Academy
 */

/* ==========================================================================
   Tablet (max-width: 992px)
   ========================================================================== */

@media (max-width: 992px) {
    h1 { font-size: 2.75rem; }
    h2 { font-size: 2.25rem; }

    .section-title {
        font-size: 2.25rem;
    }

    /* Hero — full-width image on top, text below */
    .section-hero {
        min-height: auto;
        padding: 0;
        display: block;
        background: var(--color-surface) !important;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .hero-image-col {
        display: block;
        order: -1;
        margin: 0 calc(-1 * var(--spacing-md));
        width: calc(100% + 2 * var(--spacing-md));
        height: auto;
        min-height: 0;
        max-height: none;
        position: static;
    }

    .hero-image-shape {
        border-radius: 0;
        height: auto;
        box-shadow: none;
        position: static;
    }

    .hero-image-shape::before {
        display: none;
    }

    .hero-img {
        width: 100%;
        height: auto;
        object-fit: cover;
        max-height: 50vh;
        display: block;
    }

    .hero-text {
        padding: var(--spacing-lg) 0;
    }

    .hero-title {
        font-size: 3.75rem;
    }

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

    .btn,
    .section-hero .btn-accent {
        padding: 1rem 2rem;
        font-size: 0.9375rem;
        min-height: 48px;
    }

    /* Pädagogik */
    .paedagogik-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .paedagogik-mosaic-col--offset {
        padding-top: 0;
    }

    .paedagogik-images {
        display: none;
    }

    /* Angebot Cards — swipe slideshow */
    .section-angebot {
        overflow-x: clip;
    }

    .angebot-cards-wrapper {
        position: relative;
        padding: 0 1rem;
    }

    .angebot-cards {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        align-items: stretch;
        gap: 0;
        padding: 0;
        scrollbar-width: none;
    }

    .angebot-cards::-webkit-scrollbar {
        display: none;
    }

    .angebot-card-v2 {
        flex: 0 0 100%;
        scroll-snap-align: start;
        min-width: 0;
        border-radius: 0;
        margin: 0;
    }

    .angebot-card-v2--featured {
        transform: none;
        order: -1;
    }

    .angebot-card-v2:hover {
        transform: none;
        box-shadow: none;
    }

    .angebot-card-v2--featured:hover {
        transform: none;
        box-shadow: none;
    }

    /* Slide arrows */
    .angebot-slide-arrow {
        display: flex;
    }

    /* Rezensionen */
    .rezensionen-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }

    .rezensionen-divider {
        margin-left: auto;
        margin-right: auto;
    }

    .rezension-quote {
        padding-left: 0;
    }

    .rezension-mark {
        position: static;
        display: block;
        margin-bottom: 0.5rem;
    }

    /* About */
    .about-inner-v2 {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .about-inner-v2 .about-portrait {
        order: -1;
    }

    .about-portrait-img {
        height: 400px;
    }

    .about-name {
        font-size: 2.75rem;
    }

    .about-stats {
        justify-content: flex-start;
    }

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

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-md);
    }

    .footer-brand-col {
        padding-right: 0;
    }

    .footer-brand-desc {
        margin-left: auto;
        margin-right: auto;
    }

    .footer-link-list {
        flex-direction: row;
        justify-content: center;
        gap: var(--spacing-md);
    }

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

    .footer-logo {
        display: flex;
        justify-content: center;
    }

    /* Kontakt */
    .kontakt-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Header CTA hidden on tablet */
    .header-cta {
        display: none;
    }

    /* Mobile Navigation — auch auf Tablet */
    .header-lang-mobile {
        display: block;
        margin-left: auto;
        margin-right: 0.5rem;
    }

    .header-lang-mobile .lang-switcher {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: none;
        padding-top: 0;
        margin-top: 0;
        gap: 0;
    }

    .header-lang-mobile .lang-item {
        font-size: 1rem;
        padding: 0.5rem 0.4rem;
        min-width: 40px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-navigation .lang-switcher {
        display: none;
    }

    .menu-toggle {
        display: flex;
        padding: 12px;
        min-width: 48px;
        min-height: 48px;
        justify-content: center;
    }

    .main-navigation {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        height: 100dvh;
        background: var(--color-surface);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: var(--spacing-lg) var(--spacing-md);
        overflow-y: auto;
        display: none;
    }

    .main-navigation.is-open {
        display: flex;
    }

    .primary-menu {
        flex-direction: column;
        gap: 0;
        align-items: center;
        width: 100%;
        max-width: 280px;
    }

    .primary-menu li {
        width: 100%;
        text-align: center;
    }

    .primary-menu li a {
        display: block;
        padding: 1rem 0;
        font-size: 1.125rem;
        font-weight: 500;
        opacity: 0.85;
        min-height: 48px;
        text-align: center;
        border: none;
    }

    .primary-menu li a:hover {
        opacity: 1;
    }

    .lang-switcher {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        padding-top: var(--spacing-lg);
        justify-content: center;
        border-top: 1px solid var(--color-border);
        margin-top: var(--spacing-md);
        width: 100%;
        max-width: 280px;
    }

    /* Hamburger Animation */
    .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* ==========================================================================
   Mobile (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
        --spacing-2xl: 5rem;
        --header-height: 80px;
    }

    .site-branding .custom-logo {
        max-height: 62px;
        padding: 6px 0;
    }

    /* Über mich page — sticky off */
    .ueber-hero-v2__inner {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .ueber-hero-v2__portrait-sticky {
        position: relative;
        top: 0;
        height: 50svh;
        overflow: hidden;
    }

    .ueber-hero-v2__portrait-sticky::after {
        width: 100%;
        height: 30%;
        top: auto;
        bottom: 0;
        right: 0;
        background: linear-gradient(
            to bottom,
            rgba(249, 249, 247, 0) 0%,
            rgba(249, 249, 247, 1) 100%
        );
    }

    .ueber-hero-v2__text {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .ueber-hero-v2__title {
        font-size: 2.5rem;
    }

    .ueber-testimonials .rezensionen-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .ueber-testimonials .rezensionen-divider {
        margin-left: auto;
        margin-right: auto;
    }

    /* Hero — disable background image overlay on mobile (image shown inline) */
    .section-hero[data-bg] {
        background: var(--color-surface) !important;
    }

    .section-hero[data-bg]::before {
        display: none;
    }

    .hero-title {
        font-size: 3.25rem;
    }

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

    .hero-buttons {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-buttons .btn {
        text-align: center;
    }

    /* Tipps */
    .tipps-grid {
        grid-template-columns: 1fr;
    }

    /* Newsletter CTA */
    .newsletter-cta {
        padding: 4rem 0;
    }

    .newsletter-cta__title {
        font-size: 2.5rem;
    }

    .newsletter-cta__row {
        grid-template-columns: 1fr;
    }

    /* Tutorials Filter */
    .tutorials-search {
        flex-direction: column;
    }

    .tutorials-search input {
        border-right: 1px solid var(--color-border);
        border-radius: 6px;
    }

    .tutorials-search .btn {
        border-radius: 6px;
    }

    .tutorials-hero__title {
        font-size: 2.5rem;
    }

    /* Page Headers */
    .kontakt-hero__title,
    .page-hero__title,
    .single-hero__title {
        font-size: 2.5rem;
    }

    /* Disable expensive effects on mobile */
    .hero-img {
        filter: none !important;
        transition: none !important;
    }

    .site-header {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    /* Fade-in faster on mobile */
    .fade-in {
        transition-duration: 0.3s;
    }

    /* Touch targets — min 48px */
    .pagination .page-numbers {
        width: 48px;
        height: 48px;
    }

    .social-icon {
        width: 48px;
        height: 48px;
    }

    .category-filter,
    .faq-cat-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* iOS Input Zoom Prevention */
    input[type="text"],
    input[type="email"],
    input[type="url"],
    input[type="tel"],
    input[type="search"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ==========================================================================
   Small Mobile (max-width: 480px)
   ========================================================================== */

@media (max-width: 480px) {
    .footer-link-list {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-xs);
    }

    :root {
        --spacing-md: 1.5rem;
        --spacing-lg: 2rem;
        --spacing-xl: 3rem;
        --spacing-2xl: 4rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    h1 { font-size: 2rem; }

    .hero-title {
        font-size: 2.75rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .btn {
        padding: 1rem 2rem;
        font-size: 0.9375rem;
        min-height: 48px;
    }

    .kontakt-form-card {
        padding: var(--spacing-md);
    }

    .newsletter-cta__title {
        font-size: 2rem;
    }

    .about-name {
        font-size: 2.25rem;
    }

    .rezension-zitat {
        font-size: 1.125rem;
    }
}

/* ==========================================================================
   Prefers Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-img {
        filter: none !important;
        transition: none !important;
    }

    .tipp-card,
    .angebot-card-v2 {
        transition: none !important;
    }

    .tipp-card:hover,
    .angebot-card-v2:hover {
        transform: none !important;
    }

    .tipp-image img {
        transition: none !important;
    }

    .tipp-card:hover .tipp-image img {
        transform: none !important;
    }

    * {
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .menu-toggle,
    .hero-buttons,
    .section-buchung,
    .newsletter-cta,
    .footer-social,
    .cookie-banner,
    .btn {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

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

    .site-footer {
        background: #fff !important;
        color: #000 !important;
    }
}
