/* Bioetica da Bar, standalone page. Palette sampled from the logo. */
:root {
  --cream: #f4f1e5;
  --cream-deep: #ebe5d2;
  --ink: #0d0d0d;
  --muted: #5d564a;
  --burgundy: #8c1b27;
  --gold: #c4a25a;
  --gold-soft: #ecdcb5;
  --line: #ddd5bf;
  --serif: Marcellus, "Optima", Candara, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;

  /* The stats widget reads WordPress' palette variables: give it the bar's. */
  --wp--preset--color--primary: var(--burgundy);
  --wp--preset--color--secondary: var(--gold-soft);
  --wp--preset--color--tertiary: var(--cream-deep);
  --wp--preset--color--foreground: var(--ink);
  --wp--preset--color--background: var(--cream);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
}
a { color: var(--burgundy); }
a:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 2px; }

.home { max-width: 680px; margin: 0 auto; padding: 24px 16px 64px; }

/* masthead */
.masthead { text-align: center; padding: 8px 0 8px; }
.logo { width: min(420px, 100%); height: auto; display: block; margin: 0 auto; }
.claim { font-family: var(--serif); font-size: 1.25rem; margin: 14px 0 0; }
.claim span { color: var(--burgundy); }

.eyebrow {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

/* share */
.share { margin-top: 22px; display: flex; align-items: stretch; gap: 10px; }
.share-btn { flex: 1; }
.share-btn:disabled { cursor: default; background: var(--gold-soft); color: var(--ink); }
.share-done { margin: 8px 0 0; text-align: center; font-size: .9rem; color: var(--burgundy); }
.share-done:empty { display: none; }

/* the long explanation, closed by default */
.about { margin-top: 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--cream); }
.about summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 18px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.about summary::-webkit-details-marker { display: none; }
.about summary span { font-weight: 400; color: var(--muted); font-size: .9rem; }
.about summary span::after { content: " +"; }
.about[open] summary span::after { content: " −"; }
.about summary:hover { background: var(--gold-soft); border-radius: 10px; }
.about-body { padding: 0 18px 8px; }
.about-body p { margin: 0 0 14px; }
.about-sign { font-family: var(--serif); text-align: right; }

/* episode cards: the latest one, and the barista's pick */
.latest { margin-top: 36px; }
.card-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cream-deep);
  border: 2px solid var(--ink);
}
.card-thumb { position: relative; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .15s; }
.card-thumb:hover img { filter: brightness(.92); }
.card-watch { margin-top: 10px; }
.card-listen { width: 100%; margin-top: 8px; }
.card-alt { margin: 10px 0 0; text-align: center; font-size: .9rem; color: var(--muted); }
.card-title { font-family: var(--serif); font-size: 1.6rem; line-height: 1.2; margin: 14px 0 12px; }
.card-title .num { color: var(--burgundy); margin-right: .35em; }
.card-meta { display: block; font-family: var(--sans); font-size: .9rem; color: var(--muted); margin-top: 4px; }
.card-desc { font-size: .98rem; color: var(--ink); }
.card-desc p { margin: 0 0 .7em; }
.card-desc.is-folded {
  max-height: 7.6em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
          mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.card-more {
  font: inherit;
  font-size: .9rem;
  color: var(--burgundy);
  background: none;
  border: 0;
  padding: 0;
  margin: 2px 0 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.card-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.card-audio { width: 100%; margin-top: 4px; display: block; }
.btn {
  display: block;
  text-align: center;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  padding: 12px 8px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--cream);
  cursor: pointer;
}
.btn.primary { background: var(--ink); color: var(--cream); }
.btn:hover { background: var(--gold-soft); color: var(--ink); }
.btn.primary:hover { background: var(--burgundy); border-color: var(--burgundy); color: var(--cream); }

/* the barista's pick */
.pick { margin-top: 40px; }
.pick .btn.pour {
  width: 100%;
  position: relative;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
}
/* the button fills up like a glass, then the card arrives */
.pick .btn.pour::before {
  content: "";
  position: absolute;
  inset: 100% 0 0 0;
  background: var(--gold);
  z-index: 0;
}
.pick.is-pouring .btn.pour::before { animation: pour .45s ease-in forwards; }
@keyframes pour { to { inset: 0 0 0 0; } }
.pick .btn.pour { isolation: isolate; }
.pick .btn.pour::before { z-index: -1; }
#pick-card { margin-top: 18px; }

/* channels: one row of icons */
.channels { margin-top: 36px; }
.channels ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; gap: 6px; }
.channels li { flex: 1; }
.channels a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  text-decoration: none;
  color: var(--ink);
  border-radius: 10px;
}
.channels svg {
  width: 52px;
  height: 52px;
  padding: 13px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  fill: var(--ink);
  background: var(--cream);
  transition: background .15s, fill .15s;
}
.channels a:hover svg, .channels a:focus-visible svg { background: var(--ink); fill: var(--cream); }
.channels span { font-size: .78rem; color: var(--muted); }

/* since the last visit */
.news { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #fff3c4; border: 1px solid #ffd23f; font-size: .95rem; }
.is-closed .news { background: #3b3122; border-color: #c4a25a; }

/* notify me */
.follow { margin-top: 32px; }
.follow ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.follow li { display: flex; flex-direction: column; gap: 4px; }
.follow .btn { font-weight: 600; }
.follow-alt { font-size: .8rem; text-align: center; color: var(--muted); }
.follow-note { margin: 10px 0 0; font-size: .82rem; color: var(--muted); }
.follow button.btn { width: 100%; }
.follow button.btn:disabled { cursor: default; border-color: var(--muted); color: var(--muted); background: var(--cream); }
#push-note:empty { display: none; }

/* the stats widget, dressed for the bar */
body #bdb-stats {
  --bdb-serif: var(--serif);
  --bdb-sans: var(--sans);
  --bdb-muted: var(--muted);
  --bdb-grid: var(--line);
  margin-top: 8px;
}
body #bdb-stats h2 { font-size: 1.6rem; margin-top: 2.6rem; }
body #bdb-stats .bdb-tile { border: 1px solid var(--line); }

/* suggest a story: opens under the two buttons */
.suggest-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--cream-deep);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}
.suggest-dialog::backdrop { background: rgba(13, 13, 13, .55); }
.has-dialog { overflow: hidden; }      /* the page behind stays put */
.dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 10px;
  background: var(--cream-deep);
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; margin: 0; }
.dialog-close {
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
}
.dialog-close:hover { background: var(--gold-soft); }
.suggest-form { display: grid; gap: 6px; padding: 14px 18px 18px; }
.suggest-thanks { padding: 22px 18px 20px; font-family: var(--serif); font-size: 1.2rem; }
.suggest-thanks p { margin: 0 0 8px; }
.suggest-thanks .btn { margin-top: 14px; font-family: var(--sans); font-size: 1rem; }
.suggest-form[hidden] { display: none; }   /* display:grid would otherwise beat the attribute */
.suggest-lead { margin: 0 0 4px; }
.suggest-form label { font-weight: 600; margin-top: 10px; }
.suggest-form .req { font-weight: 400; font-size: .8rem; color: var(--burgundy); margin-left: 6px; }
.suggest-form input, .suggest-form textarea {
  font: inherit;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
}
.suggest-form textarea { resize: vertical; }
.suggest-form input:focus, .suggest-form textarea:focus { outline: 2px solid var(--burgundy); outline-offset: 1px; }
.suggest-form .hint { margin: 0; font-size: .82rem; color: var(--muted); }
.suggest-form .btn { margin-top: 16px; }
.suggest-form .btn:disabled { opacity: .6; cursor: progress; }
.suggest-msg { margin: 8px 0 0; color: var(--burgundy); min-height: 1.2em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* colophon */
.colophon { margin-top: 56px; padding-top: 20px; border-top: 2px solid var(--ink); font-size: .95rem; color: var(--muted); }
.colophon p { margin: 0 0 8px; }
.colophon .fineprint { font-size: .85rem; }

@media (max-width: 420px) {
  body { font-size: 16px; }
  .card-title { font-size: 1.4rem; }
  .channels svg { width: 46px; height: 46px; padding: 11px; }
}

/* closing time: 2 to 7, the lights go down */
.closed-sign { display: none; }
.is-closed {
  --cream: #15120e;
  --cream-deep: #221e18;
  --ink: #efe8d6;
  --muted: #b2a891;
  --burgundy: #e0707c;
  --gold-soft: #3b3122;
  --line: #3a342a;
}
.is-closed body { background: var(--cream); }
.is-closed .closed-sign {
  display: block;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--gold);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 6px 14px;
  margin: 0 auto 18px;
  width: fit-content;
}
/* black lettering on a dark page: at night the logo hangs on its own lit sign */
.is-closed .logo { background: #f4f1e5; border-radius: 10px; padding: 10px 14px; filter: brightness(.88); }
@media (prefers-reduced-motion: reduce) {
  .pick.is-pouring .btn.pour::before { animation: none; }
}
