/* ============================================================
   STILE GENERALE - PORTFOLIO ASSEMBLER
   Autore: Manuel & Friends
   Ultima modifica: 2026-01-19
   ============================================================

   INDICE CSS
   ------------------------------------------------------------
   1. RESET E BASE
   2. HEADER + MENU
   3. HERO
   4. GRIGLIA CARD PROGETTI
   5. BOTTONI
   6. FOOTER
   7. RESPONSIVE DESIGN
   8. COMPONENTI FUTURI (modal, tag, toggle, etc.)
   ------------------------------------------------------------
*/

/* ============================================================
   1. RESET E BASE
============================================================ */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  background: #fff;
  color: #222;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

body.dark-mode {
  background: #121212;
  color: #f0f0f0;
}

.dark-mode .card {
  background-color: #222;
  border-color: #444;
}

.logo-img {
  height: 100px;
  width: auto;
  display: none;
}

[data-theme="light"] .logo-img.light {
  display: inline;
}

[data-theme="dark"] .logo-img.dark {
  display: inline;
}

/* ============================================================
   2. HEADER + MENU
============================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: white; /* o var(--bg-color) se usi temi */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.hamburger {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

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

  nav ul {
    display: none;
    flex-direction: column;
    gap: 1rem;
  }

  nav ul.open {
    display: flex;
  }

  .header-flex {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   3. HERO
============================================================ */
.hero {
  background-color: var(--background);
  padding: 4rem 1rem;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.hero-img img {
  max-width: 245px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  filter: brightness(1.1) contrast(1.05);
}

.hero-text {
  max-width: 600px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  border-left: 5px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 0;
}

.hero-subtitle {
  font-size: 1.8rem;
  font-weight: 400;
  margin-top: 0.2rem;
  color: var(--text-secondary);
}

.hero-desc {
  font-size: 1.1rem;
  margin: 1rem 0;
  color: var(--text-secondary);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.3s;
}

.btn.yellow {
  background-color: #FFD500;
  color: #000;
}

.btn.yellow:hover {
  background-color: #e4c200;
}

.btn.dark {
  background-color: var(--text);
  color: var(--background);
}

.btn.dark:hover {
  opacity: 0.85;
}

/* ============================================================
   4. GRIGLIA CARD PROGETTI
============================================================ */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  padding-bottom: 4rem;
}

/* CARD BASE */
.card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--card-border, #ddd);
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.04);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  text-align: center;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
}

/* TITOLO */
.card h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.8rem;
  text-align: center;
  color: var(--title-color);
}

/* DESCRIZIONE */
.card p {
  text-align: justify;
  font-size: 0.95rem;
  color: var(--text, #070707);
  margin-bottom: 1rem;
}

/* BOTTONE */
.card a.btn {
  align-self: center;
  padding: 0.5rem 1rem;
  background: var(--btn-bg, #000);
  color: var(--btn-text, #fff);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.3s;
}

.card a.btn:hover {
  background: var(--btn-hover, #222);
}

/* PAGINAZIONE */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination a {
  padding: 0.4rem 0.8rem;
  background-color: var(--pagination-bg, #f0f0f0);
  color: var(--pagination-text, #333);
  border-radius: 5px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.pagination a:hover {
  background-color: var(--pagination-hover, #e0e0e0);
}

.pagination a.active {
  background-color: var(--pagination-active-bg, #000);
  color: var(--pagination-active-text, #fff);
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-color);
}

.page-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
  line-height: 1.7;
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  border-left: 4px solid #facc15; /* giallo elegante */
  padding-left: 1rem;
}

.page-description {
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.page-content {
  font-size: 1.05rem;
}

.page-content p {
  margin-bottom: 1.2rem;
}

.page-content a {
  color: #0070f3;
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .page-description {
    color: #aaa;
  }

  .page-content a {
    color: #60a5fa;
  }
}

/* ============================================================
   5. BOTTONI
============================================================ */
.btn {
  display: inline-block;
  background: #333;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
}

.btn:hover {
  background: #555;
}

/* ============================================================
   6. FOOTER
============================================================ */
footer {
  background: #f2f2f2;
  text-align: center;
  padding: 1rem 0;
  margin-top: 3rem;
  font-size: 0.9rem;
}

/* ============================================================
   7. RESPONSIVE DESIGN
============================================================ */
/* ...inserire media query all’occorrenza */

/* ============================================================
   8. COMPONENTI FUTURI (modal, tag, toggle, etc.)
============================================================ */
/* Modale centrata */
/* Modal base */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  position: relative;
  background: var(--bg-color, #fff);
  color: var(--text-color, #000);
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  z-index: 10001;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
}

/* Bottone chiusura */
.close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Bottone fluttuante */
.modal-btn {
  position: fixed;
  bottom: 200px; /* sopra le altre pillole */
  right: 80px;
  z-index: 10002;
  background-color: #fbbf24;;
  color: rgb(6, 6, 6);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.modal-btn:hover {
  background-color: #fffefe;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background-color: #ff5c5c; /* rosso classico */
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 16px;
  line-height: 30px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.close-btn:hover {
  background-color: #ff1c1c;
}

/* Tema scuro */
[data-theme="dark"] .modal-content {
  background-color: #1a1a1a;
  color: #eee;
}
/* ============================================================
   9. PAGINA PROGETTO
============================================================ */
.project-hero {
  max-width: 100%;
  border-radius: 1rem;
  margin: 2rem 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.taglist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  background: var(--accent-color, #eee);
  color: #000;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: help;
  transition: background 0.3s ease;
}

html[data-theme="dark"] .tag {
  background: #444;
  color: #fff;
}

.page-content p {
  text-align: justify;
  text-justify: inter-word;
}

/* File CSS: assets/css/cta-pillole.css o incluso nel tuo foglio principale */

.cta-pillole {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.pillola {
  background-color: var(--cta-bg, #f1f1f1);
  color: var(--cta-text, #111);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

.pillola:hover {
  transform: scale(1.05);
  background-color: var(--cta-bg-hover, #e5e5e5);
}

html[data-theme='dark'] .pillola {
  --cta-bg: #222;
  --cta-text: #fff;
  --cta-bg-hover: #333;
}

/* Responsive fix */
@media (max-width: 768px) {
  .cta-pillole {
    bottom: 1rem;
    right: 1rem;
  }
  .pillola {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
}

/* ...placeholder */

#scrollToTop {
  display: none;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  font-size: 1.5rem;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 999;
  transition: opacity 0.3s ease;
}

#theme-toggle {
  font-size: 1.2rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease;
}

#theme-toggle:hover {
  transform: rotate(20deg) scale(1.2);
}

html {
  scroll-behavior: smooth;
}

/* =============================
   LIGHT THEME (default)
============================= */
:root[data-theme="light"] {
  --bg-color: #f9f9f5; /* meno bianco sparato */
  --text-color: #222;
  --accent-color: #ffcc00;
  --card-bg: #ffffff;
  --card-border: #dddddd;
  --btn-bg: #111;
  --btn-color: #fff;
  --btn-hover-bg: #333;
  --title-color: #333333;
  --bg-hero: #f9f9f9;
  --text-main: #1a1a1a;
  --accent: #FFD500;
  --text: #1a1a1a;
  --text-secondary: #555;
  --background: #f8f8f8;
}

/* =============================
   DARK THEME
============================= */
:root[data-theme="dark"] {
  --title-color: #fffb00;
  --bg: #000;
  --text: #eee;
  --card-bg: #111;
  --card-border: #444;
  --btn-bg: #ff0;
  --btn-text: #000;
  --btn-hover: #f5ea00;
  --pagination-bg: #222;
  --pagination-text: #fff;
  --pagination-hover: #333;
  --pagination-active-bg: #ff0;
  --pagination-active-text: #000;
  --bg-hero: #121212;
  --text-main: #ffffff;
  --accent: #FFD500;
  --text: #f8f8f8;
  --text-secondary: #aaa;
  --background: #121212;
  
}

/* =============================
   PATCH TEMA SCURO
============================= */

/* HEADER */
[data-theme="dark"] header {
  background-color: #000;
  box-shadow: 0 2px 5px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .nav a {
  color: #fff;
}

[data-theme="dark"] .nav a:hover {
  color: #ff0;
}

/* HERO */
[data-theme="dark"] .hero {
  background-color: #111;
  color: #eee;
}

/* FOOTER */
[data-theme="dark"] footer {
  background-color: #000;
  color: #aaa;
}

/* Scroll-to-top button */
[data-theme="dark"] #scrollToTop {
  background-color: #ff0;
  color: #000;
}

/* ===== FORM BASE ===== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
  margin: 2rem auto;
  padding: 1rem;
  background-color: var(--form-bg);
  border-radius: 1rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.contact-form label {
  font-weight: 600;
  color: var(--form-label);
}

.contact-form input,
.contact-form textarea {
  padding: 0.8rem;
  border: 1px solid var(--form-border);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  background-color: var(--form-input-bg);
  color: var(--form-text);
}

form.contact-form input,
form.contact-form textarea {
  background-color: #fbfbfb;
  color: #000000;
  border: 1px solid #444;
}

form.contact-form button {
  background-color:#fbbf24; /* giallo assembler */
  color: #000;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

form.contact-form button:hover {
  background-color: #fbbf24;
}

/* ===== VARIABILI TEMA LIGHT ===== */
html[data-theme='light'] {
  --form-bg: #fff;
  --form-label: #333;
  --form-border: #ccc;
  --form-input-bg: #f9f9f9;
  --form-text: #111;
}

/* ===== VARIABILI TEMA DARK ===== */
html[data-theme='dark'] {
  --form-bg: #1e1e1e;
  --form-label: #eee;
  --form-border: #444;
  --form-input-bg: #2a2a2a;
  --form-text: #fff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .contact-form {
    padding: 1rem;
    margin: 1rem;
  }

  .contact-form input,
  .contact-form textarea,
  .contact-form button {
    width: 100%;
  }
}

.form-intro {
  text-align: center;
  margin: 2rem auto;
  max-width: 500px;
}

.form-intro h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.form-intro p {
  font-size: 1.1rem;
  color: #555;
}