/* Forward Global homepage, Gitea 28.1.0. Loaded by custom/header in every theme. */
:root {
  --fg-home-bg: #ffffff;
  --fg-home-text: #0e131e;
  --fg-home-muted: #414b60;
  --fg-home-line: #d9dde4;
  --fg-home-logo: url("../img/forward-wordmark-light.png");
}

:root[data-theme$="-dark"] {
  --fg-home-bg: #030610;
  --fg-home-text: #ffffff;
  --fg-home-muted: #bfc8d9;
  --fg-home-line: #30394a;
  --fg-home-logo: url("../img/forward-wordmark-dark.png");
}

@media (prefers-color-scheme: dark) {
  :root[data-theme$="-auto"] {
    --fg-home-bg: #030610;
    --fg-home-text: #ffffff;
    --fg-home-muted: #bfc8d9;
    --fg-home-line: #30394a;
    --fg-home-logo: url("../img/forward-wordmark-dark.png");
  }
}

/* Let the homepage reach the bottom without Gitea's default content padding. */
.full.height:has(> .forward-home) { padding-bottom: 0; }
body:has(.forward-home) { background: var(--fg-home-bg); }

#navbar { min-height: 64px; }

#navbar #navbar-logo img {
  content: var(--forward-wordmark, var(--fg-home-logo));
  width: 140px;
  height: 44px;
  object-fit: contain;
}

/* Gitea initializes this native dropdown upward; place its menu below the nav. */
#navbar #footer-theme-selector > .menu,
#navbar .fg-language-selector > .menu {
  top: 100% !important;
  bottom: auto !important;
  margin-top: 4px !important;
  margin-bottom: 0 !important;
  transform-origin: top center !important;
  max-width: calc(100vw - 32px);
  max-height: min(60vh, 440px);
  overflow-y: auto;
}

#navbar #footer-theme-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  padding-inline: 12px;
}

/* Keep the native selected value for Gitea; only its compact trigger is hidden.
   Theme names inside the open menu remain visible and usable. */
#navbar #footer-theme-selector > .default-text,
#navbar #footer-theme-selector > .text {
  display: none !important;
}

#navbar #footer-theme-selector > .fg-theme-icon {
  display: block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
}

.forward-home {
  background: var(--fg-home-bg);
  color: var(--fg-home-text);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  padding: 0;
  margin: 0;
}

.forward-home .fg-container {
  width: min(1116px, calc(100% - 80px));
  margin-inline: auto;
}

.forward-home .fg-alerts:not(:has(.message)) { display: none; }
.forward-home .fg-alerts { padding-block: 16px; }
.page-content.forward-home > :first-child { margin-top: 0; }

.forward-home .fg-hero {
  position: relative;
  isolation: isolate;
  background: #537d92;
}

.forward-home .fg-hero-image {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.forward-home .fg-hero-inner {
  min-height: clamp(560px, 47.4vw, 730px);
  padding-block: 100px clamp(64px, 8.6vw, 124px);
  display: flex;
  align-items: flex-end;
}

.forward-home .fg-hero-panel {
  width: min(100%, 772px);
  padding: 48px;
  background: #030610;
  color: #ffffff;
}

.forward-home h1 {
  margin: 0 0 24px;
  font-family: inherit;
  font-size: clamp(38px, 4vw, 60px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: #ffffff;
  text-wrap: balance;
}

.forward-home .fg-hero-panel p {
  margin: 0;
  font-size: clamp(22px, 2.3vw, 34px);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.forward-home .fg-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 40px;
  margin-top: 32px;
}

.forward-home .fg-button,
.forward-home .fg-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 24px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.forward-home .fg-button {
  background: #ffcb00;
  color: #0e131e;
  border: 1px solid transparent;
}

.forward-home .fg-button:hover {
  background: #ebbb00;
  color: #0e131e;
}

.forward-home .fg-secondary {
  padding-inline: 0;
  color: #ffffff;
}

.forward-home .fg-secondary:hover,
.forward-home .fg-shortcut a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.forward-home a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 5px;
}

.forward-home .fg-button:focus-visible { outline-color: #ffffff; }

.forward-home .fg-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-block: 42px;
}

.forward-home .fg-shortcut { padding-right: 48px; }
.forward-home .fg-shortcut + .fg-shortcut {
  border-left: 1px solid var(--fg-home-line);
  padding-left: 104px;
  padding-right: 0;
}

.forward-home h2 {
  font-family: inherit;
  margin: 0 0 14px;
  color: var(--fg-home-text);
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.forward-home .fg-shortcut p {
  color: var(--fg-home-muted);
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.5;
}

.forward-home .fg-shortcut a {
  color: var(--fg-home-text);
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 767.98px) {
  #navbar { min-height: 56px; }
  #navbar #navbar-logo img { width: 116px; height: 36px; }
  .forward-home .fg-container { width: calc(100% - 40px); }
  .forward-home .fg-hero-inner { min-height: 600px; padding-block: 160px 24px; }
  .forward-home .fg-hero-panel { padding: 28px; }
  .forward-home h1 { font-size: clamp(34px, 7.5vw, 48px); }
  .forward-home .fg-hero-panel p { font-size: 23px; }
  .forward-home .fg-actions { gap: 12px 24px; margin-top: 28px; }
  .forward-home .fg-shortcuts { grid-template-columns: 1fr; padding-block: 32px; }
  .forward-home .fg-shortcut { padding: 0 0 24px; }
  .forward-home .fg-shortcut + .fg-shortcut {
    border-left: 0;
    border-top: 1px solid var(--fg-home-line);
    padding: 24px 0 0;
  }
  .forward-home h2 { font-size: 28px; }
}

@media (max-width: 400px) {
  .forward-home .fg-hero-panel { padding: 24px; }
  .forward-home .fg-button { width: 100%; padding-inline: 12px; font-size: 16px; }
}

@media (forced-colors: active) {
  .forward-home .fg-hero-image { display: none; }
  .forward-home .fg-hero-panel { border: 1px solid CanvasText; }
  .forward-home .fg-button { border-color: ButtonText; }
}
