/* ==========================================================================
   TrønderData Custom Theme & Branding for Vaultwarden
   ========================================================================== */

/* --------------------------------------------------------------------------
   Local Fonts (Self-Hosted to satisfy Content Security Policy)
   -------------------------------------------------------------------------- */

/* PT Sans (Regular) */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ptsans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ptsans-400-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* PT Sans (Bold) */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/ptsans-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/ptsans-700-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Teko (Headings) */
@font-face {
  font-family: 'Teko';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/teko-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Teko';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/teko-400-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Teko';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/teko-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Teko';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/teko-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   Root Variables & Color Palette
   -------------------------------------------------------------------------- */
:root {
  /* Fonts */
  --font-sans: 'PT Sans', Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Teko', 'PT Sans', sans-serif;

  /* TrønderData Palette */
  --td-gronnhvit: #ECF5E1;
  --td-varskog: #99B885;
  --td-sitrus: #D7DE8C;
  --td-skogsnatt: #0D3D35;
  --td-skogsnatt-rgb: 13, 61, 53;
  --td-varskog-rgb: 153, 184, 133;

  /* Primary RGB Mappings (Buttons, Links, Focus) */
  --color-primary-100: 236 245 225; /* Grønnhvit */
  --color-primary-300: 215 222 140; /* Sitrus */
  --color-primary-600: 153 184 133; /* Vårskog - Main Buttons & Links */
  --color-primary-700: 129 164 107; /* Darker Vårskog - Hover */
  --color-bw-blue: 153 184 133;

  /* Brand Scale Overrides */
  --color-brand-050: #f4f8f0;
  --color-brand-100: #ECF5E1; /* Grønnhvit */
  --color-brand-200: #d7e8c6;
  --color-brand-300: #b9d7a2;
  --color-brand-400: #99B885; /* Vårskog */
  --color-brand-500: #81a46b;
  --color-brand-600: #668851;
  --color-brand-700: #4e6b3b;
  --color-brand-800: #364e28;
  --color-brand-900: #1f3316;
  --color-brand-950: #0D3D35; /* Skogsnatt */
  --color-brand-950-rgb: 13, 61, 53;

  /* Semantic Brand Colors */
  --color-fg-brand-soft: var(--color-brand-500);
  --color-fg-brand: var(--color-brand-600);
  --color-fg-brand-strong: var(--color-brand-800);

  --color-bg-brand-softer: var(--color-brand-050);
  --color-bg-brand-soft: var(--color-brand-100);
  --color-bg-brand-medium: var(--color-brand-300);
  --color-bg-brand: var(--color-brand-500);
  --color-bg-brand-strong: var(--color-brand-700);
  --color-bg-brand-stronger: var(--color-brand-900);

  --color-border-brand-soft: var(--color-brand-200);
  --color-border-brand: var(--color-brand-400);
  --color-border-brand-strong: var(--color-brand-600);

  /* Illustrations & Accents */
  --color-illustration-outline: 13 61 53;
  --color-illustration-bg-primary: 153 184 133;
  --color-illustration-bg-secondary: 215 222 140;
  --color-illustration-bg-tertiary: 236 245 225;
  --color-illustration-logo: 13 61 53;
}

/* --------------------------------------------------------------------------
   Global Typography
   -------------------------------------------------------------------------- */
body, input, button, select, textarea {
  font-family: var(--font-sans) !important;
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4, .page-header {
  font-family: var(--font-heading) !important;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-transform: uppercase;
}

h1, .h1 {
  font-size: 2rem !important;
}

h2, .h2 {
  font-size: 1.6rem !important;
}

/* --------------------------------------------------------------------------
   Logo Presentation & Sizing
   -------------------------------------------------------------------------- */
img.new-logo-themed {
  display: block !important;
  width: 190px !important;
  max-width: 220px !important;
  height: auto !important;
  object-fit: contain !important;
}

/* Compact view in collapsed sidebars */
.tw-w-10 img.new-logo-themed,
.sidebar-compact img.new-logo-themed {
  width: 32px !important;
  content: url(images/icon-white.svg) !important;
}

/* --------------------------------------------------------------------------
   Theme Overrides: Dark Mode (Default / Preferred)
   -------------------------------------------------------------------------- */
.theme_dark {
  --color-background: 13 45 40;
  --color-background-alt: 7 30 26;
  --color-background-alt2: 18 55 49;
  --color-background-alt3: 25 70 63;
  --color-background-alt4: 7 30 26;

  /* Primary Action Colors (Vårskog) */
  --color-primary-100: 13 61 53;
  --color-primary-300: 78 107 59;
  --color-primary-600: 153 184 133;
  --color-primary-700: 215 222 140;

  /* Sidenav / Header */
  --color-nav-bg-primary: #0D3D35;
  --color-nav-bg-secondary: #082823;
  --color-nav-bg-primary-strong: #145248;
  --color-nav-bg-secondary-strong: #145248;
  --color-nav-border-primary: #185c51;
  --color-nav-border-secondary: #185c51;

  --color-bg-primary: #092622;
  --color-bg-secondary: #0D3D35;
  --color-bg-tertiary: #061e1b;
  --color-bg-quaternary: #175248;

  --color-fg-brand: #99B885;
  --color-fg-brand-soft: #b9d7a2;
  --color-fg-brand-strong: #ECF5E1;

  --color-bg-brand: #4e6b3b;
  --color-bg-brand-soft: #1f3316;
  --color-bg-brand-softer: #0d2110;

  --color-border-brand: #668851;
  --color-border-focus: #99B885;

  --color-illustration-outline: 153 184 133;
  --color-illustration-logo: 236 245 225;
}

.theme_dark img.new-logo-themed {
  content: url(images/logo-white.svg) !important;
}

/* --------------------------------------------------------------------------
   Theme Overrides: Light Mode
   -------------------------------------------------------------------------- */
.theme_light {
  --color-nav-bg-primary: #0D3D35;
  --color-nav-bg-secondary: #082823;
  --color-nav-fg-primary: #FFFFFF;
  --color-nav-fg-secondary: #ECF5E1;
  --color-nav-border-primary: #185c51;
  
  --color-bg-brand: #81a46b;
  --color-bg-brand-soft: #ECF5E1;
  --color-border-focus: #4e6b3b;
}

.theme_light img.new-logo-themed {
  content: url(images/logo.svg) !important;
}

/* --------------------------------------------------------------------------
   Angular Component Inline Logo Sizing & Color Rules
   -------------------------------------------------------------------------- */
bit-landing-header bit-svg,
bit-landing-header svg {
  display: block !important;
  width: 100% !important;
  max-width: 220px !important;
  height: auto !important;
}

bit-nav-logo svg {
  max-width: 180px !important;
  height: auto !important;
}

/* TrønderData brand colors inside rendered SVGs */
bit-landing-header svg .cls-2,
bit-nav-logo svg .cls-2 {
  fill: #99B885 !important; /* Vårskog outline */
}

/* Light mode logo styling */
bit-landing-header svg .cls-1 {
  fill: #ECF5E1 !important; /* Grønnhvit infill */
}
bit-landing-header svg .cls-4 {
  fill: #0D3D35 !important; /* Skogsnatt text */
}

/* Dark mode & Navbar logo styling */
.theme_dark bit-landing-header svg .cls-1,
[data-theme="dark"] bit-landing-header svg .cls-1,
bit-nav-logo svg .cls-1 {
  fill: rgba(153, 184, 133, 0.22) !important; /* Subtle translucent green infill */
}

.theme_dark bit-landing-header svg .cls-4,
[data-theme="dark"] bit-landing-header svg .cls-4,
bit-nav-logo svg .cls-4 {
  fill: #FFFFFF !important; /* Pure white text */
}
