/* Best Bourbon Directory — WordPress shortcode build
 * All styles scoped under .bbd-root so they cannot leak into the host theme.
 */

/* ---------- Break out of narrow page-content wrappers ----------
 * The bb2026 theme renders pages inside .container-narrow (760px) inside .container (1280px).
 * When the directory shortcode is present, lift those caps so the grid can breathe.
 * Specificity stays low; we only target wrappers that actually contain a .bbd-root.
 */
.post-single__content:has(.bbd-root),
.entry-content:has(.bbd-root),
.post-single__content > p:has(.bbd-root),
.entry-content > p:has(.bbd-root) {
  max-width: none !important;
  width: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.container-narrow:has(.bbd-root),
.container:has(.bbd-root) {
  max-width: 1480px !important; /* match the bb2026 .container-wide used by the map page */
  width: 100% !important;
}
/* If the shortcode is wrapped in a stray <p>, neutralize its block-level styles */
p:has(> .bbd-root) {
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}

.bbd-root {
  --bbd-bg: #1a1410;
  --bbd-bg-elev: #221b16;
  --bbd-bg-elev-2: #2a2018;
  --bbd-line: #2f261d;
  --bbd-text: #f1e9dc;
  --bbd-dim: #b8a994;
  --bbd-mute: #8a7d6c;
  --bbd-accent: #d4a85a;
  --bbd-accent-2: #c89a48;

  background: var(--bbd-bg);
  color: var(--bbd-text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  border-radius: 6px;
  /* Match the bb2026 theme's .container-wide used by the bourbon-map page (1480px). */
  width: 100%;
  max-width: 1480px;
  margin: 24px auto;
  padding: 40px 24px 48px;
  box-sizing: border-box;
}
.bbd-root *,
.bbd-root *::before,
.bbd-root *::after { box-sizing: border-box; }

.bbd-root a { color: inherit; text-decoration: none; }
.bbd-root em { font-style: italic; color: var(--bbd-accent); }

/* ---------- Hero ---------- */
.bbd-root .bbd-hero { margin-bottom: 32px; max-width: 740px; }
.bbd-root .bbd-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(40px, 6vw, 72px); font-weight: 500;
  letter-spacing: -0.02em; line-height: 1;
  margin: 0 0 14px;
  color: var(--bbd-text);
}
.bbd-root .bbd-hero p {
  font-size: 16px; color: var(--bbd-dim); line-height: 1.55; max-width: 600px; margin: 0;
}

/* ---------- Toolkit ---------- */
.bbd-root .bbd-toolkit {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr auto;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--bbd-line);
  border-bottom: 1px solid var(--bbd-line);
  margin-bottom: 24px;
}
.bbd-root .bbd-search-wrap {
  position: relative;
  display: flex; align-items: center;
  background: var(--bbd-bg-elev);
  border: 1px solid var(--bbd-line);
  border-radius: 4px;
  padding: 0 14px;
}
.bbd-root .bbd-search-wrap svg { color: var(--bbd-mute); flex-shrink: 0; }
.bbd-root #bbd-search {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--bbd-text);
  font-family: inherit; font-size: 14px;
  padding: 12px 8px;
  box-shadow: none;
  height: auto;
  line-height: normal;
}
.bbd-root #bbd-search::placeholder { color: var(--bbd-mute); }

.bbd-root .bbd-toolkit select,
.bbd-root .bbd-toolkit button {
  background: var(--bbd-bg-elev);
  color: var(--bbd-text);
  border: 1px solid var(--bbd-line);
  border-radius: 4px;
  padding: 12px 14px;
  font-family: inherit; font-size: 13px;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  height: auto;
  line-height: normal;
}
.bbd-root .bbd-toolkit select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23b8a994' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}
.bbd-root .bbd-toolkit button:hover,
.bbd-root .bbd-toolkit select:hover { border-color: var(--bbd-accent); color: var(--bbd-text); }

/* ---------- Count line ---------- */
.bbd-root .bbd-count-line {
  margin-bottom: 24px;
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
}
.bbd-root #bbd-count { color: var(--bbd-accent); font-weight: 700; }
.bbd-root .bbd-dim { color: var(--bbd-mute); }

/* ---------- Grid ---------- */
.bbd-root .bbd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 1100px) { .bbd-root .bbd-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  {
  .bbd-root { padding: 28px 16px 36px; }
  .bbd-root .bbd-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .bbd-root .bbd-toolkit { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px)  { .bbd-root .bbd-grid { grid-template-columns: 1fr; } }

.bbd-root .bbd-card {
  background: var(--bbd-bg-elev);
  border: 1px solid var(--bbd-line);
  border-radius: 6px;
  overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex; flex-direction: column;
  color: var(--bbd-text);
}
.bbd-root .bbd-card:hover {
  transform: translateY(-3px);
  border-color: var(--bbd-accent);
  box-shadow: 0 14px 30px -16px rgba(212, 168, 90, .35);
}

/* The image area: pure white — matches the bottle photo background exactly */
.bbd-root .bbd-card-image {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #ffffff;
  border-bottom: 1px solid var(--bbd-line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.bbd-root .bbd-card-image img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .25s ease;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: block;
}
.bbd-root .bbd-card:hover .bbd-card-image img { transform: scale(1.04); }

.bbd-root .bbd-year-badge {
  position: absolute; top: 12px; right: 12px;
  z-index: 5;
  background: #1a1410;
  border: 1px solid var(--bbd-accent);
  color: var(--bbd-accent);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 800;
  padding: 6px 11px;
  border-radius: 2px;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
}
.bbd-root .bbd-size-badge {
  position: absolute; bottom: 12px; left: 12px;
  z-index: 5;
  background: rgba(26, 20, 16, .9);
  color: var(--bbd-dim);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,.08);
}

.bbd-root .bbd-card-body {
  padding: 18px 18px 20px;
  flex: 1;
  display: flex; flex-direction: column;
  gap: 6px;
}
.bbd-root .bbd-card-brand {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bbd-mute);
  font-weight: 700;
}
.bbd-root .bbd-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px; font-weight: 500;
  line-height: 1.2;
  color: var(--bbd-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.bbd-root .bbd-card-meta {
  margin-top: auto;
  padding-top: 12px;
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px dashed var(--bbd-line);
}
.bbd-root .bbd-card-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: var(--bbd-accent);
  font-weight: 600;
}
.bbd-root .bbd-card-price-label {
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--bbd-mute);
  margin-bottom: 2px;
}

/* Empty state */
.bbd-root .bbd-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--bbd-dim);
  font-size: 18px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
}
.bbd-root .bbd-hidden { display: none !important; }
