/* ==========================================================================
   TAX SPARROW — Responsive Styles
   Consolidated responsive overrides for all page types.
   Each page-specific CSS file also contains its own responsive rules.
   This file handles global/shared responsive adjustments and anything
   not covered in individual stylesheets.
   ========================================================================== */


/* ==========================================================================
   TABLET (max-width: 1024px)
   ========================================================================== */

@media (max-width: 1024px) {

  /* --- Typography scale down ------------------------------------------- */
  :root {
    --section-py: clamp(4rem, 3rem + 4vw, 8rem);
  }

  /* --- Container padding increase for tablets -------------------------- */
  .container {
    padding-inline: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  }

  /* --- Two-column grids to single column ------------------------------- */
  .about__inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .about__text {
    max-width: 100%;
  }

  .about__image {
    max-width: 480px;
  }

  .diff__inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  /* --- Services grid: 3 -> 2 columns ---------------------------------- */
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* --- Footer grid: 4 -> 2 columns ------------------------------------ */
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  /* --- Service page sidebar unstick ------------------------------------ */
  .service-body__grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .service-sidebar {
    position: static;
    max-width: 480px;
  }

  /* --- Blog related posts: 3 -> 2 columns ------------------------------ */
  .related-posts__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* --- Kontakt grid ---------------------------------------------------- */
  .kontakt-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}


/* ==========================================================================
   MOBILE (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {

  /* --- Navigation ------------------------------------------------------ */
  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  .nav__mobile-cta {
    display: block;
  }

  body {
    padding-bottom: 60px;
  }

  /* --- Hero ------------------------------------------------------------- */
  .hero__heading-line1 {
    font-size: var(--text-5xl);
  }

  .hero__heading-line2 {
    font-size: var(--text-4xl);
  }

  .hero__tagline {
    font-size: var(--text-base);
  }

  .hero__scroll-hint {
    display: none;
  }

  /* --- Trust bar ------------------------------------------------------- */
  .trust-bar__inner {
    flex-direction: column;
    gap: var(--space-4);
  }

  .trust-bar__badges {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .trust-bar__badges::-webkit-scrollbar {
    display: none;
  }

  /* --- Section headings smaller ---------------------------------------- */
  .section-heading {
    font-size: var(--text-3xl);
  }

  /* --- Services grid: single column ------------------------------------ */
  .services__grid {
    grid-template-columns: 1fr;
  }

  /* --- Stats bar: 4 -> 2 columns --------------------------------------- */
  .stats-bar__inner {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  .stats-bar__item + .stats-bar__item::before {
    display: none;
  }

  /* --- How it works: stack --------------------------------------------- */
  .how-it-works__steps {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .how-it-works__steps::before {
    display: none;
  }

  .how-it-works__step-desc {
    max-width: none;
  }

  /* --- Testimonial ----------------------------------------------------- */
  .testimonial__text {
    font-size: var(--text-xl);
  }

  /* --- Blog preview ---------------------------------------------------- */
  .blog-preview__grid {
    grid-template-columns: 1fr;
  }

  .blog-preview__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  /* --- CTA section ----------------------------------------------------- */
  .cta-section__heading {
    font-size: var(--text-3xl);
  }

  .cta-section__trust {
    grid-template-columns: 1fr;
  }

  /* --- Footer ---------------------------------------------------------- */
  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .site-footer__bottom {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }

  .site-footer__legal {
    justify-content: center;
  }

  /* --- Service pages --------------------------------------------------- */
  .service-hero {
    min-height: 50vh;
    padding-top: calc(var(--section-py) + var(--space-10));
  }

  .service-hero__heading {
    font-size: var(--text-4xl);
    max-width: none;
  }

  .service-personas__grid {
    grid-template-columns: 1fr;
  }

  .service-related__grid {
    grid-template-columns: 1fr;
  }

  .service-related__grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--space-2);
  }

  .service-related__grid::-webkit-scrollbar {
    display: none;
  }

  .service-related__card {
    flex-shrink: 0;
    min-width: 280px;
    scroll-snap-align: start;
  }

  /* --- Blog pages ------------------------------------------------------ */
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .post-hero {
    min-height: 40vh;
    padding-top: calc(var(--section-py) + var(--space-8));
  }

  .post-hero--has-image {
    min-height: 45vh;
  }

  .post-hero__heading {
    font-size: var(--text-4xl);
    max-width: none;
  }

  .post-prose {
    font-size: var(--text-base);
  }

  .post-prose h2 {
    font-size: var(--text-2xl);
    margin-top: var(--space-12);
  }

  .post-prose h3 {
    font-size: var(--text-xl);
    margin-top: var(--space-10);
  }

  .author-box__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .related-posts__grid {
    grid-template-columns: 1fr;
  }

  /* --- Plugin pages ---------------------------------------------------- */
  .plugin-hero {
    min-height: 30vh;
    padding-top: calc(var(--section-py) + var(--space-8));
  }

  .plugin-hero__heading {
    font-size: var(--text-4xl);
  }

  .plugin-container {
    padding: var(--space-6);
  }

  .kontakt-info {
    order: 2;
  }

  .kontakt-form {
    order: 1;
  }

  .kontakt-trust__inner {
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
  }

  /* --- Legal pages ----------------------------------------------------- */
  .legal-hero__heading {
    font-size: var(--text-3xl);
  }

  /* --- 404 page -------------------------------------------------------- */
  .error-404__code {
    font-size: var(--text-6xl);
  }

  /* --- Buttons: larger touch targets ----------------------------------- */
  .btn {
    padding: var(--space-3) var(--space-6);
    min-height: 44px;
  }

  .btn--large {
    padding: var(--space-4) var(--space-8);
  }

  /* --- Pretitle: smaller ------------------------------------------------ */
  .pretitle {
    font-size: clamp(0.65rem, 0.6rem + 0.2vw, 0.75rem);
  }
}


/* ==========================================================================
   SMALL PHONE (max-width: 480px)
   ========================================================================== */

@media (max-width: 480px) {

  /* --- Further heading reductions -------------------------------------- */
  .hero__heading-line1 {
    font-size: var(--text-4xl);
  }

  .hero__heading-line2 {
    font-size: var(--text-3xl);
  }

  .section-heading {
    font-size: var(--text-2xl);
  }

  .cta-section__heading {
    font-size: var(--text-2xl);
  }

  /* --- Section padding reduction --------------------------------------- */
  :root {
    --section-py: clamp(3rem, 2.5rem + 3vw, 6rem);
    --section-px: clamp(1rem, 0.75rem + 1.5vw, 1.5rem);
  }

  /* --- Stats bar: single column on very small screens ------------------ */
  .stats-bar__inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .stat-card__number {
    font-size: var(--text-4xl);
  }

  /* --- How it works step number smaller -------------------------------- */
  .how-it-works__step-number {
    width: 56px;
    height: 56px;
    font-size: var(--text-lg);
  }

  /* --- Touch target minimum 44px --------------------------------------- */
  .nav__link,
  .nav__overlay-link,
  .site-footer__col-link,
  .blog-card__readmore,
  .service-related__card,
  .faq-item__question {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* --- Service hero ---------------------------------------------------- */
  .service-hero__heading {
    font-size: var(--text-3xl);
  }

  .service-hero__subtitle {
    font-size: var(--text-base);
  }

  /* --- Post hero ------------------------------------------------------- */
  .post-hero__heading {
    font-size: var(--text-3xl);
  }

  /* --- Plugin hero ----------------------------------------------------- */
  .plugin-hero__heading {
    font-size: var(--text-3xl);
  }

  /* --- Service content typography -------------------------------------- */
  .service-content h2 {
    font-size: var(--text-2xl);
  }

  .service-content h3 {
    font-size: var(--text-xl);
  }

  .service-content p {
    font-size: var(--text-base);
  }

  /* --- FAQ items: full width ------------------------------------------- */
  .faq-item__question {
    font-size: var(--text-base);
    padding: var(--space-4) 0;
  }

  .faq-item__answer-inner {
    font-size: var(--text-sm);
  }

  /* --- Blog card body padding ------------------------------------------ */
  .blog-card__body {
    padding: var(--space-4) var(--space-4) var(--space-6);
  }

  /* --- Personas cards -------------------------------------------------- */
  .service-personas__card {
    padding: var(--space-6);
  }

  /* --- Sidebar boxes --------------------------------------------------- */
  .service-sidebar__box {
    padding: var(--space-5);
  }

  /* --- Legal prose ------------------------------------------------------ */
  .legal-prose {
    font-size: var(--text-sm);
  }

  .legal-prose h2 {
    font-size: var(--text-xl);
  }

  /* --- Error 404 ------------------------------------------------------- */
  .error-404__code {
    font-size: var(--text-5xl);
  }

  .error-404__heading {
    font-size: var(--text-2xl);
  }

  .error-404__text {
    font-size: var(--text-base);
  }
}


/* ==========================================================================
   REDUCED MOTION
   Disable animations for users who prefer reduced motion.
   ========================================================================== */

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__scroll-hint {
    animation: none;
  }
}


/* ==========================================================================
   PRINT
   Minimal print styles for readability.
   ========================================================================== */

@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
    padding-bottom: 0;
  }

  .nav,
  .nav__overlay,
  .nav__mobile-cta,
  .grain-overlay,
  .hero__scroll-hint,
  .cta-section,
  .cta-section__glow,
  .site-footer {
    display: none !important;
  }

  .hero {
    min-height: auto;
    page-break-after: avoid;
  }

  .hero__bg {
    display: none;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  .btn::after {
    display: none;
  }
}


/* ============================================
   Mobile fixes - v3.1 (2026-03-25)
   ============================================ */

@media (max-width: 768px) {
  /* Tighter section spacing on mobile */
  :root {
    --section-py: clamp(2rem, 2rem + 2vw, 3.5rem);
  }

  /* Hero: less vertical space */
  .hero {
    min-height: 85vh;
    min-height: 85dvh;
  }

  .hero__content {
    padding-top: var(--space-12);
    padding-bottom: var(--space-8);
  }

  /* About image: smaller on mobile */
  .about__image {
    max-height: 350px;
  }

  /* Services split header: stack vertically */
  .services__header--split {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .services__header-desc {
    text-align: left;
  }

  /* Footer social: horizontal row centered */
  .site-footer__social {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: center;
  }

  .site-footer__bottom {
    text-align: center;
  }

  .site-footer__legal {
    justify-content: center;
  }

  /* About social: ensure horizontal */
  .about__social {
    display: flex;
    flex-direction: row;
    gap: var(--space-3);
    justify-content: flex-start;
  }

  /* CTA email on mobile */
  .cta-section__email {
    word-break: break-all;
  }
}

@media (max-width: 480px) {
  /* Even tighter on small phones */
  :root {
    --section-py: clamp(1.5rem, 1.5rem + 2vw, 3rem);
  }

  .hero {
    min-height: 80vh;
    min-height: 80dvh;
  }

  /* About image even smaller */
  .about__image {
    max-height: 280px;
  }
}