/*
 * layout.css — Boost4Biz
 * Reset, tipografia base, container, sezioni, utility
 * Dipende da: variables.css
 */

/* ══ RESET ═══════════════════════════════════════════════════════════════════ */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ══ TIPOGRAFIA BASE ═════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-primary); /* navy */
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

@media (max-width: 768px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-xl); }
}

@media (max-width: 480px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-lg); }
}

p {
  line-height: var(--leading-relaxed);
}

a {
  color: var(--color-electric); /* verde */
  text-decoration: none;
  transition: color var(--ease-fast);
}

a:hover {
  color: var(--color-electric-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-electric);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

ul, ol {
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ══ CONTAINER ═══════════════════════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-8);
}

.container--narrow {
  max-width: var(--container-narrow);
}

@media (max-width: 1024px) {
  .container { padding-inline: var(--sp-6); }
}

@media (max-width: 640px) {
  .container { padding-inline: var(--sp-5); }
}

/* ══ SEZIONI ═════════════════════════════════════════════════════════════════ */

.section {
  padding-block: var(--sp-24);
}

.section--sm {
  padding-block: var(--sp-16);
}

.section--lg {
  padding-block: var(--sp-32);
}

.section--dark {
  background-color: var(--color-bg-dark); /* navy */
  color: var(--color-text-on-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-text-on-dark);
}

.section--dark p {
  color: var(--color-text-muted-on-dark);
}

.section--gray {
  background-color: var(--color-bg-section); /* #EEF4F1 */
}

@media (max-width: 768px) {
  .section         { padding-block: var(--sp-16); }
  .section--lg     { padding-block: var(--sp-20); }
}

/* ══ GRIGLIA ═════════════════════════════════════════════════════════════════ */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-8);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
}

/* ══ UTILITY ═════════════════════════════════════════════════════════════════ */

/* Overline — label sovrastante */
.overline {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-electric); /* verde */
  display: block;
  margin-bottom: var(--sp-3);
}

.section--dark .overline {
  color: var(--color-cyan); /* arancione su navy */
}

/* Lead — testo introduttivo */
.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}

.section--dark .lead {
  color: var(--color-text-muted-on-dark);
}

/* Section header */
.section-header {
  margin-bottom: var(--sp-12);
}

.section-header p {
  margin-top: var(--sp-4);
  max-width: 60ch;
}

.section-header--centered {
  text-align: center;
  margin-inline: auto;
  max-width: var(--container-narrow);
}

.section-header--centered p {
  margin-inline: auto;
}

/* Accent — testo verde */
.accent {
  color: var(--color-electric);
}

/* Accent bar — linea decorativa */
.accent-bar {
  display: block;
  width: 36px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-electric), var(--color-cyan));
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-6);
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--sp-12);
}

/* Skip-to-content — accessibilità tastiera */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: 9999;
  padding: var(--sp-3) var(--sp-6);
  background: var(--color-electric);
  color: var(--color-white);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  transition: top var(--ease-fast);
}

.skip-to-content:focus {
  top: 0;
  outline: 2px solid var(--color-electric-hover);
  outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ══ ANIMAZIONE ENTRATA ══════════════════════════════════════════════════════ */

.animate-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--ease-slow), transform var(--ease-slow);
}

.animate-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .animate-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.animate-in:nth-child(2) { transition-delay: 60ms; }
.animate-in:nth-child(3) { transition-delay: 120ms; }
.animate-in:nth-child(4) { transition-delay: 180ms; }
.animate-in:nth-child(5) { transition-delay: 240ms; }
.animate-in:nth-child(6) { transition-delay: 300ms; }

/* ══ ENTRY CONTENT (articoli insight) ═══════════════════════════════════════ */

.entry-content {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
}

.entry-content > * + * {
  margin-top: var(--sp-5);
}

.entry-content h2 {
  font-size: var(--text-2xl);
  margin-top: var(--sp-12);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--color-border);
}

.entry-content h3 {
  font-size: var(--text-xl);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.entry-content p {
  max-width: 72ch;
}

.entry-content ul,
.entry-content ol {
  padding-left: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }

.entry-content li {
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

.entry-content a {
  color: var(--color-electric);
  text-decoration: underline;
  text-decoration-color: var(--color-electric-dim);
  text-underline-offset: 3px;
}

.entry-content a:hover {
  text-decoration-color: var(--color-electric);
}

.entry-content strong {
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

.entry-content blockquote {
  border-left: 3px solid var(--color-electric);
  background: var(--color-electric-dim);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--sp-4) var(--sp-6);
  margin-block: var(--sp-8);
}

.entry-content blockquote p {
  color: var(--color-text-muted);
  font-style: italic;
  max-width: none;
}

.entry-content img {
  border-radius: var(--radius-md);
  max-width: 100%;
  height: auto;
}

.entry-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--sp-10);
}
