/* ==========================================================
   Card Grid — single source of truth for card sections
   All values below are defaults; the module's Style tab
   overrides them per section through --sncg-* variables.
   ========================================================== */

.sncg {
  /* preset defaults (outline) */
  --sncg-bg: transparent;
  --sncg-border: #000;
  --sncg-title: #000;
  --sncg-text: #111;
  --sncg-accent: #974fc7;
  --sncg-divider: #6f3fa0;
  --sncg-hover-bg: #fff9ed;
  --sncg-hover-border: #fdb913;
  --sncg-below-gap: 24px;
  width: 100%;
}

/* ---------- Intro ---------- */
.sncg__intro { margin: 0 0 48px; }
.sncg--align-center .sncg__intro { text-align: center; }
.sncg__heading { margin: 0; }
.sncg__lead { margin-top: 16px; font-size: 18px; line-height: 1.55; color: #555; }
.sncg__lead > :last-child { margin-bottom: 0; }

/* ---------- Grid ---------- */
.sncg__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sncg-gap, 40px);
}
.sncg--cols-1 .sncg__grid { grid-template-columns: minmax(0, 1fr); }
.sncg--cols-2 .sncg__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sncg--cols-3 .sncg__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sncg--cols-4 .sncg__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.sncg__item { display: flex; min-width: 0; }
.sncg__item--full { grid-column: 1 / -1; }

/* Text-below-card layout: cards stay equal height per row (subgrid) */
.sncg--has-below .sncg__grid {
  row-gap: 0;
  margin-bottom: calc(var(--sncg-gap, 40px) * -1);
}
.sncg--has-below .sncg__item {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
  row-gap: var(--sncg-below-gap);
  padding-bottom: var(--sncg-gap, 40px);
}
@supports not (grid-template-rows: subgrid) {
  .sncg--has-below .sncg__item { display: flex; flex-direction: column; gap: var(--sncg-below-gap); }
}

/* ---------- Card ---------- */
.sncg-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--sncg-min-h, 0);
  padding: var(--sncg-pad, 26px);
  border: 1px solid var(--sncg-border);
  border-radius: var(--sncg-radius, 10px);
  background: var(--sncg-bg);
  color: var(--sncg-text);
  text-decoration: none;
  transition: background-color .25s ease, border-color .25s ease;
}
a.sncg-card, a.sncg-card:hover, a.sncg-card:focus { color: var(--sncg-text); text-decoration: none; }
a.sncg-card:focus-visible { outline: 2px solid var(--sncg-accent); outline-offset: 3px; }

.sncg-card__title {
  margin: 0;
  font-family: "Funnel Display", sans-serif;
  font-size: var(--sncg-title-size, 21px);
  line-height: 1.29;
  font-weight: 500;
  color: var(--sncg-title);
}
.sncg--upper .sncg-card__title { text-transform: uppercase; letter-spacing: .01em; }

.sncg-card__body { margin-top: 24px; font-size: var(--sncg-text-size, 17px); line-height: 1.6; color: var(--sncg-text); }
.sncg-card__body p { margin: 0 0 12px; }
.sncg-card__body > :last-child { margin-bottom: 0; }
.sncg-card__body strong { color: var(--sncg-accent); }

.sncg-card__list { list-style: none; margin: 20px 0 0; padding: 0; }
.sncg-card__list li {
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--sncg-divider);
  font-size: var(--sncg-text-size, 17px);
  line-height: 1.45;
  color: var(--sncg-text);
}
.sncg-card__list li:last-child { border-bottom: 0; padding-bottom: 0; }

/* Footer pinned to the bottom → links/logos align across cards */
.sncg-card__foot {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.sncg-card__logo { display: block; max-height: 32px; width: auto; height: auto; }
.sncg-card__logo + .sncg-card__link { margin-left: auto; }
.sncg-card__link { font-size: var(--sncg-text-size, 17px); font-weight: 600; color: var(--sncg-accent); text-decoration: none; }
a.sncg-card__link:hover { color: var(--sncg-accent); text-decoration: underline; }

/* Hover highlight: only cards using the section preset.
   Cards with their own preset (e.g. dark, muted, note) keep their colors. */
.sncg--hover .sncg-card.is-base:hover { background: var(--sncg-hover-bg); border-color: var(--sncg-hover-border); }

/* ---------- Presets ---------- */
.sncg-card--outline  { --sncg-bg: #fff; }
.sncg-card--lavender { --sncg-bg: #d9bbea; --sncg-border: #a865d3; }
.sncg-card--dark     { --sncg-bg: #250e36; --sncg-border: #250e36; --sncg-title: #fff; --sncg-text: #fff; --sncg-accent: #fdb913; }
.sncg-card--note     { --sncg-bg: #fff8ec; --sncg-border: #fdb913; }
.sncg-card--muted    { --sncg-bg: rgba(172, 113, 210, .05); --sncg-border: rgba(172, 113, 210, .2); --sncg-title: #6f3fa0; --sncg-text: #6f3fa0; --sncg-divider: #6f3fa0; }

/* ---------- Style-tab color overrides ----------
   Apply only to cards using the section preset (.is-base);
   cards with their own preset keep it. Empty fields fall back. */
.sncg-card.is-base {
  background: var(--sncg-c-bg, var(--sncg-bg));
  border-color: var(--sncg-c-border, var(--sncg-border));
  color: var(--sncg-c-text, var(--sncg-text));
}
.is-base .sncg-card__title { color: var(--sncg-c-title, var(--sncg-title)); }
.is-base .sncg-card__body,
.is-base .sncg-card__list li { color: var(--sncg-c-text, var(--sncg-text)); }
.is-base .sncg-card__list li { border-color: var(--sncg-c-divider, var(--sncg-divider)); }
.is-base .sncg-card__body strong,
.is-base .sncg-card__link,
.is-base a.sncg-card__link:hover { color: var(--sncg-c-accent, var(--sncg-accent)); }
.sncg--hover .sncg-card.is-base:hover {
  background: var(--sncg-c-hover-bg, var(--sncg-hover-bg));
  border-color: var(--sncg-c-hover-border, var(--sncg-hover-border));
}

/* ---------- Guard against page-level list rules ----------
   Some pages style every list with an ID selector (e.g. #main-content ul > li),
   which outranks module classes. Keep the module's own list spacing. */
.sncg .sncg-card__list { padding-left: 0 !important; list-style: none !important; }
.sncg .sncg-card__list > li { padding-left: 0 !important; }
.sncg .sncg__below ul { padding-left: 18px !important; }
.sncg .sncg__below ul > li { padding-left: 0 !important; }

/* ---------- Text below card ---------- */
.sncg__below { font-size: var(--sncg-text-size, 17px); line-height: 1.6; color: #111; }
.sncg__below p { margin: 0 0 16px; }
.sncg__below > :last-child { margin-bottom: 0; }
.sncg__below ul { margin: 16px 0 0; padding-left: 18px; }
.sncg__below li { margin-bottom: 8px; }
.sncg__below li::marker { color: #fdb913; }

/* ---------- CTA ---------- */
.sncg__cta { margin-top: 48px; text-align: center; }
.sncg--align-left .sncg__cta { text-align: left; }
.sncg .sncg__cta--center { text-align: center; }
.sncg .sncg__cta--left { text-align: left; }

.sncg__cta-button {
  display: inline-block;
  padding: 11.5px 16.4px;
  border: 2px solid var(--sncg-btn-bg, #fdb913);
  border-radius: var(--sncg-btn-radius, 10px);
  background: var(--sncg-btn-bg, #fdb913);
  color: var(--sncg-btn-text, #250e36);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 25px;
  text-decoration: none;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease, transform .3s ease;
}
.sncg__cta-button:hover,
.sncg__cta-button:focus { color: var(--sncg-btn-text, #250e36); text-decoration: none; }
.sncg__cta-button:hover { transform: scale(1.07); }
@media (prefers-reduced-motion: reduce) {
  .sncg__cta-button:hover { transform: none; }
}

/* Size: medium = 52px tall (site .btn--medium), large = 60px */
.sncg__cta-button--large { padding: 14.5px 24px; font-size: 18px; line-height: 27px; }

/* Hover: outline (site default) */
.sncg__cta-button--outline:hover,
.sncg__cta-button--outline:focus { background: transparent; border-color: var(--sncg-btn-bg, #fdb913); }

/* Hover: darker fill */
.sncg__cta-button--fill:hover,
.sncg__cta-button--fill:focus { background: var(--sncg-btn-hover, #e8a70b); border-color: var(--sncg-btn-hover, #e8a70b); }

.sncg__cta-button:focus-visible { outline: 2px solid var(--sncg-btn-bg, #fdb913); outline-offset: 3px; }

.sncg__cta-link { font-size: 17px; font-weight: 600; color: var(--sncg-link, #974fc7); text-decoration: none; }
.sncg__cta-link:hover { color: var(--sncg-link, #974fc7); text-decoration: underline; }

.sncg__cta-arrow { display: inline-block; margin-left: 2px; transition: transform .2s ease; }
.sncg__cta a:hover .sncg__cta-arrow { transform: translateX(3px); }

/* ---------- Responsive (site breakpoints) ---------- */

/* Large devices: 992px – 1199.98px — 4-up grids get tight, drop to 2 */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .sncg--cols-4 .sncg__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Medium devices (tablets): 768px – 991.98px — uses "Columns (tablet)" */
@media (min-width: 768px) and (max-width: 991.98px) {
  .sncg--tab-1 .sncg__grid { grid-template-columns: minmax(0, 1fr); }
  .sncg--tab-2 .sncg__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sncg__intro { margin-bottom: 40px; }
  .sncg-card { padding: min(var(--sncg-pad, 26px), 24px); }
}

/* Phones (portrait + landscape): 0 – 767.98px — always 1 column */
@media (max-width: 767.98px) {
  .sncg .sncg__grid { grid-template-columns: minmax(0, 1fr); }
  .sncg__intro { margin-bottom: 32px; }
  .sncg-card { padding: min(var(--sncg-pad, 26px), 20px); }
  .sncg__cta { margin-top: 32px; }
  .sncg__item--full { grid-column: auto; }
}

/* Extra small: < 576px */
@media (max-width: 575.98px) {
  .sncg-card__title { font-size: calc(var(--sncg-title-size, 21px) - 2px); }
  .sncg-card__body,
  .sncg__below,
  .sncg-card__list li { font-size: min(var(--sncg-text-size, 17px), 16px); }
}
