/* gnv.beer — limestone, spring water, and the color of whatever's in the glass. */

:root {
  --bg: #edf0ea;
  --surface: #f7f9f5;
  --ink: #13201b;
  --ink-2: #4c5c55;
  --rule: #c9d3cc;
  --amber: #e4a21b;
  --spring: #1d6a5c;
  --open: #2e7d4f;
  --warn-bg: #fbf1d8;

  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-3: clamp(2rem, 6vw, 2.75rem);
  --step-5: clamp(4rem, 17vw, 8.5rem);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1714;
    --surface: #16211d;
    --ink: #e4ece8;
    --ink-2: #9cafa7;
    --rule: #2b3a34;
    --amber: #f0b43a;
    --spring: #6cc3b1;
    --open: #6fcf97;
    --warn-bg: #2b2412;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: 76rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem) 4rem;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0) / 1.5 var(--body);
}

a {
  color: var(--spring);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 3px;
}

[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 1.5rem;
  padding-top: clamp(1.5rem, 5vw, 3rem);
}

.wordmark {
  margin: 0;
  font: 900 var(--step-5) / 0.82 var(--display);
  letter-spacing: -0.01em;
}
.wordmark span {
  color: var(--amber);
}

.dateline {
  margin: 0.5rem 0 0;
  font-size: var(--step-1);
  color: var(--ink-2);
}

/* ------------------------------------------------------------ range picker */

.ranges {
  display: inline-flex;
  margin-top: 1.75rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.ranges button {
  font: 700 var(--step--1) / 1 var(--body);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  cursor: pointer;
}
.ranges button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
}

.summary {
  margin: 1rem 0 2rem;
  font-size: var(--step-1);
  max-width: 40ch;
}

/* ----------------------------------------------------------------- brewery */

.brewery {
  border-top: 3px solid var(--ink);
  padding: 1.25rem 0 2.25rem;
}

.b-head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    'name status'
    'where where';
  align-items: baseline;
  gap: 0.15rem 1rem;
}
.b-name {
  grid-area: name;
  margin: 0;
  font: 700 var(--step-3) / 1 var(--display);
  letter-spacing: 0.005em;
}
.b-name a {
  color: inherit;
  text-decoration: none;
}
.b-name a:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
}
.b-status {
  grid-area: status;
  margin: 0;
  font-weight: 700;
  font-size: var(--step--1);
  color: var(--ink-2);
  white-space: nowrap;
}
.b-status[data-open='true'] {
  color: var(--open);
}
.b-status[data-open='true']::before {
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.4em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.05em;
}
.b-where {
  grid-area: where;
  margin: 0;
  font-size: var(--step--1);
}
.b-where a {
  color: var(--ink-2);
}

/* The pour bar: every beer on tap, in (roughly) its own color. */
.pour {
  list-style: none;
  display: flex;
  gap: 2px;
  height: 1.1rem;
  margin: 1rem 0 1.25rem;
  padding: 0;
}
.pour li {
  flex: 1 1 0;
  min-width: 3px;
  max-width: 2.75rem;
  background: var(--c);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.07);
}
.pour li:first-child {
  border-radius: 5px 2px 2px 5px;
}
.pour li:last-child {
  border-radius: 2px 5px 5px 2px;
}

/* ----------------------------------------------------------------- columns */

.b-head + .b-cols {
  margin-top: 1.25rem;
}

.b-cols {
  display: grid;
  gap: 1.25rem 2.5rem;
}
@media (min-width: 52rem) {
  .b-cols {
    grid-template-columns: 1fr 1.15fr 1.5fr;
  }
}

.col h3 {
  margin: 0 0 0.4rem;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--ink-2);
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}
.count {
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.days,
.days ul,
.taps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.day + .day {
  margin-top: 0.6rem;
}
.day-label {
  display: block;
  font-size: var(--step--1);
  font-weight: 700;
  margin-bottom: 0.1rem;
}
body[data-range='today'] .day-label {
  display: none;
}

.item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 0.75rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rule);
}
.item-title {
  font-weight: 700;
  color: var(--ink);
}
a.item-title {
  text-decoration: none;
}
a.item-title:hover {
  text-decoration: underline;
}
.item-time {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty,
.empty-taps {
  margin: 0;
  padding: 0.3rem 0;
  color: var(--ink-2);
}

/* Taps */
.tap {
  display: grid;
  grid-template-columns: 0.7rem 1fr auto;
  grid-template-areas:
    'dot name abv'
    '.   style style';
  column-gap: 0.6rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rule);
}
.tap::before {
  content: '';
  grid-area: dot;
  align-self: center;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
}
.tap-name {
  grid-area: name;
  font-weight: 700;
}
.tap-style {
  grid-area: style;
  font-size: var(--step--1);
  color: var(--ink-2);
}
.tap-abv {
  grid-area: abv;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.more summary {
  cursor: pointer;
  padding: 0.45rem 0;
  font-weight: 700;
  color: var(--spring);
  list-style: none;
}
.more summary::-webkit-details-marker {
  display: none;
}
.more summary::after {
  content: ' +';
}
.more[open] summary {
  display: none;
}

.also,
.note {
  margin: 0.5rem 0 0;
  font-size: var(--step--1);
  color: var(--ink-2);
}

.warn {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0.5rem 0.75rem;
  background: var(--warn-bg);
  border-left: 3px solid var(--amber);
  font-size: var(--step--1);
}

/* ------------------------------------------------------------------ footer */

.foot {
  border-top: 3px solid var(--ink);
  padding-top: 1.25rem;
  color: var(--ink-2);
  font-size: var(--step--1);
  max-width: 60ch;
}

@media (prefers-color-scheme: dark) {
  /* Stouts are nearly black; give every swatch an edge so they don't vanish. */
  .pour li,
  .tap::before {
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.16);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .day,
  .empty {
    animation: settle 160ms ease-out;
  }
  @keyframes settle {
    from {
      opacity: 0.2;
    }
  }
}
