/*
 * Digital Backdrop Library Template - Responsive CSS
 * Mobile-First Responsive Design with Accessibility Features
 * Bootstrap 5 Compatible Media Queries
 */

/* ========== MOBILE FIRST APPROACH ========== */
/* Base styles are for mobile devices */

/* ========== SMALL DEVICES (landscape phones, 576px and up) ========== */
@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }

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

  .hero-subtitle {
    font-size: 1.125rem;
  }

  .card-body {
    padding: 1.25rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* ========== MEDIUM DEVICES (tablets, 768px and up) ========== */
@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }

  .hero-title {
    font-size: 3rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .section-padding {
    padding: 5rem 0;
  }

  .navbar-nav .nav-link {
    margin: 0 1rem;
  }

  .card-body {
    padding: 1.5rem;
  }

  .service-card {
    margin-bottom: 2rem;
  }

  .team-photo {
    width: 120px;
    height: 120px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

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

/* ========== LARGE DEVICES (desktops, 992px and up) ========== */
@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }

  .hero-title {
    font-size: 3.5rem;
  }

  .hero-subtitle {
    font-size: 1.375rem;
  }

  .section-padding {
    padding: 6rem 0;
  }

  .navbar-nav .nav-link {
    margin: 0 1.5rem;
  }

  .card-body {
    padding: 2rem;
  }

  .service-card {
    margin-bottom: 0;
  }

  .team-photo {
    width: 150px;
    height: 150px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

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

  .contact-form {
    padding: 3rem;
  }
}

/* ========== EXTRA LARGE DEVICES (large desktops, 1200px and up) ========== */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }

  .hero-title {
    font-size: 4rem;
  }

  .hero-subtitle {
    font-size: 1.5rem;
  }

  .section-padding {
    padding: 8rem 0;
  }

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

/* ========== EXTRA EXTRA LARGE DEVICES (1400px and up) ========== */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }

  .hero-title {
    font-size: 4.5rem;
  }

  .section-padding {
    padding: 10rem 0;
  }
}

/* ========== MOBILE SPECIFIC STYLES ========== */
@media (max-width: 767px) {
  /* Header adjustments */
  .header {
    padding: 0.5rem 0;
  }

  .navbar-brand {
    font-size: 1.125rem !important;
  }

  .navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
  }

  .navbar-toggler:focus {
    box-shadow: none;
  }

  /* Hero section mobile adjustments */
  .hero {
    min-height: 100vh;
    padding: 6rem 0 4rem;
  }

  .hero-title {
    font-size: 2.25rem;
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .hero-description {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
  
  .hero-buttons .btn {
    min-width: 200px;
    width: 100%;
    max-width: 250px;
  }

  /* Button adjustments */
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
  }

  /* Card adjustments */
  .card {
    margin-bottom: 1.5rem;
  }

  .card-body {
    padding: 1rem;
  }

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

  /* Services section mobile */
  .service-card {
    margin-bottom: 2rem;
  }

  .service-price {
    font-size: 1.75rem;
  }

  /* Team section mobile */
  .team-photo {
    width: 100px;
    height: 100px;
  }

  .team-name {
    font-size: 1.125rem;
  }

  /* Gallery mobile */
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
  }

  .gallery-item img {
    height: 150px;
  }

  /* FAQ mobile */
  .faq-question {
    padding: 1rem;
    font-size: 0.95rem;
  }

  .faq-answer {
    padding: 1rem;
    font-size: 0.9rem;
  }

  /* Contact form mobile */
  .contact-form {
    padding: 1.5rem;
  }

  .form-control {
    padding: 0.625rem;
    font-size: 0.95rem;
  }

  /* Footer mobile */
  .footer {
    padding: 2rem 0 1rem;
  }

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

  .footer-section {
    text-align: center;
  }

  /* Typography mobile */
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  h4 { font-size: 1.125rem; }
  h5 { font-size: 1rem; }
  h6 { font-size: 0.95rem; }

  /* Section spacing mobile */
  .section {
    padding: 3rem 0;
  }

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

  /* Timeline mobile */
  .timeline::before {
    left: 20px;
  }
  
  .timeline-item {
    width: 100%;
    left: 0 !important;
    text-align: left !important;
    padding: 1rem 1rem 1rem 3rem;
  }
  
  .timeline-item::before {
    left: 12px !important;
    right: auto !important;
  }
  
  /* Process steps mobile */
  .process-step {
    margin-bottom: 2rem;
  }
  
  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  /* Utilities mobile */
  .mb-5 { margin-bottom: 2rem; }
  .mt-5 { margin-top: 2rem; }
  .p-5 { padding: 2rem; }
}

/* ========== ACCESSIBILITY FEATURES ========== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-1: #0000ff;
    --primary-2: #ff0000;
    --primary-3: #008000;
    --primary-4: #ff8000;
    --primary-5: #800080;
    --gray: #666666;
    --dark-gray: #333333;
    --black: #000000;
  }

  .card {
    border: 2px solid var(--dark-gray);
  }

  .btn {
    border: 2px solid currentColor;
  }

  .form-control {
    border: 2px solid var(--dark-gray);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero::before {
    animation: none;
  }

  .card:hover,
  .gallery-item:hover,
  .btn:hover {
    transform: none;
  }
}

/* Focus styles for better accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--primary-1);
  outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-1);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  z-index: 9999;
}

.skip-link:focus {
  top: 6px;
}

/* ========== PRINT STYLES ========== */
@media print {
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .header,
  .footer,
  .btn,
  .navbar,
  .breadcrumb {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }

  .card {
    border: 1px solid #ddd !important;
    page-break-inside: avoid;
  }

  .gallery-item,
  .team-member {
    page-break-inside: avoid;
  }

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

/* ========== LANDSCAPE ORIENTATION ========== */
@media screen and (orientation: landscape) and (max-height: 500px) {
  .hero {
    min-height: 100vh;
    padding: 2rem 0;
  }

  .hero-title {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

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

  .section {
    padding: 2rem 0;
  }
}

/* ========== TABLET SPECIFIC STYLES ========== */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }

  .service-card {
    margin-bottom: 1.5rem;
  }

  .team-photo {
    width: 130px;
    height: 130px;
  }

  .contact-form {
    padding: 2rem;
  }
}

/* ========== HOVER EFFECTS FOR TOUCH DEVICES ========== */
@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .gallery-item:hover,
  .btn:hover {
    transform: none;
  }

  .navbar-nav .nav-link:hover {
    color: var(--white) !important;
  }

  .faq-question:hover {
    background: var(--light-gray);
    color: var(--black);
  }
}

/* ========== DARK MODE SUPPORT (Optional) ========== */

/* ========== CONTAINER QUERIES (Future-proofing) ========== */
@supports (container-type: inline-size) {
  .card-container {
    container-type: inline-size;
  }

  @container (min-width: 300px) {
    .card-body {
      padding: 1.5rem;
    }
  }

  @container (min-width: 400px) {
    .card-body {
      padding: 2rem;
    }
  }
}

/* ========== GRID FALLBACK FOR OLDER BROWSERS ========== */
@supports not (display: grid) {
  .gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .gallery-item {
    flex: 1 1 calc(33.333% - 1rem);
    min-width: 250px;
  }

  .footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
  }

  .footer-section {
    flex: 1 1 250px;
  }
}

/* ========== INTERNET EXPLORER 11 FALLBACKS ========== */
@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {
  .card {
    border: 1px solid var(--light-gray);
  }

  .btn {
    border: 1px solid transparent;
  }

  .gallery-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
  }

  .gallery-item {
    -ms-flex: 1 1 calc(33.333% - 1rem);
    flex: 1 1 calc(33.333% - 1rem);
    min-width: 250px;
  }
}

/* ========== UTILITY CLASSES FOR RESPONSIVE DESIGN ========== */
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-none { display: none; }

@media (max-width: 575px) {
  .d-sm-none { display: none; }
  .d-sm-block { display: block; }
  .d-sm-flex { display: flex; }
}

@media (min-width: 576px) and (max-width: 767px) {
  .d-md-none { display: none; }
  .d-md-block { display: block; }
  .d-md-flex { display: flex; }
}

@media (min-width: 768px) and (max-width: 991px) {
  .d-lg-none { display: none; }
  .d-lg-block { display: block; }
  .d-lg-flex { display: flex; }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .d-xl-none { display: none; }
  .d-xl-block { display: block; }
  .d-xl-flex { display: flex; }
}

@media (min-width: 1200px) {
  .d-xxl-none { display: none; }
  .d-xxl-block { display: block; }
  .d-xxl-flex { display: flex; }
}

/* ========== RESPONSIVE SPACING UTILITIES ========== */
@media (max-width: 767px) {
  .p-sm-2 { padding: 0.5rem; }
  .p-sm-3 { padding: 1rem; }
  .p-sm-4 { padding: 1.5rem; }
  .p-sm-5 { padding: 2rem; }
  
  .m-sm-2 { margin: 0.5rem; }
  .m-sm-3 { margin: 1rem; }
  .m-sm-4 { margin: 1.5rem; }
  .m-sm-5 { margin: 2rem; }
  
  .mb-sm-2 { margin-bottom: 0.5rem; }
  .mb-sm-3 { margin-bottom: 1rem; }
  .mb-sm-4 { margin-bottom: 1.5rem; }
  .mb-sm-5 { margin-bottom: 2rem; }
  
  .mt-sm-2 { margin-top: 0.5rem; }
  .mt-sm-3 { margin-top: 1rem; }
  .mt-sm-4 { margin-top: 1.5rem; }
  .mt-sm-5 { margin-top: 2rem; }
}

/* ========== RESPONSIVE FONT SIZES ========== */
@media (max-width: 767px) {
  .fs-sm-1 { font-size: 0.8rem; }
  .fs-sm-2 { font-size: 0.9rem; }
  .fs-sm-3 { font-size: 1rem; }
  .fs-sm-4 { font-size: 1.1rem; }
  .fs-sm-5 { font-size: 1.2rem; }
}

@media (min-width: 768px) {
  .fs-md-1 { font-size: 0.9rem; }
  .fs-md-2 { font-size: 1rem; }
  .fs-md-3 { font-size: 1.1rem; }
  .fs-md-4 { font-size: 1.2rem; }
  .fs-md-5 { font-size: 1.3rem; }
}

@media (min-width: 992px) {
  .fs-lg-1 { font-size: 1rem; }
  .fs-lg-2 { font-size: 1.1rem; }
  .fs-lg-3 { font-size: 1.2rem; }
  .fs-lg-4 { font-size: 1.3rem; }
  .fs-lg-5 { font-size: 1.4rem; }
} 