/*
Theme Name: Mötesmelodier
Description: Custom WordPress theme for Nina Cherla's music therapy platform
Version: 1.0
Author: Nina Cherla
*/

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=More+Sugar:wght@400&subset=latin,latin-ext&display=swap');

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Root Variables */
:root {
    --primary: #22c55e;
    --primary-light: #CEE0CE;
    --background: #CEE0CE;
    --text: #000000;
    --text-gray: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --link-color: #000000;
}

/* Base Styles */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
    text-align: justify;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

.font-sugar {
    font-family: 'More Sugar', 'Comic Sans MS', 'Marker Felt', 'Bradley Hand', cursive, sans-serif;
    font-display: swap;
    font-weight: 400;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 0.5rem 0;
    box-shadow: var(--shadow);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo img {
    height: 3rem;
    width: auto;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.main-nav a {
    color: #000000 !important;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-nav a:visited {
    color: #000000 !important;
}

.main-nav a:hover {
    color: var(--primary) !important;
}

.main-nav li.current-menu-item > a,
.main-nav li.current_page_item > a {
    color: #000000 !important;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-nav.active {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: var(--shadow);
    }

    .main-nav.active ul {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
}

/* Hero Section */
.hero-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom right, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    position: relative;
    margin-top: 4rem;
    margin-bottom: 0;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.hero-background img {
    width: 100%;
    object-fit: cover;
    object-position: top;
    max-height: none;
}

.hero-content {
    text-align: center;
    padding: 4rem 1rem;
    position: relative;
    z-index: 10;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 2rem;
    color: #000000 !important;
    text-align: center;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #6b7280 !important;
    max-width: 32rem;
    margin: 0 auto 2rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    hyphens: none;
    -webkit-hyphens: none;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-light);
    color: var(--text);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.btn:hover {
    background-color: rgba(206, 224, 206, 0.9);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.card-content {
    padding: 1.5rem;
}

.card-image {
    width: 100%;
    height: 16rem;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.card-description {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: justify;
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

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

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 64rem;
        margin: 0 auto;
    }
}

/* Sections */
.section {
    padding: 4rem 0;
}

/* Remove top padding from section immediately following hero */
.hero-section + .section {
    padding-top: 2rem;
}

/* Add top margin for pages without hero section */
.site-main > .section:first-child {
    margin-top: 6rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: var(--text);
}

/* Social Icons */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.social-icons a {
    color: var(--text);
    font-size: 3rem;
    transition: color 0.3s ease;
}

.social-icons a:hover.spotify { color: #1DB954; }
.social-icons a:hover.apple { color: #FA243C; }
.social-icons a:hover.youtube { color: #FF0000; }

/* Collapsible */
.collapsible-trigger {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.collapsible-trigger:hover {
    background: white;
    box-shadow: var(--shadow);
}

.collapsible-content {
    margin-top: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 0.375rem;
    box-shadow: var(--shadow);
}

/* Footer */
.site-footer {
    background: var(--background);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-gray);
}

/* Tab Styles */
.tabs-container {
    width: 100%;
}

.tab-trigger {
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.tab-trigger:hover {
    background: #f8fafc !important;
}

.tab-trigger.active {
    background: white !important;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.tab-content {
    width: 100%;
}

.flex {
    display: flex;
}

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

/* Utilities */
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.italic { font-style: italic; }

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Container and layout fixes */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Hero section mobile */
    .hero-section {
        padding: 1.5rem 1rem;
        min-height: auto;
        max-height: 50vh;
        overflow: hidden;
    }

    .hero-background {
        height: 50vh;
        max-height: 400px;
    }

    .hero-background img {
        object-fit: cover;
        height: 100%;
        width: 100%;
    }

    .hero-title {
        font-size: clamp(1.5rem, 8vw, 2.5rem) !important;
        margin-bottom: 1rem !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
        word-break: break-word;
        hyphens: auto;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 1.5rem !important;
        white-space: normal !important;
        max-width: none !important;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Cards and content */
    .card {
        margin: 0 1rem;
    }

    .card-content {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    /* Navigation mobile */
    .site-header .container {
        padding: 0 1rem;
    }

    .site-logo img {
        height: 2rem;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: var(--shadow);
        padding: 1rem;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.25rem;
        cursor: pointer;
        color: var(--text);
    }

    /* Grid responsive */
    .grid {
        gap: 1rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    /* Text and typography */
    .card-description {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    /* Media tabs */
    .tab-list {
        width: 100% !important;
        max-width: none !important;
    }

    .tab-trigger {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.9rem;
    }

    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Contact blocks */
    div[style*="max-width: 600px"] {
        margin: 0 1rem !important;
        max-width: none !important;
    }

    /* Override any fixed widths */
    .hero-subtitle {
        max-width: none;
        white-space: normal;
    }

    /* Fix hero content spacing */
    .hero-content {
        padding: 1rem 0 !important;
    }

    /* Ensure sections don't have excessive margins */
    .section {
        margin-top: 1rem !important;
        padding-top: 1rem !important;
    }

    /* Fix top margin for pages without hero on mobile */
    .site-main > .section:first-child {
        margin-top: 5rem !important;
        padding-top: 1rem !important;
    }
}

/* Safari Mobile specific fixes */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        .hero-title {
            -webkit-hyphens: auto !important;
            -webkit-hyphenate-limit-before: 3 !important;
            -webkit-hyphenate-limit-after: 3 !important;
            word-break: break-word !important;
            overflow-wrap: break-word !important;
            white-space: normal !important;
            -webkit-line-break: after-white-space !important;
        }

        .hero-subtitle {
            -webkit-hyphens: auto !important;
            word-break: break-word !important;
            overflow-wrap: break-word !important;
            white-space: normal !important;
            text-align: center !important;
        }

        .hero-section {
            -webkit-text-size-adjust: 100% !important;
            text-size-adjust: 100% !important;
        }
    }
}

/* Text Justification and Word Breaking */
p {
    text-align: justify;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

li {
    text-align: justify;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Prevent horizontal overflow */
* {
    max-width: 100%;
    box-sizing: border-box;
}

img, iframe, video {
    max-width: 100%;
    height: auto;
}

/* Better mobile text rendering */
@media (max-width: 480px) {
    body {
        font-size: 14px;
        line-height: 1.5;
    }

    /* Force mobile hero fixes */
    .hero-section .hero-title {
        font-size: 1.5rem !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
        text-align: center !important;
        max-width: 100% !important;
    }

    .hero-section .hero-subtitle {
        font-size: 0.9rem !important;
        white-space: normal !important;
        text-align: center !important;
        max-width: 100% !important;
        margin-bottom: 1rem !important;
        line-height: 1.4 !important;
    }

    .hero-section {
        padding: 1rem !important;
        min-height: 60vh !important;
        max-height: 60vh !important;
    }

    .hero-content {
        padding: 0.5rem !important;
        text-align: center !important;
    }

    .card-content {
        padding: 1rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }
}