/* “Fəaliyyət istiqamətləri”
 * Desktop: Homepage 4979:22430, Large Background 4979:22459.
 * Mobile: 5257:19790 (Frame 1618873942). Title copy is “Xidmət sahələri”.
 */

.aayda-activity-directions {
  display: none;
}

.aayda-activity-directions__inner--mobile {
  display: none;
}

@media (min-width: 1416px) {
  .aayda-activity-directions {
    display: block;
    width: 100%;
    max-width: var(--aayda-container-desktop);
    margin-inline: auto;
    background: var(--aayda-colors-surface-disabled);
    font-family: var(--aayda-typography-font-primary);
    color: var(--aayda-colors-text);
  }

  /* 4979:22459 Large Background — 1400×725 at x=20, radius 12, #FAFAFB.
     725 = 102 top + the 531px grid + 92 bottom. The height follows the grid rather than being fixed,
     so four cards draw the design's 725px exactly and a single card does not leave an empty row. */
  .aayda-activity-directions__panel {
    box-sizing: border-box;
    width: 1400px;
    height: auto;
    margin-left: 20px;
    margin-right: 20px;
    padding: 102px 64px 92px;
    overflow: hidden;
    background: var(--aayda-colors-surface-subtle);
    border-radius: 12px;
  }

  .aayda-activity-directions__grid {
    display: grid;
    grid-template-columns: 408px 408px 408px;
    grid-template-rows: 258px 256px;
    column-gap: 24px;
    row-gap: 17px;
    width: 1272px;
  }

  /* Only the first cell is filled (the top middle one), so the second row would be empty: drop it.
     With two or more cards the tall right column spans both rows and the grid keeps its shape. */
  .aayda-activity-directions--cards-1 .aayda-activity-directions__grid {
    grid-template-rows: 258px;
  }

  .aayda-activity-directions__title-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    grid-column: 1;
    grid-row: 1;
    gap: var(--aayda-numbers-spacing-16);
    align-self: start;
    width: 383px;
    height: 139px;
    overflow: visible;
  }

  .aayda-activity-directions__badge {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--aayda-numbers-spacing-4);
    box-sizing: border-box;
    width: max-content;
    max-width: 100%;
    height: 28px;
    padding: 3px 15px 3px 11px;
    margin: 0;
    font-size: var(--aayda-typography-size-12);
    font-weight: var(--aayda-typography-weight-medium);
    line-height: var(--aayda-typography-line-height-12);
    letter-spacing: var(--aayda-typography-letter-spacing-12);
    color: var(--aayda-colors-text);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.46);
    border: 1px solid var(--aayda-colors-base-white);
    border-radius: 28px;
  }

  .aayda-activity-directions__badge-icon {
    display: block;
    flex-shrink: 0;
    width: 15px;
    height: 14px;
  }

  .aayda-activity-directions__badge-icon img {
    display: block;
    width: 11px;
    height: 11px;
    margin: 2px 0 0 2px;
    max-width: none;
  }

  .aayda-activity-directions__title {
    box-sizing: border-box;
    width: 100%;
    height: 48px;
    margin: 0;
    overflow: visible;
    font-size: var(--aayda-typography-size-40);
    font-weight: var(--aayda-typography-weight-semi-bold);
    line-height: var(--aayda-typography-line-height-40);
    letter-spacing: var(--aayda-typography-letter-spacing-40);
    color: var(--aayda-colors-text);
  }

  .aayda-activity-directions__card {
    position: relative;
    /* The card is the link. display:block only states what the grid already forces, so that the
       rule reads the same if the card is ever taken out of the grid; the geometry is unchanged. */
    display: block;
    box-sizing: border-box;
    margin: 0;
    overflow: hidden;
    color: inherit;
    /* Otherwise the anchor underlines the title and the subtitle it wraps. */
    text-decoration: none;
    background: var(--aayda-colors-surface-subtle);
  }

  /* Keyboard only: the pointer already has hover, and a ring on click is not in the design. */
  .aayda-activity-directions__card:focus-visible {
    outline: var(--aayda-border-width-focus-ring) solid var(--aayda-colors-ring-focus);
    outline-offset: 2px;
  }

  .aayda-activity-directions__card-media {
    position: absolute;
    overflow: hidden;
    pointer-events: none;
  }

  /* The hover animation's canvas is framed by every rule the picture is (the selectors below name both), so
     its frames lie exactly where the picture lies, in every cell and in the crossings card's hover pose. */
  .aayda-activity-directions__card-media img,
  .aayda-activity-directions__card-media canvas.aayda-activity-directions__card-animation {
    position: absolute;
    display: block;
    max-width: none;
    pointer-events: none;
  }

  /* Hidden until frame one is on it; then the picture hides and the canvas shows, both at once. visibility
     rather than opacity, so the cells' own opacity (0.86, 0.97) applies to the frames as it does to the
     picture. */
  .aayda-activity-directions__card-media > canvas.aayda-activity-directions__card-animation {
    visibility: hidden;
  }

  .aayda-activity-directions__card[data-activity-animation-state="playing"] .aayda-activity-directions__card-media img {
    visibility: hidden;
  }

  .aayda-activity-directions__card[data-activity-animation-state="playing"] .aayda-activity-directions__card-media > canvas.aayda-activity-directions__card-animation {
    visibility: visible;
  }

  .aayda-activity-directions__card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px 0;
  }

  .aayda-activity-directions__card-label {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--aayda-numbers-spacing-8);
  }

  .aayda-activity-directions__card-title {
    margin: 0;
    font-size: var(--aayda-typography-size-32);
    font-weight: var(--aayda-typography-weight-semi-bold);
    line-height: var(--aayda-typography-line-height-heading-32);
    letter-spacing: var(--aayda-typography-letter-spacing-32);
    color: var(--aayda-colors-text);
    white-space: nowrap;
  }

  .aayda-activity-directions__card-arrow {
    display: block;
    flex-shrink: 0;
    width: 27px;
    height: 27px;
  }

  .aayda-activity-directions__card-arrow img {
    display: block;
    width: 27px;
    height: 27px;
    max-width: none;
    /* iconoir:arrow-up Vector: Default -45° → Hover -90° in Figma.
       Exported SVG already bakes Default (↗). Hover is ↗ → → = CSS rotate(45deg). */
    transform-origin: 12.751px 13.049px;
    transition: transform 300ms ease-out;
  }

  /* Hover only where a pointer really hovers: on a wide touch screen a tap would otherwise leave
     the hover pose stuck after the finger lifts. */
  @media (hover: hover) {
    .aayda-activity-directions__card:hover .aayda-activity-directions__card-arrow img {
      transform: rotate(45deg);
    }
  }

  /* Active (pressed): the arrow takes its hover pose, as the hero's call to action does on
     :active, so a tap on a touch screen gives the same feedback a pointer gets; and the picture
     dims slightly while pressed, which tells a press apart from a hover. Figma draws no pressed
     variant, so this is deliberately small and moves nothing. */
  .aayda-activity-directions__card:active .aayda-activity-directions__card-arrow img {
    transform: rotate(45deg);
  }

  .aayda-activity-directions__card:active .aayda-activity-directions__card-media {
    opacity: 0.9;
  }

  @media (prefers-reduced-motion: reduce) {
    .aayda-activity-directions__card-arrow img {
      transition: none;
    }
  }

  .aayda-activity-directions__card-subtitle {
    /* The line is drawn on the artwork, so it is kept to the clear top-left area: past ~150px the
       Yollar road's guard rail starts, and no text colour reaches 4.5:1 on its grey. A longer line
       (the English "Motorways and regional roads") wraps instead; every seeded Azerbaijani line
       still fits on one. 149px is the design's own description width on mobile. */
    max-width: 149px;
    margin: 0;
    font-size: var(--aayda-typography-size-12);
    font-weight: var(--aayda-typography-weight-medium);
    line-height: var(--aayda-typography-line-height-12);
    letter-spacing: var(--aayda-typography-letter-spacing-12);
    /* gray-600, not the design's gray-500: the line sits on the artwork, and gray-500 measured
       2.5–3.0:1 against it; gray-600 keeps it lighter than the title and above WCAG AA 4.5:1. */
    color: var(--aayda-colors-gray-600);
  }

  /* 9127:49676 Road / Default — 408×253 at x=516. Image FILL, DARKEN, 0.86. */
  .aayda-activity-directions__card--roads {
    grid-column: 2;
    grid-row: 1;
    width: 408px;
    height: 253px;
    margin-top: 5px;
    border-radius: 12px;
    box-shadow: inset 0 0 0 2px var(--aayda-colors-base-white);
    isolation: isolate;
  }

  .aayda-activity-directions__card--roads .aayda-activity-directions__card-media {
    top: 2px;
    left: 2px;
    width: 404px;
    height: 249px;
    border-radius: 10px;
  }

  .aayda-activity-directions__card--roads .aayda-activity-directions__card-media img,
  .aayda-activity-directions__card--roads .aayda-activity-directions__card-media canvas.aayda-activity-directions__card-animation {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.86;
    border-radius: 10px;
    mix-blend-mode: darken;
  }

  /* 9127:49310 Tunnel card / Default — 408×256 at x=84. CROP. */
  .aayda-activity-directions__card--tunnels {
    grid-column: 1;
    grid-row: 2;
    width: 408px;
    height: 256px;
    border-radius: 12px;
    box-shadow: inset 0 0 0 2px var(--aayda-colors-base-white);
  }

  .aayda-activity-directions__card--tunnels .aayda-activity-directions__card-media {
    inset: 0;
    border-radius: 12px;
  }

  .aayda-activity-directions__card--tunnels .aayda-activity-directions__card-media img,
  .aayda-activity-directions__card--tunnels .aayda-activity-directions__card-media canvas.aayda-activity-directions__card-animation {
    top: -4.3%;
    left: -0.37%;
    width: 100.73%;
    height: 108.98%;
  }

  /* 9127:49652 Pedestrian overpass / Default — ~407×253 at x≈516. FIT, 0.97.
     Hover 9127:49688: FIT → CROP, SMART_ANIMATE 300ms EASE_OUT. */
  .aayda-activity-directions__card--crossings {
    grid-column: 2;
    grid-row: 2;
    width: 407px;
    height: 253px;
    margin-top: 2px;
    border-radius: 10px;
  }

  .aayda-activity-directions__card--crossings .aayda-activity-directions__card-media {
    inset: 0;
    border-radius: 10px;
  }

  .aayda-activity-directions__card--crossings .aayda-activity-directions__card-media img,
  .aayda-activity-directions__card--crossings .aayda-activity-directions__card-media canvas.aayda-activity-directions__card-animation {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.97;
    transition:
      width 300ms ease-out,
      height 300ms ease-out,
      top 300ms ease-out,
      left 300ms ease-out;
  }

  @media (hover: hover) {
    .aayda-activity-directions__card--crossings:hover .aayda-activity-directions__card-media img,
    .aayda-activity-directions__card--crossings:hover .aayda-activity-directions__card-media canvas.aayda-activity-directions__card-animation {
      top: 0.18%;
      left: 0;
      width: 100%;
      height: 99.64%;
    }
  }

  /* After the crossings rule it overrides: same specificity, so it has to come later. */
  @media (prefers-reduced-motion: reduce) {
    .aayda-activity-directions__card--crossings .aayda-activity-directions__card-media img,
    .aayda-activity-directions__card--crossings .aayda-activity-directions__card-media canvas.aayda-activity-directions__card-animation {
      transition: none;
    }
  }

  /* 4979:22462 Bridge / Default inside Highlight Box 4979:22460 — 408×530 at x=948. CROP. */
  .aayda-activity-directions__card--bridges {
    grid-column: 3;
    grid-row: 1 / span 2;
    width: 408px;
    height: 530px;
    margin-top: 1px;
    border-radius: 12px;
    box-shadow: inset 0 0 0 2px var(--aayda-colors-base-white);
  }

  .aayda-activity-directions__card--bridges .aayda-activity-directions__card-media {
    top: 2px;
    left: 2px;
    width: 404px;
    height: 525px;
    border-radius: 10px;
  }

  .aayda-activity-directions__card--bridges .aayda-activity-directions__card-media img,
  .aayda-activity-directions__card--bridges .aayda-activity-directions__card-media canvas.aayda-activity-directions__card-animation {
    top: -3.62%;
    left: -0.02%;
    width: 107.22%;
    height: 107.43%;
  }

  .aayda-activity-directions__card--bridges .aayda-activity-directions__card-content {
    padding-top: 15px;
  }

  /* Bug-fix 4, correction 40 — the tunnels and crossings cells' 2px white stroke. Figma draws it on
     both (Tunnel card 9127:49310: 2px white, radius 12; Keçidlər 12315:77631: 2px white, radius 10),
     inside, over the picture, as on the roads cell. The tunnels cell had the ring as an inset shadow,
     but its picture fills the whole cell and covered it; the crossings cell had none. Drawn as a
     layer above the picture and below nothing else, so the picture's crop, its hover pose and the
     card's size are unchanged. The roads and bridges cells are left as they were. */
  .aayda-activity-directions__card--tunnels::after,
  .aayda-activity-directions__card--crossings::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    box-shadow: inset 0 0 0 2px var(--aayda-colors-base-white);
    pointer-events: none;
  }
}

/* -------------------------------------------------------------------------- */
/* Mobile — Figma 5257:19790 (frame 402). Static Road category cards.         */
/* Desktop rules above are locked. Do not port the desktop image hover, video */
/* or grid here; only the arrow's shared hover/press turn applies (below).    */
/* -------------------------------------------------------------------------- */

@media (max-width: 1415px) {
  .aayda-activity-directions {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 402px;
    /* Figma's 928px frame is 32 top + the 856px column (heading block, 16px gap, four cards) + 40
       bottom. Sized by its content rather than fixed, so four cards draw exactly 928px and fewer
       cards do not leave an empty panel below them. */
    height: auto;
    margin: -50px auto 0;
    padding: 32px 28px 40px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: var(--aayda-colors-surface-subtle);
    border-radius: 12px;
    font-family: var(--aayda-typography-font-primary);
    color: var(--aayda-colors-text);
  }

  .aayda-activity-directions__panel {
    display: none;
  }

  .aayda-activity-directions__inner--mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--aayda-numbers-spacing-16);
    width: 346px;
    max-width: 100%;
  }

  .aayda-activity-directions__title-block--mobile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
    gap: var(--aayda-numbers-spacing-16);
    width: 346px;
    height: 92px;
    overflow: visible;
  }

  .aayda-activity-directions__title-block--mobile .aayda-activity-directions__badge {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--aayda-numbers-spacing-4);
    box-sizing: border-box;
    width: max-content;
    max-width: 100%;
    height: 28px;
    padding: 3px 15px 3px 11px;
    margin: 0;
    font-size: var(--aayda-typography-size-12);
    font-weight: var(--aayda-typography-weight-medium);
    line-height: var(--aayda-typography-line-height-12);
    letter-spacing: var(--aayda-typography-letter-spacing-12);
    color: var(--aayda-colors-text);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.46);
    border: 1px solid var(--aayda-colors-base-white);
    border-radius: 28px;
  }

  .aayda-activity-directions__title-block--mobile .aayda-activity-directions__badge-icon {
    display: block;
    flex-shrink: 0;
    width: 15px;
    height: 14px;
  }

  .aayda-activity-directions__title-block--mobile .aayda-activity-directions__badge-icon img {
    display: block;
    width: 11px;
    height: 11px;
    margin: 2px 0 0 2px;
    max-width: none;
  }

  .aayda-activity-directions__title--mobile {
    box-sizing: border-box;
    width: 346px;
    height: 48px;
    margin: 0;
    overflow: visible;
    font-size: var(--aayda-typography-size-24);
    font-weight: var(--aayda-typography-weight-semi-bold);
    line-height: var(--aayda-typography-line-height-heading-24);
    letter-spacing: var(--aayda-typography-letter-spacing-24);
    color: var(--aayda-colors-text);
  }

  .aayda-activity-directions__cards {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--aayda-numbers-spacing-16);
    width: 337px;
    /* Four 175px cards and three 16px gaps: the design's 748px, from the cards themselves, so fewer
       cards make a shorter column. */
    height: auto;
  }

  .aayda-activity-directions__card--road-mobile {
    position: relative;
    /* As on Desktop: the card is the link, and block is what the flex/grid parent already forces. */
    display: block;
    box-sizing: border-box;
    width: 337px;
    height: 175px;
    margin: 0;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    background: var(--aayda-colors-surface-subtle);
    border: 0;
    border-radius: 12px;
    box-shadow: inset 0 0 0 2px var(--aayda-colors-base-white);
    isolation: isolate;
  }

  .aayda-activity-directions__card--road-mobile:focus-visible {
    outline: var(--aayda-border-width-focus-ring) solid var(--aayda-colors-ring-focus);
    outline-offset: 2px;
  }

  .aayda-activity-directions__card--road-mobile .aayda-activity-directions__card-media {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: 12px;
  }

  .aayda-activity-directions__card--road-mobile .aayda-activity-directions__card-media img {
    position: absolute;
    top: 0.08%;
    left: 0;
    display: block;
    width: 99.98%;
    height: 99.83%;
    max-width: none;
    /* One box, four illustrations, three different shapes: roads and crossings are ~1.62:1,
       tunnels 1.49:1 and bridges is PORTRAIT at 0.77:1, against a 337x175 (1.93:1) card. Without
       this the box stretches each one to its own width — which was invisible while all four cards
       showed the same landscape road, and would have pulled the bridge out to two and a half times
       its width. Desktop solves the same problem per card, with a box shaped like its own artwork. */
    object-fit: cover;
    pointer-events: none;
    opacity: 0.86;
    mix-blend-mode: darken;
  }

  .aayda-activity-directions__card--road-mobile .aayda-activity-directions__card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 149px;
    padding: 13px 0 0 17px;
  }

  .aayda-activity-directions__card--road-mobile .aayda-activity-directions__card-label {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--aayda-numbers-spacing-8);
  }

  .aayda-activity-directions__card--road-mobile .aayda-activity-directions__card-title {
    margin: 0;
    font-size: var(--aayda-typography-size-20);
    font-weight: var(--aayda-typography-weight-semi-bold);
    line-height: var(--aayda-typography-line-height-20);
    letter-spacing: var(--aayda-typography-letter-spacing-20);
    color: var(--aayda-colors-text);
    white-space: nowrap;
  }

  .aayda-activity-directions__card--road-mobile .aayda-activity-directions__card-arrow {
    display: block;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
  }

  .aayda-activity-directions__card--road-mobile .aayda-activity-directions__card-arrow img {
    display: block;
    width: 20px;
    height: 20px;
    max-width: none;
    /* The desktop arrow's turn (Figma −45° → −90°, 300ms ease-out), with its pivot (12.751px,
       13.049px of 27px) restated as a share of the smaller icon. */
    transform-origin: 47.23% 48.33%;
    transition: transform 300ms ease-out;
  }

  /* A mouse at tablet width gets the desktop's arrow turn; a touch screen does not keep it stuck. */
  @media (hover: hover) {
    .aayda-activity-directions__card--road-mobile:hover .aayda-activity-directions__card-arrow img {
      transform: rotate(45deg);
    }
  }

  /* Pressed, as on desktop: the arrow turns and the picture dims slightly. This is the feedback a
     tap gets on a phone, where nothing hovers. */
  .aayda-activity-directions__card--road-mobile:active .aayda-activity-directions__card-arrow img {
    transform: rotate(45deg);
  }

  .aayda-activity-directions__card--road-mobile:active .aayda-activity-directions__card-media {
    opacity: 0.9;
  }

  @media (prefers-reduced-motion: reduce) {
    .aayda-activity-directions__card--road-mobile .aayda-activity-directions__card-arrow img {
      transition: none;
    }
  }

  .aayda-activity-directions__card--road-mobile .aayda-activity-directions__card-subtitle {
    box-sizing: border-box;
    /* 128px, not the design's 149px: on the 337px card the Yollar road's guard rail starts ~148px
       in (131px past the text's start), and on it no text colour reaches 4.5:1. A longer line wraps
       onto the box's second 18px line instead; every seeded Azerbaijani line still fits on one. */
    width: 128px;
    height: 36px;
    margin: 0;
    font-size: var(--aayda-typography-size-10);
    font-weight: var(--aayda-typography-weight-medium);
    line-height: var(--aayda-typography-line-height-10);
    letter-spacing: var(--aayda-typography-letter-spacing-10);
    /* As on desktop: gray-600 for WCAG AA over the artwork. */
    color: var(--aayda-colors-gray-600);
  }
}

/* Tablet: Mobile 5257:19790 chrome, fluid 2×2. No Desktop panel / hover. */
@media (min-width: 768px) and (max-width: 1415px) {
  .aayda-activity-directions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    margin: -50px 0 0;
    padding: 32px 16px;
    overflow: visible;
  }

  .aayda-activity-directions__inner--mobile,
  .aayda-activity-directions__title-block--mobile {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
  }

  .aayda-activity-directions__title--mobile {
    width: auto;
    max-width: 100%;
    height: auto;
  }

  .aayda-activity-directions__cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: var(--aayda-numbers-spacing-16);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
  }

  .aayda-activity-directions__card--road-mobile {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    aspect-ratio: 337 / 175;
  }
}

/* Section badge text (HomeSectionLabel, edited in the admin panel). The pill hugs its wording
   (width: max-content, as the about page's labels do); the 1px border now sits inside the
   padding, as Figma's stroke does, so the pill keeps the design's 28px and offsets. A label too long
   for the title block is cut with an ellipsis rather than wrapped, so the heading never moves. */
.aayda-activity-directions__badge-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The hover animation is the desktop grid's only: below 1416px its canvas is not drawn at all (the mobile
   column has none; this covers a desktop card's markup at the narrower widths). */
@media (max-width: 1415px) {
  .aayda-activity-directions__card-media > canvas.aayda-activity-directions__card-animation {
    display: none;
  }
}
