/* ==========================================================================
   CSS Variables (Design Tokens)
   ========================================================================== */
:root {
  --color-primary-theme-light: #0084FF;
  --color-primary-hover-theme-light: #00C3FF;
  --color-os1-theme-light: #0033ff;
  --color-os2-theme-light: #a100ff;
  --color-text-theme-light: #333333;
  --color-text-light-theme-light: #666666;
  --color-text-theme-dark: #bbbbbb;
  --color-text-hover-theme-dark: #e1e1e1;
  --color-text-light-theme-dark: #f6f6f6;
  --color-background-theme-light: #ffffff;
  --color-selection-theme-light: #b5fcb3;
  --color-selection-theme-dark: #0084FF;

  --font-primary: Verdana, 'DejaVu Sans', sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;

  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;

  --transition-speed: 0.3s;
}

/* ==========================================================================
   Modern CSS Reset
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%; /* 16px base */
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary), sans-serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text-theme-light);
  background-color: var(--color-background-theme-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: var(--spacing-lg) var(--spacing-md);
  max-width: 88ch;
  width: 100%;
  margin: 0 auto;          /* center the block */
  text-align: left;        /* keep content left-aligned */
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.9375rem; }
h6 { font-size: 0.875rem; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary), sans-serif;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-theme-light);
}

p {
  margin-bottom: var(--spacing-sm);
}

/* Links */
a {
  color: var(--color-primary-theme-light);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

a:hover {
  color: var(--color-primary-hover-theme-light);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-primary-theme-light);
  outline-offset: 2px;
}

/* External Qt link */
#link_to_external_website {
  color: var(--color-text-theme-light);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
  display: inline-block;
}

#link_to_external_website:hover {
  color: var(--color-text-light-theme-light);
  text-decoration: underline;
}

#link_to_external_website:visited {
  color: var(--color-text-theme-light);
  text-decoration: none;
}

/* ==========================================================================
   Selection
   ========================================================================== */
::-moz-selection {
  background: var(--color-selection-theme-light);
  text-shadow: none;
}

::selection {
  background: var(--color-selection-theme-light);
  text-shadow: none;
}

/* ==========================================================================
   Media Elements
   ========================================================================== */
img,
svg,
video,
canvas,
audio,
iframe {
  display: block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* ==========================================================================
   Accessibility Helper Classes
   ========================================================================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: inherit;
}

.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

/* ==========================================================================
   Navigation (Modern Flexbox Approach)
   ========================================================================== */
#header-menu {
  background-color: var(--color-primary-theme-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#header-menu ul {
  list-style: none;
  margin: 0 ;               /* center the nav block */
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;       /* center links as a group */
  gap: 0.25rem;
}

#header-menu li:last-child {
  margin-left: auto;
}

#header-menu a {
  display: flex;
  align-items: center;
  color: white;
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: background-color var(--transition-speed) ease;
  white-space: nowrap;
}

#header-menu a:hover,
#header-menu a:focus-visible {
  background-color: var(--color-primary-hover-theme-light);
  text-decoration: none;
  outline: none;
}

/* Language toggle flag styling (consolidated) */
#flag-icon {
  width: 24px;
  height: 16px;
  display: block;
  border-radius: 2px;
  transition: transform var(--transition-speed) ease;
}
#icon{
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 2px;
  transition: transform var(--transition-speed) ease;
}
#icon:hover{scale: 1.1;}
#lang-toggle:hover #flag-icon,
#lang-toggle:focus-visible #flag-icon {
  transform: scale(1.1);
}
.p-padded-left {
  position: relative;
  padding-left: 1.2em; /* space for the bullet */
}
.l-padded-left {
  position: relative;
  padding-left: 0.5em; /* space for the bullet */
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  padding: var(--spacing-lg) var(--spacing-md);
  color: var(--color-text-theme-light);
}

footer p {
  max-width: none;   /* match main content width */
  margin: 0 auto;    /* center the block */
  text-align: left;  /* keep text left-aligned */
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
/* --- Default (desktop) --- */
#menu-toggle {
  display: none; /* hide hamburger on desktop */
}

/* --- Mobile menu --- */
@media (max-width: 768px) {
  #menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: inherit;
    padding: 0.5rem 1rem;
  }

  #header-menu ul {
    display: none;          /* hide links by default */
    flex-direction: column; /* vertical layout */
    gap: 0;                 /* remove spacing */
  }

  #header-menu ul.show {
    display: flex;          /* show when toggled */
  }

  #header-menu a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.875rem 1rem;
    justify-content: flex-start;
  }

  #header-menu li:last-child {
    margin-left: 0;
  }

  main,
  footer p {
    padding: var(--spacing-lg) var(--spacing-sm);
    max-width: min(46ch, 100%);
  }
  .service-list {
    padding-left: 1.5rem;
  }
}
.service-list {
  padding-left: 2.5rem;
  margin: 1rem 0;
  list-style-type: disc;
}

.service-list li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}
/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
/* Dark theme */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #eee;
  }
  h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-theme-dark);
  }
  ::-moz-selection {
    background: var(--color-selection-theme-dark);
    text-shadow: none;
  }

  ::selection {
    background: var(--color-selection-theme-dark);
    text-shadow: none;
  }
  /* External Qt link */
  #link_to_external_website {
    color: var(--color-text-theme-dark);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
    display: inline-block;
  }

  #link_to_external_website:hover {
    color: var(--color-text-hover-theme-dark);
    text-decoration: underline;
  }

  #link_to_external_website:visited {
    color: var(--color-text-theme-dark);
    text-decoration: none;
  }
  footer {
    padding: var(--spacing-lg) var(--spacing-md);
    color: var(--color-text-theme-dark);
    margin-bottom: 2rem;
  }
}
