/* ============================================================
   RIVEL Companies — Professional Responsive Enhancements
   Overrides Webflow defaults for better mobile/tablet UX.
   Load AFTER rivel-companies.webflow.css
   ============================================================ */

/* ---- GLOBAL FOUNDATIONS ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Prevent horizontal scroll from any child */
.padding-global,
.container,
section {
  max-width: 100vw;
  overflow-x: hidden;
}

/* ---- IMAGES GLOBAL ---- */
img {
  max-width: 100%;
  height: auto;
}

.blog-card-image img,
.image {
  object-fit: cover;
  width: 100%;
}

/* ---- NAVIGATION ENHANCEMENTS ---- */
/* Menu button: only enhance on mobile/tablet where it's visible */
@media screen and (max-width: 991px) {
  .menu-button {
    min-width: 44px;
    min-height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
}
/* Ensure hamburger stays hidden on desktop */
@media screen and (min-width: 992px) {
  .menu-button {
    display: none !important;
  }
}

.navbar-link {
  transition: opacity 0.2s ease;
}

.navbar-link:hover {
  opacity: 0.75;
}

/* ---- BLOG CARD IMPROVEMENTS ---- */
.blog-card {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.3s ease;
  border-radius: 0.75rem;
  overflow: hidden;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(132, 0, 255, 0.12);
}

.blog-card-image {
  overflow: hidden;
  border-radius: 0.5rem;
}

.blog-card-image img {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.04);
}

/* ---- BLOG DETAIL RICH TEXT ---- */
.rich-text-paddig {
  max-width: 75ch;
  margin-left: auto;
  margin-right: auto;
}

.rich-text img {
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

.rich-text blockquote {
  border-left: 3px solid rgba(132, 0, 255, 0.6);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  opacity: 0.9;
}

.rich-text h2,
.rich-text h3,
.rich-text h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.rich-text p {
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.rich-text ul,
.rich-text ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.rich-text li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

/* ---- FAQ IMPROVEMENTS ---- */
.faq-item {
  transition: background-color 0.25s ease, border-color 0.25s ease;
  border: 1px solid transparent;
}

.faq-item:hover {
  border-color: rgba(132, 0, 255, 0.25);
  background-color: rgba(255, 255, 255, 0.03);
}

.faq-top {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.faq-bottom {
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

/* ---- BUTTONS & LINKS ---- */
.w-button,
.banner-button,
.read-more-tag,
.double-button-component a {
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.w-button:hover,
.banner-button:hover,
.read-more-tag:hover {
  transform: translateY(-1px);
}

.w-button:active,
.banner-button:active,
.read-more-tag:active {
  transform: translateY(0);
}

/* ---- FOOTER ENHANCEMENTS ---- */
.footer-link {
  transition: opacity 0.2s ease, color 0.2s ease;
  padding: 0.15rem 0;
}

.footer-link:hover {
  opacity: 0.8;
}

.footer-social {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.footer-social:hover {
  transform: translateY(-2px);
  opacity: 0.8;
}

/* ---- TESTIMONIAL CARDS ---- */
.testimonial-card {
  transition: border-color 0.3s ease;
}

.testimonial-card:hover {
  border-color: rgba(132, 0, 255, 0.3);
}

/* ---- BANNER ---- */
.banner-wrapper {
  overflow: hidden;
}

.banner-background img {
  transition: transform 8s ease;
}

.banner-wrapper:hover .banner-background img {
  transform: scale(1.03);
}

/* ---- CUSTOM SCROLLBAR ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: rgba(132, 0, 255, 0.4);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(132, 0, 255, 0.6);
}

/* ---- SELECTION COLOR ---- */
::selection {
  background: rgba(132, 0, 255, 0.3);
  color: #fff;
}

/* ---- FOCUS STYLES (Accessibility) ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.w-button:focus-visible {
  outline: 2px solid rgba(132, 0, 255, 0.6);
  outline-offset: 2px;
}


/* ============================================================
   TABLET ENHANCEMENTS (max-width: 991px)
   ============================================================ */
@media screen and (max-width: 991px) {

  /* Fix footer — add 2-column grid instead of 4 */
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 3rem 4rem !important;
  }

  /* Fix hardcoded margins that overflow */
  .heading-21 {
    margin-right: 0 !important;
  }

  .paragraph-9 {
    margin-right: 0 !important;
  }

  /* Blog cards — tighter grid */
  .blog-list {
    gap: 1.5rem !important;
  }

  /* Better card image height */
  .blog-card-image {
    height: 35vh;
  }

  /* Testimonial grid — 2 visible */
  .testimonial-card.hide-landscape {
    display: none;
  }

  /* Integration blocks full width */
  .integration-block-trw.first,
  .integration-block-trw.second {
    width: 100%;
  }

  /* Rich text narrower for readability */
  .rich-text-paddig {
    max-width: 65ch;
  }
}


/* ============================================================
   MOBILE ENHANCEMENTS (max-width: 767px)
   ============================================================ */
@media screen and (max-width: 767px) {

  /* Blog card images — proportional, not viewport-based */
  .blog-card-image {
    height: auto !important;
    aspect-ratio: 16 / 10;
  }

  /* Blog list — less gap */
  .blog-list {
    gap: 2rem !important;
  }

  /* Blog detail — full width image */
  .blog-image-wrapper {
    border-radius: 0 !important;
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    width: calc(100% + 2.5rem);
  }

  .blog-image-wrapper .image {
    border-radius: 0;
  }

  /* Rich text — mobile optimized */
  .rich-text-paddig {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .rich-text p {
    font-size: 1rem;
    line-height: 1.7;
  }

  .rich-text h2 {
    font-size: 1.5rem;
  }

  .rich-text h3 {
    font-size: 1.25rem;
  }

  /* FAQ items — tighter padding */
  .faq-item {
    padding: 1.25rem !important;
  }

  .faq-bottom-content {
    padding-top: 0.75rem;
  }

  /* Footer — 2 columns with less gap */
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem 2rem !important;
  }

  .footer-component {
    padding-top: 4rem !important;
    padding-bottom: 2rem !important;
  }

  .footer-social-wrapper {
    gap: 1.5rem;
  }

  /* Buttons — full width on mobile */
  .double-button-component {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .double-button-component a,
  .double-button-component .w-button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Better touch targets */
  .navbar-link,
  .footer-link {
    padding: 0.5rem 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Hero heading — fluid sizing */
  .heading-2 {
    font-size: clamp(2rem, 8vw, 3.5rem) !important;
    line-height: 1.1 !important;
  }

  /* Contact form inputs */
  .text-field-2 {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    padding: 0.875rem 0 !important;
  }

  /* Steps — fixed height is bad */
  .steps-card {
    height: auto !important;
    min-height: 280px;
  }

  /* Banner */
  .banner-wrapper {
    padding: 2rem !important;
  }

  .banner-content .heading-5 {
    font-size: 1.25rem;
  }

  /* About hero interaction — reduce height */
  .about-hero-interaction {
    height: auto !important;
    min-height: 100vh;
  }

  /* Testimonials — single card */
  .testimonial-card {
    max-width: 100% !important;
  }

  /* Remove hover effects on mobile (touch devices) */
  .blog-card:hover {
    transform: none;
    box-shadow: none;
  }

  .blog-card:hover .blog-card-image img {
    transform: none;
  }

  /* Smooth page padding */
  .padding-global {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
}


/* ============================================================
   SMALL MOBILE ENHANCEMENTS (max-width: 479px)
   ============================================================ */
@media screen and (max-width: 479px) {

  /* Blog cards — minimal gap */
  .blog-list {
    gap: 1.5rem !important;
  }

  .blog-card-image {
    aspect-ratio: 16 / 9;
  }

  /* Footer — single column */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    text-align: center;
  }

  .footer-grid-wrap {
    align-items: center;
  }

  /* Fix double-button width */
  .double-button-component.margin-top-button-features {
    width: 100% !important;
  }

  /* Hero heading fluid */
  .heading-2 {
    font-size: clamp(1.75rem, 9vw, 2.5rem) !important;
  }

  /* Padding tighter */
  .padding-global {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* FAQ even tighter */
  .faq-item {
    padding: 1rem !important;
  }

  /* Banner tighter */
  .banner-wrapper {
    padding: 1.5rem !important;
  }

  /* Fix div-block-11 excessive margin */
  .div-block-11 {
    margin-top: 200px !important;
  }

  /* Steps — better sizing */
  .steps-card {
    min-height: 220px;
  }

  /* Orb doesn't need to be huge on small phones */
  #rivel-orb {
    max-width: 320px;
    max-height: 320px;
    margin: 0 auto;
  }
}


/* ============================================================
   LARGE DESKTOP (min-width: 1600px)
   ============================================================ */
@media screen and (min-width: 1600px) {
  .container {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
  }

  .blog-list {
    grid-template-columns: 1fr 1fr 1fr !important;
  }
}


/* ============================================================
   ANIMATIONS & TRANSITIONS (Reduced motion support)
   ============================================================ */
@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;
  }

  .rivel-revealed {
    animation: none !important;
    opacity: 1 !important;
  }
}


/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .navbar-component,
  .footer-component,
  .banner-wrapper,
  #rivel-orb {
    display: none !important;
  }

  .rich-text {
    max-width: 100%;
    font-size: 12pt;
    line-height: 1.5;
  }

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