/* Global, early-loaded GitHub-inspired overrides for all Forgejo themes. */
:root {
  --arron-page: #f6f8fa;
  --arron-surface: #ffffff;
  --arron-border: #d1d9e0;
  --arron-text: #1f2328;
  --arron-muted: #59636e;
  --arron-green: #1f883d;
  --arron-green-hover: #1a7f37;
  --arron-link: #0969da;
  --arron-link-hover: #0550ae;
}

/* The default Forgejo/Gitea system themes follow the OS color preference. */
@media (prefers-color-scheme: dark) {
  html[data-theme="forgejo-auto"],
  html[data-theme="gitea-auto"],
  html[data-theme="arron"] {
    color-scheme: dark;
    --arron-page: #0d1117;
    --arron-surface: #161b22;
    --arron-border: #30363d;
    --arron-text: #e6edf3;
    --arron-muted: #8b949e;
    --arron-green: #3fb950;
    --arron-green-hover: #56d364;
    --arron-link: #58a6ff;
    --arron-link-hover: #79c0ff;
  }
}

html[data-theme="forgejo-dark"],
html[data-theme="gitea-dark"] {
  color-scheme: dark;
  --arron-page: #0d1117;
  --arron-surface: #161b22;
  --arron-border: #30363d;
  --arron-text: #e6edf3;
  --arron-muted: #8b949e;
  --arron-green: #3fb950;
  --arron-green-hover: #56d364;
  --arron-link: #58a6ff;
  --arron-link-hover: #79c0ff;
}

.ui.segment,
.ui.attached.segment,
.repository .diff-detail-box,
.repository .file-header {
  border-color: var(--arron-border);
  border-radius: 8px;
  box-shadow: none;
}

.ui.button {
  border-radius: 6px;
  box-shadow: none;
  font-weight: 600;
}

/* Keep primary actions green regardless of the selected built-in theme. */
.ui.primary.button,
.ui.primary.buttons .button {
  background: #1f883d;
  border-color: #1f883d;
  color: #ffffff;
}

.ui.primary.button:hover,
.ui.primary.button:focus,
.ui.primary.buttons .button:hover,
.ui.primary.buttons .button:focus {
  background: #1a7f37;
  border-color: #1a7f37;
  color: #ffffff;
}

.ui.primary.button:active,
.ui.primary.buttons .button:active {
  background: #116329;
  border-color: #116329;
  color: #ffffff;
}

a,
.repository .header a,
.issue.list .title a {
  color: var(--arron-link);
}

a:hover,
.repository .header a:hover,
.issue.list .title a:hover {
  color: var(--arron-link-hover);
}

.page-content.arron-home {
  min-height: calc(100vh - 8rem);
  background: var(--arron-page);
  color: var(--arron-text);
}

.arron-landing {
  width: min(calc(100% - 2rem), 1080px);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6.5rem) 0 3rem;
}

/* Remove Forgejo's default top spacing before the first homepage content block. */
.page-content.arron-home > .arron-landing {
  margin-top: 0 !important;
}

/* Remove the bottom padding Forgejo adds to the full-height page wrapper. */
.full.height {
  padding-bottom: 0 !important;
}

.arron-hero {
  padding: clamp(2rem, 6vw, 4.5rem);
  overflow: hidden;
  border: 1px solid var(--arron-border);
  border-radius: 14px;
  background: var(--arron-surface);
  box-shadow: 0 10px 30px rgb(31 35 40 / 5%);
}

.arron-kicker,
.arron-card-mark {
  color: var(--arron-green);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.arron-hero h1 {
  margin: 0.8rem 0 0.6rem;
  color: var(--arron-text);
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.arron-lead {
  max-width: 720px;
  margin: 0;
  color: var(--arron-text);
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  line-height: 1.5;
}

.arron-description {
  max-width: 650px;
  margin: 1rem 0 0;
  color: var(--arron-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.arron-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.arron-actions .ui.button {
  margin: 0;
  padding: 0.8rem 1rem;
}

.arron-projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.arron-project-card {
  min-height: 185px;
  padding: 1.5rem;
  border: 1px solid var(--arron-border);
  border-radius: 10px;
  background: var(--arron-surface);
}

.arron-project-card h2 {
  margin: 0.8rem 0 0.5rem;
  color: var(--arron-text);
  font-size: 1.1rem;
}

.arron-project-card p,
.arron-home-note {
  color: var(--arron-muted);
  line-height: 1.65;
}

.arron-project-card p {
  margin-bottom: 0;
}

.arron-home-note {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.arron-footer {
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--arron-border);
  color: var(--arron-muted);
  text-align: center;
  font-size: 0.88rem;
}

/* Hide the global site footer (Forgejo's bottom-of-page footer block). */
.page-footer {
  display: none !important;
}

/* Hide the Default theme heading and its attached theme-selection panel on appearance settings. */
.page-content.user.settings .setting-content .ui.top.attached.header:has(+ .ui.attached.segment form[action$="/user/settings/appearance/theme"]) {
  display: none !important;
}

.page-content.user.settings .setting-content .ui.attached.segment:has(form[action$="/user/settings/appearance/theme"]) {
  display: none !important;
}

/* Hide the Forgejo documentation link on the sign-in page and personal homepage. */
body:has(.page-content.user.signin, .page-content.home.arron-home) #navbar a[href="https://forgejo.org/docs/latest/"] {
  display: none !important;
}

/* Hide Explore on the sign-in page and personal homepage. */
body:has(.page-content.user.signin, .page-content.home.arron-home) #navbar a[href="/explore/repos"] {
  display: none !important;
}

@media (max-width: 700px) {
  .arron-projects {
    grid-template-columns: 1fr;
  }

  .arron-project-card {
    min-height: 0;
  }
}
