/* ── Open Source ─────────────────────────────────────────── */
.opensource-section {
  /* === Typography defaults — overridden per-instance by ACF === */
  --atg-section-title-size: clamp(48px, 6vw, 72px);
  --atg-project-eyebrow-size: 14px;
  --atg-project-eyebrow-color: var(--text-muted, #8b949e);
  --atg-project-title-size: clamp(24px, 2.5vw, 32px);
  --atg-project-title-color: var(--text-white, #ffffff);
  --atg-project-description-size: 16px;
  --atg-project-description-color: var(--text-muted, #8b949e);
  /* Section title gradient lives on .opensource__title below.
     A custom color is applied via inline <style> emitted by the render template. */

  position: relative;
  padding: 100px 0;
  text-align: left;
}

/* ── Section title (gradient single-tone) ───────────────── */
.opensource__title {
  max-width: 960px;
  margin: 0 0 80px;
  font-family: var(--font-heading, "Inter", system-ui, sans-serif);
  font-size: var(--atg-section-title-size);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #aae3e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ── Projects ───────────────────────────────────────────── */
.opensource__projects {
  display: flex;
  flex-direction: column;
}

.opensource__project {
  max-width: 720px;
}
.opensource__projects > .opensource__project + .opensource__project {
  margin-top: 80px;
}

/* ── Project: eyebrow / icon / title / description ──────── */
.opensource__project-eyebrow {
  display: block;
  margin-bottom: 24px;
  font-family: var(--font-body, "Inter", system-ui, sans-serif);
  font-size: var(--atg-project-eyebrow-size);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--atg-project-eyebrow-color);
}

.opensource__project-icon {
  display: block;
  max-height: 80px;
  width: auto;
  height: auto;
  margin-bottom: 36px;
}

.opensource__project-title {
  margin: 0 0 16px;
  font-family: var(--font-heading, "Inter", system-ui, sans-serif);
  font-size: var(--atg-project-title-size);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--atg-project-title-color);
}

/* ── Project rich content (WYSIWYG description) ─────────── */
.opensource__project-rich-content {
  margin-bottom: 36px;
  color: var(--atg-project-description-color);
  font-family: var(--font-body, "Inter", system-ui, sans-serif);
  font-size: var(--atg-project-description-size);
  line-height: 1.6;
}
.opensource__project-rich-content p { margin: 0 0 14px; }
.opensource__project-rich-content p:last-child { margin-bottom: 0; }

.opensource__project-rich-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.opensource__project-rich-content ul li {
  position: relative;
  padding-left: 22px;
}
.opensource__project-rich-content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary, #00c3d0);
}

.opensource__project-rich-content ol {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  counter-reset: opensource-ol;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.opensource__project-rich-content ol li {
  position: relative;
  padding-left: 28px;
  counter-increment: opensource-ol;
}
.opensource__project-rich-content ol li::before {
  content: counter(opensource-ol) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary, #00c3d0);
  font-weight: 600;
}

.opensource__project-rich-content strong,
.opensource__project-rich-content b {
  color: var(--text-white, #ffffff);
  font-weight: 700;
}
.opensource__project-rich-content em,
.opensource__project-rich-content i { font-style: italic; }

.opensource__project-rich-content a {
  color: var(--primary, #00c3d0);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 195, 208, 0.3);
  transition: border-color 0.2s ease;
}
.opensource__project-rich-content a:hover {
  border-bottom-color: rgba(0, 195, 208, 0.8);
}

.opensource__project-rich-content > *:last-child { margin-bottom: 0; }

/* ── URL link block (full width, centered text + cyan arrow) ─── */
.opensource__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 48px;
  padding: 18px 28px;
  background: rgba(15, 25, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: var(--text-light, #e2e8f0);
  font-family: var(--font-body, "Inter", system-ui, sans-serif);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.opensource__link:hover {
  border-color: rgba(0, 195, 208, 0.3);
  background: rgba(15, 25, 42, 0.7);
  color: var(--text-light, #e2e8f0);
}
.opensource__link-text {
  word-break: break-all;
  text-align: center;
}
.opensource__link-arrow {
  flex-shrink: 0;
  color: var(--primary, #00c3d0);
  transition: transform 0.2s ease;
}
.opensource__link:hover .opensource__link-arrow {
  transform: translate(2px, -2px);
}

/* ── Subscribers card (compact, content-width) ──────────── */
.opensource__subscribers {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: rgba(15, 25, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
}

.opensource__subscribers-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.opensource__subscribers-label {
  font-family: var(--font-body, "Inter", system-ui, sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted, #8b949e);
  line-height: 1.2;
}
.opensource__subscribers-count {
  font-family: var(--font-heading, "Inter", system-ui, sans-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-white, #ffffff);
  line-height: 1.2;
}

/* ── Avatar overlap stack ───────────────────────────────── */
.opensource__avatars {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.opensource__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  /* The border matches the section background (~rgba(8, 18, 35, ~0.95))
     so when avatars overlap via negative margin, the border creates a
     clean cutout-circle effect against the previous avatar. */
  border: 2px solid rgba(8, 18, 35, 0.95);
  flex-shrink: 0;
}
.opensource__avatar:not(:first-child) {
  margin-left: -12px;
}

/* ── Tablet (768px – 1024px) ────────────────────────────── */
@media (max-width: 1024px) {
  .opensource-section { padding: 80px 0; }
  .opensource__title { margin-bottom: 64px; }
  .opensource__projects > .opensource__project + .opensource__project {
    margin-top: 64px;
  }
}

/* ── Mobile (<768px) ────────────────────────────────────── */
@media (max-width: 767px) {
  .opensource-section { padding: 60px 0; }
  .opensource__title { margin-bottom: 48px; }
  .opensource__projects > .opensource__project + .opensource__project {
    margin-top: 56px;
  }
  .opensource__link { padding: 16px 20px; font-size: 14px; }
  /* Subscribers card already uses flex-wrap: wrap; on narrow widths it
     stacks the text + avatars rows naturally. */
}
