/* ============================================================
   Responsive Enhancements — Owusu & Partners
   Supplements responsive.css with targeted fixes
   ============================================================ */

/* Always: images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent horizontal scroll site-wide */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Video / iframe embeds */
iframe, embed, object, video {
    max-width: 100%;
}

/* Footer logo never overflows */
.footer-area .footer-widget .logo img {
    max-width: 320px;
    height: auto;
}

/* Navbar brand logo sizing */
.op-nav .navbar-brand img,
.op-responsive-nav .logo img {
    max-width: 360px;
    height: auto;
}

/* Ensure navbar has enough height for the larger logo */
.op-nav {
    padding: 8px 0;
}

/* meanmenu dropdown clears top-header + navbar on mobile (~165px total) */
.mean-container .mean-nav {
    margin-top: 88px;
}

/* ── Mobile (≤ 767px) ── */
@media (max-width: 767px) {

    /* ── Top header: stack into two centered rows ── */
    .top-header .row {
        flex-direction: column;
        align-items: center;
        padding: 6px 0;
        gap: 4px;
    }
    .top-header .col-lg-6,
    .top-header .col-sm-6 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        text-align: center;
        padding: 0;
    }
    .top-header .left-info {
        justify-content: center;
        display: flex;
        flex-wrap: wrap;
        gap: 6px 14px;
    }
    .top-header .left-info li {
        margin-right: 0;
        font-size: 11px;
    }
    .top-header .left-info li a i {
        font-size: 14px;
    }
    .top-header .right-info {
        text-align: center;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 4px 8px;
    }
    .top-header .right-info li {
        font-size: 11px;
        margin-left: 0;
    }
    .top-header .right-info li a i {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 11px;
    }
    .top-header .right-info .heder-btn {
        padding: 6px 14px;
        margin-left: 6px;
    }
    .top-header .right-info .heder-btn a {
        font-size: 11px;
    }

    /* meanmenu dropdown clears full stacked header on mobile */
    .mean-container .mean-nav {
        margin-top: 165px;
    }

    /* Touch-friendly CTAs only — not all anchors */
    .default-btn-one,
    .default-btn-two,
    button[type="submit"],
    .heder-btn a,
    .hero-btns a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Make tables scroll horizontally */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Navbar brand logo on mobile */
    .op-nav .navbar-brand img,
    .op-responsive-nav .logo img {
        max-width: 280px;
    }

    /* Footer logo on mobile */
    .footer-area .footer-widget .logo img {
        max-width: 220px;
    }

    /* Footer pl-50 widget — clear excess padding */
    .footer-area .footer-widget.pl-50 {
        padding-left: 0 !important;
    }

    /* Section spacing tightened on mobile */
    .ptb-100 {
        padding-top: 50px;
        padding-bottom: 50px;
    }

    /* Cards: prevent horizontal overflow */
    .attorney-card,
    .service-card,
    .blog-card,
    .case-study-card {
        overflow: hidden;
    }

    /* Contact form inputs full width */
    .contact-form .form-group {
        margin-bottom: 16px;
    }

    /* Footer bottom text wraps properly */
    .footer-bottom p {
        font-size: 12px;
        line-height: 1.6;
    }

    /* Page banner: account for top-header + navbar both visible */
    .page-banner .page-content {
        padding-top: 160px;
    }
}

/* ── Small phones (≤ 480px) ── */
@media (max-width: 480px) {

    /* Hero buttons stack vertically on very small screens */
    .premium-hero .slide-content .hero-btns {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .premium-hero .slide-content .hero-btns a {
        width: auto;
    }

    /* Section title tighter */
    .section-title h2 {
        font-size: 22px;
    }

    /* Attorney detail name */
    .attor-details-item .attor-details-right .attor-details-name h2 {
        font-size: 21px;
    }

    /* Fun facts single item — prevent overflow */
    .signle-fun-fact {
        padding: 30px 20px;
    }
}

/* ── Ultra-small (≤ 374px) ── */
@media (max-width: 374px) {

    .section-title h2 {
        font-size: 20px !important;
    }

    .default-btn-one, .default-btn-two {
        padding: 8px 12px !important;
        font-size: 11px !important;
    }

    .op-nav .navbar-brand img,
    .op-responsive-nav .logo img {
        max-width: 220px;
    }

    /* Top header even more compact on tiny screens */
    .top-header .left-info li {
        font-size: 10px;
    }
    .top-header .right-info li a i {
        width: 22px;
        height: 22px;
        line-height: 22px;
        font-size: 10px;
    }
    .top-header .right-info .heder-btn {
        padding: 5px 10px;
    }
    .top-header .right-info .heder-btn a {
        font-size: 10px;
    }

    /* Footer bottom wraps on tiny screens */
    .footer-bottom p a {
        display: block;
        margin-top: 4px;
    }
}

/* ── Tablet portrait (768px – 991px) ── */
@media (min-width: 768px) and (max-width: 991px) {

    /* Navbar brand logo on tablet */
    .op-nav .navbar-brand img {
        max-width: 300px;
    }

    /* Service / attorney cards consistent padding */
    .service-card .service-text {
        padding: 20px 18px;
    }

    /* Footer: no padding-left on inner widget */
    .footer-area .footer-widget.pl-50 {
        padding-left: 0 !important;
    }

    /* Footer info-list no excess indent */
    .footer-area .footer-widget .info-list {
        padding-left: 0;
    }

    /* Contact form side-by-side maintained */
    .contact-area .contact-form .col-md-6 {
        margin-bottom: 0;
    }
}

/* ── Tablet landscape & small desktop (768px – 1024px) ── */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ── Large screens (1920px+) ── */
@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
}

/* ============================================================
   COMPREHENSIVE RESPONSIVE FIXES
   ============================================================ */

/* ── Disable translateY hover lift on touch devices (prevents layout jumps) ── */
@media (hover: none) {
    .default-btn-one:hover,
    .default-btn-two:hover,
    .low-card:hover,
    .service-card:hover,
    .attorney-card:hover,
    .blog-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    .left-info a:hover,
    .right-info a:hover {
        transform: none !important;
    }
}

/* ── Law cards: fix border logic in 2-column grid (576–767px) ── */
@media (min-width: 576px) and (max-width: 767px) {
    /* Cards 3 and 4 are in the second row — no bottom separator needed */
    .bor-right:nth-child(3),
    .bor-right:nth-child(4) {
        border-bottom: none !important;
    }
}

/* ── Mobile (≤ 767px) — layout-critical fixes ── */
@media (max-width: 767px) {

    /* Services detail: sidebar always below main content */
    .services-details-area .side-bar {
        margin-top: 40px;
    }

    /* Case study carousel: min-height so images aren't squashed */
    .case-study-area .testimonials-slider-item .testimonials-img {
        max-width: 100%;
    }

    /* Attorney cards: single column on very small phones */
    .attorney-area .row.justify-content-center > [class*="col-"] {
        margin-bottom: 30px;
    }

    /* Service cards in grid: equal height images */
    .service-card .img img {
        width: 100%;
        height: 220px;
        object-fit: cover;
    }

    /* Contact page: inner col-lg-6 cards stack properly */
    .contact-text .row > [class="col-lg-6"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 16px;
    }

    /* Footer: ensure last widget in column has no extra bottom margin */
    .footer-area .footer-widget {
        margin-bottom: 35px;
    }
    .footer-area .row > [class*="col-"]:last-child .footer-widget {
        margin-bottom: 0;
    }

    /* Side bar box: full width and clean padding */
    .side-bar-box {
        padding: 25px 20px;
    }

    /* Mean-nav: auto height with max and scroll */
    .mean-container .mean-nav {
        max-height: calc(100vh - 165px);
        overflow-y: auto;
        height: auto !important;
    }

    /* Page banner: content padding fine-tuned */
    .page-banner .page-content {
        padding-top: 165px;
        padding-bottom: 50px;
    }
    .page-banner .page-content h2 {
        font-size: 24px;
        margin-bottom: 12px;
    }

    /* About section: image centred and spaced */
    .about-area .about-image {
        text-align: center;
        margin-bottom: 40px;
    }

    /* Fun facts: prevent text overflow inside stat boxes */
    .signle-fun-fact h2 {
        font-size: 28px !important;
        word-break: break-word;
    }
    .signle-fun-fact p {
        font-size: 12px;
    }

    /* FAQ: accordion headings don't overflow */
    .faq-accordion .accordion-button {
        font-size: 14px;
        padding: 14px 16px;
        word-break: break-word;
    }

    /* Gallery: 2-column grid on mobile */
    .gallery-area .row > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 15px;
    }

    /* Attorney details: stacked layout spacing */
    .attor-details-item .attor-details-right {
        padding: 30px 15px;
    }
    .attor-details-item .attor-details-left {
        padding: 0 15px 30px;
    }

    /* Case study detail tabs: pills wrap on mobile */
    .case-details-tab .nav-pills {
        flex-wrap: wrap;
        gap: 8px;
    }
    .case-details-tab .nav-pills .nav-link {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* ── Small phones (≤ 480px) ── */
@media (max-width: 480px) {

    /* Gallery: single column on very small phones */
    .gallery-area .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Footer info-list: break long email/address */
    .footer-area .footer-widget .info-list li {
        word-break: break-all;
        font-size: 13px;
    }

    /* Attorney card text: compact on tiny screens */
    .attorney-card-text {
        padding: 18px 16px !important;
    }
    .attorney-card-text h3 {
        font-size: 16px;
    }
    .attorney-card-text p {
        font-size: 12px;
    }

    /* Services detail: smaller heading */
    .services-details-content h3 {
        font-size: 20px;
    }
    .services-details-content h4 {
        font-size: 17px;
    }
    .services-details-content p,
    .services-details-content li {
        font-size: 13px;
    }

    /* Contact cards: full-width on tiny screens */
    .contact-card {
        margin-bottom: 16px;
    }
    .contact-card h3 a {
        font-size: 16px;
    }
}

/* ── Tablet portrait (768px – 991px) ── */
@media (min-width: 768px) and (max-width: 991px) {

    /* Services detail: sidebar always below main content on tablet */
    .services-details-area .col-md-5 {
        margin-top: 40px;
    }

    /* Contact inner columns: side by side on tablet */
    .contact-text .row > .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Attorney cards: enforce 2-column */
    .attorney-area .col-lg-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Case study tabs pill width */
    .case-details-tab .nav-pills .nav-link {
        font-size: 13px;
        padding: 10px 14px;
    }

    /* Fun facts: 4-column boxes are narrow at this range — reduce padding */
    .signle-fun-fact {
        padding: 30px 20px !important;
    }
    .signle-fun-fact i {
        font-size: 40px;
    }
    .signle-fun-fact h3 {
        font-size: 24px;
    }
}

/* ── Fun facts on mobile: 2-column grid ── */
@media (max-width: 767px) {
    .fun-facts-area .col-sm-12 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .signle-fun-fact {
        padding: 25px 15px !important;
    }
    .signle-fun-fact i {
        font-size: 36px;
        margin-bottom: 10px;
    }
    .signle-fun-fact h3 {
        font-size: 22px;
        margin-bottom: 6px;
    }
    .signle-fun-fact p {
        font-size: 12px;
    }
}

/* ── Fun facts on very small phones: single column ── */
@media (max-width: 400px) {
    .fun-facts-area .col-sm-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ── Landscape mobile (short viewport) ── */
@media (max-height: 500px) and (max-width: 991px) {
    .premium-hero {
        min-height: 400px !important;
        height: auto !important;
    }
    .premium-hero .hero-content-wrap {
        padding: 120px 0 40px !important;
    }
}

/* ── Safe area support (iPhone X+ notch/home bar) ── */
@supports (padding: env(safe-area-inset-bottom)) {
    .footer-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .mean-container .mean-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
