/* ==========================================================================
   Collection / Skull Archive — additive styles
   Loaded only on: is_page('skulls') || is_singular('portfolio')
   Depends on: site.v4.css (all base tokens available via :root)
   ========================================================================== */

/* --- Overview Page: /skulls/ --- */

.collection-intro {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 4rem var(--page-pad-x);
    display: grid;
    grid-template-columns: minmax(220px, var(--inner-aside-w)) minmax(0, 1fr);
    gap: var(--inner-grid-gap);
    align-items: start;
}

.collection-intro-aside {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
}

.collection-intro-aside h2 {
    margin-top: 1rem;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 2.9rem;
    line-height: 0.92;
    letter-spacing: 0.03em;
    color: var(--white);
}

.collection-intro-text {
    max-width: var(--inner-content-max);
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.85;
}

.collection-intro-text p {
    margin: 0 0 1rem;
}

.collection-intro-text p:last-child {
    margin-bottom: 0;
}

/* --- Collection Grid --- */

.collection-grid {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 4rem var(--page-pad-x);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    align-items: stretch;
}

/* --- Collection Card (Overview) --- */

.collection-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background:
        radial-gradient(ellipse at top center, rgba(255, 255, 255, 0.03), transparent 60%),
        rgba(6, 6, 6, 0.98);
    display: grid;
    grid-template-rows: 1fr auto;
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.collection-card:hover {
    border-color: rgba(57, 201, 124, 0.25);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(57, 201, 124, 0.08);
}

.collection-card-image {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 5;
}

.collection-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.collection-card:hover .collection-card-image::after {
    opacity: 0.6;
}

.collection-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    filter: grayscale(0.9) brightness(1.05) contrast(1.1);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}

.collection-card:hover .collection-card-image img {
    transform: scale(1.04);
    filter: grayscale(0.7) brightness(1.1) contrast(1.12);
}

.collection-card-body {
    padding: 1.4rem 1.5rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.collection-card-body .card-eyebrow {
    color: var(--accent);
}

.collection-card-body h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    line-height: 1;
    letter-spacing: 0.04em;
    margin: 0;
}

.collection-card-body h2 a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.2s;
}

.collection-card-body h2 a:hover {
    color: var(--accent);
}

.collection-card-body .card-excerpt {
    color: var(--text-dim);
    font-size: 0.88rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.collection-card-body .post-card-link {
    margin-top: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.collection-card-body .post-card-link:hover {
    color: var(--accent);
    border-color: rgba(57, 201, 124, 0.45);
    background: rgba(57, 201, 124, 0.07);
}

.collection-card-body .post-card-link .card-link-icon {
    display: inline-flex;
    color: var(--accent);
}

/* --- Single Portfolio Item --- */

.skull-single {
    overflow: hidden;
}

.skull-hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: flex-end;
    padding: 4rem var(--page-pad-x) 3rem;
    max-width: 100%;
    overflow: hidden;
}

.skull-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.skull-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    filter: grayscale(0.85) brightness(0.6) contrast(1.15);
}

.skull-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.85) 80%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.4) 0%, transparent 50%);
}

.skull-hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
}

.skull-hero-content .hero-eyebrow {
    margin-bottom: 0.8rem;
}

.skull-hero-content .page-title {
    max-width: 700px;
}

/* --- Back Navigation --- */

.skull-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.skull-back-link:hover {
    color: var(--accent);
}

.skull-back-link svg {
    width: 0.9rem;
    height: 0.9rem;
}

/* --- Gallery Section --- */

.skull-gallery-section {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 4rem var(--page-pad-x);
}

.skull-gallery-section .section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.skull-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.skull-gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    aspect-ratio: 1 / 1;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.skull-gallery-item:hover {
    border-color: rgba(57, 201, 124, 0.3);
}

.skull-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.85) brightness(1.05) contrast(1.08);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}

.skull-gallery-item:hover img {
    transform: scale(1.06);
    filter: grayscale(0.5) brightness(1.1) contrast(1.1);
}

.skull-gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(57, 201, 124, 0.08);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.skull-gallery-item:hover::after {
    opacity: 1;
}

/* Zoom icon hint on hover */
.skull-gallery-item::before {
    content: '';
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2339c97c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E") center/contain no-repeat;
    z-index: 2;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.skull-gallery-item:hover::before {
    opacity: 0.85;
    transform: translateY(0);
}

/* --- Description Section --- */

.skull-description {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--page-pad-x) 4rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--inner-grid-gap);
    align-items: start;
}

.skull-prose {
    color: var(--text-dim);
    font-size: 1.05rem;
    line-height: 1.85;
}

.skull-prose p {
    margin: 0 0 1.2rem;
}

.skull-prose p:last-child {
    margin-bottom: 0;
}

/* --- Provenance / Collector Block --- */

.skull-provenance {
    position: sticky;
    top: 6rem;
    border-left: 2px solid var(--accent);
    padding: 1.2rem 0 1.2rem 1.4rem;
}

.skull-provenance-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.7rem;
}

.skull-provenance-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.3rem;
    letter-spacing: 0.06em;
    color: var(--white);
    margin: 0 0 0.35rem;
}

.skull-provenance-location {
    color: var(--text-faint);
    font-size: 0.9rem;
}

/* --- Responsive: Tablet --- */

@media (max-width: 900px) {
    .collection-intro {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-left: var(--page-pad-mobile);
        padding-right: var(--page-pad-mobile);
    }

    .collection-intro-aside {
        position: static;
    }

    .collection-grid {
        gap: 1.5rem;
        padding-left: var(--page-pad-mobile);
        padding-right: var(--page-pad-mobile);
    }

    .skull-hero {
        min-height: 55vh;
        padding-left: var(--page-pad-mobile);
        padding-right: var(--page-pad-mobile);
    }

    .skull-hero-content .page-title {
        font-size: clamp(2.5rem, 8vw, 4rem);
        word-break: break-word;
    }

    .skull-gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .skull-gallery-section {
        padding-left: var(--page-pad-mobile);
        padding-right: var(--page-pad-mobile);
    }

    .skull-description {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-left: var(--page-pad-mobile);
        padding-right: var(--page-pad-mobile);
    }

    .skull-provenance {
        position: static;
    }
}

/* --- Responsive: Mobile --- */

@media (max-width: 600px) {
    .collection-intro {
        padding: 4rem var(--page-pad-mobile) 2rem;
    }

    .collection-grid {
        grid-template-columns: 1fr;
        padding: 2.5rem var(--page-pad-mobile);
        gap: 2rem;
    }

    .collection-card-image {
        aspect-ratio: 3 / 4;
    }

    .skull-hero {
        min-height: 45vh;
        padding: 3rem var(--page-pad-mobile) 2rem;
    }

    .skull-gallery-section {
        padding: 2.5rem var(--page-pad-mobile);
    }

    .skull-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .skull-description {
        padding: 0 var(--page-pad-mobile) 3rem;
    }
}

/* --- Prevent horizontal scroll globally on collection pages --- */

.skull-single,
.skull-hero {
    overflow-x: clip;
}
