/*---*\
    About Kelly Tractor
    Homepage company story with intro collage, timeline milestones, and photo gallery

    KEY FEATURES:
    - Patterned gray section band with intro text + 3-image collage and anniversary badge
    - Timeline milestone cards with yellow underline and connecting rail
    - Slick timeline slider (1 / 2 / 4) with progress bar and chevron nav below desktop
    - Full-bleed historical photo marquee with continuous autoplay

    IMPLEMENTATION NOTES:
    - Mobile-first; breakpoints 768px / 1200px
    - Collage uses CSS grid so images fill cells
    - Gallery track is duplicated in JS for a seamless marquee loop
\*---*/

.about-kelly-tractor {
    position: relative;
    overflow: hidden;
    color: var(--color-secondary);
    background-color: var(--color-surface-gray);
    background-image: url('/wp-content/themes/fx/assets/img/background-pattern-50-opacity.png');
    background-repeat: repeat;
    background-position: center top;
    background-size: 1920px auto;
}

.about-kelly-tractor__intro {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-kelly-tractor__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.about-kelly-tractor__text {
    width: 100%;
}

.about-kelly-tractor__text h2 {
    margin: 0;
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}

.about-kelly-tractor__text > p {
    margin: 20px 0 0;
    color: var(--color-paragraph-body);
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
}

.about-kelly-tractor__text > p + p {
    margin-top: 1em;
}

.about-kelly-tractor__actions {
    margin-top: 20px;
}

.about-kelly-tractor__cta:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.about-kelly-tractor__media {
    width: 100%;
}

.about-kelly-tractor__collage {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    width: 100%;
}

.about-kelly-tractor__badge {
    position: absolute;
    top: -30px;
    right: -16px;
    z-index: 2;
    width: 88px;
    height: 88px;
    pointer-events: none;
    padding: 10px;
    background-color: var(--color-surface-white);
    border-radius: 50%;
    filter: drop-shadow(0 4px 8.5px rgba(0, 0, 0, 0.25));
}

.about-kelly-tractor__badge-image {
    display: block;
    width: 100%;
    height: auto;
}

.about-kelly-tractor__figure {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 0;
    border-radius: var(--radius-card);
}

.about-kelly-tractor__figure--primary {
    grid-column: 1 / -1;
    grid-row: 1;
    aspect-ratio: 794 / 748;
}

.about-kelly-tractor__stack {
    display: contents;
}

.about-kelly-tractor__figure--secondary {
    aspect-ratio: 291 / 170;
}

.about-kelly-tractor__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-kelly-tractor__timeline {
    margin-top: 36px;
}

.about-kelly-tractor__timeline-track {
    position: relative;
}

.about-kelly-tractor__timeline-rail {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 0;
    width: calc(100% - 24px);
    height: 2px;
    background-color: var(--color-primary);
    transform: translateY(-50%);
}

@Media (min-width: 1200px) {
    .about-kelly-tractor__timeline-rail {
        width: calc(100% - 80px);
    }
}

.about-kelly-tractor__timeline-list {
    position: relative;
    z-index: 1;
    margin: 0;

    .slick-list {
        margin-block: -10px;
    }

    .slick-track {
        display: flex;
        padding-block: 10px;
    }

    .slick-slide {
        height: auto;

        > div {
            height: 100%;
        }
    }
}

.about-kelly-tractor__timeline-item {
    padding: 0 8px;
    height: 100%;
}

.about-kelly-tractor__timeline-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-radius: var(--radius-card);
    background-color: var(--color-surface-white);
    box-shadow: 0 0 5px rgb(0 0 0 / 22%);
    height: 100%;
}

.about-kelly-tractor__timeline-image-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 330 / 225;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.about-kelly-tractor__timeline-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-kelly-tractor__timeline-image-container--logo,
.about-kelly-tractor__timeline-image-container--contain {
    background-color: var(--color-surface-white);
}

.about-kelly-tractor__timeline-image--logo,
.about-kelly-tractor__timeline-image--contain {
    object-fit: contain;
    padding: 24px;
    box-sizing: border-box;
}

.about-kelly-tractor__timeline-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
}

@media (max-width: 1199px) {
    .about-kelly-tractor__timeline-card {
        box-shadow: 0 0 9.9px 0 rgba(0, 0, 0, 0.22);
    }
}

@media (min-width: 1200px) {
    .about-kelly-tractor__timeline-card {
        height: auto;
    }
}

.about-kelly-tractor__timeline-year {
    margin: 0;
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: 50px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}

.about-kelly-tractor__timeline-year::after {
    content: '';
    display: block;
    width: 101px;
    height: 2px;
    margin-top: 8px;
    background-color: var(--color-primary);
}

.about-kelly-tractor__timeline-description {
    margin: 0;
    color: var(--color-text-dark-gray);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
}

.about-kelly-tractor__timeline-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin-top: 20px;
}

.about-kelly-tractor__timeline-progress {
    flex: 1 1 auto;
    max-width: 100%;
    height: 14px;
    overflow: hidden;
    background-color: var(--color-surface-search-hover);
    clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}

@media (max-width: 767px) {
    .about-kelly-tractor__timeline-progress {
        display: none;
    }
}

.about-kelly-tractor__timeline-progress-bar {
    width: 25%;
    height: 100%;
    background-color: var(--color-secondary);
    clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
    transition: width 0.3s ease;
}

.about-kelly-tractor__timeline-nav {
    display: flex;
    flex-shrink: 0;
    flex-direction: row;
    gap: 32px;
}

@media (max-width: 767px) {
    .about-kelly-tractor__timeline-nav {
        gap: 20px;
    }
}

.about-kelly-tractor__timeline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 51px;
    height: 51px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-card);
    background-color: var(--color-secondary);
    color: var(--color-primary);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.about-kelly-tractor__timeline-btn:hover {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    opacity: 0.9;
}

.about-kelly-tractor__timeline-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.about-kelly-tractor__timeline-btn .icon-chevrons {
    font-size: 21px;
}

.about-kelly-tractor__timeline-btn--prev .icon-chevrons {
    display: inline-block;
    transform: scaleX(-1);
}

.about-kelly-tractor__timeline-btn.slick-disabled,
.about-kelly-tractor__timeline-btn.slick-disabled:hover {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    opacity: 0.35;
    cursor: default;
}

.about-kelly-tractor__gallery {
    width: 100%;
    margin-top: 36px;
    overflow: hidden;
}

.about-kelly-tractor__gallery-track {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: max-content;
    will-change: transform;
}

.about-kelly-tractor__gallery.is-animated .about-kelly-tractor__gallery-track {
    animation: about-kelly-gallery-marquee 45s linear infinite;
}

.about-kelly-tractor__gallery.is-animated:hover .about-kelly-tractor__gallery-track {
    animation-play-state: paused;
}

.about-kelly-tractor__gallery-item {
    position: relative;
    flex: 0 0 280px;
    overflow: hidden;
    aspect-ratio: 432 / 266;
    border-radius: var(--radius-card);
}

.about-kelly-tractor__gallery-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes about-kelly-gallery-marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .about-kelly-tractor__gallery.is-animated .about-kelly-tractor__gallery-track {
        animation: none;
    }
}

@media (min-width: 768px) {
    .about-kelly-tractor__intro {
        gap: 32px;
    }

    .about-kelly-tractor__text h2 {
        font-size: 36px;
    }

    .about-kelly-tractor__collage {
        grid-template-columns: 375fr 268fr;
        grid-template-rows: 149fr 164fr;
        gap: 31px 21px;
        aspect-ratio: 664 / 344;
    }

    .about-kelly-tractor__badge {
        top: -24px;
        right: auto;
        left: 44%;
        width: 121px;
        height: 121px;
        padding: 8px;
    }

    .about-kelly-tractor__figure--primary {
        grid-column: 1;
        grid-row: 1 / span 2;
        aspect-ratio: auto;
        height: 100%;
    }

    .about-kelly-tractor__stack {
        display: flex;
        flex-direction: column;
        grid-column: 2;
        grid-row: 1 / span 2;
        gap: 31px;
        min-width: 0;
        min-height: 0;
        height: 100%;
    }

    .about-kelly-tractor__figure--secondary {
        flex: 1 1 0;
        aspect-ratio: auto;
        height: 100%;
    }

    .about-kelly-tractor__figure--secondary:first-child {
        flex: 149 1 0;
    }

    .about-kelly-tractor__figure--secondary:last-child {
        flex: 164 1 0;
    }

    .about-kelly-tractor__timeline {
        margin-top: 32px;
    }

    .about-kelly-tractor__timeline-item {
        padding: 0 16px;
    }

    .about-kelly-tractor__timeline-controls {
        margin-top: 32px;
    }

    .about-kelly-tractor__gallery {
        margin-top: 32px;
    }

    .about-kelly-tractor__gallery-track {
        gap: 52px;
    }

    .about-kelly-tractor__gallery-item {
        flex: 0 0 432px;
    }

    .about-kelly-tractor__gallery.is-animated .about-kelly-tractor__gallery-track {
        animation-duration: 50s;
    }
}

@media (min-width: 1200px) {
    .about-kelly-tractor__intro {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 32px;
    }

    .about-kelly-tractor__intro:has(.about-kelly-tractor__media) .about-kelly-tractor__content {
        flex: 0 0 38%;
        max-width: 480px;
        padding-right: 100px;
    }

    .about-kelly-tractor__text h2 {
        font-size: 55px;
    }

    .about-kelly-tractor__media {
        flex: 1 1 62%;
        min-width: 0;
    }

    .about-kelly-tractor__collage {
        grid-template-columns: 397fr 291fr;
        grid-template-rows: 162fr 178fr;
        gap: 34px 34px;
        aspect-ratio: 722 / 374;
    }

    .about-kelly-tractor__badge {
        width: 145px;
        height: 145px;
        padding: 12px;
        top: -52px;
        right: auto;
        left: -72px;
    }

    .about-kelly-tractor__stack {
        gap: 34px;
    }

    .about-kelly-tractor__figure--secondary:first-child {
        flex: 162 1 0;
    }

    .about-kelly-tractor__figure--secondary:last-child {
        flex: 178 1 0;
    }

    .about-kelly-tractor__timeline {
        margin-top: 67px;
    }

    .about-kelly-tractor__timeline-item {
        padding: 0 16px;
    }

    .about-kelly-tractor__timeline-controls {
        display: none;
    }

    .about-kelly-tractor__gallery {
        margin-top: 67px;
    }

    .about-kelly-tractor__gallery-track {
        gap: 32px;
    }

    .about-kelly-tractor__gallery-item {
        flex: 0 0 402px;
        aspect-ratio: 402 / 266;
    }

    .about-kelly-tractor__gallery.is-animated .about-kelly-tractor__gallery-track {
        animation-duration: 60s;
    }
}

/* Timeline-only reuse on inner pages. The intro and controls stay contained;
   the full-width track uses fixed-width cards (Image Buttons slider pattern).
   Track padding matches .container gutters so the first card lines up with the
   heading, while the rail still spans the section edge to edge. */
.about-kelly-tractor--timeline-only .about-kelly-tractor__intro {
    display: block;
}

.about-kelly-tractor--timeline-only .about-kelly-tractor__content {
    max-width: 820px;
}

.about-kelly-tractor--timeline-only .about-kelly-tractor__timeline {
    margin-top: 28px;
}

.about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-track .slick-list {
    padding-left: var(--bs-gutter-x, 21px);
}

.about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-rail {
    width: 100%;
}

.about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-list .slick-list {
    margin-block: -10px;
    padding-block: 10px;
}

.about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-list .slick-track {
    display: flex;
}

.about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-list .slick-slide {
    display: flex;
    flex: 0 0 auto;
    height: auto;
    margin-right: 20px;
}

.about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-list .slick-slide > div {
    display: flex;
    height: 100%;
}

.about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-item {
    position: relative;
    width: min(320px, calc(100vw - 60px)) !important;
    height: 100%;
    padding: 0;
}

.about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-card {
    width: 100%;
    height: 100%;
    box-shadow: 0 0 9.9px 0 rgba(0, 0, 0, 0.22);
}

.about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-description {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 9;
    line-clamp: 9;
}

.about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-controls {
    justify-content: flex-end;
}

.about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-progress {
    display: none;
}

@media (min-width: 768px) {
    .about-kelly-tractor--timeline-only .about-kelly-tractor__timeline {
        margin-top: 32px;
    }

    .about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-track .slick-list {
        padding-left: var(--bs-gutter-x, 52px);
    }

    .about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-list .slick-slide {
        margin-right: 32px;
    }

    .about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-item {
        width: 340px !important;
    }
}

@media (min-width: 1200px) {
    .about-kelly-tractor--timeline-only .about-kelly-tractor__content {
        flex-basis: auto;
        max-width: 820px;
    }

    .about-kelly-tractor--timeline-only .about-kelly-tractor__timeline {
        margin-top: 48px;
    }

    .about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-track .slick-list {
        padding-left: var(--bs-gutter-x, 21px);
    }

    .about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-item {
        width: 400px !important;
    }

    .about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-description {
        -webkit-line-clamp: 7;
        line-clamp: 7;
    }

    .about-kelly-tractor--timeline-full-width .about-kelly-tractor__timeline-controls {
        display: flex;
    }
}
