/* AffBase New's own CSS, loaded after Legacy's content.min.css, which stays as copied from Legacy. */

/* The full deal card (DealFullCard.razor) from 480px up. Legacy's CSS positions the logo column - logo, Code/Deal
   chip, VALID chip - absolutely inside a body with a fixed minimum height of 110px, which fitted Legacy's short, wide
   logos. The logos the import downloads from the networks are often square, so the column ran into the card's footer
   and on merchant pages the VALID chip was clipped away. Laid out by grid, the body grows with the column instead. */
@media (min-width: 480px) {
    .deal.ver2 .main {
        display: grid;
        grid-template-columns: 100px minmax(0, 1fr);
        grid-template-areas:
            "logo title"
            "logo action";
        grid-template-rows: auto 1fr;
        column-gap: 15px;
    }

    /* Bootstrap's panel-body clearfix would become grid items. */
    .deal.ver2 .main:before,
    .deal.ver2 .main:after {
        display: none;
    }

    .deal.ver2 .main .dLeft {
        grid-area: logo;
        position: static;
        float: none;
    }

    .deal.ver2 .main .titleDiv {
        grid-area: title;
        margin-left: 0;
    }

    .deal.ver2 .main .dRight {
        grid-area: action;
        margin-left: 0;
    }
}

/* A deal's description, at the top of the full card's terms panel (DealFullCard.razor): the merchant's line breaks
   show. */
.deal.ver2 .dDescription {
    white-space: pre-line;
}

/* The description under the full card's title (DealFullCard.razor): the merchant's own words, cut to about 160
   characters, in plain weight under the bold title. */
.deal.ver2 .dSummary {
    margin: 4px 0 0;
    font-size: 0.9rem;
    font-weight: normal;
    line-height: 1.3;
    color: #555;
}

/* The Meet the team page (Team.razor). Bootstrap 3's floated columns leave gaps when cards differ in height, so the
   rows are laid out by flexbox and every card in a row is as tall as the tallest. */
.team-grid {
    display: flex;
    flex-wrap: wrap;
}

/* Bootstrap's row clearfix would become flex items. */
.team-grid:before,
.team-grid:after {
    display: none;
}

.team-grid > [class*="col-"] {
    display: flex;
}

.team-card {
    width: 100%;
    text-align: center;
}

.team-card-soon {
    margin-bottom: 15px;
}

.team-avatar {
    width: 120px;
    height: 120px;
    max-width: 100%;
}

.team-card .team-name {
    margin: 10px 0 4px;
}

.team-card .team-job {
    margin-bottom: 10px;
    font-weight: bold;
    color: #555;
}

.team-card .team-bio {
    text-align: left;
    line-height: 1.5;
}

.team-card-soon .team-bio {
    color: #555;
}

/* Articles (Shared\ArticleView.razor, DevDocumentation\Ai\ArticlesDev.md section 5): reading text about 70 characters
   wide and centred; a group of one to three products beside its text on a wide screen, alternating sides; four or more
   as a centred row of cards below the text; everything stacked on a phone, text first, cards two across. Pictures are shown
   whole (object-fit: contain), never cropped: some shops' terms forbid it. */
.article-page {
    font-size: 16px;
    line-height: 1.6;
}

.article-page *,
.article-page *::before,
.article-page *::after {
    box-sizing: border-box;
}

.article-reading {
    max-width: 680px;
    margin: 0 auto;
}

.article-title {
    font-size: 30px;
    line-height: 1.2;
    margin: 0 0 6px;
}

.article-byline {
    color: #777;
    font-size: 14px;
}

.article-editors {
    color: #555;
    font-size: 14px;
}

.article-group {
    display: grid;
    gap: 28px;
    align-items: center;
    margin: 36px 0;
}

.article-group.one {
    grid-template-columns: 240px minmax(0, 1fr);
}

.article-group.side {
    grid-template-columns: 3fr 2fr;
}

.article-group.one.flip {
    grid-template-columns: minmax(0, 1fr) 240px;
}

.article-group.side.flip {
    grid-template-columns: 2fr 3fr;
}

.article-group.flip .article-cards {
    order: 2;
}

.article-group.wide .article-text,
.article-group.none .article-text {
    max-width: 680px;
    margin: 0 auto;
}

.article-text h2 {
    font-size: 22px;
    margin: 0 0 8px;
}

.article-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

.article-card {
    display: flex;
    flex-direction: column;
    width: 170px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #222;
    background: #fff;
}

.article-card:hover,
.article-card:focus {
    text-decoration: none;
    border-color: #bbb;
    color: #222;
}

.article-group.one .article-card {
    width: 100%;
}

.article-card img,
.article-nopicture {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #fafafa;
    border-radius: 4px;
}

.article-brand {
    text-transform: uppercase;
    font-size: 11px;
    color: #777;
    margin-top: 6px;
}

.article-name {
    font-weight: bold;
}

.article-price {
    margin-top: 4px;
}

.article-price s {
    color: #999;
    margin-left: 4px;
}

.article-shop {
    color: #777;
    font-size: 12px;
}

.article-save {
    max-width: 680px;
    margin: -12px auto 8px;
    border: 1px solid #d9e7d2;
    background: #f4faf1;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
}

.article-save h3 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: bold;
}

.article-save ul {
    margin: 0;
    padding-left: 18px;
}

.article-save li {
    margin: 4px 0;
}

.article-tag {
    display: inline-block;
    background: #2e7d32;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    padding: 0 5px;
}

.article-ends {
    color: #777;
    font-size: 12px;
    margin-left: 4px;
}

.article-footer {
    margin-top: 32px;
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.article-checked {
    color: #777;
    font-size: 13px;
}

@media (max-width: 720px) {
    .article-group,
    .article-group.one,
    .article-group.side,
    .article-group.one.flip,
    .article-group.side.flip {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Stacked, a group's heading and text come first, then its cards. */
    .article-group .article-cards {
        order: 2;
    }

    .article-cards {
        gap: 12px;
    }

    .article-card {
        width: calc(50% - 6px);
    }

    .article-group.one .article-card {
        width: 60%;
        margin: 0 auto;
    }
}

/* A list of articles (Shared\ArticleList.razor): picture beside title, summary and date. */
.article-list-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    color: #222;
}

.article-list-item:hover,
.article-list-item:focus {
    text-decoration: none;
    border-color: #bbb;
    color: #222;
}

.article-list-item img {
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    object-fit: contain;
    background: #fafafa;
    border-radius: 4px;
}

.article-list-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.article-list-text small {
    color: #777;
}

.article-related {
    margin: 24px 0;
}
