/* Roast Release: design tokens and bespoke components.
   Page structure (spacing, flex, type sizes) is done with Tailwind utilities in the templates. */

@font-face {
  font-family: "Degular Mono";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/DegularMono-Semibold.woff2") format("woff2"),
       url("../fonts/DegularMono-Semibold.otf") format("opentype");
}
@font-face {
  font-family: "Degular Mono";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/DegularMono-Bold.woff2") format("woff2"),
       url("../fonts/DegularMono-Bold.otf") format("opentype");
}

:root {
  --cream: #f0ebe1;
  --white: #ffffff;
  --ink: #000000;
  --green: #e2f98f;
  --yellow: #f5f396;
  --orange: #ffdd99;
  --radius: 11px;
  --radius-sm: 14px;
  --font: "Degular Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 600;
  line-height: 1.45;
}
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

a.underline:hover,
a.underline:active,
a.underline:focus {
    text-decoration: none;
}



.skip-link {
  position: absolute; left: .5rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--cream); padding: .6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: .5rem; }

/* ---- social icons ---- */
.social { display: flex; gap: .6rem; list-style: none; margin: 0; padding: 0; }
.social a { display: block; width: 2.1rem; height: 2.1rem; border-radius: 50%; }
.social img { display: block; width: 100%; height: 100%; }
.social a[aria-disabled="true"] { opacity: .35; pointer-events: none; }

/* ---- release-age badges ---- */
.badge {
  display: inline-block; padding: .12rem .45rem; font-size: .75rem; font-weight: 700;
  line-height: 1.3; text-transform: uppercase; white-space: nowrap;
}
.badge--green  { background: var(--green); }
.badge--yellow { background: var(--yellow); }
.badge--orange { background: var(--orange); }
.badge--cream  { background: var(--cream); }

/* ---- thumbnails (image on top of a text fallback) ---- */
.thumb { position: relative; display: block; overflow: hidden; aspect-ratio: 1 / 1; background: var(--cream); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.thumb-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; padding: .5rem; overflow: hidden;
  text-align: center; font-size: .7rem; font-weight: 700; line-height: 1.2; text-transform: uppercase;
}
.thumb--card { width: 78%; }
.thumb--row { width: 64px; flex: none; border-radius: 6px; }
.thumb--row .thumb-fallback { font-size: .5rem; padding: .2rem; }

/* ---- latest-release cards ---- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card {
  display: flex; flex-direction: column; position: relative; overflow: hidden; text-decoration: none;
 
}
.card-media { position: relative; display: flex; justify-content: center; padding: 1.75rem 0 1.5rem; border-radius: var(--radius); background: var(--white);}
.card .badge { position: absolute; top: 1.4rem; left: 0; z-index: 1; }
.card-body {
  display: flex; flex: 1; flex-direction: column; gap: .35rem;
  padding: 1.4rem 1.6rem; border-top: 2px dashed var(--cream);
  border-radius: var(--radius); background: var(--white);
}
.card-media,
.card-body {
  transition: all 0.15s;
}
.card:hover .card-media,
.card:hover .card-body {
  box-shadow: inset 0 0 0 2px var(--ink);
}
.card-roaster { font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.card-title { font-size: 1.15rem; line-height: 1.3; }
.card-cta { margin-top: auto; padding-top: 1rem; font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; }

/* ---- releases table ---- */
.table-head, .release-row { display: grid; grid-template-columns: 2.6fr 1fr 1fr 2fr; gap: 0; }
.table-head { padding-bottom: .6rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.table-head span:not(:first-child) { padding-left: 1.4rem; }
.release-table { display: flex; flex-direction: column; gap: .45rem; }
.release-row { text-decoration: none; }
.cell {
  display: flex; align-items: center; min-height: 5.6rem; padding: .9rem 1.4rem;
  background: var(--white); border-radius: var(--radius); font-size: .9rem;
  transition: all 0.15s;
}
.cell:not(:first-of-type) {
    border-left: 2px dashed var(--cream);
}
.cell--coffee { gap: 1rem; padding-left: .9rem; }
.cell:last-child {  }
.release-row:hover .cell { box-shadow: inset 0 0 0 2px var(--ink); }
.row-text { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: .2rem; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.row-roaster { font-size: .85rem; font-weight: 700; text-transform: uppercase; }
.row-title { font-size: .95rem; line-height: 1.3; }
.soldout-tag {
  padding: 0 .35rem; border: 1.5px solid var(--ink); border-radius: 2px;
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
}
.is-soldout .cell { color: #555; }
.is-soldout .thumb, .is-soldout .badge { opacity: .5; }

.empty { padding: 1.5rem 1.25rem; background: var(--white); border-radius: var(--radius-sm); font-size: .9rem; }
.empty code { font-size: .85em; }

/* ---- buttons and filter ---- */
.btn {
  display: inline-block; padding: .8rem 1.4rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--cream); font: inherit; font-size: .85rem; font-weight: 700; text-transform: uppercase;
}
.btn:hover { background: #222; }
.filter-btn img { width: 1.25rem; height: auto; }
.filter-btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .3rem 0; border: 0; background: none; cursor: pointer;
  color: inherit; font: inherit; font-size: .8rem; font-style: italic; text-transform: uppercase;
}

/* ---- right-hand filter flyout ---- */
.flyout-overlay {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .4);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s;
}
.flyout-overlay.is-open { opacity: 1; visibility: visible; transition: opacity .25s; }
.flyout {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(380px, 100vw); overflow-y: auto;
  background: var(--white); transform: translateX(100%); visibility: hidden;
  transition: transform .25s ease, visibility 0s .25s;
}
.flyout.is-open { transform: none; visibility: visible; transition: transform .25s ease; }
.flyout form { display: flex; min-height: 100%; flex-direction: column; padding: 1.5rem; }
.flyout-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.flyout-head h2 { margin: 0; font-size: 1.25rem; font-weight: 700; text-transform: uppercase; }
.flyout-close { border: 0; background: none; cursor: pointer; font: inherit; font-size: 2rem; line-height: 1; }
.flyout-group { margin: 0 0 1.5rem; padding: 0; border: 0; }
.flyout-group legend { margin-bottom: .4rem; padding: 0; font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.check { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; font-size: .9rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--ink); }
.muted { margin: 0; font-size: .85rem; color: #555; }
.flyout-actions {
  position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding: 1rem 0 0; background: var(--white);
}
.clear-link { font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; }
body.no-scroll { overflow: hidden; }

/* ---- pagination ---- */
.pagination {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 1.5rem; font-size: .85rem; font-weight: 700; text-transform: uppercase;
}
.pagination ul { display: flex; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.pagination a, .pagination span {
  display: inline-block; min-width: 2.2rem; padding: .4rem .6rem; border-radius: var(--radius-sm);
  text-align: center; text-decoration: none;
}
.pagination a:hover { background: var(--white); }
.pagination .is-current { background: var(--ink); color: var(--cream); }
.pagination .is-disabled { opacity: .4; }
.pagination li.gap { padding: .4rem .2rem; }

/* ---- forms ---- */
.form-card {
  display: flex; flex-direction: column; gap: 1.1rem; margin-top: 1.5rem; padding: 1.75rem;
  background: var(--white); border-radius: var(--radius);
}
.field label { display: block; margin-bottom: .35rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.field-input {
  width: 100%; padding: .75rem .9rem; border: 2px solid var(--ink); border-radius: var(--radius-sm);
  background: var(--white); font: inherit; font-weight: 600;
}
.field-error { margin: .35rem 0 0; font-size: .85rem; font-weight: 700; color: #a40000; }
.notice { margin-top: 1.5rem; padding: 1rem 1.2rem; border-radius: var(--radius-sm); background: var(--green); font-size: .9rem; }

.hp { position: absolute; left: -9999px; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  /* .card-grid { grid-template-columns: repeat(2, 1fr); } */
}
@media (max-width: 767px) {
  .table-head { display: none; }
  .release-row { grid-template-columns: 1fr; gap: 2px; }
  .cell { min-height: 0; padding: .7rem 1rem; font-size: .85rem; }
  .cell--coffee { border-radius: 8px; }
  .cell:last-child { }
  .cell--data { align-items: baseline; }
  .cell--data::before {
    content: attr(data-label); flex: none; width: 5.5rem; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  }
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
  .thumb--card { width: 70%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
