/*
BBQToolbox components.css
Reusable visual components used across templates:
buttons, breadcrumbs, cards, category/home listings, tables, related cards.
*/

.button-primary {
  justify-self: start;
  cursor: pointer;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 800;
}

.button-primary:hover {
  background: var(--accent-dark);
}

.breadcrumbs {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: 0.35rem;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-item {
  margin: 0;
  min-width: 0;
}

.card,
.content-card {
  display: block;
  height: 100%;
  padding: 1rem;
  color: var(--text);
  text-decoration: none;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.card:hover,
.card:focus,
.content-card:hover,
.content-card:focus-within {
  border-color: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(48, 29, 13, 0.12);
}

.content-card-title,
.content-card-title a {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.2;
  text-decoration: none;
}

.content-card-description {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.content-card .overlay,
.content-card a.overlay,
.content-card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.content-card .overlay::after,
.content-card a.overlay::after,
.content-card-overlay {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.content-card * {
  position: relative;
  z-index: 2;
}

.content-card a,
.content-card a:link,
.content-card a:visited,
.content-card a:hover,
.content-card a:focus,
.content-card a:active,
.content-card-title,
.content-card-description,
.topic-tag,
.content-card-link,
.content-card-link:link,
.content-card-link:visited,
.content-card-link:hover,
.content-card-link:focus,
.content-card-link:active,
.content-card-link * {
  color: inherit;
  text-decoration: none;
}

.topic-list,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.topic-tag,
.tag-list li {
  border-radius: 999px;
  background: var(--surface-warm);
  color: var(--accent-dark);
  padding: 0.22rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.table-wrap,
.chart-table-wrap {
  margin-block: 1rem 1.25rem;
  overflow-x: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

.table-wrap table,
.chart-table-wrap table,
.utility-table,
.reference-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.table-wrap caption,
.chart-table-wrap caption,
.utility-table caption,
.reference-table caption {
  padding: 0.9rem 1rem;
  color: var(--muted);
  text-align: left;
  font-weight: 650;
  caption-side: top;
}

.table-wrap th,
.table-wrap td,
.chart-table-wrap th,
.chart-table-wrap td,
.utility-table th,
.utility-table td,
.reference-table th,
.reference-table td {
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.table-wrap thead th,
.chart-table-wrap thead th,
.utility-table thead th,
.reference-table thead th {
  background: var(--surface-warm);
  color: var(--accent-dark);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-wrap tr:last-child td,
.chart-table-wrap tr:last-child td,
.utility-table tr:last-child td,
.reference-table tr:last-child td,
.reference-table tr:last-child th[scope="row"] {
  border-bottom: 0;
}

.table-wrap td:first-child,
.chart-table-wrap td:first-child,
.utility-table td:first-child,
.reference-table th[scope="row"] {
  width: 22%;
  color: var(--accent-dark);
  font-weight: 800;
}

.table-wrap td:nth-child(2),
.chart-table-wrap td:nth-child(2),
.utility-table td:nth-child(2),
.reference-table td:nth-child(2) {
  width: 22%;
  color: var(--accent-dark);
  font-weight: 800;
}

.table-wrap td:nth-child(3),
.chart-table-wrap td:nth-child(3),
.utility-table td:nth-child(3),
.reference-table td:nth-child(3) {
  width: 28%;
}

.related-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-list li {
  border: 1px solid rgba(116, 72, 44, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.62);
  padding: 0.8rem 0.9rem;
}

.related-list a {
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}

.related-list a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.related-list p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.related-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.related-card {
  display: block;
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(116, 72, 44, 0.18);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.related-card:hover,
.related-card:focus {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(42, 24, 14, 0.08);
}

.related-card-title,
.related-card-description {
  display: block;
  text-decoration: none;
}

.related-card-title {
  font-weight: 700;
}

.related-card-description {
  margin-top: 0.25rem;
  color: var(--muted);
  line-height: 1.45;
}

.related-pages .related-card-list {
  margin: 0;
  padding: 0;
}

.related-pages .related-card-list li {
  margin: 0;
}

.related-card,
.related-card:link,
.related-card:visited,
.related-card:hover,
.related-card:focus,
.related-card:active,
.related-card * {
  text-decoration: none;
}

.topic-page,
.page {
  max-width: 860px;
  margin-inline: auto;
}

.topic-links ul {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-links a {
  display: block;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.topic-links a:hover,
.topic-links a:focus {
  background: var(--surface-warm);
}

@media (max-width: 600px) {
  .breadcrumbs {
    font-size: 0.84rem;
  }

  .card,
  .content-card,
  .table-wrap,
  .chart-table-wrap {
    border-radius: 12px;
  }
}

/* ------------------------------------------------------------------ */
/* Content Images                                                     */
/* ------------------------------------------------------------------ */

.content-image {
    margin: 1.5rem 0;
}

.content-image img {
    display: block;
    width: 100%;
    max-width: 900px;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
}

.content-image figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-muted);
}

/* ------------------------------------------------------------------ */
/* Content Blocks                                                     */
/* ------------------------------------------------------------------ */

.content-block {
    margin: 1.5rem 0;
}

/* ------------------------------------------------------------------ */
/* Callouts                                                           */
/* ------------------------------------------------------------------ */

.callout {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.callout-body {
    margin: 0;
    line-height: 1.55;
}

.callout-body strong {
    color: var(--accent-dark);
}

/* Tip */

.callout-tip {
    background: #fff8dc;
    border-left-color: #d6a800;
}

/* Note */

.callout-note {
    background: #f5f7fa;
    border-left-color: #8aa1b5;
}

/* Warning */

.callout-warning {
    background: #fff1f1;
    border-left-color: #c0392b;
}

/* Safety */

.callout-safety {
    background: #eef8ff;
    border-left-color: #2c6fb7;
}

@media (min-width: 680px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 920px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .table-wrap,
  .chart-table-wrap {
    margin-inline: -0.35rem;
    border-radius: 12px;
  }

  .table-wrap table,
  .chart-table-wrap table,
  .reference-table,
  .utility-table {
    min-width: 720px;
  }

  .table-wrap caption,
  .chart-table-wrap caption {
    padding: 0.8rem 0.85rem;
  }

  .table-wrap th,
  .table-wrap td,
  .chart-table-wrap th,
  .chart-table-wrap td,
  .reference-table th,
  .reference-table td,
  .utility-table th,
  .utility-table td {
    padding: 0.75rem 0.8rem;
    font-size: 0.92rem;
  }
}

@media print {
  .table-wrap,
  .chart-table-wrap {
    box-shadow: none;
  }
}
