/* =====================================================================
   Trending Gifts Gadget — own look (load AFTER bestcoolgadgetsnew.css)
   Orange-red buttons, dark rank numbers and tags, warm light page.
   ===================================================================== */

:root {
    --ink: #1e1e20;
    --accent: #d9530e;       /* buttons and links */
    --accent-dark: #b84309;
    --accent-tint: #fdeedd;  /* background of the deal box */
    --dark: #232427;         /* rank numbers and discount tags */
    --orange: #f4a024;       /* stars and the headline underline */
    --page: #f6f4f0;
    --muted: #5f5f63;
    --border: #e2dfd8;
    /* the old blue tokens now resolve to the accent */
    --blue: var(--accent);
    --soft-blue: var(--accent-tint);
}

body { background: var(--page); }
.wrap { width: min(940px, calc(100% - 40px)); }
.masthead { background: #fff; }

/* ---------- heading ---------- */
.article-heading { padding-top: 40px; }
.title-emphasis {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--orange);
    text-decoration-thickness: .11em;
    text-underline-offset: .16em;
    text-decoration-skip-ink: none;
}
.byline {
    gap: 4px 20px;
    margin-block: 16px 26px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}
.byline img { display: none; }
.byline-author { color: var(--ink); font-weight: 600; }
.byline time, .byline a { border-left: 0; padding-left: 0; }

/* ---------- photo collage ---------- */
.collage {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
    aspect-ratio: 940 / 464;
    margin-top: 4px;
}
.collage .tile { min-width: 0; min-height: 0; overflow: hidden; border-radius: 16px; background: #fff; }
.collage .tile :is(img, video) { display: block; width: 100%; height: 100%; object-fit: cover; }
.collage .t-squishy { grid-area: 1 / 1 / span 4 / span 8; border-radius: 22px; }
.collage .t-washer { grid-area: 1 / 9 / span 4 / span 2; }
.collage .t-mug { grid-area: 1 / 11 / span 2 / span 2; }
.collage .t-casekis { grid-area: 3 / 11 / span 2 / span 2; }
.collage .t-vac { grid-area: 5 / 1 / span 2 / span 4; }
.collage .t-rocket { grid-area: 5 / 5 / span 2 / span 2; }
.collage .t-note { grid-area: 5 / 7 / span 2 / span 4; }
/* text tile: the small line changes with the season (see the script addition) */
.collage .t-note {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding-inline: 26px;
    text-align: center;
    background: var(--dark);
    color: #fff;
    font-family: var(--display);
    line-height: 1.05;
}
.collage .t-note small { color: #f6c37a; font-size: 15px; font-weight: 600; }
.collage .t-note strong { font-size: 32px; font-weight: 700; letter-spacing: -.03em; }
.collage .t-note i { display: block; width: 44px; height: 5px; margin: 8px auto 0; border-radius: 5px; background: var(--orange); }
.collage .t-egg { grid-area: 5 / 11 / span 2 / span 2; }

/* ---------- intro ---------- */
.intro { margin-block: 30px 30px; }

/* ---------- product entries ---------- */
.product-list { gap: 20px; }
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: 14px;
    padding: 30px 34px 34px 112px;
    background: #fff;
    box-shadow: none;
}
/* Let the description and highlights follow the headline and media in DOM order. */
.product-card .card-copy,
.product-card .card-copy > div { display: contents; }

.product-card .card-top { margin-bottom: 6px; }

/* rank numeral sits in the left gutter */
.product-card .card-number {
    position: absolute;
    top: 25px;
    left: 22px;
    display: block;
    width: 70px;
    height: auto;
    border-radius: 0;
    background: none;
    color: var(--dark);
    font: 700 42px/1 var(--display);
    letter-spacing: -.04em;
    text-align: right;
}
.product-card .card-name { font: 700 27px/1.16 var(--display); letter-spacing: -.02em; color: var(--ink); }
.product-card .card-name a:hover { color: var(--accent-dark); text-decoration: underline; }

.rating-stars { background-image: linear-gradient(90deg, var(--orange) var(--rating-fill), #d8d6d0 var(--rating-fill)); }
.discount { border-radius: 5px; padding: 4px 8px; background: var(--dark); color: #fff; font-size: 12.5px; font-weight: 700; }

/* headline under the product name: medium weight in the body typeface,
   so it reads as a subtitle and does not compete with the bold name */
.product-card .card-headline {
    margin: 2px 0 20px;
    color: #2a2b30;
    font: 500 23px/1.35 "DM Sans", var(--display), sans-serif;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}
.card-headline a { text-decoration: none; }
.card-headline a:hover { color: var(--accent-dark); }
.card-media, .card-media-link { border-radius: 10px; }
.card-media { aspect-ratio: 16 / 9; background: var(--page); }

.product-card .card-description { margin-top: 22px; font-size: 18px; }
.product-card .card-description a { text-decoration-color: #d9530e66; }

.product-card .card-highlights { margin-top: 22px; background: var(--page); border-radius: 10px; }
.product-card .card-highlights ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; }
.highlight-check { background: var(--dark); }

.product-card .card-action {
    margin-top: 24px;
    padding: 14px 14px 14px 20px;
    border-top: 0;
    border-radius: 10px;
    background: var(--accent-tint);
}
.card-offer strong { font-size: 18px; }
.card-offer span { color: #55555a; }
.offer-button {
    flex-basis: 270px;
    min-height: 52px;
    border-radius: 8px;
    background: var(--accent);
    font-size: 17px;
}
.offer-button:hover { background: var(--accent-dark); }
.offer-button span { display: none; }

/* bonus / newsletter block keeps pace with the entries */
.newsletter-card { border: 0; border-radius: 14px; background: #fff; box-shadow: none; }
.newsletter-card .card-name { font-size: 24px; }
.newsletter-image { border-radius: 10px; }
.newsletter-form { border-top-color: var(--border); }

/* ---------- footer ---------- */
.site-footer { background: #eceae5; color: var(--muted); }
.footer-links a { color: var(--accent-dark); }

/* ---------- tablet ---------- */
@media (max-width: 1023px) {
    .collage .t-note { padding-inline: 18px; }
    .collage .t-note small { font-size: 13px; }
    .collage .t-note strong { font-size: 26px; }
    .product-list { gap: 16px; }
    .product-card { border: 0; border-radius: 14px; padding: 26px 26px 26px 96px; }
    .newsletter-card { border: 0; border-radius: 14px; padding: 24px 26px; }
    .product-card .card-number { left: 12px; font-size: 38px; }
    .product-card .card-name { font-size: 24px; }
    .product-card .card-headline { font-size: 21.5px; }
}

/* ---------- phone ---------- */
@media (max-width: 767px) {
    .wrap { width: calc(100% - 24px); }
    .article-heading { padding-top: 32px; }

    .collage { gap: 8px; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: auto; aspect-ratio: auto; }
    .collage .tile { border-radius: 12px; }
    .collage .t-squishy { grid-area: 1 / 1 / span 1 / span 6; aspect-ratio: 2 / 1; border-radius: 16px; }
    .collage .t-mug { grid-area: 2 / 1 / span 1 / span 2; aspect-ratio: 1; }
    .collage .t-egg { grid-area: 2 / 3 / span 1 / span 2; aspect-ratio: 1; }
    .collage .t-casekis { grid-area: 2 / 5 / span 1 / span 2; aspect-ratio: 1; }
    .collage :is(.t-washer, .t-vac, .t-note, .t-rocket) { display: none; }

    .intro { margin-block: 24px 24px; }

    .product-list { gap: 14px; }
    .product-card { padding: 16px 14px 14px; }
    /* same header as before on phones: rank + name, then stars and discount tag on the next row */
    .product-card .card-top { align-items: flex-start; gap: 6px 10px; margin-bottom: 10px; }
    .product-card .card-name { flex: 1 1 100%; min-width: 0; align-items: flex-start; gap: 9px; font-size: 21px; }
    .product-card .card-name a { padding-top: 3px; }
    .product-card .card-meta { flex-basis: 100%; margin-inline-start: 0; }
    .product-card .card-number {
        position: static;
        display: grid;
        place-items: center;
        width: auto;
        min-width: 30px;
        height: 30px;
        padding-inline: 7px;
        border-radius: 7px;
        background: var(--dark);
        color: #fff;
        font-size: 15px;
        letter-spacing: 0;
    }
    /* phones: headline goes below the picture (name, picture, headline, text, offer) */
    .product-card > *,
    .product-card .card-copy > *,
    .product-card .card-copy > div > * { order: 4; }
    .product-card .card-top { order: 1; }
    .product-card .card-media-link,
    .product-card > .card-media { order: 2; }
    .product-card .card-headline {
        order: 3;
        margin: 16px 0 0;
        color: var(--ink);
        font-size: 20px;
        font-weight: 600;
        line-height: 1.28;
    }
    .product-card .card-action { order: 5; }
    /* media runs edge to edge inside the card */
    .product-card .card-media-link { margin-inline: -14px; border-radius: 0; }
    .product-card > .card-media { width: calc(100% + 28px); margin-inline: -14px; }
    .product-card .card-media { border-radius: 0; }
    .product-card .card-description { margin-top: 10px; font-size: 17px; }
    .product-card .card-highlights { margin-top: 16px; }
    .product-card .card-highlights ul { grid-template-columns: minmax(0, 1fr); }
    .product-card .card-action { flex-direction: column; align-items: stretch; gap: 12px; margin-top: 18px; padding: 14px; }
    .offer-button { flex: none; min-height: 54px; }
    .newsletter-card { padding: 18px 14px 16px; }
}

/* White page. Phone entries use dividers, and tablet cards have a hairline frame. */
:root { --page: #ffffff; --soft: #f6f4f0; }
.card-media { background: var(--soft); }
.product-card .card-highlights { background: var(--soft); }
.discount { background: var(--accent-tint); color: var(--accent-dark); }
.collage .t-note { background: var(--accent-tint); color: var(--ink); }
.collage .t-note small { color: var(--accent-dark); }
.collage .t-note i { background: var(--accent); }
.site-footer { background: var(--soft); }
@media (max-width: 1023px) {
    .product-card, .newsletter-card { border: 1px solid #e7e4de; }
}
@media (max-width: 767px) {
    .wrap { width: calc(100% - 36px); }
    .product-list { gap: 0; }
    .product-card {
        border: 0;
        border-top: 1px solid #e3e0da;
        border-radius: 0;
        padding: 24px 0 28px;
        background: none;
    }
    .product-card .card-number { background: var(--accent-tint); color: var(--accent-dark); }
    .product-card .card-media-link { margin-inline: 0; border-radius: 12px; }
    .product-card > .card-media { width: 100%; margin-inline: 0; }
    .product-card .card-media { border-radius: 12px; }
    .newsletter-card { border: 1px solid #e3e0da; margin-top: 8px; }
}

/* Rank badge in the left gutter on tablet and desktop. */
@media (min-width: 768px) {
    .product-card .card-number {
        display: grid;
        place-items: center;
        background: var(--accent-tint);
        color: var(--accent-dark);
        letter-spacing: -.02em;
        text-align: center;
    }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .product-card { padding: 26px 84px 30px; }
    .product-card .card-number { top: 21px; left: 16px; width: 52px; height: 52px; border-radius: 13px; font-size: 23px; }
}
/* Desktop: no boxes. A thin rule separates the products and the rank number
   sits in the middle of that rule as a large outlined numeral. Everything below
   it (name, headline, picture, text, offer) lines up with the intro and the collage. */
@media (min-width: 1024px) {
    .product-list { gap: 0; }
    .product-card {
        margin-top: 28px;
        border: 0;
        border-top: 1px solid #e3e0da;
        border-radius: 0;
        padding: 54px 0 42px;
        background: none;
    }
    .product-card .card-top { margin-bottom: 8px; }
    .product-card .card-number {
        top: -30px;
        left: 50%;
        transform: translateX(-50%);
        display: block;
        width: auto;
        height: 60px;
        padding: 0 20px;
        border-radius: 0;
        background: var(--page);
        color: var(--accent);
        font-size: 50px;
        line-height: 60px;
        letter-spacing: -.01em;
        white-space: nowrap;
    }
    /* outlined numeral where the browser supports it, solid orange otherwise */
    @supports (-webkit-text-stroke: 1px #000) {
        .product-card .card-number { color: transparent; -webkit-text-stroke: 1.8px var(--accent); }
    }
    .newsletter-card { border: 1px solid #e3e0da; margin-top: 36px; }
}
