/* ==========================================================================
   EHTEKAM LAW FIRM - COMPREHENSIVE RESPONSIVE STYLESHEET
   Handles Desktop, Tablet (Landscape & Portrait), and Mobile Screens.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TABLETS AND SMALL DESKTOPS (<= 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    .consultants-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .consultants-content {
        padding: 0;
        text-align: center;
    }

    .consultants-image-wrapper {
        margin: 0 auto;
        max-width: 500px;
        width: 100%;
    }

    .sectors-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .s-grid {
        flex-wrap: wrap;
        gap: 20px;
    }

    .service {
        flex: 1 1 calc(50% - 20px);
        max-width: 100%;
    }

    .ch, .cd, .cw, .cm {
        max-width: 100%;
    }
}

/* --------------------------------------------------------------------------
   2. MOBILE NAVIGATION BREAKPOINT (<= 991px)
   Activates Hamburger Menu & Mobile Top Bar
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
    .bar-tp {
        height: auto;
        min-height: 65px;
        padding: 0;
    }

    .header-inner {
        justify-content: space-between;
        height: 65px;
        padding: 0 20px;
    }

    .logo-link {
        order: 1;
        padding: 0;
    }

    .logo-img {
        height: 42px;
        width: auto;
    }

    /* Hamburger Toggle Button (3 lines) */
    .menu-toggle {
        order: 2;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 38px;
        height: 32px;
        background: transparent;
        border: 1px solid rgba(212, 175, 55, 0.4);
        border-radius: 6px;
        padding: 6px 5px;
        cursor: pointer;
        z-index: 1001;
        transition: all 0.3s ease;
    }

    .menu-toggle:hover,
    .menu-toggle:focus {
        border-color: var(--color-gold);
        background: rgba(200, 155, 60, 0.12);
        outline: none;
    }

    .bar-line {
        display: block;
        width: 100%;
        height: 2.5px;
        background-color: var(--color-gold);
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
        transform-origin: center;
    }

    /* Animated 'X' when menu is open */
    .menu-toggle.active .bar-line:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .menu-toggle.active .bar-line:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .menu-toggle.active .bar-line:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Slide-down Mobile Navigation Drawer */
    .nav-menu {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background-color: #0b1721;
        border-top: 1px solid rgba(212, 175, 55, 0.3);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.75);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, visibility 0.4s ease;
        z-index: 999;
    }

    .nav-menu.active {
        max-height: 480px;
        opacity: 1;
        visibility: visible;
        padding: 10px 0 15px;
    }

    .header-nav1, .header-nav2 {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0;
        order: unset;
    }

    .header-nav1 a, .header-nav2 a {
        display: block;
        width: 100%;
        padding: 13px 25px;
        font-size: 1.05rem;
        color: #FFFFFF;
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 0;
        transition: all 0.25s ease;
        box-sizing: border-box;
    }

    html[dir="rtl"] .header-nav1 a,
    html[dir="rtl"] .header-nav2 a {
        text-align: right;
    }

    html[dir="ltr"] .header-nav1 a,
    html[dir="ltr"] .header-nav2 a {
        text-align: left;
    }

    .header-nav1 a:hover,
    .header-nav2 a:hover,
    .header-nav1 a:focus,
    .header-nav2 a:focus {
        background-color: rgba(200, 155, 60, 0.14);
        color: var(--color-gold);
        border-style: none;
    }

    html[dir="rtl"] .header-nav1 a:hover,
    html[dir="rtl"] .header-nav2 a:hover {
        padding-right: 32px;
    }

    html[dir="ltr"] .header-nav1 a:hover,
    html[dir="ltr"] .header-nav2 a:hover {
        padding-left: 32px;
    }

    /* Footer Tablet Adjustment */
    .footer-container {
        gap: 30px;
        padding: 0 20px 30px;
    }
    
    .footer-col {
        flex: 1 1 45%;
    }
}

/* --------------------------------------------------------------------------
   3. MOBILE PHONES & PORTRAIT TABLETS (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    html {
        overflow-x: hidden;
    }

    h1 {
        font-size: 2rem;
    }

    body,
    .add-bg,
    .ex-main,
    .a-main,
    .why-us,
    .our-message,
    .s-main,
    .h-main {
        background-attachment: scroll;
    }

    /* Hero / Home Page */
    .h-main {
        min-height: auto;
        padding: 50px 20px;
    }

    .main-slogan {
        font-size: clamp(1.8rem, 5vw, 2.3rem);
        line-height: 1.4;
    }

    .sub-text {
        font-size: 1rem;
        line-height: 1.8;
    }

    .d-home {
        padding: 20px;
        margin: 25px auto 0;
        max-width: 95%;
    }

    .law-quote {
        font-size: 1.15rem;
        line-height: 1.7;
    }

    .quote-author {
        display: block;
        margin-top: 8px;
        font-size: 0.95rem;
    }

    html[dir="rtl"] .quote-author {
        text-align: right;
    }

    html[dir="ltr"] .quote-author {
        text-align: left;
    }

    /* Consultants Section */
    .consultants-section {
        padding: 50px 0;
    }

    .consultants-content h2 {
        font-size: 1.8rem;
        line-height: 1.4;
    }

    .consultants-content p {
        font-size: 1rem;
        line-height: 1.8;
    }

    .experience-badge {
        position: static;
        margin: 20px auto 0;
        justify-content: center;
        max-width: 320px;
    }

    /* Sectors Section */
    .main-sectors-section {
        padding: 50px 0;
    }

    .main-sectors-title h2 {
        font-size: 1.8rem;
    }

    .sectors-cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }

    /* CTA Section */
    .law-cta-section {
        padding: 55px 15px;
    }

    .law-cta-body h2 {
        font-size: 1.7rem;
    }

    .btn-golden-consultation {
        padding: 14px 28px;
        font-size: 1rem;
    }

    /* Services Page */
    .s-main {
        min-height: auto;
        padding: 50px 20px;
    }

    .s-main h1 {
        font-size: 1.9rem;
    }

    .s-title, .s-title2 {
        padding: 40px 15px;
    }

    .s-title h2, .s-title2 h2 {
        font-size: 1.8rem;
        margin-bottom: 25px;
    }

    .s-grid, .s-grid2 {
        flex-direction: column;
        gap: 20px;
    }

    .service, .s-card, .s-card2 {
        width: 100%;
        flex: 1 1 100%;
        border-radius: 10px;
    }

    /* Experts Page */
    .ex-main {
        min-height: auto;
        padding: 50px 20px;
    }

    .ex-main h1 {
        font-size: 1.9rem;
    }

    .exteam {
        padding: 40px 15px;
        gap: 30px;
    }

    .ch, .cd, .cw, .cm,
    .card-reverse {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        border-radius: 16px;
    }

    .ch img, .cd img, .cw img, .cm img {
        width: 100%;
        height: 320px;
        object-fit: cover;
    }

    .t-ex {
        padding: 25px 20px;
        text-align: center;
    }

    .t-ex h2 {
        font-size: 1.4rem;
    }

    /* About Us Page */
    .a-main {
        min-height: auto;
        padding: 50px 20px;
    }

    .a-main h1 {
        font-size: 1.9rem;
    }

    .who-us, .why-us, .vision, .our-message, .values {
        padding: 40px 20px;
        min-height: auto;
    }

    .who-us h2, .why-us h2, .vision h2, .our-message h2, .values h2 {
        font-size: 1.8rem;
    }

    .who-us h2::after, .why-us h2::after, .vision h2::after, .our-message h2::after, .values h2::after {
        width: 60px;
    }

    .who-us p, .vision p, .values p,
    .why-us p, .our-message p {
        padding: 0 10px;
        font-size: 1rem;
        line-height: 1.8;
    }

    /* Contact Us Page */
    .c-main {
        min-height: auto;
        padding: 50px 20px;
    }

    .c-main h1 {
        font-size: 1.9rem;
    }

    .c1-cards {
        flex-direction: column;
        padding: 40px 15px;
        gap: 25px;
    }

    .pcard, .wcard, .ecard {
        flex: 1 1 100%;
        margin-top: 0;
        width: 100%;
    }

    .add-bg {
        height: auto;
        padding: 40px 15px;
    }

    .add-bg h1 {
        font-size: 2rem;
        margin-bottom: 0;
    }

    .c2-cards {
        height: auto;
        padding: 40px 15px;
        flex-direction: column;
    }

    .mcard {
        flex-direction: column;
        margin-top: 0;
        padding: 35px 20px;
        gap: 25px;
        width: 100%;
    }

    .tcard {
        width: 100%;
    }

    iframe {
        width: 100%;
        height: 220px;
        border-radius: 8px;
    }

    /* 404 Page */
    .error-code {
        font-size: clamp(4.5rem, 16vw, 6rem);
    }

    .error-title {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }

    /* Footer Mobile Alignment */
    .main-footer {
        padding-top: 45px;
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
        padding: 0 20px 25px;
    }

    .footer-col {
        width: 100%;
        min-width: 100%;
    }

    .footer-col.about-col {
        align-self: center;
        text-align: center;
    }

    .footer-logo {
        display: flex;
        justify-content: center;
    }

    .footer-col h3 {
        text-align: center;
    }

    .footer-col h3::after {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    .footer-col ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .contact-info li {
        justify-content: center;
    }

    .copyright-container {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 20px 15px;
    }

    .icz {
        justify-content: center;
    }
}

/* --------------------------------------------------------------------------
   4. SMALL MOBILE SCREENS (<= 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    h1 {
        font-size: 1.55rem;
    }

    .logo-img {
        height: 38px;
    }

    .c-main h1, .ex-main h1, .a-main h1, .s-main h1, .add-bg h1 {
        font-size: 1.5rem;
    }

    .c-main p, .ex-main p, .a-main p, .s-main p {
        font-size: 0.92rem;
        line-height: 1.7;
    }

    .main-slogan {
        font-size: 1.6rem;
    }

    .sub-text {
        font-size: 0.92rem;
    }

    .law-quote {
        font-size: 1rem;
    }

    .card-header-box h3 {
        font-size: 1.15rem;
    }

    .card-body-text p {
        font-size: 0.92rem;
    }

    .experience-badge {
        flex-direction: column;
        text-align: center;
        gap: 5px;
        padding: 15px 20px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .exp-years {
        font-size: 28px;
    }

    .exp-text {
        max-width: 100%;
        font-size: 12px;
    }

    .btn-golden-consultation {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    .pcard, .wcard, .ecard, .mcard {
        padding: 30px 15px;
    }

    .ch img, .cd img, .cw img, .cm img {
        height: 270px;
    }
}