/* ==========================================================================
   KRAFTING DIGITAL — RESPONSIVE MEDIA QUERIES (RESPONSIVE.CSS)
   Targeted Coverage: 320px, 360px, 375px, 390px, 414px, 430px, 
                      768px, 820px, 1024px, 1280px, 1440px, 1920px
   ========================================================================== */

/* --------------------------------------------------------------------------
   Widescreen Displays (1440px - 1920px+)
   -------------------------------------------------------------------------- */
@media (min-width: 1440px) {
  .container-custom {
    max-width: 1360px;
  }

  .hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4.5rem;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   Standard Desktops & Laptops (1025px - 1439px)
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) and (max-width: 1439px) {
  .hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3.5rem;
    align-items: center;
  }

  .footer-top-grid {
    grid-template-columns: 1.25fr 0.85fr 1.05fr 1.6fr;
    gap: 2.75rem;
    align-items: start;
  }
}

/* --------------------------------------------------------------------------
   Small Laptops & Large Tablets (992px - 1024px)
   -------------------------------------------------------------------------- */
@media (min-width: 992px) and (max-width: 1024px) {
  .footer-top-grid {
    grid-template-columns: 1.2fr 0.85fr 1fr 1.55fr;
    gap: 2rem;
    align-items: start;
  }

  .footer-brand p {
    max-width: 250px;
  }
}

/* --------------------------------------------------------------------------
   Tablets & Landscape Mobile (769px - 1024px)
   (e.g., iPad Mini, iPad Air 820px, iPad Pro 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root {
    --kd-header-height: 72px;
  }

  .site-header {
    height: var(--kd-header-height);
  }

  .brand-logo-img {
    height: 48px;
    max-width: 130px;
  }

  .nav-menu,
  .nav-actions .contact-quick-link,
  .nav-actions .btn-kd-primary,
  .nav-actions a:not(.mobile-toggle) {
    display: none !important;
  }

  .mobile-toggle {
    display: flex;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    text-align: center;
  }

  .hero-content {
    max-width: 700px;
    margin: 0 auto;
  }

  .hero-cta-group {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Tablets Only (768px - 991px)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 991px) {
  .footer-top-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.75rem 2.5rem;
  }

  .footer-brand {
    grid-column: span 1;
  }
}

/* --------------------------------------------------------------------------
   Standard Tablets & Portrait Mode (768px - 820px)
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .section {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
  }

  .hero-stats {
    gap: 1.5rem;
  }

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

/* --------------------------------------------------------------------------
   Mobile Devices (< 768px)
   (e.g., 430px iPhone Pro Max, 414px, 390px, 375px, 360px, 320px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .container-custom {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .section {
    padding-top: 3.75rem;
    padding-bottom: 3.75rem;
  }

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

  .hero-stats {
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 1rem;
  }

  .hero-cta-group .btn-kd-primary,
  .hero-cta-group .btn-kd-secondary,
  .hero-actions .btn-kd-primary,
  .hero-actions .btn-kd-secondary {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  /* Full-Screen Hero Mobile Responsiveness (Home, About, Contact, Portfolio, 404) */
  .editorial-hero,
  .kd-banner,
  .portfolio-sparkles-hero,
  #contactHeroSection {
    min-height: calc(100vh - var(--kd-header-height)) !important;
    min-height: calc(100svh - var(--kd-header-height)) !important;
    min-height: calc(100dvh - var(--kd-header-height)) !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: clamp(1.25rem, 3.5vw, 2.5rem) !important;
    padding-bottom: clamp(1.5rem, 4vw, 2.5rem) !important;
    box-sizing: border-box;
  }

  /* Internal Content & Service Page Banners (Natural Growth, No Over-Stretching) */
  .page-hero:not(.editorial-hero):not(.portfolio-sparkles-hero):not(#contactHeroSection),
  .hero-banner-850:not(.editorial-hero):not(.portfolio-sparkles-hero):not(#contactHeroSection),
  .ppc-hero-section {
    min-height: auto !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: clamp(1.5rem, 4vw, 2.75rem) !important;
    padding-bottom: clamp(1.75rem, 4.5vw, 2.75rem) !important;
    box-sizing: border-box;
  }

  /* Editorial & Page Hero Title Responsiveness */
  .editorial-hero-title,
  .hero-title,
  .page-hero h1,
  .editorial-hero h1 {
    font-size: clamp(1.75rem, 6.2vw, 2.35rem) !important;
    line-height: 1.16 !important;
    word-break: break-word;
    overflow-wrap: break-word;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem !important;
  }

  .hero-subtitle,
  .page-hero .lead,
  .editorial-hero .lead {
    font-size: clamp(0.92rem, 3.4vw, 1.05rem) !important;
    line-height: 1.55 !important;
    margin-bottom: 1.25rem !important;
  }

  .hero-actions,
  .editorial-col-center .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  /* Hide intrusive floating icons on mobile (< 768px) so text and buttons are clean and unobstructed */
  .seo-floating-icon,
  .web-floating-icon,
  .about-floating-icon,
  .home-floating-icon {
    display: none !important;
  }

  /* Frameless Hero Graphics on Mobile (SEO, SMM, Web Designing) */
  .seo-hero-media-stage,
  .web-hero-media-stage,
  .smm-hero-media-stage {
    margin-top: 1.5rem;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .seo-hero-graphic-wrap,
  .web-hero-graphic-wrap,
  .smm-hero-slider-wrap {
    max-width: 100% !important;
    width: 100% !important;
  }

  .seo-hero-graphic {
    max-height: 340px !important;
    transform: scale(1) !important;
    width: auto !important;
    max-width: 100% !important;
  }

  .smm-slider-container {
    min-height: auto !important;
    max-height: 360px !important;
  }

  .smm-slide-img {
    min-height: auto !important;
    max-height: 340px !important;
    transform: scale(1) !important;
    width: auto !important;
    max-width: 100% !important;
  }

  .web-hero-graphic {
    max-height: 320px !important;
    transform: scale(1) !important;
    width: auto !important;
    max-width: 100% !important;
  }

  .editorial-stat-block {
    justify-content: flex-start;
  }

  .cta-banner {
    padding: 3rem 1.5rem;
  }

  .cta-actions {
    flex-direction: column;
    width: 100%;
  }

  .cta-actions .btn-kd-primary,
  .cta-actions .btn-kd-secondary {
    width: 100%;
  }

  /* Centered Footer for Phone View */
  .site-footer {
    padding-top: 4rem;
    padding-bottom: 2.25rem;
    margin-top: 4rem;
    text-align: center;
  }

  .footer-top-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.75rem;
    text-align: center;
    margin-bottom: 2.5rem;
  }

  .footer-brand {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
  }

  .footer-brand .brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem auto;
  }

  .footer-brand .brand-logo .brand-logo-img {
    height: 58px;
    max-width: 150px;
    margin: 0 auto;
  }

  .footer-brand p {
    text-align: center;
    margin: 0 auto 1.5rem auto;
    max-width: 320px;
    font-size: 0.92rem;
    line-height: 1.65;
  }

  .footer-socials {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
  }

  .footer-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
  }

  .footer-col h4 {
    text-align: center;
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
  }

  .footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.85rem;
    padding: 0;
    margin: 0 auto;
    width: 100%;
  }

  .footer-links li {
    width: 100%;
    text-align: center;
  }

  .footer-links a {
    display: inline-block;
    text-align: center;
    padding-left: 0;
    font-size: 0.95rem;
  }

  .footer-links a:hover {
    padding-left: 0;
    transform: translateY(-2px);
    color: var(--kd-accent-cyan);
  }

  .footer-contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    margin: 0 auto 1.1rem auto;
    max-width: 320px;
    width: 100%;
    font-size: 0.93rem;
  }

  .footer-contact-item svg {
    flex-shrink: 0;
    margin-top: 0;
  }

  .footer-contact-item div {
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
    align-items: center;
    justify-content: center;
    padding-top: 2rem;
  }

  .footer-bottom>div {
    text-align: center;
  }

  .footer-bottom a {
    margin: 0 0.85rem;
  }

  .portfolio-filter-tabs {
    justify-content: center;
  }

  .filter-tab-btn {
    width: 100%;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Compact Mobile Screens (<= 390px / 375px / 360px / 320px)
   -------------------------------------------------------------------------- */
@media (max-width: 390px) {
  h1, .hero-title, .editorial-hero-title, .page-hero h1 {
    font-size: clamp(1.65rem, 7.5vw, 1.95rem) !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 1.45rem !important;
  }

  .btn-kd-primary,
  .btn-kd-secondary,
  .btn-kd-lg {
    padding: 0.72rem 1.15rem !important;
    font-size: 0.88rem !important;
    width: 100% !important;
  }

  .seo-hero-graphic {
    max-height: 260px !important;
  }

  .smm-slide-img {
    max-height: 260px !important;
  }

  .web-hero-graphic {
    max-height: 240px !important;
  }

  .kd-glass-card {
    padding: 1.25rem;
  }

  .floating-chip {
    font-size: 0.75rem;
    padding: 6px 12px;
  }
}

@media (max-width: 320px) {
  html {
    font-size: 14px;
  }

  h1, .hero-title, .editorial-hero-title, .page-hero h1 {
    font-size: 1.45rem !important;
  }

  .seo-hero-graphic {
    max-height: 200px !important;
  }

  .smm-slide-img {
    max-height: 200px !important;
  }

  .web-hero-graphic {
    max-height: 180px !important;
  }

  .brand-logo-text {
    font-size: 1.15rem;
  }

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

/* --------------------------------------------------------------------------
   Short Mobile Screens & Landscape Orientation (e.g. 844x390, max-height: 600px)
   -------------------------------------------------------------------------- */
@media (max-height: 600px) and (orientation: landscape) {
  :root {
    --kd-header-height: 56px;
  }

  .site-header {
    height: var(--kd-header-height) !important;
  }

  body {
    padding-top: var(--kd-header-height) !important;
  }

  .page-hero,
  .editorial-hero,
  .hero-banner-850,
  .kd-banner,
  .portfolio-sparkles-hero,
  #contactHeroSection {
    min-height: auto !important;
    padding-top: 1rem !important;
    padding-bottom: 1.25rem !important;
  }

  .editorial-hero-title,
  .hero-title,
  .page-hero h1,
  .editorial-hero h1 {
    font-size: 1.65rem !important;
    line-height: 1.15 !important;
    margin-bottom: 0.5rem !important;
  }

  .hero-subtitle,
  .page-hero .lead,
  .editorial-hero .lead {
    font-size: 0.88rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.85rem !important;
  }

  .hero-actions,
  .editorial-col-center .hero-actions {
    flex-direction: row !important;
    gap: 0.75rem !important;
    justify-content: center !important;
  }

  .hero-actions .btn-kd-primary,
  .hero-actions .btn-kd-secondary {
    width: auto !important;
    padding: 0.5rem 1.25rem !important;
    font-size: 0.85rem !important;
  }

  .seo-hero-graphic,
  .smm-slide-img,
  .web-hero-graphic {
    max-height: 180px !important;
  }
}

@media (max-height: 650px) and (orientation: portrait) {
  .editorial-hero,
  .kd-banner,
  .portfolio-sparkles-hero {
    min-height: calc(100svh - var(--kd-header-height)) !important;
    min-height: calc(100dvh - var(--kd-header-height)) !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  .page-hero:not(.editorial-hero):not(.portfolio-sparkles-hero),
  .hero-banner-850:not(.editorial-hero):not(.portfolio-sparkles-hero) {
    min-height: auto !important;
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }

  .editorial-hero-title,
  .hero-title,
  .page-hero h1 {
    font-size: 1.65rem !important;
    margin-bottom: 0.5rem !important;
  }

  .hero-subtitle,
  .page-hero .lead {
    font-size: 0.88rem !important;
    margin-bottom: 0.85rem !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile Responsive Brand Logo Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .brand-logo-img {
    height: 44px;
    max-width: 115px;
  }

  .mobile-drawer .brand-logo-img {
    height: 46px;
    max-width: 120px;
  }
}

@media (max-width: 480px) {
  .brand-logo-img {
    height: 40px;
    max-width: 105px;
  }

  .mobile-drawer .brand-logo-img {
    height: 42px;
    max-width: 110px;
  }

  .footer-brand .brand-logo .brand-logo-img {
    height: 52px;
    max-width: 135px;
  }
}

@media (max-width: 360px) {
  .brand-logo-img {
    height: 36px;
    max-width: 95px;
  }

  .mobile-drawer .brand-logo-img {
    height: 38px;
    max-width: 100px;
  }
}

/* --------------------------------------------------------------------------
   Service Cards & Section 4 Mobile & Tablet Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .service-card {
    padding: 1.6rem 1.25rem !important;
  }

  .service-icon-box {
    width: 46px !important;
    height: 46px !important;
    font-size: 1.3rem !important;
    margin-bottom: 1.15rem !important;
  }

  .service-title {
    font-size: 1.2rem !important;
  }
}

@media (max-width: 480px) {
  .eyebrow {
    font-size: 0.72rem !important;
    padding: 0.28rem 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }

  .service-card {
    padding: 1.4rem 1.1rem !important;
  }

  .service-icon-box {
    width: 42px !important;
    height: 42px !important;
    font-size: 1.2rem !important;
    margin-bottom: 1rem !important;
  }

  .service-features-list {
    margin: 0.9rem 0 1.2rem !important;
  }

  .service-features-list li {
    font-size: 0.82rem !important;
  }
}