/* Responsive Design for Jobs Website */

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop (992px to 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 1140px;
    }
    
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet (768px to 991px) */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
        padding: 0 15px;
    }
    
    /* Header Adjustments */
    .header-content {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .search-bar {
        order: 3;
        flex-basis: 100%;
        margin: 15px 0 0 0;
        max-width: none;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    /* Navigation */
    .nav-menu {
        flex-wrap: wrap;
    }
    
    .nav-link {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    /* Content Grid */
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .bottom-footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-menu ul {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Mobile Large (576px to 767px) */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 15px;
    }
    
    /* Hide desktop navigation, show mobile menu */
    .navigation {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Header Adjustments */
    .top-bar {
        padding: 5px 0;
    }
    
    .top-bar-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .contact-info {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .contact-info span {
        margin-right: 0;
        font-size: 12px;
    }
    
    .main-header {
        padding: 10px 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo {
        align-self: flex-start;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .search-bar {
        order: 2;
        width: 100%;
        margin: 0;
    }
    
    .header-actions {
        position: absolute;
        top: 15px;
        right: 15px;
    }
    
    /* Breaking News */
    .breaking-news-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .breaking-label {
        margin-right: 0;
        align-self: flex-start;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 30px 0;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    /* Content */
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .post-card {
        padding: 20px;
    }
    
    .post-title a {
        font-size: 1.1rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .category-card {
        padding: 20px;
    }
    
    /* Ad Spaces */
    .ad-banner {
        padding: 30px 20px;
    }
    
    .ad-placeholder {
        font-size: 16px;
    }
    
    /* Footer */
    .main-footer {
        padding: 30px 0 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input {
        margin-bottom: 10px;
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* Mobile Small (up to 575px) */
@media (max-width: 575px) {
    .container {
        padding: 0 10px;
    }
    
    /* Header */
    .top-bar-content {
        font-size: 12px;
    }
    
    .social-links {
        gap: 8px;
    }
    
    .social-link {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .logo-img {
        height: 35px;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .search-input {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .search-btn {
        padding: 6px 12px;
    }
    
    .theme-toggle {
        width: 35px;
        height: 35px;
        padding: 8px;
    }
    
    /* Breaking News */
    .breaking-news {
        padding: 8px 0;
    }
    
    .breaking-label {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .ticker-content {
        font-size: 14px;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 25px 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    /* Content */
    .main-content {
        padding: 15px 0;
    }
    
    .section-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .post-card {
        padding: 15px;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .post-title a {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .post-excerpt {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .category-card {
        padding: 15px;
    }
    
    .category-card h3 {
        font-size: 1.1rem;
    }
    
    /* Ad Spaces */
    .ad-banner {
        padding: 20px 15px;
    }
    
    .ad-placeholder {
        font-size: 14px;
    }
    
    /* Footer */
    .main-footer {
        padding: 25px 0 15px;
    }
    
    .footer-section h3 {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .footer-text {
        font-size: 14px;
    }
    
    .footer-links a {
        font-size: 14px;
    }
    
    .contact-item {
        font-size: 14px;
    }
    
    .newsletter h4 {
        font-size: 14px;
    }
    
    .newsletter-form input,
    .newsletter-form button {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .bottom-footer {
        padding: 15px 0;
    }
    
    .copyright {
        font-size: 12px;
    }
    
    .footer-menu a {
        font-size: 12px;
    }
    
    .footer-menu ul {
        gap: 15px;
    }
    
    /* Mobile Menu */
    .mobile-menu {
        width: 280px;
    }
    
    .mobile-menu-header {
        padding: 15px;
    }
    
    .mobile-menu-title {
        font-size: 1.1rem;
    }
    
    .mobile-nav-menu a {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .mobile-dropdown-menu a {
        padding-left: 40px;
        font-size: 13px;
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* Extra Small Mobile (up to 375px) */
@media (max-width: 375px) {
    .container {
        padding: 0 8px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .post-card,
    .category-card {
        padding: 12px;
    }
    
    .post-title a {
        font-size: 0.95rem;
    }
    
    .mobile-menu {
        width: 260px;
    }
    
    .footer-menu ul {
        gap: 10px;
    }
    
    .footer-menu a {
        font-size: 11px;
    }
}

/* Landscape Mobile Orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 20px 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .main-header {
        padding: 8px 0;
    }
    
    .breaking-news {
        padding: 5px 0;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .breaking-news,
    .ad-space,
    .ad-banner,
    .back-to-top,
    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .post-card,
    .category-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .hero-section {
        background: none !important;
        color: #000 !important;
        padding: 20px 0;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-secondary: #000;
    }
    
    [data-theme="dark"] {
        --border-color: #fff;
        --text-secondary: #fff;
    }
    
    .post-card,
    .category-card {
        border-width: 2px;
    }
}

/* Focus Styles for Accessibility */
@media (prefers-reduced-motion: no-preference) {
    *:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    .nav-link:focus,
    .search-btn:focus,
    .theme-toggle:focus {
        outline-color: #fff;
    }
}