/*
 * FONON mobile v10
 * Mobile-only styling: NO desktop breakpoints or overrides.
 * 1. Two statistics cards per row
 * 2. Two compact, readable service cards per row
 * 3. RTL horizontal, swipeable portfolio carousel
 */
@media screen and (max-width: 760px) {
  /* Keep page content within the viewport. */
  .stats-grid,
  .service-grid,
  .section.work .portfolio-grid {
    min-width: 0;
  }

  /* 01 — Facts/statistics: two boxes per row */
  .stats .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .stats .stats-grid > div {
    min-width: 0;
    min-height: 134px;
    padding: 18px 14px;
    border-radius: 19px;
    box-shadow: 0 8px 22px rgba(32, 21, 29, .05);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .stats .stats-grid strong {
    font-size: clamp(23px, 6.3vw, 32px);
    line-height: 1.18;
    margin-bottom: 9px;
    letter-spacing: -.6px;
    overflow-wrap: anywhere;
  }
  .stats .stats-grid span {
    display: block;
    font-size: clamp(12px, 3.45vw, 15px);
    line-height: 1.7;
    color: #454044;
    overflow-wrap: anywhere;
  }

  /* 02 — Services: same two-column idea, without overwhelming text */
  .services .section-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 24px;
  }
  .services .section-top h2 {
    font-size: clamp(29px, 8vw, 36px);
    max-width: 100%;
    line-height: 1.25;
  }
  .services .section-top > p {
    font-size: 14px;
    line-height: 1.95;
    margin: 0;
  }
  .services .service-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .services .service-card {
    width: 100%;
    min-width: 0;
    min-height: 226px;
    height: 100%;
    padding: 18px 13px 20px;
    border-radius: 19px;
    box-shadow: 0 8px 22px rgba(32, 21, 29, .05);
    overflow-wrap: anywhere;
  }
  .services .service-symbol {
    margin-bottom: 14px;
    min-height: 29px;
    font-size: 26px;
  }
  .services .service-symbol .service-line-icon {
    width: 28px;
    height: 28px;
  }
  .services .service-count {
    left: 15px;
    top: 17px;
    font-size: 12px;
  }
  .services .service-card h3 {
    font-size: clamp(14px, 4vw, 17px);
    line-height: 1.5;
    margin-bottom: 9px;
  }
  .services .service-card p {
    font-size: clamp(11.5px, 3.15vw, 13px);
    line-height: 1.85;
    margin: 0;
    color: #665d63;
  }

  /* 03 — Selected works: RTL, swipe-friendly, responsive carousel */
  .section.work .section-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 22px;
  }
  .section.work .section-top h2 {
    font-size: clamp(30px, 8vw, 38px);
    line-height: 1.25;
    margin-bottom: 6px;
  }
  .section.work .section-top .text-link {
    align-self: flex-start;
    font-size: 14px;
  }
  .section.work .portfolio-grid {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 13px;
    overflow-x: auto;
    overflow-y: hidden;
    direction: rtl;
    scroll-snap-type: x mandatory;
    scroll-padding-inline-start: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
    padding: 2px 2px 16px;
    margin: 0;
  }
  .section.work .portfolio-grid::-webkit-scrollbar {
    display: none;
  }
  .section.work .portfolio-card {
    display: flex;
    flex-direction: column;
    flex: 0 0 min(81%, 340px);
    width: min(81%, 340px);
    min-width: 0;
    height: auto;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    border-radius: 21px;
    transform: none;
    box-shadow: 0 8px 22px rgba(40, 20, 32, .08);
  }
  .section.work .portfolio-card:hover {
    transform: none;
  }
  .section.work .portfolio-media {
    width: 100%;
    aspect-ratio: 1.18 / 1;
    min-height: 0;
    background: #fff;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
  }
  .section.work .portfolio-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }
  .section.work .portfolio-detail {
    padding: 15px 17px 18px;
    flex: 1;
  }
  .section.work .portfolio-detail h3 {
    font-size: 19px;
    line-height: 1.45;
    margin-bottom: 7px;
  }
  .section.work .portfolio-detail span {
    font-size: 12px;
    margin-bottom: 5px;
  }
  .section.work .portfolio-detail p {
    margin: 0;
    font-size: 12px;
    line-height: 1.8;
  }

  /* These controls are only inserted for mobile by mobile-v10.js. */
  .fonon-mobile-carousel-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2px 0 6px;
    gap: 16px;
    direction: ltr;
  }
  .fonon-mobile-carousel-controls .carousel-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    direction: rtl;
  }
  .fonon-mobile-carousel-controls .carousel-dot {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 99px;
    padding: 0;
    background: #d7cbd1;
    cursor: pointer;
    transition: width .2s ease, background .2s ease;
  }
  .fonon-mobile-carousel-controls .carousel-dot[aria-current="true"] {
    background: #c11856;
    width: 23px;
  }
  .fonon-mobile-carousel-controls .carousel-arrows {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .fonon-mobile-carousel-controls .carousel-arrow {
    display: grid;
    place-items: center;
    height: 39px;
    width: 39px;
    border-radius: 50%;
    border: 1px solid #dfccd5;
    background: #fff;
    color: #a41950;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    touch-action: manipulation;
  }
  .fonon-mobile-carousel-controls .carousel-arrow:focus-visible,
  .fonon-mobile-carousel-controls .carousel-dot:focus-visible {
    outline: 3px solid #c11856;
    outline-offset: 3px;
  }
}

@media screen and (max-width: 360px) {
  .stats .stats-grid,
  .services .service-grid { gap: 9px; }
  .stats .stats-grid > div { padding: 15px 11px; }
  .services .service-card { padding: 16px 10px 18px; }
  .services .service-card h3 { font-size: 13.5px; }
  .services .service-card p { font-size: 11.5px; }
}

@media screen and (prefers-reduced-motion: reduce) and (max-width: 760px) {
  .section.work .portfolio-grid { scroll-behavior: auto; }
}
