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

:root {
  --rosso: #c0392b;
  --nero: #1a1a1a;
  --grigio-scuro: #2c2c2c;
  --grigio: #666;
  --grigio-chiaro: #f5f5f5;
  --bianco: #ffffff;
  --navbar-h: 80px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', sans-serif;
  color: var(--nero);
  background: var(--bianco);
  line-height: 1.6;
}

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

/* ===== NAVBAR ===== */
:root {
  --navbar-h: 100px;
}

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(240, 240, 240, 0.96);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  height: var(--navbar-h);
}

.navbar-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.navbar-logo-img {
  height: 80px;
  width: auto;
  display: block;
}

.navbar-menu {
  list-style: none;
  display: flex;
  gap: 4px;
  align-items: center;
}

.navbar-menu a {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--nero);
  padding: 9px 15px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  display: block;
  white-space: nowrap;
}

.navbar-menu a:hover {
  background: rgba(0,0,0,0.08);
}

.navbar-menu a.active {
  background: rgba(180,180,180,0.55);
  color: var(--nero);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--nero);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===== HERO ===== */
.hero {
  margin-top: var(--navbar-h);
  height: 460px;
  background: url('https://images.unsplash.com/photo-1552321554-5fefe8c9ef14?w=1600&q=80') center/cover no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.50);
}

.hero-content {
  position: relative;
  text-align: center;
  color: var(--bianco);
  padding: 0 24px;
}

.hero-content h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.hero-content p {
  font-family: 'Open Sans', sans-serif;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 400;
  opacity: 0.90;
  max-width: 580px;
  margin: 0 auto;
}

/* ===== FILTRI ===== */
.filters-section {
  background: var(--bianco);
  padding: 40px 0 24px;
  border-bottom: 1px solid #eee;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.80rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 10px 22px;
  border: 2px solid #ddd;
  border-radius: 30px;
  background: var(--bianco);
  color: var(--grigio);
  cursor: pointer;
  transition: all 0.25s;
}

.filter-btn:hover {
  border-color: var(--rosso);
  color: var(--rosso);
}

.filter-btn.active {
  background: var(--rosso);
  border-color: var(--rosso);
  color: var(--bianco);
}

/* ===== GRIGLIA LAVORI ===== */
.jobs-section {
  padding: 48px 0 90px;
  min-height: 400px;
}

.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

/* Skeleton */
.skeleton-card {
  height: 340px;
  border-radius: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Job card */
.job-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  background: var(--bianco);
}

.job-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.14);
}

.job-card:focus {
  outline: 3px solid var(--rosso);
  outline-offset: 2px;
}

.job-card-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  background: var(--grigio-chiaro);
}

.job-card-img-placeholder {
  width: 100%;
  height: 240px;
  background: var(--grigio-chiaro);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 2.5rem;
}

.job-card-body {
  padding: 20px 22px 22px;
}

.job-card-cat {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--rosso);
  margin-bottom: 8px;
}

.job-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--nero);
  margin-bottom: 8px;
  line-height: 1.3;
}

.job-card-desc {
  font-size: 0.87rem;
  color: var(--grigio);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.job-card-date {
  font-size: 0.78rem;
  color: #aaa;
}

.job-card-count {
  font-size: 0.78rem;
  color: var(--grigio);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 0;
  color: var(--grigio);
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
}

/* ===== LIGHTBOX ===== */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 2000;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 70px;
}

.lightbox-close {
  position: absolute;
  top: 18px; right: 22px;
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  font-size: 1.3rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10;
}

.lightbox-close:hover { background: rgba(255,255,255,0.25); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.10);
  border: none;
  color: white;
  font-size: 2.8rem;
  width: 52px; height: 52px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lightbox-nav:hover { background: rgba(255,255,255,0.22); }
.lightbox-nav.prev { left: 14px; }
.lightbox-nav.next { right: 14px; }

.lightbox-main {
  max-width: 860px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-main img {
  max-width: 100%;
  max-height: 58vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
}

.lightbox-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  max-width: 860px;
  width: 100%;
  padding: 4px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.lb-thumb {
  width: 66px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.50;
  border: 2px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.lb-thumb.active {
  opacity: 1;
  border-color: var(--rosso);
}

.lb-thumb:hover { opacity: 0.80; }

.lightbox-info {
  text-align: center;
  color: white;
  margin-top: 14px;
  max-width: 700px;
  width: 100%;
}

.lightbox-info h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.lightbox-info p {
  font-size: 0.84rem;
  opacity: 0.70;
}

/* ===== FOOTER ===== */
.footer {
  background: #dce6f0;
  color: #2c2c2c;
  padding: 56px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1.6fr;
  gap: 40px;
  margin-bottom: 48px;
  align-items: start;
}

.footer-col {}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-logo-img {
  height: 80px;
  width: auto;
  display: block;
}

.footer-tagline {
  font-size: 0.90rem;
  color: #444;
  line-height: 1.6;
  max-width: 240px;
}

.footer-col-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.80rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--nero);
  margin-bottom: 16px;
}

.footer-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-menu a {
  font-size: 0.90rem;
  color: #444;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-menu a:hover { color: var(--rosso); }

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.social-btn:hover { opacity: 0.85; }
.social-fb { background: #1877f2; }
.social-ig { background: #e1306c; }

.footer-contacts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-contacts li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: #444;
  line-height: 1.4;
}

.contact-icon {
  flex-shrink: 0;
  font-size: 1rem;
  margin-top: 1px;
}

.footer-contacts a {
  color: #444;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-contacts a:hover { color: var(--rosso); }

.footer-bottom {
  border-top: 1px solid rgba(0,0,0,0.12);
  padding: 20px 0;
  text-align: center;
  font-size: 0.78rem;
  color: #666;
  background: #ccd8e6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .navbar-menu { display: none; }
  .navbar-menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--navbar-h);
    left: 0; right: 0;
    background: rgba(240,240,240,0.98);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 12px 0;
    gap: 0;
  }
  .navbar-menu.open li a { padding: 13px 28px; border-radius: 0; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .lightbox { padding: 20px 60px; }
}

@media (max-width: 640px) {
  .hero { height: 320px; }
  .jobs-grid { grid-template-columns: 1fr; }
  .lightbox { padding: 20px 10px; }
  .lightbox-nav { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
