/* STYLE.CSS - Marco Mangano Website - Mobile First */

/* Variabili colori */
:root {
  --primary: #2C3E50;
  --secondary: #34495E;
  --accent: #E67E22;
  --light: #ECF0F1;
  --dark: #1A252F;
  --text: #333333;
  --text-light: #7F8C8D;
  --background: #FFFFFF;
  --background-alt: #F5F5F5;
  
  /* Colori categorie */
  --gis-color: #3498DB;
  --rigenerazione-color: #27AE60;
  --integrazione-color: #E67E22;
  
  /* Shadow */
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Reset e base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Open Sans', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--background);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p { margin-bottom: 1rem; }
a { color: var(--primary); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

/* Layout */
.container { width: 100%; padding: 0 15px; margin: 0 auto; }
.row { 
  display: flex; 
  flex-direction: column; 
  gap: 2rem;
  margin-top: 1rem;
}
.col { 
  width: 100%; 
  padding: 0; 
  margin-bottom: 1.5rem;
}

/* Header */
header {
  background-color: var(--primary);
  color: var(--light);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--light);
  display: flex;
  align-items: center;
  z-index: 1001;
}
.logo img { height: 32px; margin-right: 8px; }
.logo a {
  color: var(--light);
  display: flex;
  align-items: center;
  text-decoration: underline;
}
.logo a:hover { color: var(--accent); }

/* Navigation */
nav { position: relative; }
nav ul {
  display: none;
  flex-direction: column;
  list-style: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background-color: var(--primary);
  box-shadow: var(--shadow);
  z-index: 1000;
  width: 100%;
  overflow-y: auto;
  max-height: calc(100vh - 56px);
}
nav ul.show { display: flex; }
nav ul li { margin: 0; text-align: center; }
nav ul li a {
  color: var(--light);
  font-weight: 600;
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
nav ul li a:hover, nav ul li a:active, nav ul li a.active {
  color: var(--accent);
  background-color: rgba(255, 255, 255, 0.05);
}
.mobile-menu-btn {
  display: block;
  background: none;
  border: none;
  color: var(--light);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  position: relative;
  right: 0;
}

/* To Top Button */
.to-top-btn {
  position: fixed;
  bottom: 30px;
  right: 20px;
  width: 40px;
  height: 40px;
  background-color: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 998;
}
.to-top-btn.visible { opacity: 1; visibility: visible; }
.to-top-btn:hover {
  background-color: #d35400;
  color: white;
  transform: translateY(-5px);
}
.to-top-btn i { font-size: 1.5rem; }

/* Nascondi il pulsante to-top quando il menu è aperto */
nav ul.show ~ #to-top-btn {
  display: none;
}

/* Stile aggiuntivo per il menu mobile */
@media (max-width: 991px) {
  nav ul.show {
    display: flex;
    padding-bottom: 20px;
  }
}

/* Hero Section */
.hero {
  background-color: var(--primary);
  color: var(--light);
  padding: 2.5rem 0;
  text-align: center;
}
.hero h1 {
  font-size: 1.75rem;
  color: var(--light);
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1rem;
  text-align: center;
  margin: 0 auto 1rem;
}
.hero-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1rem;
  background-color: var(--accent);
  color: white;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.3s;
  text-align: center;
  width: 100%;
  border: none;
  cursor: pointer;
}
.btn:hover {
  background-color: #d35400;
  color: white;
  transform: translateY(-2px);
}
.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--light);
}
.btn-secondary:hover { background-color: rgba(255, 255, 255, 0.1); }

/* Sections */
section { padding: 3rem 0; position: relative; }
.section-title {
  text-align: center;
  margin-bottom: 2rem;
}
.section-title h2 {
  font-size: 2rem;
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
}
.section-title h2:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background-color: var(--accent);
}
.section-title p {
  margin-top: 0.5rem;
  color: var(--text-light);
}

/* Profile */
.profile-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}
.profile-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-content { flex: 1; text-align: center; }
.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--light);
  font-size: 1.25rem;
  transition: all 0.3s;
}
.social-links a:hover {
  background-color: var(--accent);
  transform: translateY(-3px);
}

.cv-links {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  justify-content: center;
}

.cv-links a {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

/* Card system - Base comune per tutte le card */
.card {
  background-color: var(--background);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  height: 100%;
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 1.5rem;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.card h3,
.card .card-title {
  font-size: 1.3rem;
  height: 2.7em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

/* Layout container per le card */
.features,
.row {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1rem;
  width: 100%;
}

/* Sezioni con backgrounds alternati */
.services,
.contact,
.portfolio:nth-child(even) {
  background-color: var(--background-alt);
}

/* Stili specifici per service cards */
.service-icon {
  color: var(--accent);
}

.service-list {
  list-style-type: none;
  padding: 0;
  margin: 0.5rem 0 0;
  text-align: left;
}

.service-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.service-list li:last-child {
  border-bottom: none;
}

/* Stili specifici per portfolio */
.portfolio-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 0;
  height: 250px;
  transition: all 0.3s;
}

.portfolio-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s;
  padding: 1rem;
  text-align: center;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-item:hover img {
  transform: scale(1.1);
}

.portfolio-overlay h3 {
  color: white;
  font-size: 1.25rem;
  height: auto;
  margin-bottom: 0.5rem;
}

.portfolio-overlay p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.5rem;
}

.portfolio-category {
  background-color: var(--accent);
  color: white;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.portfolio-category a {
  color: white;
  text-decoration: none;
}

.portfolio-category a:hover {
  color: white;
  text-decoration: underline;
}

/* Contact */
.contact { background-color: var(--background-alt); }
.contact-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.contact-container.centered {
  align-items: center;
  justify-content: center;
}
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}
.info-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: var(--background);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}
.info-item:hover { transform: translateY(-5px); }
.info-item i {
  font-size: 2rem;
  color: var(--accent);
  width: 40px;
  text-align: center;
}
.info-item p { margin: 0; font-size: 1.1rem; }
.info-item a { color: var(--text); text-decoration: none; }
.info-item a:hover { color: var(--accent); }

/* Footer */
footer {
  background-color: var(--dark);
  color: var(--light);
  padding: 20px 0 70px;
  text-align: center;
}
.footer-text { margin: 0; font-size: 14px; }

/* Utility Classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Media Queries */
@media (min-width: 576px) {
  .container { max-width: 540px; }
  .hero-buttons { flex-direction: row; justify-content: center; }
  .btn { width: auto; }
}

@media (min-width: 768px) {
  .container { max-width: 720px; }
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  
  /* Layout a 2 colonne su tablet */
  .row,
  .features { 
    flex-direction: row; 
    flex-wrap: wrap;
    gap: 2rem;
  }
  
  .features .card,
  .col { 
    width: calc(50% - 1rem);
    flex: 0 0 calc(50% - 1rem);
    margin-bottom: 0;
  }
  
  .hero { padding: 5rem 0; }
  .hero h1 { font-size: 2.25rem; }
  .hero p { font-size: 1.1rem; }
  .profile-container { 
    flex-direction: row; 
    text-align: left;
    align-items: flex-start;
  }
  .profile-content { text-align: left; }
  .social-links { justify-content: flex-start; }
  footer {
    padding: 20px 0;
  }
}

@media (min-width: 992px) {
  .container { max-width: 960px; }
  
  /* Layout a 3 colonne su desktop */
  .features .card,
  .col { 
    width: calc(33.333% - 1.333rem); 
    flex: 0 0 calc(33.333% - 1.333rem);
  }
  
  .mobile-menu-btn { display: none; }
  nav ul {
    display: flex;
    flex-direction: row;
    position: static;
    background: none;
    box-shadow: none;
  }
  nav ul li { margin: 0 0.5rem; }
  nav ul li a { padding: 0.5rem 0.75rem; border-bottom: none; }
  nav ul li a:hover { background: none; }
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }
  .hero { padding: 6rem 0; }
  .hero h1 { font-size: 2.5rem; }
  .hero p { font-size: 1.25rem; max-width: 80%; }
  section { padding: 5rem 0; }
}

@media (min-width: 1200px) {
  .container { max-width: 1140px; }
  h1, .hero h1 { font-size: 3rem; }
}

/* Print Styles */
@media print {
  body { color: #000; background: #fff; font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
  header, nav, footer, .btn, .hero-buttons, .to-top-btn { display: none; }
  .container { max-width: 100%; width: 100%; }
  .card, .feature { box-shadow: none; break-inside: avoid; }
}