/**
 * Tactical Legacy Theme - Responsive Stylesheet
 * 
 * Mobile-first responsive design for all screen sizes
 * Maintains original color scheme and brand identity
 * 
 * @package Tactical_Legacy
 * @since 1.0.4
 */

/* ==========================================================================
   MOBILE FIRST - BASE STYLES (320px+)
   ========================================================================== */

/* Ensure all images are responsive by default */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent horizontal scroll on mobile */
body {
    overflow-x: hidden;
}

/* ==========================================================================
   HAMBURGER MENU - ALWAYS VISIBLE ON MOBILE/TABLET
   ========================================================================== */

/* Show hamburger menu on all devices up to 991px */
@media screen and (max-width: 991px) {
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
        z-index: 10001;
        position: relative;
        width: 44px;
        height: 44px;
        transition: all 0.3s ease;
    }

    .menu-toggle:hover {
        opacity: 0.7;
    }

    .menu-toggle:focus {
        outline: 2px solid #C8A96A;
        outline-offset: 2px;
    }

    /* Hamburger Icon Container */
    .menu-toggle-icon {
        display: block;
        position: relative;
        width: 28px;
        height: 20px;
        margin: auto;
    }

    /* Hamburger Lines */
    .menu-toggle-icon::before,
    .menu-toggle-icon::after {
        content: '';
        display: block;
        position: absolute;
        width: 100%;
        height: 3px;
        background-color: #0B1F2A;
        border-radius: 2px;
        transition: all 0.3s ease;
        left: 0;
    }

    .menu-toggle-icon::before {
        top: 0;
    }

    .menu-toggle-icon::after {
        bottom: 0;
    }

    /* Middle line */
    .menu-toggle-icon span {
        display: block;
        position: absolute;
        width: 100%;
        height: 3px;
        background-color: #0B1F2A;
        border-radius: 2px;
        top: 50%;
        transform: translateY(-50%);
        transition: all 0.3s ease;
        left: 0;
    }

    /* Animated Hamburger to X */
    .menu-toggle[aria-expanded="true"] .menu-toggle-icon::before {
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
    }

    .menu-toggle[aria-expanded="true"] .menu-toggle-icon span {
        opacity: 0;
        transform: translateX(-20px);
    }

    .menu-toggle[aria-expanded="true"] .menu-toggle-icon::after {
        bottom: 50%;
        transform: translateY(50%) rotate(-45deg);
    }

    /* Mobile Navigation Styles */
    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background-color: #FFFFFF;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        padding: 4rem 1.5rem 2rem;
        flex-direction: column;
        align-items: flex-start;
        transition: right 0.3s ease-in-out;
        overflow-y: auto;
        z-index: 9999;
    }

    .main-navigation.active {
        right: 0;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #E9ECEF;
    }

    .nav-menu a {
        padding: 1rem 0;
        width: 100%;
        font-size: 1rem;
    }

    .nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: 1rem;
        display: none;
        background-color: #F2F4F6;
        margin-top: 0.5rem;
        border-radius: 0;
    }

    .nav-menu li:hover > .sub-menu,
    .nav-menu li:focus-within > .sub-menu {
        display: block;
    }

    .nav-menu .sub-menu a {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .header-cta {
        width: 100%;
        margin-top: 1.5rem;
    }

    .header-cta .btn {
        width: 100%;
        display: block;
    }

    /* Mobile menu overlay backdrop */
    body.menu-open {
        overflow: hidden;
    }

    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(11, 31, 42, 0.7);
        z-index: 9998;
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
}

/* ==========================================================================
   SMALL MOBILE DEVICES (max-width: 480px)
   ========================================================================== */

@media screen and (max-width: 480px) {

    /* Typography Adjustments */
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.125rem;
    }

    /* Container Adjustments */
    .container,
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Header & Navigation */
    .site-header {
        padding: 0.75rem 0;
    }

    .custom-logo-link img {
        max-height: 40px;
    }

    .site-branding-text .site-title {
        font-size: 1.125rem;
    }

    .site-branding-text .site-description {
        font-size: 0.75rem;
    }

    .main-navigation {
        width: 85%;
        max-width: 320px;
    }

    /* Hero Section */
    .hero-section {
        min-height: 400px;
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 1.75rem;
        letter-spacing: 1px;
        margin-bottom: 1rem;
    }

    .hero-tagline {
        font-size: 1rem;
        margin-bottom: 1rem;
        letter-spacing: 0.5px;
    }

    .hero-description {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-cta .btn {
        width: 100%;
        padding: 0.875rem 1.25rem;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .btn-small {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }

    .button-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .button-group .btn {
        width: 100%;
    }

    /* Grid System */
    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .section-header {
        margin-bottom: 2rem;
    }

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

    .section-subtitle {
        font-size: 1rem;
    }

    /* Service Cards */
    .service-card {
        padding: 1.5rem;
    }

    .service-card-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .service-card-title {
        font-size: 1.25rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Cards */
    .card {
        padding: 1.5rem;
    }

    .card-image {
        margin: -1.5rem -1.5rem 1rem;
    }

    /* Stats Section */
    .stat-card {
        padding: 1.5rem;
        text-align: center;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }

    /* Testimonials */
    .testimonial-quote-mark {
        font-size: 3rem;
    }

    .testimonial-quote {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .testimonial-cta-box {
        flex-direction: column;
    }

    .cta-box {
        padding: 1.5rem;
    }

    /* CTA Section */
    .cta-section {
        padding: 2.5rem 0;
    }

    .cta-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .cta-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .cta-buttons .btn {
        width: 100%;
    }

    /* Blog Grid */
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .blog-card-image {
        height: 200px;
    }

    .blog-card-content {
        padding: 1.5rem;
    }

    .blog-card-meta {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .blog-card-title {
        font-size: 1.125rem;
    }

    /* Post Content */
    .post-content-wrapper,
    .page-content-wrapper {
        padding: 0 1rem;
    }

    .entry-meta {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.85rem;
    }

    .entry-content {
        font-size: 1rem;
    }

    .entry-content h2 {
        font-size: 1.5rem;
        margin-top: 2rem;
    }

    .entry-content h3 {
        font-size: 1.25rem;
        margin-top: 1.5rem;
    }

    .entry-content ul,
    .entry-content ol {
        padding-left: 1.25rem;
    }

    .entry-content blockquote {
        padding-left: 1rem;
        margin: 1.5rem 0;
        font-size: 0.95rem;
    }

    /* Post Navigation */
    .nav-links {
        flex-direction: column;
        gap: 1.5rem;
    }

    .nav-next {
        text-align: left;
    }

    /* Pagination */
    .pagination-list {
        gap: 0.25rem;
    }

    .pagination-list a {
        padding: 0.5rem;
        min-width: 35px;
        font-size: 0.9rem;
    }

    /* Forms */
    .form-control {
        padding: 0.75rem;
        font-size: 1rem;
    }

    .search-form {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-submit {
        width: 100%;
    }

    /* Contact Info */
    .contact-info-item {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .contact-info-icon {
        font-size: 1.75rem;
    }

    /* FAQ */
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .faq-item {
        padding: 1.5rem;
    }

    /* Pricing Cards */
    .pricing-card {
        padding: 1.5rem;
    }

    /* About Page */
    .step-card {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
    }

    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .feature-icon {
        font-size: 2.5rem;
    }

    /* Footer */
    .footer-widgets {
        padding: 2.5rem 0;
    }

    .footer-widgets-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .site-info {
        padding: 1.5rem 0;
    }

    .site-info-inner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-navigation {
        width: 100%;
    }

    .footer-menu {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

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

/* ==========================================================================
   MOBILE DEVICES (481px - 767px)
   ========================================================================== */

@media screen and (min-width: 481px) and (max-width: 767px) {

    html {
        font-size: 15px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.375rem; }

    .container,
    .container-fluid {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .hero-section {
        min-height: 450px;
        padding: 2.5rem 0;
    }

    .hero-title { font-size: 2rem; }
    .hero-tagline { font-size: 1.125rem; }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-section .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-widgets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   TABLETS (768px - 991px)
   ========================================================================== */

@media screen and (min-width: 768px) and (max-width: 991px) {

    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .custom-logo-link img {
        max-height: 50px;
    }

    /* Keep hamburger menu visible on tablets */
    .menu-toggle {
        display: flex !important;
    }

    .hero-section {
        min-height: 500px;
    }

    .hero-title { font-size: 2.5rem; }
    .hero-tagline { font-size: 1.25rem; }

    .hero-cta {
        flex-direction: row;
        justify-content: center;
    }

    .hero-cta .btn {
        width: auto;
    }

    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section {
        padding: 3rem 0;
    }

    .cta-buttons {
        flex-direction: row;
        justify-content: center;
    }

    .cta-buttons .btn {
        width: auto;
    }

    .button-group {
        flex-direction: row;
    }

    .button-group .btn {
        width: auto;
    }

    .testimonial-cta-box {
        flex-direction: row;
        gap: 2rem;
    }

    .footer-widgets-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .site-info-inner {
        flex-direction: row;
        text-align: left;
    }

    .footer-menu {
        flex-direction: row;
        gap: 1rem;
    }
}

/* ==========================================================================
   DESKTOP - HIDE HAMBURGER, SHOW NORMAL MENU (992px+)
   ========================================================================== */

@media screen and (min-width: 992px) {

    /* Hide hamburger menu on desktop */
    .menu-toggle {
        display: none !important;
    }

    /* Show normal horizontal navigation */
    .main-navigation {
        position: static;
        width: auto;
        height: auto;
        background-color: transparent;
        box-shadow: none;
        padding: 0;
        flex-direction: row;
        overflow-y: visible;
    }

    .nav-menu {
        flex-direction: row;
        gap: 1rem;
    }

    .nav-menu li {
        width: auto;
        border-bottom: none;
    }

    .nav-menu a {
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
    }

    .nav-menu .sub-menu {
        position: absolute;
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        background-color: #FFFFFF;
        box-shadow: 0 10px 15px -3px rgba(11, 31, 42, 0.1);
        padding: 0.5rem 0;
        margin-top: 0;
    }

    .nav-menu li:hover > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .header-cta {
        width: auto;
        margin-top: 0;
    }

    .header-cta .btn {
        width: auto;
    }
}

/* ==========================================================================
   SMALL DESKTOPS (992px - 1199px)
   ========================================================================== */

@media screen and (min-width: 992px) and (max-width: 1199px) {

    .container {
        max-width: 960px;
    }

    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(3, 1fr); }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .faq-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-widgets-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   LARGE DESKTOPS (1200px+)
   ========================================================================== */

@media screen and (min-width: 1200px) {

    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-widgets-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================================================
   LANDSCAPE ORIENTATION
   ========================================================================== */

@media screen and (max-width: 767px) and (orientation: landscape) {

    .hero-section {
        min-height: 350px;
        padding: 1.5rem 0;
    }

    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .hero-tagline {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .hero-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .section {
        padding: 2rem 0;
    }
}

/* ==========================================================================
   TOUCH DEVICE OPTIMIZATIONS
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {

    .btn {
        min-height: 44px;
        padding: 0.875rem 1.5rem;
    }

    .nav-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .card:hover,
    .blog-card:hover,
    .service-card:hover {
        transform: none;
    }
}

/* ==========================================================================
   HIGH RESOLUTION DISPLAYS
   ========================================================================== */

@media screen and (min-width: 1400px) {
    .container { max-width: 1320px; }
    html { font-size: 17px; }
}

@media screen and (min-width: 1600px) {
    .container { max-width: 1440px; }
    html { font-size: 18px; }
}

/* ==========================================================================
   RESPONSIVE UTILITY CLASSES
   ========================================================================== */

@media screen and (max-width: 767px) {
    .hide-mobile { display: none !important; }
}

@media screen and (min-width: 768px) and (max-width: 991px) {
    .hide-tablet { display: none !important; }
}

@media screen and (min-width: 992px) {
    .hide-desktop { display: none !important; }
}

@media screen and (min-width: 768px) {
    .show-mobile-only { display: none !important; }
}

/* ==========================================================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

@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;
    }
}

/* ==========================================================================
   RESPONSIVE TABLES
   ========================================================================== */

@media screen and (max-width: 767px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .site-header,
    .menu-toggle,
    .main-navigation,
    .hero-section,
    .cta-section,
    .site-footer,
    .btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }
}