/* ==========================================================================
   Ubuntu Modern Responsive CSS Base
   Inspired by ubuntu.com/desktop (Canonical Design System Vanilla UI)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. @font-face Definitions
   -------------------------------------------------------------------------- */

/* Ubuntu Sans */
@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url('/fonts/Ubuntu-Th.ttf') format('truetype');
}

@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/Ubuntu-L.ttf') format('truetype');
}

@font-face {
  font-family: 'Ubuntu';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/Ubuntu-LI.ttf') format('truetype');
}

@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Ubuntu-R.ttf') format('truetype');
}

@font-face {
  font-family: 'Ubuntu';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Ubuntu-RI.ttf') format('truetype');
}

@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Ubuntu-M.ttf') format('truetype');
}

@font-face {
  font-family: 'Ubuntu';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Ubuntu-MI.ttf') format('truetype');
}

@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Ubuntu-B.ttf') format('truetype');
}

@font-face {
  font-family: 'Ubuntu';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Ubuntu-BI.ttf') format('truetype');
}

/* Ubuntu Condensed */
@font-face {
  font-family: 'Ubuntu Condensed';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Ubuntu-C.ttf') format('truetype');
}

/* Ubuntu Mono */
@font-face {
  font-family: 'Ubuntu Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/UbuntuMono-R.ttf') format('truetype');
}

@font-face {
  font-family: 'Ubuntu Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/UbuntuMono-RI.ttf') format('truetype');
}

@font-face {
  font-family: 'Ubuntu Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/UbuntuMono-B.ttf') format('truetype');
}

@font-face {
  font-family: 'Ubuntu Mono';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/UbuntuMono-BI.ttf') format('truetype');
}

/* --------------------------------------------------------------------------
   2. Design Tokens & Variables (Ubuntu Brand Palette & Modern Layout)
   -------------------------------------------------------------------------- */

:root {
  /* Ubuntu Core Palette */
  --ubuntu-orange: #E95420;
  --ubuntu-orange-hover: #D84315;
  --ubuntu-dark-aubergine: #2C001E;
  --ubuntu-mid-aubergine: #5E2750;
  --ubuntu-light-aubergine: #77216F;
  --ubuntu-warm-grey: #AEA79F;
  --ubuntu-cool-grey: #333333;
  --ubuntu-text-dark: #111111;
  --ubuntu-light-bg: #F7F7F7;
  --ubuntu-white: #FFFFFF;
  --ubuntu-border-grey: #E5E5E5;

  /* Typography Variables */
  --font-sans: 'Ubuntu', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-condensed: 'Ubuntu Condensed', 'Ubuntu', sans-serif;
  --font-mono: 'Ubuntu Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout Variables */
  --container-max-width: 1200px;
  --header-height: 64px;
}

/* --------------------------------------------------------------------------
   3. Reset & Base Styles
   -------------------------------------------------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 300; /* Ubuntu Light Body style */
  line-height: 1.6;
  color: var(--ubuntu-text-dark);
  background-color: var(--ubuntu-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Container Utility */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.25;
  color: var(--ubuntu-text-dark);
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 300;
  border-top: 1px solid var(--ubuntu-orange);
  padding-top: 0.75rem;
  margin-top: 2rem;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 400;
}

p {
  margin-bottom: 1.25rem;
  font-size: 1.0625rem;
}

a {
  color: var(--ubuntu-orange);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover, a:focus {
  color: var(--ubuntu-orange-hover);
  text-decoration: underline;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  background-color: var(--ubuntu-light-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  border-left: 3px solid var(--ubuntu-orange);
  margin-bottom: 1.5rem;
}

pre code {
  background: none;
  padding: 0;
}

/* --------------------------------------------------------------------------
   4. Header & Navigation (Ubuntu Global Style Bar)
   -------------------------------------------------------------------------- */

.site-header {
  background-color: var(--ubuntu-text-dark);
  color: var(--ubuntu-white);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--ubuntu-orange);
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--ubuntu-white);
  text-decoration: none;
}

.site-brand span {
  color: var(--ubuntu-orange);
  font-weight: 500;
}

.site-brand:hover {
  text-decoration: none;
  opacity: 0.95;
}

/* Navigation Links */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.main-nav a {
  color: #CCCCCC;
  font-size: 0.95rem;
  font-weight: 400;
  padding: 0.5rem 0;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--ubuntu-white);
  text-decoration: none;
  border-bottom: 2px solid var(--ubuntu-orange);
}

/* Mobile Menu Button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ubuntu-white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* --------------------------------------------------------------------------
   5. Main Content & Canonical Hero Sections
   -------------------------------------------------------------------------- */

.site-main {
  flex: 1 0 auto;
}

/* Ubuntu Banner / Hero Section */
.hero {
  background: linear-gradient(135deg, var(--ubuntu-dark-aubergine) 0%, var(--ubuntu-mid-aubergine) 100%);
  color: var(--ubuntu-white);
  padding: 4rem 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.hero h1 {
  color: var(--ubuntu-white);
}

.hero p {
  font-size: 1.25rem;
  font-weight: 300;
  max-width: 800px;
  color: #E0E0E0;
}

/* Canonical Style Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  text-align: center;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none !important;
}

.btn-primary {
  background-color: var(--ubuntu-orange);
  color: var(--ubuntu-white);
}

.btn-primary:hover {
  background-color: var(--ubuntu-orange-hover);
  color: var(--ubuntu-white);
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--ubuntu-white);
  color: var(--ubuntu-white);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--ubuntu-white);
}

/* Card / Feature Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2.5rem 0;
}

.card {
  background: var(--ubuntu-white);
  border: 1px solid var(--ubuntu-border-grey);
  border-top: 3px solid var(--ubuntu-orange);
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   6. Footer (Canonical Dark Style)
   -------------------------------------------------------------------------- */

.site-footer {
  background-color: #111111;
  color: #888888;
  font-size: 0.875rem;
  padding: 3rem 0 1.5rem 0;
  margin-top: 4rem;
  border-top: 1px solid #222222;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  color: var(--ubuntu-white);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: #AAAAAA;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--ubuntu-white);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid #222222;
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* --------------------------------------------------------------------------
   7. Responsive Media Queries (Mobile First)
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none; /* Da attivare/disattivare tramite JS per menu hamburger */
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--ubuntu-text-dark);
    flex-direction: column;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--ubuntu-orange);
    gap: 1rem;
  }

  .main-nav.is-open {
    display: flex;
  }

  .hero {
    padding: 2.5rem 0;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
