/* ============================================================
   ALBION LAW FIRM LIMITED — Responsive & Image Auto-Size CSS
   Covers: 375px (mobile), 576px (sm), 768px (md), 1024px (lg)
   Applied AFTER main.css to override/extend template styles
============================================================ */

/* ─── GLOBAL IMAGE AUTO-SIZING ──────────────────────────── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Contain all images within their parent */
figure img,
.card img,
.team-member img,
.team-member__img img,
.stories-card__img img,
.post-card img,
.gallery-item img,
.awards-img img,
.service-card img,
.about-wrap img,
.hero-tile img,
.bg-stretch img,
.footer-logo img,
.single-post img,
.sidebar img,
.page-content img,
.case-item img,
.news-item img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

/* ─── GLOBAL BOX MODEL FIX ───────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent horizontal overflow on all pages */
html,
body,
.wrapper {
  overflow-x: hidden;
  width: 100%;
}

/* ─── CONTAINER RESPONSIVE ───────────────────────────────── */
.container {
  width: 100%;
  padding-left: 16px;
  padding-right: 16px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 576px) {
  .container { max-width: 540px; }
}
@media (min-width: 768px) {
  .container { max-width: 720px; padding-left: 24px; padding-right: 24px; }
}
@media (min-width: 1024px) {
  .container { max-width: 980px; }
}
@media (min-width: 1200px) {
  .container { max-width: 1170px; }
}
@media (min-width: 1400px) {
  .container { max-width: 1320px; }
}

/* ─── HEADER RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1023px) {
  /* Hide top bar on mobile */
  .header-upper.visible--md {
    display: none !important;
  }

  /* Mobile header layout */
  .header-main {
    padding: 12px 0;
    flex-wrap: wrap;
  }

  .header-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  /* Logo sizing on mobile */
  .logo img,
  .header-logo img {
    max-width: 140px;
    height: auto;
  }

  /* Phone + appointment on mobile */
  .header-phone {
    font-size: 0.9rem;
  }

  .header-appointment .btn {
    padding: 8px 14px;
    font-size: 0.8rem;
  }
}

/* ─── NAVIGATION RESPONSIVE ──────────────────────────────── */
@media (max-width: 1023px) {
  /* Hide desktop nav, show hamburger */
  .nav-wrap {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 36, 64, 0.98);
    z-index: 9999;
    padding: 80px 30px 30px;
    overflow-y: auto;
  }

  .nav-wrap.is-open {
    display: block;
  }

  .nav {
    flex-direction: column;
    gap: 0;
  }

  .nav > li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .nav > li > a {
    padding: 14px 0;
    font-size: 1.05rem;
    color: #ffffff;
    display: block;
  }

  .nav .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: rgba(255,255,255,0.05);
    padding: 0;
  }

  .nav .dropdown a {
    color: #cbd5e0;
    padding: 10px 16px;
    font-size: 0.95rem;
  }

  /* Hamburger button */
  .nav-toggle {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    z-index: 10000;
    background: none;
    border: none;
  }

  .nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #0f2440;
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  /* Close button for mobile nav */
  .nav-close {
    display: flex !important;
    position: absolute;
    top: 20px;
    right: 20px;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
  }
}

@media (min-width: 1024px) {
  .nav-toggle { display: none !important; }
  .nav-close { display: none !important; }
}

/* ─── HERO SLIDER RESPONSIVE ─────────────────────────────── */

/* Ensure the hero always has position: relative so bg-stretch fills it */
.hero-tile {
  position: relative;
  overflow: hidden;
}

/* bg-stretch MUST be absolutely positioned inside hero-tile */
.hero-tile .bg-stretch {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 0 !important;
}

/* Make bg-stretch image fill completely — override global img rules */
.hero-tile .bg-stretch img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  display: block !important;
}

/* Hero content must sit above the bg image */
.hero-tile .container {
  position: relative;
  z-index: 1;
}

/* Dark overlay on hero for text readability on mobile */
.hero-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 30, 60, 0.45);
  z-index: 0;
  pointer-events: none;
}

@media (max-width: 767px) {
  .hero-slider,
  .hero-tile {
    min-height: 480px;
  }

  .hero-tile__title,
  .hero-tile .h1 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
    margin-bottom: 14px;
  }

  .hero-tile .text-wrap p {
    font-size: 0.95rem;
    color: #e8eef6;
  }

  .hero-tile .container {
    padding-top: 80px;
    padding-bottom: 60px;
  }

  .hero-tile .btn {
    font-size: 0.85rem;
    padding: 10px 20px;
  }

  /* Swiper slide must fill the hero height */
  .hero-slider .swiper-slide {
    height: auto;
    min-height: 480px;
  }

  .hero-slider {
    min-height: 480px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-tile {
    min-height: 560px;
  }

  .hero-tile__title,
  .hero-tile .h1 {
    font-size: 2.4rem !important;
  }

  .hero-slider .swiper-slide {
    min-height: 560px;
  }
}

/* ─── SERVICE CARDS (3-column → 1-column) ────────────────── */
@media (max-width: 767px) {
  .service-list {
    flex-direction: column;
    display: flex;
  }

  .service-list__item {
    width: 100% !important;
  }

  .service-card {
    min-height: 220px;
  }
}

/* ─── SERVICE OFFERINGS GRID ─────────────────────────────── */
@media (max-width: 767px) {
  .row-list.gap--1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .row-list.gap--1 .row-list__item {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .row-list.gap--1 {
    grid-template-columns: 1fr;
  }
}

/* ─── TEAM MEMBER CARDS ──────────────────────────────────── */
@media (max-width: 767px) {
  .team {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .team__item {
    width: 100% !important;
  }

  .team-member__img img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    object-position: top;
  }
}

@media (max-width: 480px) {
  .team {
    grid-template-columns: 1fr !important;
  }

  .team-member__img img {
    height: 320px;
  }
}

/* ─── SUCCESS STORIES SLIDER ─────────────────────────────── */
@media (max-width: 767px) {
  .stories-card {
    flex-direction: column !important;
  }

  .stories-card__img {
    width: 100% !important;
    height: 220px;
    overflow: hidden;
  }

  .stories-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .stories-card__content {
    padding: 20px 16px;
  }
}

/* ─── FREE CASE EVAL + TRENDING (split → stacked) ────────── */
@media (max-width: 1023px) {
  .section-tile {
    flex-direction: column !important;
    display: flex;
  }

  .section-tile__item {
    width: 100% !important;
  }
}

/* ─── FOOTER BACKGROUND FIX (all screen sizes) ───────────── */

/* Footer needs position:relative so bg-stretch can fill it */
.footer {
  position: relative;
  overflow: hidden;
  background-color: #0a1e40; /* solid dark navy fallback */
}

/* Dark overlay so text is always readable even if bg image fails */
.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 48, 0.82);
  z-index: 0;
  pointer-events: none;
}

/* Force footer bg-stretch to fill absolutely */
.footer > .bg-stretch {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 0 !important;
}

.footer > .bg-stretch img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  display: block !important;
}

/* Footer content must sit above background image + overlay */
.footer .container {
  position: relative;
  z-index: 2;
}

/* Ensure all footer link/text colors are visible (white on dark) */
.footer-upper__title {
  color: #ffffff !important;
}

.footer-list__link {
  color: rgba(255,255,255,0.8) !important;
}

.footer-list__link:hover {
  color: #abc3e1 !important;
}

.info-list__text {
  color: rgba(255,255,255,0.6) !important;
}

.info-list__link {
  color: #ffffff !important;
}

.footer-contact .info-list__text {
  color: rgba(255,255,255,0.6) !important;
}

.footer-contact .info-list__link {
  color: #ffffff !important;
  font-weight: 600;
}

.footer-under,
.footer-under li,
.footer-under a {
  color: rgba(255,255,255,0.7) !important;
}


/* ─── FOOTER RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1023px) {
  .footer-upper {
    flex-direction: column;
    gap: 30px;
  }

  /* On tablet show 2-column footer link grid */
  .footer-upper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  /* Logo takes full width on tablet */
  .footer-upper__col.col--4 {
    grid-column: 1 / -1;
  }

  .footer-upper__col {
    width: 100% !important;
  }

  .footer-contact {
    flex-direction: column;
    gap: 20px;
  }

  /* Stack info-list items (HEAD OFFICE / MAIL / TEL) vertically */
  .footer-contact .info-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-contact .info-list__item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .footer-contact .info-list__text {
    font-size: 10px;
    opacity: 0.7;
    margin-right: 0;
  }

  .footer-contact .info-list__link {
    font-size: 13px;
    color: #fff;
    word-break: break-word;
  }

  .footer-contact__item {
    gap: 20px;
    flex-wrap: wrap;
  }

  .footer-under {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .footer-list--row {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 767px) {
  /* Single column footer on mobile */
  .footer-upper {
    grid-template-columns: 1fr;
    padding-top: 40px;
    padding-bottom: 20px;
    gap: 24px;
  }

  .footer-upper__col.col--4 {
    grid-column: auto;
  }

  .footer-logo img {
    max-width: 160px;
  }

  .footer-upper__title {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }

  /* Contact row stacks vertically */
  .footer-contact {
    padding-top: 20px;
    padding-bottom: 20px;
    gap: 16px;
  }

  .footer-contact__item {
    gap: 16px;
    width: 100%;
  }

  /* Social icons row */
  .footer-contact .social {
    gap: 16px;
  }

  .footer-contact .btn--white {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Bottom bar */
  .footer-under {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    font-size: 0.8rem;
  }
}

/* ─── WHO WE ARE / ABOUT SECTION ─────────────────────────── */
@media (max-width: 767px) {
  .about-wrap {
    padding: 0 8px;
  }

  .about-wrap h3 {
    font-size: 1.5rem;
  }

  .company-verification-badge {
    padding: 16px;
  }

  /* Awards grid: 2-column on mobile */
  .row-list.col--3 {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    justify-items: center;
  }
}

/* ─── SECTION HEADINGS ───────────────────────────────────── */
@media (max-width: 767px) {
  .section-headline h4 {
    font-size: 0.75rem;
  }

  .section-headline p {
    font-size: 0.95rem;
  }

  h1, .h1 { font-size: 2rem; }
  h2, .h2 { font-size: 1.7rem; }
  h3, .h3 { font-size: 1.35rem; }
  h4, .h4 { font-size: 1.1rem; }
}

/* ─── SECTION PADDING ────────────────────────────────────── */
@media (max-width: 767px) {
  .section {
    padding-top: 50px !important;
    padding-bottom: 50px !important;
  }

  .section-tile .container {
    padding-top: 50px;
    padding-bottom: 50px;
  }
}

/* ─── PAGE BANNERS ───────────────────────────────────────── */
@media (max-width: 767px) {
  section[style*="padding: 90px"] {
    padding: 50px 0 40px !important;
  }

  section[style*="padding: 90px"] h1 {
    font-size: 1.8rem !important;
  }

  section[style*="padding: 90px"] p {
    font-size: 1rem !important;
  }
}

/* ─── GALLERY GRID ───────────────────────────────────────── */
@media (max-width: 767px) {
  .gallery-grid,
  [style*="display: grid"][style*="repeat(3"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  .gallery-item,
  [style*="display: grid"][style*="repeat(3"] > div {
    height: 200px !important;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ─── FORMS (contacts, case eval) ───────────────────────── */
@media (max-width: 767px) {
  .form-row {
    flex-direction: column;
  }

  .form-row__field {
    width: 100% !important;
  }

  .form-control,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea {
    width: 100% !important;
    font-size: 1rem;
  }
}

/* ─── CARDS (service grid, row-list) ─────────────────────── */
@media (max-width: 767px) {
  .card {
    margin-bottom: 16px;
  }

  /* Bootstrap-like row grids */
  .col-lg-4,
  .col-lg-6,
  .col-md-6 {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* ─── TABLES ─────────────────────────────────────────────── */
@media (max-width: 767px) {
  table {
    display: block;
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }
}

/* ─── TESTIMONIAL SLIDER ─────────────────────────────────── */
@media (max-width: 767px) {
  .testimonial-quote {
    padding: 30px 20px;
  }

  .testimonial-quote p {
    font-size: 1rem;
  }

  .section-testimonial {
    min-height: 300px;
  }
}

/* ─── NEWS / BLOG LISTINGS ───────────────────────────────── */
@media (max-width: 767px) {
  .post-list .post-card {
    padding: 20px 0;
  }

  .listing-meta {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* ─── BREADCRUMBS ────────────────────────────────────────── */
@media (max-width: 767px) {
  .breadcrumbs {
    font-size: 0.85rem;
    flex-wrap: wrap;
  }
}

/* ─── SWIPER PAGINATION DOTS ─────────────────────────────── */
@media (max-width: 767px) {
  .swiper-pagination {
    bottom: 12px !important;
  }

  .swiper-pagination-bullet {
    width: 8px !important;
    height: 8px !important;
  }
}

/* ─── ADMIN PANEL RESPONSIVE ─────────────────────────────── */
@media (max-width: 1023px) {
  .admin-sidebar {
    width: 100% !important;
    position: relative !important;
    height: auto !important;
  }

  .admin-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .admin-layout {
    flex-direction: column !important;
  }
}

/* ─── MOBILE NAV HAMBURGER — JS-driven ───────────────────── */
.nav-toggle {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
}

.nav-close {
  display: none;
}

@media (max-width: 1023px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
  }

  .nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: #0f2440;
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  /* Animate hamburger to X on open */
  .nav-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .nav-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ─── UTILITY: prevent images overflowing inline styles ─── */
[style*="background-image"] {
  background-size: cover !important;
  background-position: center !important;
}
