/* Public site root is 10px (Bootstrap 3) — px only, no rem. */

.hv-tan,
.hv-tan-modal,
.hv-tan-ghost {
    --tan-navy: #0e1282;
    --tan-red: #af0000;
    --tan-ink: #1a1a1a;
    --tan-mid: #5a5f6b;
    --tan-line: #e3e5ea;
    --tan-tint: #f3f4f8;
    --tan-radius: 12px;
    --tan-gap: 28px;
    --tan-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --tan-shadow: 0 10px 30px -12px rgba(14, 18, 50, 0.35);
}

/* Theme styles every <button> (bg, padding, ::before overlays) — neutralize. */
.hv-tan button,
.hv-tan-modal button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    border: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    font: inherit;
    color: inherit;
    line-height: inherit;
    text-transform: none;
    letter-spacing: normal;
    min-width: 0;
    min-height: 0;
    height: auto;
    border-radius: 0;
}

.hv-tan button::before,
.hv-tan button::after,
.hv-tan-modal button::before,
.hv-tan-modal button::after {
    content: none !important;
    display: none !important;
}

/* ── Card ─────────────────────────────────────────────────────────────── */

.hv-tan {
    position: relative;
    font-size: 16px;
    color: var(--tan-ink);
}

.hv-tan .hv-tan__card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border-radius: var(--tan-radius);
    -webkit-tap-highlight-color: transparent;
}

.hv-tan .hv-tan__card:focus {
    outline: none;
}

.hv-tan .hv-tan__card:focus-visible {
    outline: 3px solid var(--tan-navy);
    outline-offset: 6px;
}

.hv-tan__media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    perspective: 1400px;
}

.hv-tan__flip {
    position: absolute;
    inset: 0;
    display: block;
    transform-style: preserve-3d;
    transition: transform 1.7s var(--tan-ease);
}

.hv-tan__face {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    border-radius: var(--tan-radius);
    background: var(--tan-tint);
    box-shadow: var(--tan-shadow);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.hv-tan__face--after {
    transform: rotateY(180deg);
}

.hv-tan .hv-tan__face img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transition: transform 0.7s var(--tan-ease);
}

@media (hover: hover) {
    .hv-tan__media:hover .hv-tan__flip {
        transform: rotateY(180deg);
    }

    .hv-tan__media:hover .hv-tan__face img {
        transform: scale(1.03);
    }
}

.hv-tan__card:focus-visible .hv-tan__flip,
.hv-tan__card.is-holding-after .hv-tan__flip {
    transform: rotateY(180deg);
}

.hv-tan__card.is-source .hv-tan__media {
    visibility: hidden;
}

.hv-tan__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--tan-navy);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.hv-tan__badge--now {
    background: var(--tan-red);
    color: #fff;
}

.hv-tan__name {
    display: block;
    padding: 0 2px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.25;
    transition: color 0.25s ease;
}

.hv-tan__card:hover .hv-tan__name {
    color: var(--tan-red);
}

/* ── Grid ─────────────────────────────────────────────────────────────── */

.hv-tan--grid .hv-tan__track {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px var(--tan-gap);
}

@media (max-width: 900px) {
    .hv-tan--grid .hv-tan__track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px 20px;
    }
}

@media (max-width: 480px) {
    .hv-tan--grid .hv-tan__track {
        grid-template-columns: minmax(0, 1fr);
        max-width: 360px;
        margin-inline: auto;
    }
}

/* ── Side-scroll carousel (STComponents::carousel) ──────────────────── */

.hv-tan--scroll {
    --st-carousel-slide-size: 33.333%;
    --st-carousel-gap: var(--tan-gap);
    --st-carousel-pill-color: var(--tan-navy);
    --st-carousel-btn-top: 42%;
}

/* Vertical room for the 3D flip + shadows inside the viewport's overflow clip. */
.hv-tan--scroll .st-carousel__viewport {
    margin: -24px 0 -28px;
}

.hv-tan--scroll .st-carousel__slide {
    padding-top: 24px;
    padding-bottom: 28px;
}

@media (max-width: 900px) {
    .hv-tan--scroll {
        --tan-gap: 20px;
        --st-carousel-slide-size: 50%;
    }
}

@media (max-width: 600px) {
    .hv-tan--scroll {
        --st-carousel-slide-size: 78%;
    }
}

/* The button reset above outranks the component's zero-specificity styles, so restyle its controls here. */
.hv-tan .st-carousel__button {
    position: absolute;
    top: var(--st-carousel-btn-top);
    z-index: 2;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    color: var(--tan-navy);
    box-shadow: 0 6px 20px -6px rgba(14, 18, 50, 0.4);
    cursor: pointer;
    transform: translateY(-50%);
    transition:
        opacity 0.25s ease,
        transform 0.25s var(--tan-ease),
        background-color 0.25s ease,
        color 0.25s ease;
}

.hv-tan .st-carousel__button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hv-tan .st-carousel__button:hover {
    background: var(--tan-navy);
    color: #fff;
}

.hv-tan .st-carousel__button:focus-visible {
    outline: 3px solid var(--tan-navy);
    outline-offset: 3px;
}

.hv-tan .st-carousel__button:disabled {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.8);
}

.hv-tan .st-carousel__button--prev {
    left: -24px;
}

.hv-tan .st-carousel__button--next {
    right: -24px;
}

@media (max-width: 1260px) {
    .hv-tan .st-carousel__button--prev {
        left: 8px;
    }
    .hv-tan .st-carousel__button--next {
        right: 8px;
    }
}

@media (max-width: 600px), (hover: none) {
    .hv-tan .st-carousel__button {
        display: none;
    }
}

.hv-tan .st-carousel__dots {
    margin-top: 28px;
}

.hv-tan .st-carousel__dot {
    display: block;
    padding: 8px 4px;
    cursor: pointer;
}

.hv-tan .st-carousel__dot:focus-visible {
    outline: 2px solid var(--tan-navy);
    outline-offset: 0;
    border-radius: 999px;
}

/* ── Modal ────────────────────────────────────────────────────────────── */

html.hv-tan-lock,
html.hv-tan-lock body {
    overflow: hidden !important;
}

.hv-tan-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-size: 16px;
    color: var(--tan-ink);
}

.hv-tan-modal[hidden] {
    display: none;
}

.hv-tan-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 40, 0.72);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.hv-tan-modal__shell {
    position: relative;
    width: 100%;
    max-width: 1040px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.hv-tan-modal__panel {
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
}

.hv-tan-modal__panel:focus {
    outline: none;
}

.hv-tan-modal.is-visible .hv-tan-modal__backdrop,
.hv-tan-modal.is-visible .hv-tan-modal__shell {
    opacity: 1;
}

.hv-tan-modal .hv-tan-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--tan-ink);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.hv-tan-modal .hv-tan-modal__close:hover {
    background: var(--tan-navy);
    color: #fff;
}

.hv-tan-modal .hv-tan-modal__close:focus-visible {
    outline: 3px solid var(--tan-navy);
    outline-offset: 2px;
}

.hv-tan-modal__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 40px;
    padding: 40px;
}

.hv-tan-modal__photos {
    position: sticky;
    top: 40px;
    align-self: start;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.hv-tan-modal__photo {
    --st-lightbox-radius: var(--tan-radius);
    --st-lightbox-bg: var(--tan-tint);
    --st-lightbox-caption-gap: 10px;
    min-width: 0;
}

.hv-tan-modal__figure {
    margin: 0;
}

.hv-tan-modal__frame {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: var(--tan-radius);
    background: var(--tan-tint);
}

.hv-tan-modal .hv-tan-modal__frame img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.hv-tan-modal .st-lightbox__img {
    max-width: none;
}

.hv-tan-modal__photo.is-pending img {
    opacity: 0;
}

.hv-tan-modal__figure figcaption,
.hv-tan-modal .st-lightbox__caption {
    margin-top: 10px;
    color: var(--tan-mid);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-align: center;
    text-transform: uppercase;
}

.hv-tan-modal__photo[data-face="after"] figcaption {
    color: var(--tan-red);
}

/* PhotoSwipe defaults to the same z-index as the modal; keep the lightbox on top. */
html.hv-tan-lock .pswp {
    --pswp-root-z-index: 100010;
}

.hv-tan-modal__info {
    padding-top: 4px;
    padding-right: 24px;
}

.hv-tan-modal__rank {
    margin: 0 0 6px;
    color: var(--tan-red);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hv-tan-modal .hv-tan-modal__name {
    margin: 0;
    color: var(--tan-ink);
    font-size: 34px;
    font-weight: 800;
    line-height: 1.15;
}

.hv-tan-modal__section {
    margin-top: 28px;
}

.hv-tan-modal .hv-tan-modal__label {
    margin: 0 0 12px;
    color: var(--tan-mid);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.3;
    text-transform: uppercase;
}

.hv-tan-modal__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hv-tan-modal__chips li {
    margin: 0;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--tan-tint);
    color: var(--tan-navy);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.hv-tan-modal__timeline {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hv-tan-modal__timeline li {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    margin: 0;
    padding: 10px 0 10px 26px;
    border-bottom: 1px solid var(--tan-line);
    font-size: 15px;
    line-height: 1.4;
}

.hv-tan-modal__timeline li:last-child {
    border-bottom: 0;
}

.hv-tan-modal__timeline li::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 4px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--tan-navy);
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
}

.hv-tan-modal__loc {
    font-weight: 700;
}

.hv-tan-modal .hv-tan-modal__years {
    margin: 0;
    font-weight: 700;
}

.hv-tan-modal__when {
    color: var(--tan-mid);
    font-variant-numeric: tabular-nums;
}

.hv-tan-modal__desc p {
    margin: 0 0 14px;
    color: #33363f;
    font-size: 16px;
    line-height: 1.7;
}

.hv-tan-modal__desc p:last-child {
    margin-bottom: 0;
}

@media (max-width: 860px) {
    .hv-tan-modal {
        padding: 12px;
    }

    .hv-tan-modal__panel {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }

    .hv-tan-modal__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
        padding: 24px 20px 28px;
    }

    .hv-tan-modal__photos {
        position: static;
        max-width: 480px;
        padding-right: 44px;
    }

    .hv-tan-modal__info {
        padding-right: 0;
    }

    .hv-tan-modal .hv-tan-modal__name {
        font-size: 28px;
    }
}

/* ── Flying image (FLIP ghost) ────────────────────────────────────────── */

.hv-tan-ghost {
    position: fixed;
    z-index: 100001;
    overflow: hidden;
    margin: 0;
    background: var(--tan-tint);
    transform-origin: 0 0;
    pointer-events: none;
    will-change: transform;
}

.hv-tan-ghost img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
    .hv-tan__flip,
    .hv-tan .hv-tan__face img {
        transition-duration: 0.01ms;
    }
}
