/* The beer — canvas board "3 · The beer".
 *
 * In the map section's language: a 669 C plum panel, and four cream tasting
 * cards with the plum outline and a hard 1225 yellow shadow (yellow, because
 * plum on plum would vanish). Each card names its station in a red pill like
 * the map's region tags, and the amber + turns it over to the full note.
 */

.sgs {
  background: var(--sg-page);
  padding: var(--page-gutter) 0;
}

/* cnt_section_attrs writes the Section background as an inline background-color
   on the section itself, which no stylesheet rule can outrank. Here that colour
   belongs to the inner panel, not the page behind it, so the section is forced
   back to the tan and --sec-bg is picked up by .sgs__in below. */
.sgs.has-sec-bg { background-color: var(--sg-page) !important; }

.sgs__in {
  position: relative;
  margin-inline: var(--page-gutter);
  border-radius: var(--panel-r);
  background: var(--sec-bg, var(--plum));
  color: var(--cream);
  overflow: hidden;
  isolation: isolate;
}

/* A photograph is optional and, if set, sits well back behind the cards. */
.sgs__photo { position: absolute; inset: 0; z-index: 0; }
.sgs__photo img { width: 100%; height: 100%; object-fit: cover; }
.sgs__shade { position: absolute; inset: 0; z-index: 1; }
.sgs__photo ~ .sgs__shade { background: color-mix(in srgb, var(--sec-bg, var(--plum)) 92%, transparent); }

.sgs__body {
  position: relative;
  z-index: 2;
  padding: clamp(36px, 4.6vw, 60px) clamp(20px, 4.4vw, 56px) clamp(36px, 4.2vw, 54px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* the headline, two sizes --------------------------------------------------*/

.sgs__head { text-align: center; }

.sgs__eyebrow { margin: 0 0 12px; font-family: var(--f-mono); font-size: 12px; letter-spacing: 2.16px; text-transform: uppercase; color: var(--yel); }

.sgs__over {
  margin: 0 0 6px;
  /* the quiet first line is in Aller, bold italic, like the hero's tagline,
     so "California Common?" is the only Gulden in the headline */
  font-family: var(--f-body);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(18px, 1.9vw, 24px);
  line-height: 1.1;
  color: color-mix(in srgb, var(--cream) 85%, transparent);
}

.sgs__title {
  margin: 2px 0 0;
  font-family: var(--f-display);
  font-size: clamp(40px, 6.7vw, 86px);
  line-height: .92;
  letter-spacing: -1.4px;
  text-transform: uppercase;
  color: var(--cream);
}

.sgs__lede {
  margin: 18px auto 0;
  max-width: 34ch;
  font-family: var(--f-body);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.4;
  color: color-mix(in srgb, var(--cream) 90%, transparent);
}

/* the row ------------------------------------------------------------------
 * Four cards in one even row, read left to right like a tasting, with a
 * dashed line running behind them through their middles.
 */

.sgs__route { position: relative; margin: 34px auto 0; width: 100%; max-width: 1000px; }

.sgs__track {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 130px;            /* half the card height */
  border-top: 2px dashed color-mix(in srgb, var(--yel) 50%, transparent);
  animation: sgsDraw 1.6s ease-out both;
  transform-origin: left center;
}

@keyframes sgsDraw {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.sgs__stns {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 210px));
  justify-content: space-between;
  gap: 30px 22px;
}

.sgs__stn {
  animation: sgsRise .8s cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: var(--d, 0s);
}

@keyframes sgsRise {
  from { opacity: 0; translate: 0 22px; }
  to   { opacity: 1; translate: 0 0; }
}

/* the card ---------------------------------------------------------------- */

.sgs__card {
  position: relative;
  display: grid;
  height: 260px;
  box-sizing: border-box;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: var(--cream);
  color: var(--navy);
  box-shadow: 6px 6px 0 var(--yel);
  rotate: var(--tilt, 0deg);
  transition: background-color .3s ease, rotate .3s ease, translate .18s ease, box-shadow .18s ease;
}

/* a hand-stuck tilt, alternating */
.sgs__stn:nth-child(4n+1) { --tilt: -1.5deg; }
.sgs__stn:nth-child(4n+2) { --tilt: 1deg; }
.sgs__stn:nth-child(4n+3) { --tilt: -1deg; }
.sgs__stn:nth-child(4n+4) { --tilt: 1.5deg; }

/* Front and back share the card's one grid cell and cross-fade, so the card
   never changes size and nothing around it moves. */
.sgs__face, .sgs__back {
  grid-area: 1 / 1;
  transition: opacity .28s ease, transform .28s ease;
}

.sgs__face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 16px;
  text-align: center;
}

.sgs__face svg { width: 64px; height: 64px; }

/* the station name, as a red pill like the map's region tags */
.sgs__sname {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 11px;
  border: 1.5px solid var(--line);
  border-radius: 30px;
  background: var(--lime);
  color: var(--cream);
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.sgs__stext {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--navy);
}

.sgs__back {
  display: grid;
  place-items: center;
  padding: 0 22px;
  text-align: center;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.4;
  color: var(--plum);
  opacity: 0;
  transform: scale(.94);
}

/* the + that says "there's more" */
.sgs__more {
  position: absolute;
  right: -11px;
  top: -11px;
  width: 30px;
  height: 30px;
  box-sizing: border-box;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--amber);
  transition: transform .28s ease, background-color .28s ease;
}

.sgs__more::before, .sgs__more::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  border-radius: 2px;
  background: var(--plum);
}

.sgs__more::after { transform: rotate(90deg); }

.sgs__stn.has-detail { cursor: pointer; outline: none; }

/* lifted a touch on hover, turned over on hover, focus or tap */
.sgs__stn.has-detail:is(:hover, :focus-visible, .is-open) .sgs__card { background: var(--amber); rotate: 0deg; }
.sgs__stn.has-detail:is(:hover, :focus-visible, .is-open) .sgs__face { opacity: 0; transform: scale(.85); }
.sgs__stn.has-detail:is(:hover, :focus-visible, .is-open) .sgs__back { opacity: 1; transform: none; }
.sgs__stn.has-detail:is(:hover, :focus-visible, .is-open) .sgs__more { transform: rotate(45deg); background: var(--cream); }
.sgs__stn.has-detail:focus-visible .sgs__card { outline: 3px solid var(--cream); outline-offset: 4px; }

/* the close ----------------------------------------------------------------*/

.sgs__close {
  margin-top: auto;
  padding-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.sgs__text {
  text-align: center;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  line-height: 1.6;
  max-width: 560px;
  color: color-mix(in srgb, var(--cream) 85%, transparent);
}

.sgs__text p { margin: 0; }

/* The split pill: a cream label and an amber arrow, each a sticker with the
   plum outline and the yellow shadow it needs on a dark panel. */
.sgs__cta { display: inline-flex; align-items: stretch; gap: 10px; text-decoration: none; }

.sgs__cta-t, .sgs__cta-a {
  height: 52px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  box-shadow: var(--hard-dark);
  transition: translate .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.sgs__cta-t {
  padding-inline: 30px;
  border-radius: 60px;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.sgs__cta-a {
  width: 52px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--plum);
}

.sgs__cta-a svg { width: 18px; height: 18px; }
.sgs__cta:hover .sgs__cta-t, .sgs__cta:hover .sgs__cta-a { translate: 2px 2px; box-shadow: 2px 2px 0 var(--yel); }
.sgs__cta:hover .sgs__cta-t { background: var(--amber); color: var(--plum); }

/* ---- narrow screens ------------------------------------------------------
 * Two by two below 900px. The line goes, since it can only join a single row.
 */

@media (max-width: 900px) {
  .sgs__track { display: none; }
  .sgs__stns { grid-template-columns: repeat(2, minmax(0, 200px)); justify-content: center; gap: 24px 18px; }
  .sgs__card { height: 236px; }
  .sgs__face { gap: 11px; }
  .sgs__face svg { width: 52px; height: 52px; }
  .sgs__stext { font-size: 15px; }
  .sgs__back { font-size: 14px; padding: 0 14px; }
  .sgs__title { letter-spacing: -.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .sgs__track, .sgs__stn { animation: none; }
  .sgs__card, .sgs__face, .sgs__back, .sgs__more, .sgs__cta-t, .sgs__cta-a { transition: none; }
}
