/* My Shelf: what can I make with what I have (js/shelf.js). */

#screen-shelf { background: var(--cream); padding-bottom: 2rem; }
#shelf-content { max-width: 1100px; }
#screen-shelf .section-label { font-weight: 400; }
.shelf-back { margin: 0.5rem 0.75rem 0; min-height: 44px; width: auto; max-width: calc(100% - 1.5rem); }
.shelf-undo { display: flex; align-items: center; gap: 0.75rem; margin: 0 0.75rem 0.75rem; font-family: 'Nunito', sans-serif; font-weight: 600; }
.shelf-undo .btn-secondary { min-height: 44px; }
.shelf-hero {
  margin: 0.75rem;
  padding: 1.1rem 1.1rem 1.2rem;
  background: linear-gradient(135deg, #1f6a8c 0%, #123d55 100%);
  border: var(--border-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-ink);
  color: var(--white);
}
.shelf-kicker { margin: 0 0 0.35rem; font-family: 'Space Mono', monospace; font-size: 0.7rem; letter-spacing: 2px; color: var(--white); }
.shelf-count { margin: 0; font-family: 'Bangers', cursive; font-weight: 400; letter-spacing: 2px; font-size: 2rem; line-height: 1.05; }
.shelf-count:focus { outline: none; }
.shelf-sub { margin: 0.5rem 0 0; font-family: 'Nunito', sans-serif; font-size: 0.95rem; line-height: 1.4; max-width: 46ch; }

.shelf-next { margin: 0 0.75rem 0.75rem; }
.shelf-next .section-label, #screen-shelf .section-label { margin: 1rem 0 0; }
.shelf-next-list { list-style: none; margin: 0; padding: 0; border: var(--border-ink); border-top: 0; background: var(--white); }
.shelf-next-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.75rem; border-top: 1px solid rgba(26,18,9,0.12); }
.shelf-next-item:first-child { border-top: 0; }
.shelf-next-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.shelf-next-name { font-family: 'Bangers', cursive; letter-spacing: 1.5px; font-size: 1.15rem; line-height: 1.1; }
.shelf-next-why { font-family: 'Nunito', sans-serif; font-size: 0.85rem; color: var(--text-light); line-height: 1.35; }
.shelf-got { flex-shrink: 0; min-height: 44px; }

#shelf-content > section { margin-left: 0.75rem; margin-right: 0.75rem; }
.shelf-list { border: var(--border-ink); border-top: 0; background: var(--white); }
.shelf-list .drink-row { width: 100%; border: 0; border-bottom: 1px solid rgba(26,18,9,0.1); padding: 0; text-align: left; font: inherit; color: inherit; }
.shelf-list .drink-row:last-child { border-bottom: 0; }
.shelf-list .drink-info { display: flex; flex-direction: column; }
.shelf-list .drink-thumb:not(.glass-thumb) { width: 52px; min-height: 52px; align-self: stretch; }
.shelf-missing, .shelf-optional { font-family: 'Nunito', sans-serif; font-size: 0.8rem; font-weight: 600; margin-top: 0.15rem; }
.shelf-missing { color: var(--coral-dark); }
.shelf-optional { color: var(--text-light); font-weight: 400; }

.shelf-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; background: var(--paper); border-bottom: 1px solid rgba(26,18,9,0.1); }
.shelf-picker-head .section-label { border-bottom: 0; }
.shelf-picker-head .section-label { margin: 0 !important; }
.shelf-picker-head .section-label { flex: 1; }
.shelf-clear { background: none; border: 0; padding: 0 0.25rem; min-height: 44px; font-family: 'Space Mono', monospace; font-size: 0.7rem; color: var(--text-light); text-decoration: underline; cursor: pointer; }
.shelf-group { border: 0; margin: 0; padding: 1.25rem 0 0; }
.shelf-group legend { float: left; width: 100%; padding: 0; margin-bottom: 0.55rem; font-family: 'Space Mono', monospace; font-size: 0.65rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-light); }
.shelf-chips { clear: both; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.shelf-chip {
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.shelf-chip[aria-pressed='true'] { background: var(--navy); color: var(--white); }
.shelf-chip[aria-pressed='true']::before { content: ''; display: inline-block; width: 0.45rem; height: 0.8rem; margin-right: 0.45rem; border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translateY(-2px); }
.shelf-chip:focus-visible, .shelf-got:focus-visible, .shelf-clear:focus-visible, .shelf-list .drink-row:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* The card at the top of the home page */
.shelf-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'text art' 'cta cta';
  gap: 0.6rem 1rem;
  align-items: center;
  padding: 1rem 1.15rem;
  background: linear-gradient(135deg, #1f6a8c 0%, #123d55 100%);
  color: var(--white);
  text-decoration: none;
  border: var(--border-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-ink);
  transition: box-shadow 0.15s, transform 0.15s;
}
.shelf-card:hover { box-shadow: var(--shadow-ink-lg); transform: translate(-2px, -2px); }
.shelf-card:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.shelf-card-text { grid-area: text; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.shelf-card-kicker { font-family: 'Space Mono', monospace; font-size: 0.65rem; letter-spacing: 2px; }
.shelf-card-title { font-family: 'Bangers', cursive; letter-spacing: 2px; font-size: 1.6rem; line-height: 1.05; }
.shelf-card-sub { font-family: 'Nunito', sans-serif; font-size: 0.92rem; line-height: 1.35; }
.shelf-card-glasses { grid-area: art; display: flex; align-items: flex-end; gap: 0.1rem; }
.shelf-card-glasses .glass-art { width: 30px; height: 40px; filter: drop-shadow(2px 2px 0 var(--ink)); }
.shelf-card-cta { grid-area: cta; justify-self: start; display: inline-flex; align-items: center; min-height: 40px; padding: 0.35rem 1rem; background: var(--white); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius-pill); box-shadow: 2px 2px 0 var(--ink); font-family: 'Bangers', cursive; letter-spacing: 1.5px; font-size: 1rem; }

@media (max-width: 599px) {
  .shelf-card { grid-template-columns: 1fr auto; grid-template-areas: 'text cta'; padding: 0.8rem 0.9rem; gap: 0.75rem; }
  .shelf-card-glasses, .shelf-card-kicker { display: none; }
  .shelf-card-title { font-size: 1.3rem; }
  .shelf-card-sub { font-size: 0.85rem; }
  .shelf-card-cta { padding: 0.3rem 0.75rem; font-size: 0.9rem; }
}

/* On a recipe page */
.shelf-recipe-note { margin: 0.5rem 0 0; font-family: 'Nunito', sans-serif; font-weight: 600; font-size: 0.9rem; color: var(--navy); }
.ingredient-list li.shelf-have::after, .ingredient-list li.shelf-lack::after {
  margin-left: auto;
  padding: 0.15rem 0.6rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.ingredient-list li.shelf-have::after { content: 'On shelf'; background: #dfeedd; color: var(--stamp-green); }
.ingredient-list li.shelf-lack::after { content: 'Need'; background: #f6dcd2; color: var(--coral-dark); }

@media (min-width: 768px) {
  .shelf-card { grid-template-columns: 1fr auto auto; grid-template-areas: 'text art cta'; padding: 1.1rem 1.5rem; }
  .shelf-card-glasses .glass-art { width: 40px; height: 54px; }
  .shelf-hero { margin: 1.5rem 1.5rem 1rem; padding: 1.5rem 1.75rem; }
  .shelf-count { font-size: 2.6rem; }
  #shelf-content > section, .shelf-next { margin-left: 1.5rem; margin-right: 1.5rem; }
  .shelf-list { display: grid; grid-template-columns: 1fr 1fr; }
  .shelf-list .drink-row:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
}
