/* Collection page. Builds on styles.css + product.css (crumbs, sr-only, solid nav). */

/* hero: copy + elevation chart */
.c-hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 5vw, 80px); align-items: center; padding-top: 140px; padding-bottom: clamp(56px, 7vw, 96px); }
.c-hero__title { font-family: var(--serif); font-size: clamp(3.5rem, 8vw, 6rem); line-height: 0.95; letter-spacing: -0.035em; margin-top: 20px; }
.c-hero__lede { margin: 24px 0 32px; color: #cfcec9; font-size: 1.1875rem; max-width: 44ch; }

.elev-chart { margin: 0; padding: clamp(24px, 3vw, 36px); border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.elev-chart h2 { font-family: var(--serif); font-size: 2rem; line-height: 1.05; }
.elev-chart figcaption p { color: var(--fg-2); font-size: 0.9375rem; margin-top: 6px; }
.elev-list { list-style: none; margin: 24px 0 0; padding: 0; }
.elev-row { display: grid; grid-template-columns: 150px 1fr 118px; align-items: center; gap: 16px; padding: 9px 10px; margin-inline: -10px; border-radius: 10px; transition: background-color 200ms ease; }
.elev-row__name { font-weight: 500; font-size: 0.9375rem; line-height: 1.2; }
.elev-row__name small { display: block; font-weight: 400; color: var(--fg-2); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.elev-row__track { position: relative; height: 10px; border-radius: 999px; background: rgba(236, 235, 231, 0.08); }
.elev-row__bar { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--fg); transform-origin: center; min-width: 10px; transition: background-color 200ms ease; }
.elev-row__val { font-size: 0.8125rem; color: var(--fg-2); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.elev-row.is-on { background: rgba(236, 235, 231, 0.07); }
.elev-row.is-on .elev-row__bar { background: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .elev-row:hover { background: rgba(236, 235, 231, 0.06); }
  .elev-row:hover .elev-row__bar { background: var(--accent); }
}
.elev-axis { display: grid; grid-template-columns: 150px 1fr 118px; gap: 16px; margin-top: 10px; font-size: 0.75rem; color: var(--fg-2); }
.elev-axis span { grid-column: 2; grid-row: 1; }
.elev-axis span:nth-child(2) { justify-self: center; }
.elev-axis span:nth-child(3) { justify-self: end; }

/* filters: pinned to the very top; drop below the nav only while the nav is showing */
html:not(.nav-hidden) .filters { top: 72px; }
@media (max-width: 640px) { html:not(.nav-hidden) .filters { top: 64px; } }
.results { scroll-margin-top: 90px; }
.filters { position: sticky; top: 0; z-index: 30; transition: top 450ms var(--ease-out); display: grid; gap: 14px; padding: 14px 0 16px; margin-bottom: 28px; background: rgba(12, 12, 11, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 0 0 100vmax rgba(12, 12, 11, 0.94), 0 1px 0 100vmax var(--line); clip-path: inset(0 -100vmax); }
.f-roast { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 6px; border-radius: var(--r); background: var(--tile); }
.f-bean { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border: 0; border-radius: 999px; background: transparent; color: var(--tile-fg-2); cursor: pointer; font-size: 0.9375rem; font-weight: 500; transition: background-color 250ms ease, color 250ms ease, transform 160ms var(--ease-out); }
.f-bean img { width: 22px; transition: transform 400ms var(--ease-out); }
.f-bean:active { transform: scale(0.97); }
.f-bean:disabled { opacity: 0.32; cursor: not-allowed; }
.f-bean:disabled:active { transform: none; }
.f-bean[aria-pressed="true"] { background: rgba(20, 20, 19, 0.24); color: var(--tile-fg); }
.f-bean[aria-pressed="true"] img { transform: scale(1.18); }
@media (hover: hover) and (pointer: fine) { .f-bean:not([aria-pressed="true"]):not(:disabled):hover { color: var(--tile-fg); background: rgba(20, 20, 19, 0.14); } }
.f-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.f-select { position: relative; display: inline-flex; align-items: center; }
.f-select select { appearance: none; -webkit-appearance: none; height: 44px; padding: 0 40px 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--fg); font: inherit; font-size: 0.9375rem; cursor: pointer; }
.f-select select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.f-select i { position: absolute; right: 16px; pointer-events: none; font-size: 13px; color: var(--fg-2); }
.switch { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 8px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-size: 0.9375rem; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__ui { position: relative; width: 40px; height: 24px; border-radius: 999px; background: rgba(236, 235, 231, 0.16); transition: background-color 250ms ease; }
.switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--fg); transition: transform 300ms var(--ease-out); }
.switch input:checked + .switch__ui { background: var(--accent); }
.switch input:checked + .switch__ui::after { transform: translateX(16px); }
.switch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.view { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); }
.view__btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--fg-2); cursor: pointer; font-size: 0.875rem; font-weight: 500; transition: background-color 250ms ease, color 250ms ease; }
.view__btn[aria-pressed="true"] { background: var(--fg); color: var(--tile-fg); }
.f-count { margin-left: auto; color: var(--fg-2); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.f-count span { color: var(--fg); }
.f-clear { border: 0; background: none; color: var(--fg); font: inherit; font-size: 0.9375rem; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 10px 4px; }

/* grid */
.grid { position: relative; z-index: 0; isolation: isolate; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px 16px; }
.ccard { display: flex; flex-direction: column; min-width: 0; }
.ccard__img { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 5; min-height: 0; border-radius: var(--r); background: var(--tile); overflow: clip; }
.ccard__img img { position: absolute; inset: 3%; width: 94%; height: 94%; object-fit: contain; transition: transform 600ms var(--ease-out); }
.ccard__tag { position: absolute; left: 12px; top: 12px; padding: 5px 10px; border-radius: 999px; background: var(--tile-fg); color: var(--fg); font-size: 0.75rem; font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .ccard:hover .ccard__img img { transform: translateY(-6px); } }
.ccard__roast { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 0.8125rem; font-weight: 500; color: var(--accent); }
.ccard__roast img { width: 14px; }
.ccard__name { font-family: var(--serif); font-size: 1.75rem; line-height: 1.08; margin-top: 6px; }
.ccard__origin { color: var(--fg-2); font-size: 0.875rem; margin-top: 4px; }
.ccard__notes { color: #cfcec9; font-size: 0.9375rem; margin-top: 10px; }
.ccard__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 16px; }
.ccard__price { font-size: 0.9375rem; font-weight: 500; }
.ccard__add { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.875rem; font-weight: 500; transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out); }
.ccard__add:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .ccard__add:hover { background: var(--fg); color: var(--tile-fg); border-color: var(--fg); } }

/* compare table */
.compare { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); }
.ctable { width: 100%; border-collapse: collapse; font-size: 0.9375rem; min-width: 900px; }
.ctable th, .ctable td { text-align: left; padding: 16px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ctable thead th { font-weight: 500; font-size: 0.8125rem; color: var(--fg-2); background: var(--bg-2); position: sticky; top: 0; }
.ctable tbody th { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; white-space: nowrap; }
.ctable tbody td { color: #cfcec9; }
.ctable td:nth-child(3), .ctable td:nth-child(4) { white-space: nowrap; }
.ctable tbody tr:last-child > * { border-bottom: 0; }
.ctable tbody tr { transition: background-color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .ctable tbody tr:hover { background: rgba(236, 235, 231, 0.04); } }
.ctable a { border-bottom: 1px solid var(--line); }

.empty { padding: 80px 0; text-align: center; display: grid; justify-items: center; gap: 20px; }
.empty__title { font-family: var(--serif); font-size: 2rem; }

/* FAQ */
.c-faq { display: grid; grid-template-columns: 0.9fr 1.3fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.c-faq__head { position: sticky; top: 140px; }
.c-faq__head .h2 { font-size: clamp(2.5rem, 4.4vw, 4rem); }
.c-faq__head .link { display: inline; }
.faq { border-top: 1px solid var(--line); interpolate-size: allow-keywords; }
.faq:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-family: var(--serif); font-size: clamp(1.375rem, 2vw, 1.75rem); line-height: 1.2; }
.faq__icon { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); transition: transform 400ms var(--ease-out), background-color 250ms ease, border-color 250ms ease; }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; background: currentColor; translate: -50% -50%; }
.faq__icon::after { rotate: 90deg; transition: rotate 400ms var(--ease-out); }
.faq[open] .faq__icon { background: var(--fg); color: var(--tile-fg); border-color: var(--fg); }
.faq[open] .faq__icon::after { rotate: 0deg; }
@media (hover: hover) and (pointer: fine) { .faq summary:hover .faq__icon { border-color: var(--fg); } }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.faq::details-content { height: 0; overflow: clip; transition: height 450ms var(--ease-out), content-visibility 450ms allow-discrete; }
.faq[open]::details-content { height: auto; }
.faq__a p { color: var(--fg-2); padding: 0 56px 28px 0; max-width: 62ch; }

/* more */
.more__grid { margin-top: 48px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.more__tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 300px; padding: 22px; border-radius: var(--r); background: var(--tile); color: var(--tile-fg); overflow: clip; isolation: isolate; }
.more__tile img { position: absolute; right: -40%; top: -12%; width: 100%; z-index: -1; transition: transform 600ms var(--ease-out); }
.more__tile img.cover { inset: 0; width: 100%; height: 62%; object-fit: cover; right: auto; top: 0; }
.more__tile img.bean { width: 34%; right: 12%; top: 10%; }
.more__tile > span { display: grid; gap: 2px; font-size: 0.875rem; color: var(--tile-fg-2); }
.more__name { font-family: var(--serif); font-size: 1.75rem; line-height: 1.05; color: var(--tile-fg); }
.more__tile > i { position: absolute; right: 18px; bottom: 22px; font-size: 20px; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .more__tile:hover img { transform: translateY(-6px); }
  .more__tile:hover > i { transform: rotate(45deg); }
}

@media (max-width: 1100px) {
  .c-hero { grid-template-columns: 1fr; align-items: start; padding-top: 112px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .more__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .c-faq { grid-template-columns: 1fr; }
  .c-faq__head { position: static; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .c-hero { padding-top: 96px; }
  .elev-row, .elev-axis { grid-template-columns: 96px 1fr 84px; gap: 10px; }
  .elev-row__name small { display: none; }
  .elev-row__val { font-size: 0.75rem; }
  .filters { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .f-roast { grid-template-columns: repeat(5, 1fr); }
  .f-bean { flex-direction: column; gap: 4px; height: 70px; font-size: 0.6875rem; line-height: 1.1; text-align: center; }
  .f-count { margin-left: 0; width: 100%; }
  .grid { gap: 28px 12px; }
  .ccard__name { font-size: 1.375rem; }
  .ccard__notes { font-size: 0.875rem; }
  .ccard__foot { flex-direction: column; align-items: stretch; }
  .ccard__add { justify-content: center; }
  .faq__a p { padding-right: 0; }
  .more__grid { grid-template-columns: 1fr 1fr; }
  .more__tile { min-height: 220px; padding: 16px; }
  .more__name { font-size: 1.375rem; }
}

[hidden] { display: none !important; }
