/* ================================================================
   MOBILE & RESPONSIVE STYLESHEET
   Optimizations for consistent mobile view across all pages
   ================================================================ */

/* ===== MOBILE MENU STYLES ===== */
@media (max-width: 768px) {
    /* Header adjustments for mobile */
    header {
        padding: 12px 15px !important;
        background-color: rgba(26, 58, 109, 0.95);
    }

    .has-announcement header {
        top: 35px;
    }

    /* Logo responsive sizing */
    .logo {
        flex: 1;
    }

    .logo img {
        height: 55px;
    }

    .site-name {
        font-size: 1.6rem;
        line-height: 1.1;
    }

    /* Mobile menu toggle button */
    .menu-toggle {
        display: flex !important;
        font-size: 1.3rem;
    }

    /* Mobile navigation menu */
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        max-width: 80%;
        height: 100vh;
        background: rgba(26, 58, 109, 0.98);
        transition: right 0.3s ease;
        z-index: 1100;
        overflow-y: auto;
        padding-top: 60px;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
        padding: 0;
    }

    nav ul li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav ul li a {
        width: 100%;
        text-align: left;
        padding: 12px 20px;
        border-radius: 0;
        font-size: 0.9rem;
    }

    /* Mobile dropdown menu */
    .dropdown-content {
        position: static !important;
        display: none;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.05) !important;
        box-shadow: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        margin-top: 0 !important;
        transform: none !important;
        border-radius: 0;
    }

    .dropdown.active .dropdown-content {
        display: block !important;
    }

    .dropdown-content a {
        color: rgba(255, 255, 255, 0.8) !important;
        padding: 10px 20px 10px 40px !important;
        border-bottom: none;
        text-transform: none;
    }

    .dropdown-content a:hover {
        background-color: rgba(255, 255, 255, 0.1) !important;
        color: var(--white) !important;
        padding-left: 40px !important;
    }

    /* Mobile menu close button */
    .mobile-menu-close {
        display: flex !important;
        position: absolute;
        top: 12px;
        right: 15px;
        z-index: 1101;
    }

    /* Announcement bar on mobile */
    .announcement-bar {
        padding: 0.4rem 2.5rem 0.4rem 0.8rem;
        font-size: 0.75rem;
        line-height: 1.2;
    }

    .close-announcement {
        right: 0.3rem;
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    /* Hero section mobile */
    .hero {
        min-height: 400px;
        height: auto;
        padding: 60px 20px;
    }

    .hero-content {
        padding: 0 15px;
    }

    .welcome-text {
        font-size: 1.4rem;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .hero-button {
        width: 100%;
    }

    .scroll-indicator {
        display: none;
    }

    /* Section spacing on mobile */
    .section {
        padding: 3rem 0;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    /* Grids on mobile */
    .values-grid,
    .connect-grid,
    .event-cards,
    .beliefs-grid,
    .team-grid,
    .leadership-grid,
    .worship-features {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    /* Cards on mobile */
    .value-card,
    .connect-card,
    .event-card,
    .belief-card,
    .team-card,
    .pastor-card,
    .leader-card {
        padding: 1.5rem;
    }

    /* Icons on mobile */
    .value-icon,
    .connect-icon {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }

    /* Footer on mobile */
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1.5rem;
    }

    .link-group {
        padding: 0;
    }

    /* Forms on mobile */
    .form-container {
        padding: 20px;
        border-radius: 8px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group {
        flex: none;
    }

    .submit-btn {
        width: 100%;
        padding: 12px 20px;
    }

    /* Chat widget on mobile */
    .chat-box {
        width: 100%;
        max-width: 90vw;
        height: 400px;
        bottom: 70px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    /* Story section on mobile */
    .story-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .story-text {
        padding-right: 0;
    }

    .story-image {
        max-width: 100%;
        order: -1;
    }

    .story-image img {
        max-height: 300px;
    }

    /* Leadership tabs on mobile */
    .leadership-tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .leadership-tab {
        width: 100%;
        text-align: center;
    }

    /* Pastors grid on mobile */
    .pastors-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Worship features on mobile */
    .worship-content {
        padding: 0 15px;
    }

    .worship-text {
        max-width: 100%;
    }

    /* Buttons on mobile */
    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.8rem;
    }

    /* Modal/Dialog adjustments */
    @supports (display: flex) {
        .modal {
            width: 95vw;
            max-width: 100%;
            padding: 20px;
        }
    }
}

/* ===== EXTRA SMALL DEVICES (480px and below) ===== */
@media (max-width: 480px) {
    /* Header extra small */
    header {
        padding: 10px 12px;
    }

    .logo img {
        height: 50px;
    }

    .site-name {
        font-size: 1.3rem;
    }

    .menu-toggle {
        font-size: 1.1rem;
    }

    /* Announcement bar extra small */
    .announcement-bar {
        padding: 0.3rem 2rem 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    .close-announcement {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    /* Navigation extra small */
    nav {
        width: 100%;
        max-width: 100%;
    }

    /* Hero extra small */
    .hero {
        min-height: 350px;
        padding: 40px 15px;
    }

    .welcome-text {
        font-size: 1.2rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.75rem;
    }

    /* Section titles extra small */
    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    /* Cards extra small */
    .value-card,
    .connect-card,
    .event-card,
    .belief-card {
        padding: 1.2rem;
        border-radius: 10px;
    }

    .value-icon,
    .connect-icon {
        width: 65px;
        height: 65px;
        font-size: 1.6rem;
    }

    /* Footer extra small */
    .footer-content {
        gap: 1.5rem;
    }

    .footer-info h3 {
        font-size: 1.25rem;
    }

    .footer-info p {
        font-size: 0.85rem;
    }

    .link-group h3 {
        font-size: 1rem;
    }

    .link-group ul li a {
        font-size: 0.8rem;
    }

    /* Chat widget extra small */
    .chat-box {
        width: calc(100% - 20px);
        height: 350px;
        bottom: 60px;
    }

    .chat-button {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    /* Form extra small */
    .form-container {
        padding: 15px;
    }

    input, select, textarea {
        padding: 10px 12px;
        font-size: 14px;
    }

    label {
        font-size: 0.9rem;
    }

    .submit-btn {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    /* Grids extra small - all 1 column */
    .beliefs-grid,
    .team-grid,
    .leadership-grid {
        grid-template-columns: 1fr;
    }

    /* Image heights extra small */
    .team-image,
    .pastor-image,
    .leader-image {
        height: 200px;
    }

    .story-image img {
        max-height: 250px;
    }
}

/* ===== DEVICE ORIENTATION ===== */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 8px 15px;
    }

    .logo img {
        height: 45px;
    }

    .site-name {
        font-size: 1.3rem;
    }

    .hero {
        min-height: 300px;
        padding: 30px 20px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .section {
        padding: 2rem 0;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets on mobile */
    .btn,
    .hero-button,
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .value-card:hover,
    .connect-card:hover,
    .event-card:hover,
    .btn:hover {
        box-shadow: var(--shadow-sm);
        transform: none;
    }

    /* Better tap feedback */
    .btn,
    button,
    a {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    header,
    footer,
    nav,
    .menu-toggle,
    .chat-widget,
    .announcement-bar {
        display: none;
    }

    body {
        background: white;
    }

    .container {
        max-width: 100%;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== HIGH DPI SCREENS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}
