/**
 * GinecologPlus Medical Theme - Responsive Styles
 * @version 1.0.0
 */

/* ==========================================================================
   Breakpoints:
   - Mobile: < 576px
   - Tablet: 576px - 991px
   - Desktop: 992px+
   ========================================================================== */

/* ==========================================================================
   Mobile First - Base styles for small screens
   ========================================================================== */
@media (max-width: 575.98px) {
    :root {
        --header-height: 60px;
    }
    
    /* Typography */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    
    /* Top Bar */
    .top-bar {
        display: none;
    }
    
    /* Header */
    .site-branding {
        flex: 1;
    }
    
    .site-title {
        font-size: 1rem;
    }
    
    .site-description {
        display: none;
    }
    
    .custom-logo {
        max-height: 40px;
    }
    
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Main Navigation - Hidden on mobile */
    .main-navigation {
        display: none;
    }
    
    /* Hero Section */
    .hero-section {
        min-height: 400px;
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    /* Doctors Grid */
    .doctors-grid {
        grid-template-columns: 1fr;
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Contact Grid */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .maps-container {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Sidebar */
    .widget-area {
        padding-left: 0;
        margin-top: 2rem;
    }
    
    /* Services Sidebar - Not sticky on mobile */
    .services-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
    
    /* Page Header */
    .page-header {
        padding: 1.5rem 0;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    /* Post Navigation */
    .post-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-previous,
    .nav-next {
        max-width: 100%;
        text-align: left;
    }
    
    /* Forms */
    .contact-form {
        padding: 1.5rem;
    }
    
    /* Tables */
    .entry-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Sticky Appointment Button */
    .appointment-btn-sticky {
        display: block;
    }
    
    /* Add padding to body for sticky button */
    body {
        padding-bottom: 60px;
    }
}

/* ==========================================================================
   Tablet - Medium screens (576px - 991px)
   ========================================================================== */
@media (min-width: 576px) and (max-width: 991.98px) {
    :root {
        --header-height: 70px;
    }
    
    /* Top Bar */
    .top-bar .container {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .top-bar-left,
    .top-bar-center,
    .top-bar-right {
        width: 100%;
        justify-content: center;
    }
    
    /* Header */
    .site-title {
        font-size: 1.125rem;
    }
    
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Main Navigation - Hidden on tablet */
    .main-navigation {
        display: none;
    }
    
    /* Hero Section */
    .hero-section {
        min-height: 450px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Doctors Grid */
    .doctors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Contact Grid */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Footer */
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Sidebar */
    .widget-area {
        padding-left: 0;
        margin-top: 2rem;
    }
    
    /* Services Sidebar */
    .services-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}

/* ==========================================================================
   Desktop - Large screens (992px+)
   ========================================================================== */
@media (min-width: 992px) {
    /* Mobile Navigation - Hidden on desktop */
    .mobile-navigation {
        display: none !important;
    }
    
    /* Mobile Menu Toggle - Hidden on desktop */
    .mobile-menu-toggle {
        display: none;
    }
    
    /* Main Navigation - Visible on desktop */
    .main-navigation {
        display: flex;
    }
    
    /* Two column layout for pages with sidebar */
    .has-sidebar .site-main .container {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 3rem;
    }
    
    /* Services page layout */
    .services-layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 3rem;
    }
}

/* ==========================================================================
   Large Desktop - Extra large screens (1200px+)
   ========================================================================== */
@media (min-width: 1200px) {
    .container {
        padding: 0 2rem;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Doctors Grid */
    .doctors-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    /* Hide unnecessary elements */
    .top-bar,
    .site-header,
    .mobile-menu-toggle,
    .mobile-navigation,
    .appointment-btn-sticky,
    .site-footer,
    .breadcrumbs,
    .post-navigation,
    .social-sharing,
    .sidebar,
    .services-sidebar,
    .btn,
    button {
        display: none !important;
    }
    
    /* Reset styles for print */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    /* Ensure content is visible */
    .site-main {
        min-height: auto;
        padding: 0;
    }
    
    /* Links */
    a {
        color: #000;
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 90%;
        opacity: 0.8;
    }
    
    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    img {
        page-break-inside: avoid;
        max-width: 100% !important;
    }
    
    p, li {
        orphans: 3;
        widows: 3;
    }
    
    /* Tables */
    table {
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   High Contrast Mode (Accessibility)
   ========================================================================== */
@media (prefers-contrast: high) {
    :root {
        --text-color: #000;
        --bg-light: #fff;
        --border-color: #000;
    }
    
    .btn {
        border: 2px solid #000;
    }
    
    a:focus,
    button:focus,
    input:focus,
    textarea:focus {
        outline: 3px solid #000;
        outline-offset: 2px;
    }
}

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

/* ==========================================================================
   Dark Mode Support (Optional)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    :root {
        --text-color: #e0e0e0;
        --text-light: #b0b0b0;
        --bg-light: #1a1a1a;
        --bg-white: #2d2d2d;
        --border-color: #404040;
    }
    
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .site-header {
        background-color: #2d2d2d;
    }
    
    .dropdown-menu {
        background-color: #2d2d2d;
    }
    */
}

/* ==========================================================================
   Touch Device Optimizations
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-menu a,
    .btn,
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .service-card:hover,
    .doctor-card:hover {
        transform: none;
    }
    
    /* Show dropdown menus on click instead of hover */
    .dropdown-menu {
        display: none;
    }
    
    .nav-menu li.active > .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
}

/* ==========================================================================
   Landscape Orientation on Mobile
   ========================================================================== */
@media (max-width: 767.98px) and (orientation: landscape) {
    .hero-section {
        min-height: 300px;
    }
    
    .mobile-navigation {
        top: var(--header-height);
    }
}

/* ==========================================================================
   iOS Safe Area Support (Notch devices)
   ========================================================================== */
@supports (padding: max(0px)) {
    .site-header,
    .top-bar,
    .appointment-btn-sticky {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .appointment-btn-sticky {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}
