/*
  main.css – Stile pubblico di M.T. Energy Srl
  Basato sullo schema di colori definito in CLAUDE.md (palette solar‑industrial).
  Utilizza variabili CSS per facilitare eventuali personalizzazioni future.
*/

:root {
  /* Brand */
  --color-solar:    #F59E0B;   /* giallo solare – accento principale */
  --color-solar-dk: #D97706;   /* hover/pressed */
  --color-sky:      #0EA5E9;   /* azzurro cielo – accento secondario */

  /* Neutri */
  --color-bg:       #FAFAF8;   /* bianco caldo */
  --color-surface:  #FFFFFF;
  --color-border:   #E5E3DC;
  --color-text:     #1C1917;   /* quasi-nero caldo */
  --color-muted:    #78716C;

  /* Tipografia */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Sans 3', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

/* Reset di base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: min(90%, 1200px);
  margin-inline: auto;
  padding: 1rem;
}

/* Header */
.site-header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}
.site-header .logo {
  height: 48px;
  margin-inline-end: 0.5rem;
}
.site-header .site-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0;
  color: var(--color-text);
}
.site-header .site-subtitle {
  font-size: 1rem;
  color: var(--color-muted);
}

/* Hero */
.hero {
  text-align: center;
  margin-block: 2rem 1.5rem;
}
.hero h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.hero p {
  font-size: 1.125rem;
  color: var(--color-muted);
}

/* Document grid */
.documents-grid {
  display: grid;
  gap: 1rem;
}

.year-accordion {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}
.year-toggle {
  width: 100%;
  text-align: left;
  background: var(--color-surface);
  border: none;
  padding: 0.75rem 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.year-toggle:hover,
.year-toggle:focus {
  background: var(--color-solar);
  color: #fff;
}
.year-content {
  display: none;
  background: var(--color-bg);
  padding: 0.5rem 1rem;
}
.year-accordion[open] .year-content {
  display: block;
}

/* Document list */
.document-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.document-item {
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0;
}
.document-link {
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #0EA5E9; color: white; padding: 8px 15px; text-decoration: none; border-radius: 4px;
}
.document-link:hover {
  color: var(--color-solar);
}
.title {
  font-weight: 500;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* Responsive */
@media (min-width: 600px) {
  .documents-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* Button utility (usato dal JS per aprire/chiudere gli accordion) */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--color-solar);
  color: #fff;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover {
  background: var(--color-solar-dk);
}

/* Tooltip per accessibilità */
[aria-expanded="true"] .year-toggle {
  background: var(--color-sky);
  color: #fff;
}

/* Hero image responsiveness */
.hero-image-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
}
.hero-image {
    width: 100%;
    height: auto;
    display: block;
}
