/*
 * CCDS Forgejo theme.
 * Main target: wikis, org landing pages and repository READMEs used as project hubs.
 */

:root {
  --ccds-ink: #172233;
  --ccds-ink-soft: #526277;
  --ccds-line: rgba(23, 34, 51, 0.1);
  --ccds-line-strong: rgba(47, 111, 206, 0.16);
  --ccds-surface: #ffffff;
  --ccds-surface-soft: rgba(255, 255, 255, 0.92);
  --ccds-surface-muted: #f6faf8;
  --ccds-primary: #44bf69;
  --ccds-primary-strong: #2f8f4d;
  --ccds-accent: #2f6fce;
  --ccds-accent-soft: rgba(47, 111, 206, 0.12);
  --ccds-shadow: 0 18px 42px rgba(25, 44, 76, 0.08);
  --ccds-radius-lg: 22px;
  --ccds-radius-md: 16px;
  --ccds-radius-sm: 12px;
}

body:has(.page-content.repository.wiki) {
  background:
    radial-gradient(circle at top left, rgba(68, 191, 105, 0.12), transparent 20rem),
    radial-gradient(circle at top right, rgba(47, 111, 206, 0.1), transparent 24rem),
    linear-gradient(180deg, #fbfdfb 0%, #eef6f2 100%);
}

.page-content.repository.wiki {
  color: var(--ccds-ink);
}

.page-content.repository.wiki > .ui.container {
  width: min(1240px, calc(100% - 32px)) !important;
  margin-top: 26px;
  margin-bottom: 60px;
}

.page-content.repository.wiki .repo-button-row {
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--ccds-line);
  border-radius: var(--ccds-radius-md);
  background: var(--ccds-surface-soft);
  box-shadow: 0 10px 24px rgba(18, 34, 61, 0.05);
  backdrop-filter: blur(14px);
}

.page-content.repository.wiki .repo-button-row .ui.button,
.page-content.repository.wiki .repo-button-row .ui.input > input {
  min-height: 40px;
  border-radius: 11px !important;
}

.page-content.repository.wiki .repo-button-row .ui.basic.button {
  border-color: rgba(47, 111, 206, 0.2);
  background: #f7fbff;
}

.page-content.repository.wiki .ui.dividing.header {
  position: relative;
  overflow: hidden;
  margin: 18px 0 22px;
  padding: 28px 30px !important;
  border: 1px solid var(--ccds-line-strong) !important;
  border-radius: var(--ccds-radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(245, 250, 247, 0.97));
  box-shadow: var(--ccds-shadow);
}

.page-content.repository.wiki .ui.dividing.header::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: linear-gradient(90deg, var(--ccds-primary), var(--ccds-accent));
}

.page-content.repository.wiki .ui.dividing.header::after {
  content: "WIKI CCDS";
  position: absolute;
  top: 22px;
  right: 26px;
  color: rgba(47, 111, 206, 0.12);
  font-size: clamp(1.4rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  pointer-events: none;
}

.page-content.repository.wiki .ui.dividing.header .column {
  position: relative;
  z-index: 1;
}

.page-content.repository.wiki .ui.dividing.header > .ui.grid > .column:first-child {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 850;
  letter-spacing: -0.025em;
}

.page-content.repository.wiki .ui.sub.header {
  margin-top: 8px;
  color: var(--ccds-ink-soft);
  font-size: 0.84rem;
  font-weight: 500;
}

.page-content.repository.wiki .ui.primary.button {
  border-color: var(--ccds-accent) !important;
  background: linear-gradient(135deg, #3e80dc, #2f6fce) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(47, 111, 206, 0.22) !important;
}

.page-content.repository.wiki .ui.primary.button:hover {
  background: linear-gradient(135deg, #4b8ae4, #3979d4) !important;
  transform: translateY(-1px);
}

.page-content.repository.wiki .wiki-content-parts {
  align-items: flex-start;
  gap: 22px;
}

.page-content.repository.wiki .wiki-content-main,
.page-content.repository.wiki .wiki-content-sidebar,
.page-content.repository.wiki .wiki-content-footer {
  border: 1px solid var(--ccds-line);
  border-radius: var(--ccds-radius-lg);
  background: var(--ccds-surface);
  box-shadow: var(--ccds-shadow);
}

.page-content.repository.wiki .wiki-content-main {
  min-width: 0;
  padding: clamp(24px, 4vw, 46px);
}

.page-content.repository.wiki .wiki-content-sidebar {
  position: sticky;
  top: 74px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 30px rgba(25, 44, 76, 0.08);
}

.page-content.repository.wiki .wiki-content-sidebar .markup {
  font-size: 0.95rem;
}

.page-content.repository.wiki .wiki-content-sidebar ul {
  margin: 0;
  padding-left: 1.05rem;
}

.page-content.repository.wiki .wiki-content-sidebar li + li {
  margin-top: 0.4rem;
}

.page-content.repository.wiki .wiki-content-footer {
  margin-top: 22px;
  padding: 18px 24px;
  color: var(--ccds-ink-soft);
  text-align: center;
}

.page-content.repository.wiki .markup h1,
.page-content.repository.wiki .markup h2,
.page-content.repository.wiki .markup h3,
.page-content.repository.wiki .markup h4 {
  color: var(--ccds-ink);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.page-content.repository.wiki .markup h1 {
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid rgba(68, 191, 105, 0.18);
  font-size: clamp(2rem, 5vw, 3rem);
}

.page-content.repository.wiki .markup h2 {
  position: relative;
  margin-top: 2.4rem;
  padding-left: 16px;
  border-bottom: 0;
  font-size: clamp(1.34rem, 3vw, 1.74rem);
}

.page-content.repository.wiki .markup h2::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--ccds-primary), var(--ccds-accent));
}

.page-content.repository.wiki .markup h3 {
  margin-top: 1.8rem;
  font-size: 1.16rem;
}

.page-content.repository.wiki .markup p,
.page-content.repository.wiki .markup li {
  color: #445164;
  font-size: 1rem;
  line-height: 1.8;
}

.page-content.repository.wiki .markup strong {
  color: var(--ccds-ink);
}

.page-content.repository.wiki .markup a {
  color: var(--ccds-primary);
  font-weight: 650;
  text-decoration-color: rgba(47, 111, 206, 0.28);
  text-underline-offset: 3px;
}

.page-content.repository.wiki .markup a:hover {
  color: var(--ccds-primary-strong);
  text-decoration-color: currentColor;
}

.page-content.repository.wiki .markup blockquote {
  margin: 1.5rem 0;
  padding: 18px 20px;
  border: 1px solid rgba(47, 111, 206, 0.14);
  border-left: 5px solid var(--ccds-primary);
  border-radius: 5px var(--ccds-radius-sm) var(--ccds-radius-sm) 5px;
  background: linear-gradient(115deg, #f7fbf8, #fefefe);
  color: #445164;
}

.page-content.repository.wiki .markup hr {
  border-color: rgba(68, 191, 105, 0.12);
}

.page-content.repository.wiki .markup ul li::marker,
.page-content.repository.wiki .markup ol li::marker {
  color: var(--ccds-primary);
}

.page-content.repository.wiki .markup table {
  display: table;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 206, 0.12) !important;
  border-radius: var(--ccds-radius-sm);
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: 0 10px 22px rgba(25, 44, 76, 0.05);
}

.page-content.repository.wiki .markup table th {
  border-color: rgba(47, 111, 206, 0.12) !important;
  background: #eef7f2 !important;
  color: #214d34;
  font-weight: 760;
}

.page-content.repository.wiki .markup table td {
  border-color: rgba(47, 111, 206, 0.08) !important;
  background: rgba(255, 255, 255, 0.78);
}

.page-content.repository.wiki .markup table tr:hover td {
  background: #f7fbf8;
}

.page-content.repository.wiki .markup code:not(pre code) {
  border: 1px solid rgba(47, 111, 206, 0.12);
  border-radius: 7px;
  background: #f1f7f3;
  color: #1f6d44;
}

.page-content.repository.wiki .markup pre {
  border: 1px solid rgba(12, 38, 68, 0.32);
  border-radius: 15px;
  background: #12213a;
  box-shadow: 0 12px 28px rgba(17, 29, 48, 0.16);
}

.page-content.repository.wiki .markup pre code {
  color: #f6fbff;
}

.page-content.repository.wiki .markup img {
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(25, 44, 76, 0.08);
}

.page-content.repository.wiki .wiki-pages-list {
  overflow: hidden;
  border: 1px solid var(--ccds-line) !important;
  border-radius: 18px !important;
  background: var(--ccds-surface) !important;
  box-shadow: var(--ccds-shadow) !important;
}

.page-content.repository.wiki .wiki-pages-list .item {
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

.page-content.repository.wiki .ui.label,
.page-content.repository.wiki .markup .ui.label {
  border-radius: 999px;
  background: var(--ccds-accent-soft);
  color: #245a96;
  font-weight: 700;
}

.ccds-home,
.ccds-roadmap,
.ccds-rgaa {
  display: grid;
  gap: 22px;
  margin: 1.25rem 0 0;
}

.ccds-hero,
.ccds-panel,
.ccds-roadmap-list,
.ccds-rgaa-grid {
  border: 1px solid rgba(68, 191, 105, 0.12);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(247, 252, 249, 0.97));
  box-shadow: 0 14px 30px rgba(25, 44, 76, 0.06);
}

.ccds-hero {
  padding: 28px;
}

.ccds-hero-kicker {
  margin-bottom: 10px;
  color: var(--ccds-accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ccds-hero h1,
.ccds-panel h2,
.ccds-roadmap-list h2,
.ccds-rgaa h2 {
  margin-top: 0;
}

.ccds-hero p {
  max-width: 72ch;
  margin-bottom: 0;
}

.ccds-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.ccds-card {
  padding: 22px;
  border: 1px solid rgba(68, 191, 105, 0.1);
  border-radius: 18px;
  background: #fff;
}

.ccds-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--ccds-ink);
}

.ccds-card p {
  margin-bottom: 0.9rem;
}

.ccds-card ul {
  margin: 0;
  padding-left: 1.15rem;
}

.ccds-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ccds-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef7f2;
  color: var(--ccds-accent);
  font-size: 0.84rem;
  font-weight: 700;
}

.ccds-badge.success {
  background: rgba(57, 185, 107, 0.14);
  color: #1f6d44;
}

.ccds-badge.warn {
  background: rgba(224, 155, 34, 0.14);
  color: #8b5a00;
}

.ccds-badge.muted {
  background: #eff3f7;
  color: #5b6b80;
}

.ccds-panel {
  padding: 24px;
}

.ccds-roadmap-list {
  padding: 14px;
}

.ccds-roadmap-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  padding: 16px;
  border-radius: 16px;
}

.ccds-roadmap-item + .ccds-roadmap-item {
  border-top: 1px solid rgba(21, 101, 192, 0.08);
}

.ccds-roadmap-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ccds-primary), var(--ccds-accent));
  color: #fff;
  font-weight: 800;
}

.ccds-roadmap-item h3 {
  margin: 0 0 8px;
}

.ccds-roadmap-item p {
  margin: 0 0 10px;
}

.ccds-rgaa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 18px;
}

.ccds-rgaa-card {
  padding: 20px;
  border: 1px solid rgba(68, 191, 105, 0.1);
  border-radius: 18px;
  background: #fff;
}

.ccds-rgaa-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.ccds-rgaa-card ul {
  margin-bottom: 0;
  padding-left: 1.15rem;
}

body:has(.page-content.organization) {
  background:
    radial-gradient(circle at top left, rgba(68, 191, 105, 0.1), transparent 20rem),
    linear-gradient(180deg, #fbfdfb 0%, #eef6f2 100%);
}

.page-content.organization .ui.container,
.page-content.repository .ui.container {
  width: min(1240px, calc(100% - 32px));
}

.page-content.organization .markdown:not(.wiki-content-main),
.page-content.repository:not(.wiki) .markup {
  color: var(--ccds-ink);
}

.page-content.organization .markdown h1,
.page-content.organization .markdown h2,
.page-content.repository:not(.wiki) .markup h1,
.page-content.repository:not(.wiki) .markup h2 {
  color: var(--ccds-ink);
}

@media (max-width: 960px) {
  .page-content.repository.wiki > .ui.container {
    width: calc(100% - 20px) !important;
    margin-top: 16px;
  }

  .page-content.repository.wiki .wiki-content-parts {
    gap: 16px;
  }

  .page-content.repository.wiki .wiki-content-sidebar {
    position: static;
  }

  .page-content.repository.wiki .ui.dividing.header {
    padding: 22px 20px !important;
  }

  .page-content.repository.wiki .ui.dividing.header::after {
    top: auto;
    right: 18px;
    bottom: 18px;
    font-size: 1.2rem;
  }

  .ccds-grid,
  .ccds-rgaa-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-content.repository.wiki .repo-button-row {
    padding: 12px;
  }

  .page-content.repository.wiki .wiki-content-main {
    padding: 20px 18px;
  }

  .page-content.repository.wiki .markup h1 {
    font-size: 1.8rem;
  }

  .page-content.repository.wiki .markup p,
  .page-content.repository.wiki .markup li {
    font-size: 0.96rem;
  }

  .ccds-hero,
  .ccds-panel,
  .ccds-rgaa-grid {
    padding: 18px;
  }

  .ccds-roadmap-item {
    grid-template-columns: 1fr;
  }
}
