/* trim-profiles.css — Trim & Profiles page sections */

/* ---- Intro ---- */
.tp-intro { padding-block: var(--space-16); background: var(--bg-page); }
.tp-intro__inner {
    display: grid; grid-template-columns: 1.4fr 1fr;
    gap: var(--space-12); align-items: center;
}
@media (max-width: 880px) { .tp-intro__inner { grid-template-columns: 1fr; } }
.tp-intro p { color: var(--text-body); line-height: 1.6; max-width: 60ch; margin-bottom: var(--space-4); }
.tp-intro__cta { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-2); }
.tp-intro__cta .btn--ghost {
    background: transparent;
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
}
.tp-intro__cta .btn--ghost:hover {
    background: var(--brand-primary);
    color: var(--text-on-dark);
}

/* ---- Premium "At a Glance" highlights panel ---- */
.tp-intro__highlights {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    color: var(--text-on-dark);
    border-radius: var(--radius-lg, 12px);
    padding: var(--space-8) var(--space-6);
    box-shadow: 0 18px 40px rgba(15, 16, 17, 0.18);
}
.tp-intro__highlights-pattern {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}
.tp-intro__highlights-pattern::after {
    content: '';
    position: absolute;
    right: -60px; bottom: -60px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}
.tp-intro__highlights-tag {
    position: relative; z-index: 1;
    display: block;
    margin: 0 0 var(--space-5);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: var(--fw-bold);
    color: #ffffff !important;
    padding-left: 28px;
}
.tp-intro__highlights-tag::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 18px; height: 2px;
    background: var(--text-on-dark);
    transform: translateY(-50%);
}
.tp-intro__highlights-list {
    position: relative; z-index: 1;
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--space-4);
}
.tp-intro__highlights-list li {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.tp-intro__highlights-list li:last-child { border-bottom: 0; }
.tp-intro__highlight-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: var(--text-on-dark);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--fs-md);
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
    transition: background 220ms ease, transform 220ms ease;
}
.tp-intro__highlights-list li:hover .tp-intro__highlight-icon {
    background: rgba(255, 255, 255, 0.30);
    transform: scale(1.04);
}
.tp-intro__highlight-text {
    display: flex; flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}
.tp-intro__highlight-text strong {
    color: var(--text-on-dark);
    font-weight: var(--fw-bold);
    font-size: var(--fs-md);
}
.tp-intro__highlight-text em {
    color: rgba(255, 255, 255, 0.82);
    font-style: normal;
    font-size: var(--fs-sm);
    margin-top: 2px;
}

/* ---- Profile cards — 5 panels + 1 "custom" tile ---- */
.tp-profiles { padding-block: var(--space-16); background: var(--bg-soft); }
.tp-profiles__head { text-align: center; margin-bottom: var(--space-10); }

.tp-profiles__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
}
@media (max-width: 1080px) { .tp-profiles__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .tp-profiles__grid { grid-template-columns: 1fr; } }

.profile-card {
    background: var(--bg-page);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    display: flex; flex-direction: column;
    transition: transform 280ms ease, box-shadow 280ms ease, border-color 280ms ease;
}
.profile-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-primary);
    box-shadow: 0 18px 40px rgba(15, 16, 17, 0.10);
}
.profile-card__media {
    aspect-ratio: 4 / 3;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border-subtle);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.profile-card__media img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    display: block;
    padding: var(--space-2);
}
.profile-card__body { padding: var(--space-6); flex: 1 1 auto; display: flex; flex-direction: column; }

.profile-card__tag {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--brand-primary);
    margin-bottom: var(--space-1);
}
.profile-card__title {
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: var(--text-heading);
    margin: 0 0 var(--space-1);
}
.profile-card__width {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin: 0 0 var(--space-3);
    font-weight: var(--fw-semibold);
}
.profile-card__desc {
    color: var(--text-body);
    font-size: var(--fs-sm);
    line-height: 1.55;
    margin: 0;
}
.profile-card__link {
    margin-top: var(--space-4);
    color: var(--brand-primary);
    font-weight: var(--fw-semibold);
    text-decoration: none;
}
.profile-card__link:hover { text-decoration: underline; }

/* "Custom" call-to-action tile */
.profile-card--custom {
    background:
        linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    color: var(--text-on-dark);
    border-color: var(--brand-primary);
    justify-content: flex-start;
    position: relative;
    isolation: isolate;
}
/* Decorative blueprint grid + corner sphere — fills the empty green space
   without competing with the foreground content. */
.profile-card--custom .profile-card__custom-pattern {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}
.profile-card--custom .profile-card__custom-pattern::after {
    content: '';
    position: absolute;
    right: -40px; bottom: -40px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}
.profile-card--custom .profile-card__custom-icon {
    align-self: center;
    margin: var(--space-8) 0 var(--space-4);
    width: 72px; height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    color: var(--text-on-dark);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--fs-xl);
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}
.profile-card--custom .profile-card__body {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1 1 auto;
}
.profile-card--custom .profile-card__tag { color: rgba(255, 255, 255, 0.85); }
.profile-card--custom .profile-card__title,
.profile-card--custom .profile-card__desc { color: var(--text-on-dark); }
.profile-card--custom .profile-card__desc { color: rgba(255, 255, 255, 0.90); }
.profile-card--custom .profile-card__link {
    color: var(--text-on-dark);
    text-decoration: underline;
}

/* "Or call the shop" footer — fills the bottom and keeps the tile balanced */
.profile-card--custom .profile-card__custom-foot {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding: var(--space-5) var(--space-6);
    background: rgba(0, 0, 0, 0.18);
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    text-align: center;
}
.profile-card--custom .profile-card__custom-foot-label {
    display: block;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    font-weight: var(--fw-semibold);
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 4px;
}
.profile-card--custom .profile-card__custom-foot-phone {
    display: inline-flex; align-items: center;
    gap: var(--space-2);
    color: var(--text-on-dark);
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    font-size: var(--fs-md);
    text-decoration: none;
    transition: opacity 180ms ease;
}
.profile-card--custom .profile-card__custom-foot-phone:hover { opacity: 0.85; }
.profile-card--custom .profile-card__custom-foot-phone i {
    width: 30px; height: 30px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--fs-sm);
}

/* ---- Standard Trim grid ---- */
.tp-trim { padding-block: var(--space-16); background: var(--bg-page); }
.tp-trim__head { text-align: center; margin-bottom: var(--space-10); }
.tp-trim__head .section-lede { color: var(--text-body); max-width: 720px; }

.tp-trim__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
}
@media (max-width: 880px) { .tp-trim__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .tp-trim__grid { grid-template-columns: 1fr; } }

.trim-tile {
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    border-top: 4px solid var(--brand-primary);
}
.trim-tile i {
    color: var(--brand-primary);
    font-size: var(--fs-lg);
    margin-bottom: var(--space-3);
}
.trim-tile h3 {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--text-heading);
    margin: 0 0 var(--space-2);
}
.trim-tile p {
    font-size: var(--fs-sm);
    color: var(--text-body);
    line-height: 1.5;
    margin: 0;
}

.tp-trim__diagram-note {
    margin-top: var(--space-8);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    font-style: italic;
}

/* ---- Clickable profile card (button variant) ---- */
.profile-card--clickable {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--border-subtle);
    background: var(--bg-page);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    padding: 0;
    width: 100%;
}
.profile-card__media { position: relative; }
.profile-card__zoom {
    position: absolute;
    top: var(--space-3); right: var(--space-3);
    width: 40px; height: 40px;
    background: rgba(15, 16, 17, 0.75);
    color: var(--text-on-dark);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--fs-sm);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 220ms ease, transform 220ms ease, background 220ms ease;
}
.profile-card--clickable:hover .profile-card__zoom,
.profile-card--clickable:focus-visible .profile-card__zoom {
    opacity: 1;
    transform: translateY(0);
    background: var(--brand-primary);
}
.profile-card--clickable:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 2px;
}
.profile-card__hint {
    margin-top: var(--space-4);
    color: var(--brand-primary);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
    transition: gap var(--transition);
}

/* ---- Profile spec viewer modal ---- */
.profile-modal {
    position: fixed; inset: 0;
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: var(--space-6);
}
.profile-modal[hidden] { display: none; }

.profile-modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 16, 17, 0.78);
    backdrop-filter: blur(4px);
    animation: profile-modal-fade 240ms ease;
}
@keyframes profile-modal-fade {
    from { opacity: 0; } to { opacity: 1; }
}

.profile-modal__shell {
    position: relative;
    width: min(960px, 100%);
    max-height: calc(100vh - var(--space-12));
    display: flex; flex-direction: column;
    animation: profile-modal-rise 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.profile-modal__panel {
    position: relative;
    background: var(--bg-page);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    flex: 1 1 auto;
    display: flex; flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
@keyframes profile-modal-rise {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-modal__close {
    /* Lives OUTSIDE the panel (sibling, inside the shell) so the panel's
       overflow:hidden never clips it. Floats above the top-right corner. */
    position: absolute;
    top: -52px; right: 0;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-strong);
    border: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--fs-lg);
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.30);
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
.profile-modal__close:hover,
.profile-modal__close:focus-visible {
    background: var(--brand-primary);
    color: var(--text-on-dark);
    transform: scale(1.05);
    outline: 0;
}

.profile-modal__header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-6);
    align-items: center;
    padding: var(--space-6) var(--space-8);
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border-subtle);
}
@media (max-width: 720px) {
    .profile-modal__header {
        grid-template-columns: 1fr;
        padding: var(--space-5);
    }
}

.profile-modal__eyebrow {
    margin: 0 0 4px;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--brand-primary);
    font-weight: var(--fw-semibold);
}
.profile-modal__title {
    margin: 0;
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: var(--text-heading);
    line-height: 1.2;
}

.profile-modal__download {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--brand-primary);
    color: var(--text-on-dark);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-family: var(--font-heading);
    box-shadow: 0 8px 18px rgba(31, 122, 58, 0.25);
    transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
}
.profile-modal__download:hover,
.profile-modal__download:focus-visible {
    background: var(--brand-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(31, 122, 58, 0.35);
}
.profile-modal__download i {
    font-size: var(--fs-lg);
    flex-shrink: 0;
    width: 28px; height: 28px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
}
.profile-modal__download span { display: flex; flex-direction: column; line-height: 1.2; }
.profile-modal__download-label {
    font-weight: var(--fw-bold);
    font-size: var(--fs-sm);
}
.profile-modal__download-sub {
    font-size: var(--fs-xs);
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
    font-weight: var(--fw-regular);
}

.profile-modal__body {
    flex: 1 1 auto;
    background: var(--bg-soft);
    min-height: 50vh;
}
.profile-modal__pdf {
    width: 100%;
    height: 100%;
    min-height: 60vh;
    border: 0;
    display: block;
}

/* Lock body scroll when modal is open */
body.profile-modal-open { overflow: hidden; }
