/* ==========================================================================
   Shared components — glass panels, cards, accordions, tables, code, badges
   ========================================================================== */

/* Hero ------------------------------------------------------------------- */

.hero {
  position: relative;
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 1rem + 3vw, 3.4rem);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 220px at 88% -10%, rgba(255, 255, 255, 0.8), transparent 70%),
    radial-gradient(320px 260px at 6% 120%, rgba(210, 217, 227, 0.6), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; }

/* Glass panel / section -------------------------------------------------- */

.panel {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem 1.6rem;
  margin: 1.4rem 0;
}
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

/* Cards grid ------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 1.1rem;
  margin: 1.6rem 0;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.3rem 1.35rem;
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
a.card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.95);
}
.card__icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(150deg, #ffffff, #dfe4ec);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  font-size: 1.25rem;
  margin-bottom: 0.3rem;
}
.card__title { font-weight: 700; color: var(--ink-900); font-size: 1.06rem; }
.card__desc { font-size: 0.9rem; color: var(--ink-500); margin: 0; }
.card__more {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--accent-strong);
}
a.card:hover .card__more { color: var(--accent); }

/* Feature list ----------------------------------------------------------- */

.feature-list { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: 0.9rem; }
.feature-list > li {
  padding: 1.05rem 1.2rem;
  background: var(--glass-faint);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  margin: 0;
}
.feature-list > li strong { display: block; margin-bottom: 0.2rem; color: var(--ink-900); }

/* Accordion (native details) -------------------------------------------- */

.accordion { margin: 1.2rem 0; display: grid; gap: 0.6rem; }

details.acc {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
details.acc > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 1.1rem;
  font-weight: 600;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.15s ease;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.2s ease;
}
details.acc[open] > summary::after { content: "–"; }
details.acc > summary:hover { background: var(--glass-strong); }
details.acc[open] > summary { border-bottom: 1px solid var(--hairline); }
.acc__body { padding: 0.6rem 1.1rem 1.1rem; }
.acc__body > :first-child { margin-top: 0; }
.acc__body > :last-child { margin-bottom: 0; }

summary code { font-size: 0.9em; }

/* Code ------------------------------------------------------------------- */

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(120, 133, 154, 0.14);
  color: var(--accent-strong);
  padding: 0.12em 0.42em;
  border-radius: 6px;
}
pre {
  margin: 1rem 0;
  padding: 1.1rem 1.2rem;
  background: #1c2431;
  color: #e7ecf3;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.55;
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}
.code-label {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-400);
  margin: 0.6rem 0 -0.4rem;
}

/* Tables ----------------------------------------------------------------- */

.table-wrap { overflow-x: auto; margin: 1.2rem 0; border-radius: var(--radius-sm); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
thead th {
  text-align: left;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-900);
  font-weight: 650;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
tbody td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--hairline); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, 0.45); }

/* Badges & chips --------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--hairline);
  color: var(--ink-700);
}
.badge--accent { color: var(--accent-strong); background: var(--accent-soft); border-color: transparent; }
.badge--ok { color: #1f7a54; background: rgba(31, 122, 84, 0.10); border-color: transparent; }
.badge--warn { color: #9a6b16; background: rgba(154, 107, 22, 0.12); border-color: transparent; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0; }
.chip {
  font-size: 0.82rem;
  font-family: var(--mono);
  padding: 0.28rem 0.62rem;
  border-radius: 8px;
  background: var(--glass-strong);
  border: 1px solid var(--hairline);
  color: var(--ink-700);
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.95rem;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  color: var(--ink-900);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--primary { background: linear-gradient(150deg, var(--accent), var(--accent-strong)); color: #fff; border-color: transparent; }
.btn--primary:hover { color: #fff; }
.btn--sponsor { background: linear-gradient(150deg, #e35d8b, var(--sponsor)); color: #fff; border-color: transparent; }
.btn--sponsor:hover { color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.4rem 0 0.4rem; }

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

.callout {
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin: 1.3rem 0;
  border: 1px solid var(--hairline);
  background: var(--glass-faint);
  display: flex;
  gap: 0.8rem;
}
.callout__icon { font-size: 1.15rem; line-height: 1.5; }
.callout__body > :first-child { margin-top: 0; }
.callout__body > :last-child { margin-bottom: 0; }
.callout--warn { background: rgba(214, 158, 46, 0.10); border-color: rgba(214, 158, 46, 0.35); }
.callout--info { background: var(--accent-soft); border-color: rgba(91, 113, 137, 0.28); }
.callout--danger { background: rgba(214, 51, 108, 0.08); border-color: rgba(214, 51, 108, 0.30); }

/* Section heading anchor spacing ---------------------------------------- */
.section { margin-top: 2.2rem; }
.section:first-of-type { margin-top: 0; }

/* Definition rows -------------------------------------------------------- */
.deflist { display: grid; gap: 0.6rem; margin: 1rem 0; }
.deflist__row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--hairline);
}
.deflist__row:last-child { border-bottom: none; }
.deflist__term { font-weight: 650; color: var(--ink-900); }
@media (max-width: 620px) {
  .deflist__row { grid-template-columns: 1fr; gap: 0.2rem; }
}
