/* =============================================================================
   Ameratrail Partners — Frontend Styles
   ============================================================================= */

/* ── Wrapper ── */
.atp-partners-section {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 24px 64px;
    font-family: inherit;
    color: inherit;
    box-sizing: border-box;
}

.atp-partners-section *,
.atp-partners-section *::before,
.atp-partners-section *::after {
    box-sizing: border-box;
}

/* ── Page header ── */
.atp-page-header {
    text-align: center;
    margin-bottom: 56px;
}

.atp-page-heading {
    font-size: clamp(26px, 4vw, 44px);
    font-weight: 700;
    line-height: 1.15;
    color: #111827;
    margin: 0 0 16px;
    letter-spacing: -0.5px;
}

.atp-page-intro {
    font-size: 17px;
    line-height: 1.75;
    color: #6b7280;
    max-width: 620px;
    margin: 0 auto;
}

/* ── Layout ── */
.atp-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

.atp-nav-right {
    flex-direction: row-reverse;
}

/* ── Side nav ── */
.atp-side-nav {
    width: 172px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    align-self: flex-start;
}

.atp-side-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid #e5e7eb;
}

.atp-nav-right .atp-side-nav ul {
    border-left: none;
    border-right: 2px solid #e5e7eb;
}

.atp-side-nav li {
    margin: 0;
    padding: 0;
}

.atp-side-nav a {
    display: block;
    padding: 9px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: color 0.18s ease, border-color 0.18s ease;
    line-height: 1.4;
}

.atp-nav-right .atp-side-nav a {
    border-left: none;
    border-right: 2px solid transparent;
    margin-left: 0;
    margin-right: -2px;
    text-align: right;
    padding: 9px 16px;
}

.atp-side-nav a:hover {
    color: #374151;
    border-color: #d1d5db;
}

.atp-side-nav a.atp-nav-active {
    color: #1d4ed8;
    border-color: #1d4ed8;
}

/* ── Content area ── */
.atp-content {
    flex: 1;
    min-width: 0;
}

/* ── Category section ── */
.atp-category-block {
    margin-bottom: 72px;
    scroll-margin-top: 100px;
}

.atp-category-block:last-child {
    margin-bottom: 0;
}

.atp-cat-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
}

.atp-cat-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
    letter-spacing: -0.2px;
}

.atp-cat-desc {
    font-size: 14px;
    line-height: 1.65;
    color: #9ca3af;
    margin: 0;
}

/* ── Grid ── */
.atp-grid {
    display: grid;
    grid-template-columns: repeat(var(--atp-cols, 4), 1fr);
    gap: 14px;
}

/* ── Card ── */
.atp-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    cursor: default;
    outline: none;
    transition:
        transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.22s ease,
        border-color 0.22s ease;
    overflow: hidden;
}

.atp-card--linked {
    cursor: pointer;
}

.atp-card--linked:hover,
.atp-card--linked:focus-visible {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db;
}

.atp-card--linked:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

/* ── Card inner layout ── */
.atp-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 7% 8%;
}

/* ── Logo area — scales with card width via aspect ratio ── */
.atp-logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 3 / 2;
    flex-shrink: 0;
}

.atp-logo-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

/* Logo "pops" out a little extra beyond the card lift on hover */
.atp-card:hover .atp-logo-area img,
.atp-card:focus-visible .atp-logo-area img {
    transform: scale(1.12);
}

/* ── Logo placeholder (no image) ── */
.atp-logo-placeholder {
    width: 60%;
    aspect-ratio: 1;
    max-width: 110px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.atp-card:hover .atp-logo-placeholder,
.atp-card:focus-visible .atp-logo-placeholder {
    transform: scale(1.12);
}

.atp-logo-placeholder span {
    font-size: 34px;
    font-weight: 700;
    color: #d1d5db;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
}

/* ── Partner name (reveals on hover) ── */
.atp-card-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    /* Backing so the name stays readable over the logo */
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 -6px 14px rgba(17, 24, 39, 0.06);
    opacity: 0;
    transform: translateY(100%);
    transition:
        opacity 0.22s ease,
        transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.atp-card:hover .atp-card-name,
.atp-card:focus-visible .atp-card-name {
    opacity: 1;
    transform: translateY(0);
}

/* ── Empty state ── */
.atp-empty {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 40px 0;
}

/* ── Mobile ── */
@media (max-width: 820px) {
    .atp-layout {
        flex-direction: column;
        gap: 32px;
    }

    .atp-side-nav {
        width: 100%;
        position: static;
        top: auto;
    }

    .atp-side-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        border-left: none;
        border-bottom: none;
        padding-bottom: 0;
    }

    .atp-nav-right .atp-side-nav ul {
        border-right: none;
    }

    .atp-side-nav a {
        border-left: none !important;
        border-right: none !important;
        border: 1px solid #e5e7eb;
        margin: 0;
        border-radius: 20px;
        padding: 6px 14px;
        font-size: 11px;
        background: #f9fafb;
        transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }

    .atp-side-nav a:hover {
        background: #f3f4f6;
        border-color: #9ca3af;
    }

    .atp-side-nav a.atp-nav-active {
        background: #1d4ed8;
        border-color: #1d4ed8;
        color: #fff;
    }

    .atp-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 520px) {
    .atp-partners-section {
        padding: 32px 16px 48px;
    }

    .atp-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .atp-card-inner {
        padding: 9% 10%;
    }
}
