/* =========================
   HAPPY PENS — LATEST ADDED
   Row 1: 1 card
   Row 2: 2 cards
   Row 3: info block + 2 cards
   Row 4: 3 cards
   Row 5: 4 cards
   Row 6: 1 card
   Row 7: 3 cards
   Row 8: 4 cards
========================= */

/* =========================
   DESIGN CONTROLS
========================= */

:root {

    /* Card radius */
    --hpc-latest-radius: 8px;

    /* Gap between cards */
    --hpc-latest-gap: 18px;

    /* Card border */
    --hpc-latest-border: rgba(176, 138, 82, 0.28);

    /* Card shadow */
    --hpc-latest-shadow: 0 16px 34px rgba(0,0,0,0.055);

}

.hpc-latest-added-page,
.hpc-latest-added-page * {
    box-sizing: border-box;
}

.hpc-latest-added-page {
    width: 100%;
    padding: 0;
    color: #171411;
}

/* HERO */

.hpc-latest-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 28px;
    align-items: end;
    margin-bottom: 34px;
    padding-bottom: 26px;
    border-bottom: 1px solid rgba(176, 138, 82, 0.28);
}

.hpc-latest-hero h1 {
    margin: 0 0 10px;
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: clamp(30px, 4.4vw, 50px);
    line-height: 1.05;
    color: #171411;
}

.hpc-latest-hero p {
    max-width: 640px;
    margin: 0;
    color: #5E5A55;
    font-size: 15px;
    line-height: 1.7;
}

.hpc-latest-total {
    border: 1px solid rgba(176, 138, 82, 0.34);
    background: #FDFBF8;
    padding: 18px 18px 16px;
    text-align: center;
    box-shadow: 0 14px 30px rgba(0,0,0,0.04);
}

.hpc-latest-total span {
    display: block;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7A7066;
}

.hpc-latest-total strong {
    display: block;
    margin: 6px 0;
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 42px;
    line-height: 1;
    color: #171411;
}

/* MAIN GRID */

.hpc-latest-layout {
    display: grid;
    grid-template-columns: repeat(60, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 18px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* BASE CARD */

.hpc-latest-card,
.hpc-latest-info-block {
    min-width: 0;
    max-width: 100%;
}

.hpc-latest-card {
    position: relative;
    overflow: hidden;
    background: #FDFBF8;
    border: 1px solid var(--hpc-latest-border);
    border-radius: var(--hpc-latest-radius);
    box-shadow: var(--hpc-latest-shadow);
}
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.hpc-latest-card:hover {
    transform: translateY(-3px);
    border-color: rgba(176, 138, 82, 0.62);
    box-shadow: 0 22px 44px rgba(0,0,0,0.09);
}

.hpc-latest-card-link {
    display: grid;
    height: 100%;
    min-height: 100%;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.hpc-latest-card-link:hover {
    color: inherit;
    text-decoration: none;
}

.hpc-latest-card-info {
    position: relative;
    z-index: 2;
    min-width: 0;
    height: 100%;
    min-height: 100%;
    padding: 22px;
    display: flex;
    flex-direction: column;
}

.hpc-latest-label {
    margin-bottom: 7px;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #B08A52;
    font-weight: 700;
}

.hpc-latest-number {
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 28px;
    line-height: 1;
    color: #8A6A3F;
    margin-bottom: 10px;
}

.hpc-latest-title {
    margin: 0 0 9px;
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 21px;
    line-height: 1.22;
    color: #171411;
    overflow-wrap: anywhere;
}

.hpc-latest-meta {
    margin-bottom: 9px;
    font-size: 13px;
    line-height: 1.45;
    color: #5E5A55;
    overflow-wrap: anywhere;
}

.hpc-latest-date {
    margin-top: auto;
    padding-top: 16px;
    font-size: 12px;
    color: #7A7066;
}

.hpc-latest-image {
    min-width: 0;
    width: 100%;
    background: #F4EFE7;
    overflow: hidden;
}

.hpc-latest-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ROW 1 */

.hpc-latest-card-1 {
    grid-column: span 60;
    min-height: 180px;
}

.hpc-latest-card-1 .hpc-latest-card-link {
    grid-template-columns: minmax(0, 45%) minmax(0, 55%);
}

.hpc-latest-card-1 .hpc-latest-card-info {
    padding: 25px;
}

.hpc-latest-card-1 .hpc-latest-number {
    font-size: clamp(30px, 5vw, 50px);
    margin-bottom: 6px;
}

.hpc-latest-card-1 .hpc-latest-title {
    font-size: clamp(20px, 3vw, 30px);
    max-width: 640px;
}

.hpc-latest-card-1 .hpc-latest-meta {
    font-size: 15px;
}

.hpc-latest-card-1 .hpc-latest-date {
    font-size: 13px;
}

.hpc-latest-card-1 .hpc-latest-image {
    aspect-ratio: 16 / 9;
}

/* ROW 2 */

.hpc-latest-card-2,
.hpc-latest-card-3 {
    grid-column: span 30;
    min-height: 240px;
}

.hpc-latest-row2-link {
    grid-template-columns: minmax(0, 38%) minmax(0, 62%);
    grid-template-rows: auto minmax(0, 1fr);
}

.hpc-latest-row2-left {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.hpc-latest-row2-left .hpc-latest-date {
    margin-top: auto;
    padding-top: 18px;
}

.hpc-latest-row2-image {
    aspect-ratio: 16 / 9;
}

.hpc-latest-row2-bottom {
    grid-column: 1 / -1;
    padding: 22px 24px 24px;
    border-top: 1px solid rgba(176, 138, 82, 0.22);
}

.hpc-latest-card-2 .hpc-latest-title,
.hpc-latest-card-3 .hpc-latest-title {
    font-size: 24px;
    margin-bottom: 7px;
}

.hpc-latest-card-2 .hpc-latest-meta,
.hpc-latest-card-3 .hpc-latest-meta {
    font-size: 14px;
    margin-bottom: 0;
    padding-top: 8px;
}

/* ROW 3 */

.hpc-latest-info-block {
    grid-column: span 20;
    min-height: 260px;
    padding: 28px;
    background: #171411;
    color: #FDFBF8;
    border: 1px solid rgba(176, 138, 82, 0.46);
    border-radius: var(--hpc-latest-radius);
    box-shadow: 0 16px 34px rgba(0,0,0,0.09);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hpc-latest-info-block strong {
    display: block;
    margin-bottom: 10px;
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 28px;
    line-height: 1.15;
    color: #FDFBF8;
}

.hpc-latest-info-block span {
    color: #D9CDBE;
    font-size: 14px;
    line-height: 1.6;
}

.hpc-latest-card-4,
.hpc-latest-card-5 {
    grid-column: span 20;
    min-height: 300px;
}

.hpc-latest-card-4 .hpc-latest-card-link,
.hpc-latest-card-5 .hpc-latest-card-link {
    grid-template-rows: auto minmax(0, 1fr);
}

.hpc-latest-card-4 .hpc-latest-image,
.hpc-latest-card-5 .hpc-latest-image {
    order: -1;
    aspect-ratio:16 / 9;
}

.hpc-latest-row3-number-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 13px;
}

.hpc-latest-row3-number-row .hpc-latest-number {
    margin-bottom: 0;
}

.hpc-latest-row3-number-row .hpc-latest-date {
    margin-top: 0;
    padding-top: 0;
    white-space: nowrap;
}

.hpc-latest-card-4 .hpc-latest-title,
.hpc-latest-card-5 .hpc-latest-title {
    font-size: 20px;
}

/* ROW 4 */

.hpc-latest-card-6,
.hpc-latest-card-7,
.hpc-latest-card-8 {
    grid-column: span 20;
    min-height: 200px;
}

.hpc-latest-row4-link {
    grid-template-columns: minmax(0, 32%) minmax(0, 68%);
    grid-template-rows: auto minmax(0, 1fr);
}

.hpc-latest-row4-left {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.hpc-latest-row4-left .hpc-latest-date {
    margin-top: auto;
    padding-top: 18px;
}

.hpc-latest-row4-image {
    aspect-ratio: 15 / 9;
}

.hpc-latest-row4-bottom {
    grid-column: 1 / -1;
    padding: 22px 24px 14px;
    border-top: 1px solid rgba(176, 138, 82, 0.22);
}

.hpc-latest-card-6 .hpc-latest-title,
.hpc-latest-card-7 .hpc-latest-title,
.hpc-latest-card-8 .hpc-latest-title {
    font-size: 20px;
}

/* ROW 5 */

.hpc-latest-card-9,
.hpc-latest-card-10,
.hpc-latest-card-11,
.hpc-latest-card-12 {
    grid-column: span 15;
    min-height: 320px;
}

.hpc-latest-card-9 .hpc-latest-card-link,
.hpc-latest-card-10 .hpc-latest-card-link,
.hpc-latest-card-11 .hpc-latest-card-link,
.hpc-latest-card-12 .hpc-latest-card-link {
    grid-template-rows: auto minmax(0, 1fr);
}

.hpc-latest-card-9 .hpc-latest-image,
.hpc-latest-card-10 .hpc-latest-image,
.hpc-latest-card-11 .hpc-latest-image,
.hpc-latest-card-12 .hpc-latest-image {
    order: -1;
    aspect-ratio: 4 / 3;
}

.hpc-latest-card-9 .hpc-latest-card-info,
.hpc-latest-card-10 .hpc-latest-card-info,
.hpc-latest-card-11 .hpc-latest-card-info,
.hpc-latest-card-12 .hpc-latest-card-info {
    padding: 18px;
}

.hpc-latest-row5-number-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 13px;
}

.hpc-latest-row5-number-row .hpc-latest-number {
    margin-bottom: 0;
}

.hpc-latest-row5-number-row .hpc-latest-date {
    margin-top: 0;
    padding-top: 0;
    white-space: nowrap;
}

.hpc-latest-card-9 .hpc-latest-title,
.hpc-latest-card-10 .hpc-latest-title,
.hpc-latest-card-11 .hpc-latest-title,
.hpc-latest-card-12 .hpc-latest-title {
    font-size: 18px;
}

/* ROW 6 — 1 CARD
   Structure:
   entry/date | image | title/meta
*/

.hpc-latest-card-13 {
    grid-column: span 60;
    min-height: 160px;
}

.hpc-latest-row6-link {
    grid-template-columns: minmax(0, 18%) minmax(0, 36%) minmax(0, 46%);
    grid-template-rows: 1fr;
}

.hpc-latest-row6-entry {
    padding-top: 26px;
    padding-right: 16px;
    padding-bottom: 26px;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hpc-latest-row6-entry .hpc-latest-label {
    margin-bottom: 18px;
}

.hpc-latest-row6-entry .hpc-latest-number {
    margin-bottom: 18px;
    text-align: center;
}

.hpc-latest-row6-entry .hpc-latest-date {
    margin-top: auto;
    padding-top: 0;
    text-align: center;
}

.hpc-latest-row6-image {
    aspect-ratio: 16 / 9;
    height: 100%;
}

.hpc-latest-row6-main {
    padding-top: 26px;
    padding-right: 22px;
    padding-bottom: 26px;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hpc-latest-row6-main .hpc-latest-title {
    font-size: 28px;
    margin-bottom: 18px;
}

.hpc-latest-row6-main .hpc-latest-meta {
    margin-top: auto;
    margin-bottom: 0;
    font-size: 14px;
}


/* ROW 7 — 3 CARDS */

.hpc-latest-card-14,
.hpc-latest-card-15,
.hpc-latest-card-16 {
    grid-column: span 20;
    min-height: 300px;
}

.hpc-latest-card-14 .hpc-latest-card-link,
.hpc-latest-card-15 .hpc-latest-card-link,
.hpc-latest-card-16 .hpc-latest-card-link {
    grid-template-rows: auto minmax(0, 1fr);
}

.hpc-latest-card-14 .hpc-latest-image,
.hpc-latest-card-15 .hpc-latest-image,
.hpc-latest-card-16 .hpc-latest-image {
    order: -1;
    aspect-ratio: 16 / 9;
}

.hpc-latest-card-14 .hpc-latest-card-info,
.hpc-latest-card-15 .hpc-latest-card-info,
.hpc-latest-card-16 .hpc-latest-card-info {
    padding: 18px;
}

.hpc-latest-card-14 .hpc-latest-title,
.hpc-latest-card-15 .hpc-latest-title,
.hpc-latest-card-16 .hpc-latest-title {
    font-size: 18px;
}

/* ROW 8 — 4 CARDS */

.hpc-latest-card-17,
.hpc-latest-card-18,
.hpc-latest-card-19,
.hpc-latest-card-20 {
    grid-column: span 15;
    min-height: 300px;
}

.hpc-latest-card-17 .hpc-latest-card-link,
.hpc-latest-card-18 .hpc-latest-card-link,
.hpc-latest-card-19 .hpc-latest-card-link,
.hpc-latest-card-20 .hpc-latest-card-link {
    grid-template-rows: auto minmax(0, 1fr);
}

.hpc-latest-card-17 .hpc-latest-image,
.hpc-latest-card-18 .hpc-latest-image,
.hpc-latest-card-19 .hpc-latest-image,
.hpc-latest-card-20 .hpc-latest-image {
    order: -1;
    aspect-ratio: 4 / 3;
}

.hpc-latest-card-17 .hpc-latest-card-info,
.hpc-latest-card-18 .hpc-latest-card-info,
.hpc-latest-card-19 .hpc-latest-card-info,
.hpc-latest-card-20 .hpc-latest-card-info {
    padding: 18px;
}

.hpc-latest-card-17 .hpc-latest-title,
.hpc-latest-card-18 .hpc-latest-title,
.hpc-latest-card-19 .hpc-latest-title,
.hpc-latest-card-20 .hpc-latest-title {
    font-size: 18px;
}

/* RESPONSIVE */

@media (max-width: 900px) {

    .hpc-latest-hero {
        grid-template-columns: 1fr;
    }

    .hpc-latest-layout {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 18px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .hpc-latest-card,
    .hpc-latest-info-block {
        grid-column: 1 / -1 !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hpc-latest-card-link,
    .hpc-latest-row2-link,
    .hpc-latest-row4-link,
    .hpc-latest-row6-link {
        display: grid;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hpc-latest-card-info,
    .hpc-latest-row2-left,
    .hpc-latest-row2-bottom,
    .hpc-latest-row4-left,
    .hpc-latest-row4-bottom,
    .hpc-latest-row6-entry,
    .hpc-latest-row6-main {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hpc-latest-card .hpc-latest-image,
    .hpc-latest-row2-image,
    .hpc-latest-row4-image,
    .hpc-latest-row6-image {
        order: -1;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .hpc-latest-card-1 .hpc-latest-card-info {
        padding: 28px;
    }

    .hpc-latest-card-1 .hpc-latest-number {
        font-size: 58px;
    }

    .hpc-latest-card-1 .hpc-latest-title {
        font-size: 32px;
    }

    .hpc-latest-row2-bottom,
    .hpc-latest-row4-bottom {
        min-height: 130px;
    }
}

@media (max-width: 520px) {

    .hpc-latest-card-info,
    .hpc-latest-row2-left,
    .hpc-latest-row2-bottom,
    .hpc-latest-row4-left,
    .hpc-latest-row4-bottom,
    .hpc-latest-row6-entry,
    .hpc-latest-row6-main {
        padding: 18px;
    }

    .hpc-latest-card .hpc-latest-image,
    .hpc-latest-row2-image,
    .hpc-latest-row4-image,
    .hpc-latest-row6-image {
        min-height: 190px;
    }

    .hpc-latest-title {
        font-size: 18px;
    }

    .hpc-latest-card-1 .hpc-latest-title {
        font-size: 28px;
    }

    .hpc-latest-total strong {
        font-size: 34px;
    }
}

/* =========================
   ROW 2 / 3 / 4 / 5
   Push meta to the bottom
========================= */

/* Row 2 */
.hpc-latest-row2-bottom {
    display: flex;
    flex-direction: column;
}

.hpc-latest-row2-bottom .hpc-latest-meta {
    margin-top: auto;
    padding-top: 18px;
}

/* Row 3 */
.hpc-latest-card-4 .hpc-latest-card-info,
.hpc-latest-card-5 .hpc-latest-card-info {
    display: flex;
    flex-direction: column;
}

.hpc-latest-card-4 .hpc-latest-meta,
.hpc-latest-card-5 .hpc-latest-meta {
    margin-top: auto;
    padding-top: 18px;
}

/* Row 4 */
.hpc-latest-row4-bottom {
    display: flex;
    flex-direction: column;
}

.hpc-latest-row4-bottom .hpc-latest-meta {
    margin-top: auto;
    padding-top: 18px;
}

/* Row 5 */
.hpc-latest-card-9 .hpc-latest-card-info,
.hpc-latest-card-10 .hpc-latest-card-info,
.hpc-latest-card-11 .hpc-latest-card-info,
.hpc-latest-card-12 .hpc-latest-card-info {
    display: flex;
    flex-direction: column;
}

.hpc-latest-card-9 .hpc-latest-meta,
.hpc-latest-card-10 .hpc-latest-meta,
.hpc-latest-card-11 .hpc-latest-meta,
.hpc-latest-card-12 .hpc-latest-meta {
    margin-top: auto;
    padding-top: 18px;
}

/* ROW 7 — number + date row */

.hpc-latest-row7-number-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 13px;
}

.hpc-latest-row7-number-row .hpc-latest-number {
    margin-bottom: 0;
}

.hpc-latest-row7-number-row .hpc-latest-date {
    margin-top: 0;
    padding-top: 0;
    white-space: nowrap;
}

/* ROW 8 — number + date row */

.hpc-latest-row8-number-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 13px;
}

.hpc-latest-row8-number-row .hpc-latest-number {
    margin-bottom: 0;
}

.hpc-latest-row8-number-row .hpc-latest-date {
    margin-top: 0;
    padding-top: 0;
    white-space: nowrap;
}