/* sdg-banner.css - SDG panel in the event banner (#1896).
   Every rule is scoped under .sdgb. Built for dark banners (white text on a
   translucent navy panel); .sdgb--light flips it for light hero cards.
   --sdgb-accent is the heading colour, set per site in sdg-site.php. */

.sdgb {
  --sdgb-accent: #f7a823;
  --sdgb-bg: rgba(6, 26, 48, .78);
  --sdgb-line: rgba(255, 255, 255, .16);
  --sdgb-text: #ffffff;
  --sdgb-row: rgba(255, 255, 255, .06);
  --sdgb-icon: 48px;
  box-sizing: border-box;
  max-width: 100%;
  margin: 18px 0;
  padding: 12px 12px 12px !important;
  background: var(--sdgb-bg);
  border: 1px solid var(--sdgb-line);
  border-radius: 12px;
  color: var(--sdgb-text);
  text-align: left;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
.sdgb *, .sdgb *::before, .sdgb *::after { box-sizing: border-box; }

.sdgb .sdgb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}
.sdgb .sdgb-wheel {
  flex: 0 0 auto;
  width: 32px !important;
  height: 32px !important;
  max-width: none;
  margin: 0;
  padding: 2px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
}
.sdgb .sdgb-heading {
  display: block;
  margin: 0;
  color: var(--sdgb-accent);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.sdgb .sdgb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sdgb .sdgb-item {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sdgb .sdgb-icon {
  flex: 0 0 auto;
  display: block;
  width: var(--sdgb-icon) !important;
  height: var(--sdgb-icon) !important;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  object-fit: contain;      /* official tile: keep its colours and proportions */
}
.sdgb .sdgb-label {
  font-size: 14px;
  line-height: 1.3;
  color: var(--sdgb-text);
}
.sdgb .sdgb-label b { font-weight: 700; }

/* Strip: heading + a row of icons. The tiles carry their own number and
   title, so the text label is not repeated. */
.sdgb--strip { display: inline-block; }
.sdgb--strip .sdgb-label {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sdgb--strip.sdgb--center { display: block; width: fit-content; margin-left: auto; margin-right: auto; }
.sdgb--strip.sdgb--center .sdgb-head,
.sdgb--strip.sdgb--center .sdgb-list { justify-content: center; }

/* Panel: one row per SDG with its name, for a column beside the title. */
.sdgb--panel .sdgb-list { flex-direction: column; flex-wrap: nowrap; gap: 6px; }
.sdgb--panel .sdgb-item {
  padding: 4px 8px 4px 4px;
  background: var(--sdgb-row);
  border: 1px solid var(--sdgb-line);
  border-radius: 8px;
}

/* Light hero card (e.g. a white box on the banner). */
.sdgb--light {
  --sdgb-bg: rgba(255, 255, 255, .92);
  --sdgb-line: rgba(0, 0, 0, .1);
  --sdgb-text: #1d2433;
  --sdgb-row: rgba(0, 0, 0, .03);
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}
.sdgb.sdgb--light .sdgb-wheel { box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }

/* Tablet */
@media (max-width: 991px) {
  .sdgb { --sdgb-icon: 44px; margin: 16px 0; }
  .sdgb .sdgb-heading { font-size: 15px; }
}

/* Phone: every layout becomes the compact strip; icons wrap, never scroll. */
@media (max-width: 575px) {
  .sdgb { --sdgb-icon: 44px; display: block; width: 100%; padding: 12px !important; }
  .sdgb .sdgb-wheel { width: 28px !important; height: 28px !important; }
  .sdgb .sdgb-heading { font-size: 15px; }
  .sdgb--panel .sdgb-list { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .sdgb--panel .sdgb-item { padding: 0; background: none; border: 0; }
  .sdgb--panel .sdgb-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}

/* Solid panel - for busy banner photos where the translucent panel is hard
   to read (opt in per site: 'class' => 'sdgb--solid' in sdg-site.php). */
.sdgb.sdgb--solid {
  --sdgb-bg: rgba(5, 20, 38, .96);
  --sdgb-row: rgba(255, 255, 255, .09);
  --sdgb-line: rgba(255, 255, 255, .22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
}

/* Design 2: the SDG wheel with the organisation's statement. */
.sdgb--wheel {
  display: flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
  max-width: 100%;
}
.sdgb--wheel .sdgb-wheel-lg {
  flex: 0 0 auto;
  display: block;
  width: 130px !important;
  height: 130px !important;
  max-width: none;
  margin: 0;
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
}
/* the ring turns, the centre logo stays upright on top of it */
.sdgb--wheel .sdgb-wheel-ring,
.sdgb--wheel .sdgb-wheel-center {
  position: absolute;
  top: 4px; left: 4px;
  width: calc(100% - 8px) !important;
  height: calc(100% - 8px) !important;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
}
.sdgb--wheel .sdgb-wheel-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sdgb--wheel .sdgb-statement {
  display: block;
  margin: 0;
  color: var(--sdgb-accent);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}
.sdgb--wheel .sdgb-caption {
  display: block;
  color: var(--sdgb-text);
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .85;
}
@media (max-width: 991px) {
  .sdgb--wheel .sdgb-wheel-lg { width: 120px !important; height: 120px !important; }
  .sdgb--wheel .sdgb-statement { font-size: 18px; }
}
@media (max-width: 575px) {
  .sdgb--wheel { width: 100%; gap: 12px; }
  .sdgb--wheel .sdgb-wheel-lg { width: 96px !important; height: 96px !important; }
  .sdgb--wheel .sdgb-statement { font-size: 16px; }
  .sdgb--wheel .sdgb-caption { font-size: 11px; }
}

/* Design 2 in a narrow column beside the details: wheel above the statement
   ('layout' => 'stack'); a compact row again on tablet/phone. */
@media (min-width: 992px) {
  .sdgb--wheel.sdgb--stack {
    flex-direction: column;
    width: 100%;
    padding: 18px 16px !important;
    text-align: center;
  }
  .sdgb--wheel.sdgb--stack .sdgb-wheel-lg { width: 180px !important; height: 180px !important; }
  .sdgb--wheel.sdgb--stack .sdgb-wheel-text { align-items: center; order: -1; }   /* heading above the circle */
}

/* Design 2: the wheel turns slowly (as on the icrtmdr.com reference). The
   statement stays still; no motion for visitors who ask for less. */
@keyframes sdgb-spin { to { transform: rotate(360deg); } }
.sdgb--wheel .sdgb-wheel-ring { animation: sdgb-spin 20s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .sdgb--wheel .sdgb-wheel-ring { animation: none; }
}

/* Design 2 with conference data: the event's SDG icons on a circle round
   the logo. The orbit turns; each icon turns back at the same speed, so it
   stays upright. Positions and size are printed per icon by sdg-view.php. */
.sdgb--wheel .sdgb-orbit {
  position: absolute;
  inset: 0;
  animation: sdgb-spin 30s linear infinite;
}
.sdgb--wheel .sdgb-orbit-icon {
  position: absolute;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  object-fit: contain;
  transform: translate(-50%, -50%);
  animation: sdgb-spin-back 30s linear infinite;
}
@keyframes sdgb-spin-back {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(-360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .sdgb--wheel .sdgb-orbit,
  .sdgb--wheel .sdgb-orbit-icon { animation: none; }
}

/* Site brand stripe along the top edge ('brand' in sdg-site.php). */
.sdgb {
  border-top-width: 4px;
  border-top-color: var(--sdgb-brand, var(--sdgb-line));
}
