/* =========================================================================
   AJONTec — Home page components
     .ajp-*  How We Work timeline (image beside the text)
     .aj-slider  shared auto-advancing carousel
     .ajw-*  Our Work cards      .ajb-*  Blog cards      .ajr-*  Reviews
   Everything is palette-driven so light and dark presets both look right.
   ========================================================================= */

:root {
    --ajh-primary: var(--accent-indigo, #6366f1);
    --ajh-rgb: var(--theme-primary-rgb, 99, 102, 241);
    --ajh-line: var(--border-color, rgba(255, 255, 255, .08));
    --ajh-card: var(--bg-card, rgba(18, 24, 46, .62));
    --ajh-r: 16px;
}

/* =========================================================================
   1. HOW WE WORK  — steps on one side, a single picture on the other
   ========================================================================= */
.ajp { padding: 60px 0; }
.ajp-sub { max-width: 640px; margin: 14px auto 0; opacity: .75; line-height: 1.7; }

.ajp-shell {
    display: grid;
    gap: 30px;
    /* stretch, so the picture column is exactly as tall as the step list -
       both sides finish on the same line. */
    align-items: stretch;
    margin-top: 38px;
}
.ajp-has-media { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); }
.ajp-no-media  { grid-template-columns: minmax(0, 1fr); max-width: 880px; margin-inline: auto; }

/* Picture on the left: flip the columns, and move it visually first while the
   steps stay first in the DOM for screen readers. */
.ajp-media-left { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); }
.ajp-media-left .ajp-list  { order: 2; }
.ajp-media-left .ajp-aside { order: 1; }

/* ---------- the timeline ---------- */
.ajp-list { list-style: none; margin: 0; padding: 0; }

.ajp-step {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 20px;
    padding-bottom: 30px;
}
.ajp-step:last-child { padding-bottom: 0; }

.ajp-rail { display: flex; flex-direction: column; align-items: center; }

.ajp-num {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .98rem;
    color: #fff;
    background: var(--gradient-glow, linear-gradient(135deg, #6366f1, #22d3ee));
    box-shadow: 0 8px 20px rgba(var(--ajh-rgb), .28);
    z-index: 1;
    transition: transform .3s cubic-bezier(.32, .72, 0, 1);
}
.ajp-step:hover .ajp-num { transform: translateY(-2px) scale(1.05); }

.ajp-line {
    flex: 1 1 auto;
    width: 2px;
    margin-top: 8px;
    min-height: 28px;
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(var(--ajh-rgb), .5), transparent);
}

.ajp-body {
    padding: 16px 20px;
    border: 1px solid var(--ajh-line);
    border-radius: var(--ajh-r);
    background: var(--ajh-card);
    transition: border-color .28s ease, transform .28s cubic-bezier(.32, .72, 0, 1);
}
.ajp-step:hover .ajp-body {
    border-color: rgba(var(--ajh-rgb), .4);
    transform: translateX(3px);
}

.ajp-index {
    display: inline-block;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ajh-primary);
    margin-bottom: 6px;
}
.ajp-title {
    font-size: 1.12rem;
    font-weight: 750;
    letter-spacing: -.02em;
    margin: 0 0 6px;
    color: var(--text-primary, #f8fafc);
}
.ajp-desc {
    margin: 0;
    line-height: 1.7;
    font-size: .91rem;
    color: var(--text-secondary, #aab2c5);
}

/* ---------- the single side picture ---------- */
.ajp-aside { display: flex; min-height: 100%; }

.ajp-figure {
    margin: 0;
    width: 100%;
    /* Fills the full height of the steps column, no inner padding at all. */
    display: flex;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--ajh-line);
    background: var(--ajh-card);
    box-shadow: 0 22px 55px rgba(var(--theme-bg-rgb, 6, 9, 20), .18);
}
.ajp-figure img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 980px) {
    .ajp { padding: 44px 0; }
    .ajp-shell { grid-template-columns: minmax(0, 1fr) !important; gap: 26px; margin-top: 32px; }
    /* On a phone the picture sits above the steps, whichever side was chosen. */
    .ajp-list  { order: 2; }
    .ajp-aside { order: 1; min-height: 0; }
    .ajp-figure img { min-height: 0; height: auto; aspect-ratio: 16 / 9; }
}

@media (max-width: 620px) {
    .ajp-step { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding-bottom: 22px; }
    .ajp-num { width: 36px; height: 36px; flex-basis: 36px; font-size: .85rem; border-radius: 11px; }
    .ajp-body { padding: 14px 15px; }
    .ajp-title { font-size: 1.02rem; }
    .ajp-desc { font-size: .87rem; }
    .ajp-step:hover .ajp-body { transform: none; }
}

/* =========================================================================
   2. SHARED SLIDER
   ========================================================================= */
.aj-slider { position: relative; margin-top: 24px; }

/* Nothing to scroll -> behave like a centred row, no controls. */
.aj-slider--fits .aj-slider-track { justify-content: center; }
.aj-slider--fits .aj-slider-nav,
.aj-slider--fits .aj-slider-dots { display: none !important; }

.aj-slider-track {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 2px 6px;
}
.aj-slider-track::-webkit-scrollbar { display: none; }

.aj-slide {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-width: 0;
}

/* ---- arrows ---- */
.aj-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text-primary, #f8fafc);
    background: var(--bg-card-hover, rgba(26, 34, 64, .92));
    border: 1px solid var(--ajh-line);
    box-shadow: 0 6px 20px rgba(var(--theme-bg-rgb, 6, 9, 20), .3);
    opacity: 0;
    transition: opacity .25s ease, background .2s ease, color .2s ease;
}
.aj-slider-prev { left: -6px; }
.aj-slider-next { right: -6px; }
.aj-slider:hover .aj-slider-nav,
.aj-slider:focus-within .aj-slider-nav { opacity: 1; }
.aj-slider-nav:hover { background: var(--ajh-primary); color: #fff; border-color: var(--ajh-primary); }

/* ---- dots ---- */
.aj-slider-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 16px;
}
.aj-slider-dots:empty { display: none; }

.aj-slider-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 99px;
    cursor: pointer;
    background: var(--text-muted, #6b7488);
    opacity: .38;
    transition: width .28s cubic-bezier(.32, .72, 0, 1), opacity .2s ease, background .2s ease;
}
.aj-slider-dot.is-active {
    width: 22px;
    opacity: 1;
    background: var(--ajh-primary);
}

/* Touch devices: arrows are useless, the finger does the work. */
@media (hover: none) {
    .aj-slider-nav { display: none; }
}

/* =========================================================================
   3. OUR WORK  (compact)
   ========================================================================= */
.ajw-card {
    /* Four to a row on a wide screen, sized off the track so the last card
       always lands flush with the right edge. */
    width: calc((100% - 3 * 18px) / 4);
    min-width: 250px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ajh-line);
    border-radius: var(--ajh-r);
    background: var(--ajh-card);
    overflow: hidden;
    transition: transform .3s cubic-bezier(.32, .72, 0, 1), border-color .3s ease;
}
.ajw-card:hover { transform: translateY(-5px); border-color: rgba(var(--ajh-rgb), .45); }

.ajw-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.ajw-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.32, .72, 0, 1); }
.ajw-card:hover .ajw-media img { transform: scale(1.06); }

.ajw-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #fff;
    /* Always sits on a photo, so a fixed dark pill guarantees contrast on
       both the light and the dark palette. */
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .22);
}

.ajw-body { padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.ajw-body h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: -.015em;
    line-height: 1.32;
    color: var(--text-primary, #f8fafc);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ajw-body p {
    margin: 0;
    font-size: .84rem;
    line-height: 1.6;
    color: var(--text-secondary, #aab2c5);
    /* flex:1 would blockify this and break -webkit-line-clamp. */
    flex: 0 0 auto;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ajw-actions { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 6px; }
.ajw-link {
    font-size: .82rem;
    font-weight: 700;
    color: var(--ajh-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.ajw-link:hover { text-decoration: underline; }
.ajw-link-muted { color: var(--text-muted, #6b7488); font-weight: 600; }

/* =========================================================================
   4. BLOG  (compact)
   ========================================================================= */
.ajb-card {
    width: calc((100% - 3 * 18px) / 4);
    min-width: 246px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ajh-line);
    border-radius: var(--ajh-r);
    background: var(--ajh-card);
    overflow: hidden;
    transition: transform .3s cubic-bezier(.32, .72, 0, 1), border-color .3s ease;
}
.ajb-card:hover { transform: translateY(-5px); border-color: rgba(var(--ajh-rgb), .45); }

.ajb-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(var(--ajh-rgb), .1);
}
.ajb-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.32, .72, 0, 1); }
.ajb-card:hover .ajb-media img { transform: scale(1.06); }

.ajb-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--ajh-primary);
    opacity: .55;
}
.ajb-cat {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #fff;
    background: var(--gradient-glow, linear-gradient(135deg, #6366f1, #22d3ee));
}

.ajb-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.ajb-body h3 { margin: 0; font-size: .97rem; font-weight: 750; line-height: 1.35; letter-spacing: -.015em; }
.ajb-body h3 a {
    color: var(--text-primary, #f8fafc);
    text-decoration: none;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ajb-body h3 a:hover { color: var(--ajh-primary); }
.ajb-body p {
    margin: 0;
    font-size: .83rem;
    line-height: 1.6;
    color: var(--text-secondary, #aab2c5);
    flex: 0 0 auto;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ajb-date { font-size: .74rem; color: var(--text-muted, #6b7488); margin-top: auto; padding-top: 6px; }

/* =========================================================================
   5. CLIENT REVIEWS  (5 across on a wide screen)
   ========================================================================= */
.ajr-slider .aj-slider-track { gap: 16px; }

.ajr-card {
    position: relative;
    width: calc((100% - 4 * 16px) / 5);
    min-width: 216px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px 20px 18px;
    border: 1px solid var(--ajh-line);
    border-radius: var(--ajh-r);
    background: var(--ajh-card);
    margin: 0;
    transition: transform .3s cubic-bezier(.32, .72, 0, 1), border-color .3s ease;
}
.ajr-card:hover { transform: translateY(-4px); border-color: rgba(var(--ajh-rgb), .45); }

.ajr-quote {
    position: absolute;
    top: 6px;
    right: 16px;
    font-size: 3.2rem;
    line-height: 1;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ajh-primary);
    opacity: .16;
    pointer-events: none;
}

.ajr-stars { display: flex; gap: 2px; }
.ajr-stars svg { fill: #f59e0b; }

.ajr-text {
    margin: 0;
    font-size: .86rem;
    line-height: 1.7;
    color: var(--text-secondary, #aab2c5);
    flex: 0 0 auto;
    display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}

.ajr-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--ajh-line);
}
.ajr-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--ajh-line);
}
.ajr-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ajr-meta strong {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ajr-meta span {
    font-size: .74rem;
    color: var(--text-muted, #6b7488);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- responsive card widths ---- */
@media (max-width: 1280px) { .ajr-card { width: calc((100% - 3 * 16px) / 4); } }
@media (max-width: 1100px) {
    .ajw-card, .ajb-card { width: calc((100% - 2 * 18px) / 3); }
}
@media (max-width: 1024px) {
    .ajr-card { width: calc((100% - 2 * 16px) / 3); }
}
@media (max-width: 820px) {
    .ajw-card, .ajb-card { width: calc((100% - 18px) / 2); min-width: 0; }
}
@media (max-width: 760px) {
    .ajr-card { width: calc((100% - 16px) / 2); min-width: 200px; }
}
@media (max-width: 560px) {
    .aj-slider-track { gap: 12px; }
    .ajw-card, .ajb-card { width: 80vw; max-width: 320px; min-width: 0; }
    .ajr-card { width: 80vw; max-width: 320px; min-width: 0; padding: 18px 16px 15px; }
    .ajw-card:active, .ajb-card:active, .ajr-card:active { transform: scale(.985); }
}

@media (prefers-reduced-motion: reduce) {
    .aj-slider-track { scroll-behavior: auto; }
    .ajw-card, .ajb-card, .ajr-card, .ajp-body, .ajp-num,
    .ajw-media img, .ajb-media img { transition: none !important; }
}

/* Plain grid variant, used on the dedicated /projects page. */
.ajw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.ajw-grid .ajw-card { width: auto; }
@media (max-width: 560px) { .ajw-grid { grid-template-columns: 1fr; } }


/* =========================================================================
   6. HOME RHYTHM — the old spacing left large empty bands between sections
   ========================================================================= */
.m-section { padding: 52px 0; }
.m-section-sm { padding: 34px 0; }
.m-section.pt-0 { padding-top: 0; }
.m-head { margin-bottom: 28px; }
.m-center-btn { margin-top: 26px; }

/* Home service cards: the modal script adds a "Read more" hint, which
   collided with the real "View Details" link on the same line. */
.m-card .aj-readmore-hint { display: none; }
.m-card { padding: 22px 20px; }
.m-cards { gap: 18px; }

@media (max-width: 640px) {
    .m-section { padding: 40px 0; }
    .m-section-sm { padding: 26px 0; }
    .m-head { margin-bottom: 22px; }
}
