/* ===================================
   TOMAS FRONGIA - PROFESSIONAL PORTFOLIO
   Modern, Clean, Professional Design
   =================================== */

/* === CSS RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette */
  --primary-color: #0066cc;
  --primary-dark: #004999;
  --primary-light: #3385db;
  --secondary-color: #1a2942;
  --secondary-light: #2d3e57;
  --accent-color: #00a8e8;
  --text-dark: #1a1a1a;
  --text-medium: #4a4a4a;
  --text-light: #6a6a6a;
  --bg-white: #ffffff;
  --bg-light: #f8f9fa;
  --bg-lighter: #fafbfc;
  --border-color: #e5e7eb;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Poppins', sans-serif;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  --spacing-3xl: 6rem;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.4s ease;
}

/* === TYPOGRAPHY === */
body {
  font-family: var(--font-primary);
  color: var(--text-dark);
  background: var(--bg-white);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--text-medium);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

section {
  padding: var(--spacing-3xl) 0;
}

/* === HEADER === */
header {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-light) 100%);
  color: var(--bg-white);
  padding: var(--spacing-3xl) var(--spacing-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.4;
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

.header-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
  margin: 0 auto var(--spacing-lg) auto;
  display: block;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-base);
}

.header-photo:hover {
  transform: scale(1.05);
}

header h1 {
  color: var(--bg-white);
  margin-bottom: var(--spacing-sm);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: var(--spacing-xs);
}

.subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--spacing-xl);
}

/* === BUTTONS === */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-color);
  color: var(--bg-white);
}

.btn-primary:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 102, 204, 0.3);
}

.btn-large {
  padding: 18px 48px;
  font-size: 1.1rem;
}

/* === LANGUAGE TOGGLE === */
.lang-toggle {
  text-align: center;
  padding: var(--spacing-lg) 0;
  background: var(--bg-lighter);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.lang-btn {
  padding: 10px 24px;
  margin: 0 6px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-white);
  color: var(--text-medium);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-primary);
}

.lang-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.lang-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--bg-white);
}

/* === LANGUAGE SECTIONS === */
.lang {
  display: none;
}

.lang.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === SECTION HEADERS === */
.section-header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.section-label {
  display: inline-block;
  padding: 6px 16px;
  background: var(--bg-light);
  color: var(--primary-color);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius-full);
  margin-bottom: var(--spacing-md);
}

.section-header h2 {
  color: var(--secondary-color);
  margin-bottom: var(--spacing-sm);
}

/* === ABOUT SECTION === */
.about-section {
  background: var(--bg-white);
}

.lead-text {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  line-height: 1.7;
  color: var(--text-dark);
  font-weight: 500;
  max-width: 900px;
  margin: 0 auto var(--spacing-lg) auto;
  text-align: center;
}

.about-section p {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  font-size: 1.05rem;
}

/* === CHALLENGES SECTION === */
.challenges-section {
  background: var(--bg-lighter);
}

.challenges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.challenge-card {
  background: var(--bg-white);
  padding: var(--spacing-xl);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all var(--transition-base);
}

.challenge-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.challenge-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  filter: grayscale(0.2);
}

.challenge-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-sm);
  color: var(--secondary-color);
}

.challenge-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* === APPROACH SECTION === */
.approach-section {
  background: var(--bg-white);
}

.approach-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-2xl);
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.approach-text h3 {
  color: var(--secondary-color);
  margin-bottom: var(--spacing-md);
}

.approach-text p {
  margin-bottom: var(--spacing-lg);
}

.method-list {
  list-style: none;
  padding: 0;
}

.method-list li {
  padding: var(--spacing-sm) 0;
  padding-left: var(--spacing-lg);
  position: relative;
  color: var(--text-medium);
  line-height: 1.6;
}

.method-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
  font-size: 1.2rem;
}

.method-list strong {
  color: var(--text-dark);
}

.approach-stats {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.stat-card {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  padding: var(--spacing-xl);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--bg-white);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base);
}

.stat-card:hover {
  transform: scale(1.03);
}

.stat-number {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: var(--spacing-xs);
  line-height: 1;
}

.stat-label {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === FOCUS SECTION === */
.focus-section {
  background: var(--bg-lighter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-xl);
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.card-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--bg-light);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card-image img {
  transform: scale(1.08);
}

.card-content {
  padding: var(--spacing-xl);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-content h3 {
  font-size: 1.3rem;
  margin-bottom: var(--spacing-md);
  color: var(--secondary-color);
}

.card-content p {
  color: var(--text-medium);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0;
  flex: 1;
}

/* === TESTIMONIALS SECTION === */
.testimonials-section {
  background: var(--bg-white);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-xl);
  max-width: 1000px;
  margin: 0 auto;
}

.testimonial {
  background: var(--bg-lighter);
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--accent-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.testimonial:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.testimonial-text {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text-dark);
  line-height: 1.7;
  margin-bottom: var(--spacing-lg);
  position: relative;
}

.testimonial-text::before {
  content: '"';
  font-size: 4rem;
  color: var(--accent-color);
  opacity: 0.2;
  position: absolute;
  top: -20px;
  left: -10px;
  font-family: Georgia, serif;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 2px solid var(--border-color);
  padding-top: var(--spacing-md);
}

.testimonial-author strong {
  color: var(--secondary-color);
  font-size: 1rem;
  font-weight: 700;
}

.testimonial-author span {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* === CONTACT SECTION === */
.contact-section {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-light) 100%);
  color: var(--bg-white);
  text-align: center;
}

.contact-section .section-label {
  background: rgba(255, 255, 255, 0.15);
  color: var(--bg-white);
}

.contact-section h2 {
  color: var(--bg-white);
}

.contact-intro {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--spacing-xl);
}

.contact-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-xl);
  margin: var(--spacing-xl) 0 var(--spacing-2xl) 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 1.05rem;
  color: var(--bg-white);
}

.contact-icon {
  font-size: 1.5rem;
}

.contact-item a {
  color: var(--bg-white);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition-fast);
}

.contact-item a:hover {
  border-bottom-color: var(--accent-color);
}

/* === FOOTER === */
footer {
  background: #0f1922;
  color: rgba(255, 255, 255, 0.8);
  padding: var(--spacing-xl) var(--spacing-lg);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.footer-copyright {
  font-size: 0.95rem;
  margin: 0;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.footer-nav a:hover {
  color: var(--accent-color);
}

.separator {
  color: rgba(255, 255, 255, 0.3);
}

/* === LEGAL PAGES STYLES === */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}





#privacy,
#impressum {
  max-width: 900px;
  margin: var(--spacing-2xl) auto;
  padding: var(--spacing-2xl);
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

#privacy h2,
#impressum h2 {
  color: var(--secondary-color);
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

#privacy p,
#impressum p {
  margin-bottom: var(--spacing-lg);
  line-height: 1.8;
}

#privacy strong,
#impressum strong {
  color: var(--secondary-color);
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin: var(--spacing-xl);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  color: var(--primary-color);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.back-link:hover {
  background: var(--primary-color);
  color: var(--bg-white);
  transform: translateX(-4px);
}

/* === RESPONSIVE === */
@media (max-width: 992px) {
  :root {
    --spacing-xl: 2.5rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
  }
  
  .approach-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
  
  .approach-stats {
    flex-direction: row;
  }
  
  .challenges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --spacing-xl: 2rem;
    --spacing-2xl: 2.5rem;
    --spacing-3xl: 3rem;
  }
  
  .header-photo {
    width: 140px;
    height: 140px;
  }
  
  .challenges-grid {
    grid-template-columns: 1fr;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
  
  .approach-stats {
    flex-direction: column;
  }
  
  .contact-info {
    flex-direction: column;
    gap: var(--spacing-md);
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-nav {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .lang-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  
  .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
  
  .btn-large {
    padding: 14px 32px;
    font-size: 1rem;
  }
  
  .card-content {
    padding: var(--spacing-lg);
  }
}

.card-content h3 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
    color: var(--secondary-color);

    /* Nuove regole per testi lunghi */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;  /* divide parole troppo lunghe */
}

.card-content p {
    color: var(--text-medium);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
    flex: 1;

    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === PRINT STYLES === */
@media print {
  header,
  .lang-toggle,
  footer {
    display: none;
  }
  
  body {
    background: white;
  }
  
  .card,
  .testimonial {
    break-inside: avoid;
  }
}

.testimonial-author strong {
    color: #00bfff; /* azzurro chiaro per i nomi */
}

.testimonial-author span {
    color: #87CEFA; /* azzurro più tenue per il ruolo */
}

/* =========================
   PRIVACY / LEGAL FIX ONLY
========================= */

#privacy {
  color: var(--text-dark);
}

#privacy p,
#privacy li {
  color: var(--text-dark);
}

#privacy h3,
#privacy h4 {
  color: var(--secondary-color);
}

#privacy a {
  color: var(--primary-color);
}

#privacy a:hover {
  color: var(--primary-dark);
}

#privacy ul {
  padding-left: 1.2rem;
  margin-left: 0;
}

#privacy li {
  color: var(--text-dark);
  line-height: 1.7;
}
