/* Scoped to stock gitea-* themes ONLY: this file is injected on every page by
   custom/header.tmpl, so an unscoped :root here would come after (and clobber)
   the registered granthi-* theme stylesheets, whose tokens live in
   granthi-tokens-{light,dark}.css. Under granthi-* themes this block must not
   apply. */
html[data-theme^="gitea"],
html[class*="theme-gitea"]{
 --color-primary:#5b4bd6; --color-primary-contrast:#ffffff;
 --color-primary-dark-1:#5140c4; --color-primary-dark-2:#4636ad; --color-primary-dark-3:#3b2d93;
 --color-primary-dark-4:#30246f; --color-primary-dark-5:#241a52; --color-primary-dark-6:#1a123b; --color-primary-dark-7:#0f0a23;
 --color-primary-light-1:#6d5ede; --color-primary-light-2:#8577e6; --color-primary-light-3:#9e93ec;
 --color-primary-light-4:#b7aef2; --color-primary-light-5:#d0caf7; --color-primary-light-6:#e3dffb; --color-primary-light-7:#f1effd;
 --color-primary-hover:#6a5ce0; --color-primary-active:#4636ad;
 --color-primary-alpha-30:rgba(91,75,214,.3); --color-primary-alpha-40:rgba(91,75,214,.4);
 --color-primary-alpha-50:rgba(91,75,214,.5); --color-primary-alpha-60:rgba(91,75,214,.6);
 --color-primary-alpha-70:rgba(91,75,214,.7); --color-primary-alpha-80:rgba(91,75,214,.8); --color-primary-alpha-90:rgba(91,75,214,.9);
 --granthi-page:#f7f8fb; --granthi-surface:#ffffff; --granthi-surface-2:#f3f5fa;
 --granthi-text:#17181f; --granthi-muted:#687082; --granthi-border:#e3e7ef;
 --granthi-shadow:0 16px 44px rgba(20,24,36,.08);
 --granthi-nav-z:1100; --granthi-secondary-nav-z:1050; --granthi-menu-z:1200;
 --granthi-green:#16895a; --granthi-amber:#a66a00; --granthi-red:#c43d4d;
}

html.theme-gitea-dark,
html[data-theme="gitea-dark"]{
 --granthi-page:#0c0e13; --granthi-surface:#151821; --granthi-surface-2:#10131a;
 --granthi-text:#f4f6fb; --granthi-muted:#a3abba; --granthi-border:#2a2f3a;
 --granthi-shadow:0 18px 52px rgba(0,0,0,.34);
 --granthi-green:#54d28f; --granthi-amber:#f0b45b; --granthi-red:#ff7887;
}

/* gitea-auto resolves dark via the OS scheme, not a *-dark selector — without
   this block the dark tokens above never fire under the default auto theme. */
@media (prefers-color-scheme: dark){
 html.theme-gitea-auto,
 html[data-theme="gitea-auto"]{
  --granthi-page:#0c0e13; --granthi-surface:#151821; --granthi-surface-2:#10131a;
  --granthi-text:#f4f6fb; --granthi-muted:#a3abba; --granthi-border:#2a2f3a;
  --granthi-shadow:0 18px 52px rgba(0,0,0,.34);
  --granthi-green:#54d28f; --granthi-amber:#f0b45b; --granthi-red:#ff7887;
 }
}

body{
 letter-spacing:0;
}

#navbar{
 position:relative;
 z-index:var(--granthi-nav-z,1100);
 border-bottom:1px solid var(--granthi-border);
 backdrop-filter:saturate(160%) blur(16px);
}

#navbar .item{
 border-radius:8px;
}

#navbar .ui.dropdown .menu,
#navbar .ui.menu .dropdown.item .menu{
 z-index:var(--granthi-menu-z,1200);
 overflow:visible;
}

.secondary-nav{
 position:relative;
 z-index:var(--granthi-secondary-nav-z,1050);
}

.secondary-nav .ui.dropdown .menu,
.secondary-nav .ui.menu .dropdown.item .menu{
 z-index:var(--granthi-menu-z,1200);
 overflow:visible;
}

.ui.button,
.ui.buttons .button{
 border-radius:8px;
}

.ui.segment,
.ui.repository.list,
.repository.file.list,
.page-content .ui.card,
.page-content .ui.cards > .card{
 border-color:var(--granthi-border);
 box-shadow:var(--granthi-shadow);
}

.ui.primary.button,
.ui.primary.buttons .button{
 background:var(--color-primary);
}

.ui.primary.button:hover,
.ui.primary.buttons .button:hover{
 background:var(--color-primary-hover);
}

/* Footer (markup in templates/base/footer_content.tmpl, styles owned here) */
.granthi-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.granthi-footer .gf-brand{display:flex;align-items:center;gap:10px;opacity:.9}
.granthi-footer .gf-brand img{height:17px;width:auto}
.granthi-footer .gf-copy{font-size:12px;color:var(--color-text-light-2)}
.granthi-footer .gf-links{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.granthi-footer .gf-links a{font-size:12.5px;color:var(--color-text-light-2);text-decoration:none}
.granthi-footer .gf-links a:hover{color:var(--color-primary)}
