/* ================================================
   LES TOURS DU MALT — BEER-CARDS.CSS
   Carte bière partagée (page bières + accueil)
   Variables par carte : --beer-bg (fond) / --beer-fg (texte contrasté)
================================================ */

/* ── GRILLE ───────────────────────────────────── */
.beer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 30px;
}

/* ── CARTE ────────────────────────────────────── */
.bcard {
    --beer-bg: #f3f1ec;
    --beer-fg: #111;
    --ease: cubic-bezier(.22, 1, .36, 1);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 2px solid #111;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 6px 6px 0 #111;
    transition: transform .18s ease, box-shadow .18s ease;
    position: relative;
}

/* Carte entière cliquable : le lien du titre est étiré sur toute la carte */
.bcard-link { color: inherit; text-decoration: none; }
.bcard-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.bcard-link:focus-visible { outline: none; }
.bcard-link:focus-visible::after { outline: 3px solid #e03527; outline-offset: -3px; border-radius: 16px; }
.bcard-tasting, .bcard-desc a { position: relative; z-index: 2; }
.bcard-more {
    display: inline-block;
    margin-top: 16px;
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #e03527;
    transition: transform .18s ease;
}
.bcard:hover .bcard-more { transform: translateX(4px); }
.bcard:hover .bcard-link { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.bcard--legacy .bcard-more { color: #f59e0b; }
.bcard.reveal.visible:hover,
.bcard:hover {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 #111;
}

/* Visuel coloré */
.bcard-visual {
    position: relative;
    height: 380px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 56px 0 30px;
    overflow: hidden;
    isolation: isolate;
    container-type: inline-size;
    background:
        radial-gradient(120% 75% at 50% 35%, rgba(255,255,255,.42), rgba(255,255,255,0) 62%),
        linear-gradient(180deg, rgba(255,255,255,0) 55%, rgba(0,0,0,.10) 100%),
        var(--beer-bg);
    border-bottom: 2px solid #111;
}
/* Trame « halftone » discrète, façon impression */
.bcard-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(0,0,0,.09) 1px, transparent 1.4px);
    background-size: 12px 12px;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 60%);
            mask-image: linear-gradient(180deg, transparent 0%, #000 60%);
}

/* Grand nom décoratif derrière la bouteille */
.bcard-watermark {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px 40px;
    text-align: center;
    font-family: 'Archivo Black', sans-serif;
    font-size: 3rem;
    font-size: clamp(2rem, calc((100cqi - 24px) / (var(--wm-len, 6) * 0.8)), 5.2rem);
    line-height: .86;
    text-transform: uppercase;
    letter-spacing: -.02em;
    color: var(--beer-fg);
    opacity: .13;
    overflow-wrap: normal;
    hyphens: none;
    pointer-events: none;
    user-select: none;
    transition: transform .6s var(--ease), opacity .4s ease;
}

/* Bouteille détourée */
.bcard-bottle {
    position: relative;
    z-index: 2;
    height: 100%;
    max-width: 78%;
    width: auto;
    object-fit: contain;
    filter:
        drop-shadow(0 18px 18px rgba(0,0,0,.22))
        drop-shadow(0 4px 4px rgba(0,0,0,.12));
    transform-origin: 50% 100%;
    transition: transform .55s var(--ease);
}
.bcard-ground {
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: 22px;
    width: 42%;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0,0,0,.38), rgba(0,0,0,0));
    transform: translateX(-50%);
    transition: transform .55s var(--ease), opacity .55s ease;
}
.bcard:hover .bcard-bottle    { transform: translateY(-12px) rotate(-4deg) scale(1.03); }
.bcard:hover .bcard-ground    { transform: translateX(-50%) scale(.72); opacity: .6; }
.bcard:hover .bcard-watermark { transform: scale(1.06); opacity: .2; }

/* Badges */
.bcard-tags {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 90px;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.bcard-badge {
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 5px 10px;
    border-radius: 7px;
    border: 2px solid #111;
    box-shadow: 2px 2px 0 #111;
    white-space: nowrap;
}
.badge-permanent { background: #f59e0b; color: #111; }
.badge-ephemeral { background: #e03527; color: #fff; }
.badge-soft      { background: #22c55e; color: #fff; }
.badge-legacy    { background: #333;    color: #e03527; }
.badge-soldout   { background: #fff;    color: #111; }

/* Tampon degré */
.bcard-stamp {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid #111;
    background: #fff;
    box-shadow: 3px 3px 0 #111;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: rotate(8deg);
    transition: transform .5s var(--ease);
    color: #111;
}
.bcard-stamp strong {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.25rem;
    line-height: 1;
    font-weight: 400;
}
.bcard-stamp small { font-size: .7rem; margin-left: 1px; }
.bcard-stamp em {
    font-style: normal;
    font-size: .52rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 2px;
    max-width: 54px;
    text-align: center;
    line-height: 1.05;
}
.bcard:hover .bcard-stamp { transform: rotate(-6deg) scale(1.05); }

/* Logo officiel Certifié AB dans le cadre de la bière */
.bcard-ab-logo {
    position: absolute;
    bottom: 14px;
    left: 14px;
    z-index: 3;
    width: 44px;
    height: auto;
    background: #fff;
    border: 2px solid #111;
    border-radius: 6px;
    padding: 3px;
    box-shadow: 2px 2px 0 #111;
    object-fit: contain;
    transition: transform .3s var(--ease);
}
.bcard:hover .bcard-ab-logo {
    transform: scale(1.06) rotate(-3deg);
}

/* Corps */
.bcard-body {
    flex: 1;
    padding: 22px 24px 26px;
    background: #fff;
    background: color-mix(in srgb, var(--beer-bg) 12%, #fff);
}
.bcard-name {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    text-transform: uppercase;
    color: #111;
    line-height: 1.1;
}
.bcard-style {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--beer-bg);
    color: var(--beer-fg);
    border: 2px solid #111;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.bcard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.bcard-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 2px solid #111;
    border-radius: 7px;
    padding: 4px 10px;
    font-size: .72rem;
    font-weight: 800;
    color: #111;
}
.bcard-ibu-bar {
    display: inline-block;
    width: 46px;
    height: 7px;
    border-radius: 4px;
    border: 1.5px solid #111;
    background: #fff;
    overflow: hidden;
}
.bcard-ibu-bar span {
    display: block;
    height: 100%;
    background: #111;
}
.bcard-desc {
    color: #444;
    font-size: .88rem;
    line-height: 1.65;
    margin-top: 14px;
}
.bcard-desc p { margin-bottom: .5rem; }
.bcard-desc p:last-child { margin-bottom: 0; }

.bcard-tasting {
    margin-top: 16px;
    border: 2px solid #111;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.bcard-tasting summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-family: 'Archivo Black', sans-serif;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #e03527;
}
.bcard-tasting summary::-webkit-details-marker { display: none; }
.bcard-tasting summary::after {
    content: '+';
    font-size: 1.1rem;
    color: #111;
    transition: transform .2s ease;
}
.bcard-tasting[open] summary::after { transform: rotate(45deg); }
.bcard-tasting-text {
    padding: 0 14px 12px;
    color: #555;
    font-size: .84rem;
    line-height: 1.6;
}

/* ── ANCIENNE COLLECTION : noir & blanc, couleur au survol ── */
.bcard--legacy {
    border-color: rgba(255,255,255,.25);
    box-shadow: 6px 6px 0 #e03527;
}
.bcard--legacy:hover { box-shadow: 3px 3px 0 #e03527; }
.bcard--legacy .bcard-visual {
    filter: grayscale(1) brightness(.85);
    transition: filter .5s ease;
}
.bcard--legacy:hover .bcard-visual { filter: none; }
.bcard--legacy .bcard-body { background: #1a1a1a; }
.bcard--legacy .bcard-name { color: #eee; }
.bcard--legacy .bcard-desc { color: rgba(255,255,255,.55); }
.bcard--legacy .bcard-pill { background: #222; color: #e03527; border-color: rgba(224,53,39,.4); }


@media (max-width: 640px) {
    .beer-grid { gap: 24px; }
    .bcard-visual { height: 340px; }
}

@media (prefers-reduced-motion: reduce) {
    .bcard, .bcard-bottle, .bcard-ground, .bcard-watermark, .bcard-stamp { transition: none; }
    .bcard:hover .bcard-bottle { transform: none; }
}

/* ── VARIANTE COMPACTE (accueil) ─────────────── */
.beer-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.bcard--compact { border-radius: 16px; box-shadow: 5px 5px 0 #111; }
.bcard--compact:hover { box-shadow: 2px 2px 0 #111; }
.bcard--compact .bcard-visual { height: 330px; padding: 54px 0 26px; }
.bcard--compact .bcard-stamp { width: 60px; height: 60px; }
.bcard--compact .bcard-stamp strong { font-size: 1.05rem; }
.bcard--compact .bcard-body { padding: 16px 18px 20px; }
.bcard--compact .bcard-name { font-size: 1.05rem; }
.bcard--compact .bcard-meta { margin-top: 12px; }
.beer-grid--softs .bcard-visual { height: 270px; }

@media (max-width: 1024px) {
    .beer-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .beer-grid--4 { grid-template-columns: 1fr; }
    .beer-grid--softs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .beer-grid--softs .bcard-visual { height: 220px; padding-top: 46px; }
    .beer-grid--softs .bcard-stamp,
    .beer-grid--softs .bcard-meta { display: none; }
    .beer-grid--softs .bcard-name { font-size: .9rem; }
}
