/* =========================================================
   HAPPY PENS ARCHIVE — MODEL PAGE V1
========================================================= */

.hpc-model-counts,
.hpc-model-featured-pens,
.hpc-model-counts *,
.hpc-model-featured-pens * {
    box-sizing: border-box;
}


/* =========================================================
   MODEL COUNTS
========================================================= */

.hpc-model-counts {
    --hpc-model-text: #171411;
    --hpc-model-muted: #5f5a54;
    --hpc-model-gold: #b08a52;
    --hpc-model-border: #dfd6ca;
    --hpc-model-bg: #faf8f5;

    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    width: 100%;
    overflow: hidden;

    color: var(--hpc-model-text);
    background: var(--hpc-model-bg);
    border: 0px solid var(--hpc-model-border);
    border-radius: 4px;
}

.hpc-model-count {
    display: flex;
    min-width: 0;
    min-height: 104px;
    padding: 18px 24px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hpc-model-count + .hpc-model-count {
    border-left: 1px solid var(--hpc-model-border);
}

.hpc-model-count-value {
    color: var(--hpc-model-text);
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.1;
}

.hpc-model-count-label {
    margin-top: 8px;
    color: var(--hpc-model-muted);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .045em;
    line-height: 1.25;
    text-transform: uppercase;
}


/* =========================================================
   ICONIC / FEATURED MODEL PENS
========================================================= */

.hpc-model-featured-pens {
    --hpc-model-text: #171411;
    --hpc-model-muted: #5f5a54;
    --hpc-model-gold: #b08a52;
    --hpc-model-border: #dfd6ca;
    --hpc-model-card-bg: #fffdf9;
    --hpc-model-featured-gap: 18px;

    display: flex;
    width: 100%;

    align-items: stretch;
    justify-content: center;
    flex-wrap: nowrap;

    gap: var(--hpc-model-featured-gap);
}

.hpc-model-featured-pen {
    display: flex;

    width:
        calc(
            (
                100%
                - var(--hpc-model-featured-gap) * 3
            )
            / 4
        );

    min-width: 0;
    max-width:
        calc(
            (
                100%
                - var(--hpc-model-featured-gap) * 3
            )
            / 4
        );

    flex:
        0 0
        calc(
            (
                100%
                - var(--hpc-model-featured-gap) * 3
            )
            / 4
        );

    flex-direction: column;
    overflow: hidden;

    color: var(--hpc-model-text);
    background: var(--hpc-model-card-bg);
    border: 1px solid var(--hpc-model-border);
    border-radius: 4px;
    box-shadow: 0 7px 20px rgba(23, 20, 17, .08);

    text-decoration: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

/* Если карточек пять, они уменьшаются и остаются в одном ряду */

.hpc-model-featured-pens:has(
    .hpc-model-featured-pen:nth-child(5)
)
.hpc-model-featured-pen {
    width:
        calc(
            (
                100%
                - var(--hpc-model-featured-gap) * 4
            )
            / 5
        );

    max-width:
        calc(
            (
                100%
                - var(--hpc-model-featured-gap) * 4
            )
            / 5
        );

    flex-basis:
        calc(
            (
                100%
                - var(--hpc-model-featured-gap) * 4
            )
            / 5
        );
}

.hpc-model-featured-pen:hover,
.hpc-model-featured-pen:focus-visible {
    color: var(--hpc-model-text);
    border-color: var(--hpc-model-gold);
    box-shadow: 0 11px 26px rgba(23, 20, 17, .13);
    text-decoration: none;
    transform: translateY(-3px);
    outline: none;
}

.hpc-model-featured-media {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #f1eee9;
}

.hpc-model-featured-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;

    transition:
        transform .38s ease;
}

.hpc-model-featured-pen:hover
.hpc-model-featured-image,
.hpc-model-featured-pen:focus-visible
.hpc-model-featured-image {
    transform: scale(1.035);
}

.hpc-model-featured-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(
            135deg,
            rgba(176, 138, 82, .12),
            rgba(23, 20, 17, .025)
        );
}

.hpc-model-featured-content {
    display: flex;
    min-height: 96px;
    padding: 15px 12px 14px;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hpc-model-featured-title {
    color: var(--hpc-model-text);
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.hpc-model-featured-meta {
    margin-top: 7px;
    color: var(--hpc-model-muted);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

    .hpc-model-featured-pens {
        flex-wrap: wrap;
    }

    .hpc-model-featured-pen,
    .hpc-model-featured-pens:has(
        .hpc-model-featured-pen:nth-child(5)
    )
    .hpc-model-featured-pen {
        width:
            calc(
                (
                    100%
                    - var(--hpc-model-featured-gap) * 2
                )
                / 3
            );

        max-width:
            calc(
                (
                    100%
                    - var(--hpc-model-featured-gap) * 2
                )
                / 3
            );

        flex-basis:
            calc(
                (
                    100%
                    - var(--hpc-model-featured-gap) * 2
                )
                / 3
            );
    }
}

@media (max-width: 760px) {

    .hpc-model-count {
        min-height: 90px;
        padding: 15px 12px;
    }

    .hpc-model-count-label {
        font-size: 11px;
    }

    .hpc-model-featured-pens {
    --hpc-model-featured-gap: 14px;
}

.hpc-model-featured-pen,
.hpc-model-featured-pens:has(
    .hpc-model-featured-pen:nth-child(5)
)
.hpc-model-featured-pen {
    width:
        calc(
            (
                100%
                - var(--hpc-model-featured-gap)
            )
            / 2
        );

    max-width:
        calc(
            (
                100%
                - var(--hpc-model-featured-gap)
            )
            / 2
        );

    flex-basis:
        calc(
            (
                100%
                - var(--hpc-model-featured-gap)
            )
            / 2
        );
    }
}

@media (max-width: 480px) {

    .hpc-model-counts {
        grid-template-columns: 1fr;
    }

    .hpc-model-count + .hpc-model-count {
        border-top: 1px solid var(--hpc-model-border);
        border-left: 0;
    }

    .hpc-model-featured-pen,
    .hpc-model-featured-pens:has(
    .hpc-model-featured-pen:nth-child(5)
    )
    .hpc-model-featured-pen {
    width: 100%;
    max-width: 100%;
    flex-basis: 100%;
    }
}

/* Model Page breadcrumbs — identical typography and spacing to CPT Pen. */
.hpc-model-breadcrumbs {
    margin-bottom: 16px;
    color: #8A6A2F;
    font-family: DM Sans, sans-serif;
    font-size: 13px;
}
.hpc-model-breadcrumbs a {
    color: #8A6A2F;
    text-decoration: none;
}
.hpc-model-breadcrumbs a:hover {
    text-decoration: underline;
}
.hpc-model-breadcrumbs [aria-current="page"] {
    color: #171411;
    font-weight: 600;
}

/* Model Catalogue Photo: preserve the full photograph and its natural ratio. */
.hpc-model-catalogue-photo {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.hpc-model-catalogue-photo .hpc-model-catalogue-photo__image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
}