/* ============================================================
   Espressophie – Bohnen als Kacheln + Detailblatt
   Gemeinsam für Rösterei-Seiten und Geschmacksfinder (assets/bohnen.js)
   ============================================================ */
/* ---------- Bohnen als Kacheln: 2 nebeneinander auf dem Handy, bis 4 am Desktop ---------- */
.bean-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .bean-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px) { .bean-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bt { display: flex; flex-direction: column; min-width: 0; padding: 0; border: 0; border-radius: 20px; overflow: hidden; text-align: left; font: inherit; color: var(--text);
  background: var(--card-2); cursor: pointer; transition: transform 0.25s var(--spring), box-shadow 0.25s; }
a.bt, a.bt:hover { text-decoration: none; } /* Kachel als Link zur Bohnenseite */
.bt:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18); }
.bt:active { transform: scale(0.98); }
.bt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bt-art { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--g); background-size: cover; background-position: center; }
.bt-art.gen::before, .sh-art.gen::before { content: ""; position: absolute; right: -6%; bottom: -22%; width: 52%; aspect-ratio: 1; opacity: 0.2; transform: rotate(-14deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cellipse cx='12' cy='12' rx='5.6' ry='8.2' transform='rotate(32 12 12)' fill='white' fill-opacity='.35'/%3E%3Cpath d='M9.6 5.6c-1.4 3.6 4.2 9.2 4.8 12.8'/%3E%3C/svg%3E") no-repeat center / contain; }
.sh-art.gen::before { width: 34%; bottom: -30%; right: 4%; }
.bt-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.28)); }
.bt-roast { position: absolute; left: 10px; bottom: 9px; z-index: 1; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.38);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.bt-fit { position: absolute; right: 9px; top: 9px; z-index: 1; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--on-accent); background: var(--accent); }
.bt-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 12px 13px 14px; }
.bt-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
.bt-sub { margin-top: -3px; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.bt-notes { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.bt-notes i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--dot); }
.bt-notes span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
.bt-kg { font-size: 14px; font-weight: 700; }
.bt-kg small { font-weight: 500; color: var(--muted); }
.bt-fl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.bt-sca { padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid currentColor; color: var(--muted); white-space: nowrap; }
.rmeter { display: inline-flex; gap: 3px; } /* Röstgrad-Balken (nicht .meter: das ist in Mein Espresso schon vergeben) */
.rmeter i { width: 6px; height: 12px; border-radius: 2px; background: var(--fill); }
.rmeter i.on { background: #8a5a35; }

/* ---------- Detailblatt (unten auf dem Handy, mittig am Desktop) ---------- */
.sheet { width: 100%; max-width: 560px; max-height: 88vh; margin: auto auto 0; padding: 0; border: 0; border-radius: 26px 26px 0 0; color: var(--text); background: var(--card); overflow: auto; overscroll-behavior: contain; }
.sheet[open] { animation: sheetUp 0.32s var(--spring) both; }
.sheet::backdrop { background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 26px; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }
body:has(.sheet[open]) { overflow: hidden; }
.sh-art { position: relative; height: 150px; overflow: hidden; background: var(--g); background-size: cover; background-position: center; }
/* Foto der Rösterei: derselbe Ausschnitt wie in der Kachel (16 : 10), nur größer – statt eines flachen 150-px-Streifens */
.sh-art.photo { height: auto; aspect-ratio: 16 / 10; max-height: 50vh; }
/* Fotos kommen im Format 1200 × 630 px (1,9 : 1): immer die volle Höhe zeigen, nur links/rechts zuschneiden */
.bt-art.photo, .sh-art.photo { background-color: #fff; background-size: auto 100%; background-repeat: no-repeat; background-position: center; }
.sh-close { position: absolute; right: 12px; top: 12px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; font-size: 22px; line-height: 1; color: #fff; background: rgba(0, 0, 0, 0.4); cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sh-body { display: grid; gap: 14px; padding: 18px 20px calc(22px + env(safe-area-inset-bottom)); }
.sh-body h3, .sh-body h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; line-height: 1.15; }
.sh-body h3 a { color: inherit; }
.sh-body h1 small, .sh-body h3 small { display: block; margin-top: 4px; font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.sh-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.sh-facts div { padding: 10px 12px; border-radius: 14px; background: var(--card-2); }
.sh-facts dt { font-size: 12px; color: var(--muted); }
.sh-facts dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sh-prices { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-prices span { padding: 8px 12px; border-radius: 12px; font-size: 14px; background: var(--card-2); }
.sh-prices b { margin-left: 4px; }
.sh-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.sh-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-actions a { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 auto; min-height: 48px; padding: 0 18px; border-radius: 999px; font-weight: 600; background: var(--fill); }
.sh-actions a.primary { color: var(--on-accent); background: var(--accent); }
.sh-actions a:hover { text-decoration: none; }
.bt-fit.pct { background: rgba(0, 0, 0, 0.42); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.bt-fit.pct.hi { color: var(--on-accent); background: var(--accent); }
.sh-who { margin: -6px 0 0; font-size: 15px; color: var(--muted); }
.sh-who a { font-weight: 600; }
.sh-body .notes li { color: var(--text); } /* volle Textfarbe: --muted auf --fill wäre hell nur 4,4:1 */
.sh-body .notes li.hit { box-shadow: inset 0 0 0 1.5px var(--accent); }
/* Rezeptvorschlag der Rösterei im Detailblatt */
.sh-recipe { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 9%, var(--card-2)); }
.sh-recipe > b { font-size: 15px; }
.sh-rc { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.sh-rc div { padding: 8px 10px; border-radius: 12px; background: var(--card); }
.sh-rc span { display: block; font-size: 12px; color: var(--muted); }
.sh-rc b { font-size: 17px; }
.sh-recipe .sh-text { margin: 0; font-size: 14px; color: var(--text); } /* Hinweis der Rösterei: --muted auf dem getönten Block wäre unter 4,5:1 */
@media (prefers-color-scheme: dark) {
  /* Dunkel: Werte-Kacheln heben sich sonst kaum vom Rezeptblock ab */
  .sh-rc div, .bo-card .sh-recipe .sh-rc div { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
}
.sh-applink { justify-self: start; display: inline-flex; align-items: center; min-height: 40px; font-weight: 600; }

/* ---------- Merkliste: Stern auf der Kachel, Knopf „Merken“ im Blatt (assets/merkliste.js) ---------- */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.bt-star { position: absolute; left: 9px; top: 9px; z-index: 1; display: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e0a100; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.bt.is-marked .bt-star { display: grid; }
.bt-star svg { width: 16px; height: 16px; fill: #fff; }
.sh-star { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: -4px; padding: 0 18px 0 14px; border: 0; border-radius: 999px;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--text); background: var(--fill); cursor: pointer; transition: background-color 0.2s, transform 0.25s var(--spring); }
.sh-star:active, .sh-share:active { transform: scale(0.96); }
/* Merken · Eigene Seite · Teilen in einer Zeile */
.sh-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: -4px; }
.sh-tools .sh-star { margin-top: 0; }
.sh-own { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-weight: 600; }
.sh-share { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px; border: 0; border-radius: 999px;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--text); background: var(--fill); cursor: pointer; transition: transform 0.25s var(--spring); }
.sh-share svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Bohnenseite (/kaffee-roestereien/bohne/): derselbe Inhalt wie das Blatt, als Karte auf der Seite ---------- */
.bo-card { overflow: hidden; border-radius: 26px; color: var(--text); background: var(--card-2); }
.bo-card .sh-body { padding: 20px 22px 24px; }
.bo-card .sh-body h1 { font-size: clamp(26px, 5vw, 36px); letter-spacing: -0.03em; }
.bo-card .sh-body h1 small { font-size: 16px; }
.bo-card .sh-facts div, .bo-card .sh-prices span, .bo-card .sh-rc div { background: var(--card); }
@media (prefers-color-scheme: dark) {
  .bo-card .sh-facts div, .bo-card .sh-prices span, .bo-card .sh-rc div { background: var(--fill); }
  /* Beschriftungen auf den helleren Kacheln: heller als --muted, sonst nur ~4,3:1 */
  .bo-card .sh-facts dt, .sh-rc span { color: #c7c7cc; }
}
.bo-card .sh-art.gen { height: 190px; }
.bo-card .sh-art.photo { aspect-ratio: 1200 / 630; max-height: none; } /* volle Breite, Fotos sind 1200 × 630 px */
.sh-star svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.sh-star[aria-pressed="true"] { color: #1d1d1f; background: #ffc83d; }
.sh-star[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- Schon gekauft: Tüte oben rechts auf der Kachel, Zeile im Blatt (EPGekauft, von Mein Espresso) ---------- */
.bt-bought { position: absolute; right: 9px; top: 9px; z-index: 1; display: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #2f9e62; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.bt.is-bought .bt-bought { display: grid; }
.bt.is-bought .bt-fit { right: 44px; }
.bt-bought svg, .sh-bought svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sh-bought { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 10px; margin: 0; font-size: 14px; color: var(--muted); }
.sh-bought svg { flex: none; width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: #2f9e62; }
.sh-bought b { color: var(--text); }
.sh-bought span { flex: 1; min-width: 0; padding-top: 2px; }
.sh-bought a { flex-basis: 100%; padding-left: 36px; font-weight: 600; }

/* Aktuell nicht verfügbar (Saison/ausverkauft): Bohne bleibt sichtbar, Kachel wird gedämpft */
.bt-out { position: absolute; left: 9px; top: 9px; z-index: 1; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(60, 60, 67, 0.85); }
.bt.is-marked .bt-out { left: 44px; }
.bt.is-out .bt-art { filter: grayscale(0.85); opacity: 0.8; }
.bt.is-out .bt-body { opacity: 0.8; }
.sh-out { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; background: var(--card-2); color: var(--text); }
