/* ============================================
   ISTITUTO SAN GIUSEPPE - CSS GLOBALE
   Font: Playfair Display + Source Sans 3
   Palette: Blu #1B4D6E / Arancione #E8913A
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #1B4D6E;
  --primary-light: #2A6F97;
  --primary-dark: #0F3049;
  --accent: #E8913A;
  --accent-light: #F4A94D;
  --accent-glow: rgba(232, 145, 58, 0.15);
  --cream: #FDF8F0;
  --warm-white: #FEFCF8;
  --text-dark: #1A1A2E;
  --text-mid: #4A4A5A;
  --text-light: #6B6B7B;
  --border-soft: rgba(27, 77, 110, 0.08);
  --shadow-soft: 0 4px 24px rgba(27, 77, 110, 0.06);
  --shadow-card: 0 8px 32px rgba(27, 77, 110, 0.08);
  --shadow-hover: 0 12px 40px rgba(27, 77, 110, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
  color: var(--text-dark);
  background: var(--warm-white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================
   HEADER
   ========================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 32px;
  transition: all 0.4s ease;
  background: var(--cream);
  box-shadow: 0 1px 12px rgba(27, 77, 110, 0.06);
}
.site-header.scrolled {
  background: rgba(253, 248, 240, 0.97);
  backdrop-filter: blur(16px);
  box-shadow: 0 2px 20px rgba(27, 77, 110, 0.1);
}
/* Header scuro di default sulle pagine interne */
.site-header.header-solid {
  background: rgba(15, 48, 73, 0.97);
  backdrop-filter: blur(16px);
}
.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  transition: height 0.4s ease;
}
.site-header.scrolled .header-inner { height: 64px; }
.header-logo {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: var(--primary-dark);
}
.header-logo img {
  height: 46px; width: auto;
  transition: height 0.4s ease;
}
.site-header.scrolled .header-logo img { height: 38px; }
/* Pagine interne: logo bianco */
.site-header.header-solid .header-logo img {
  filter: brightness(0) invert(1);
}
.site-header.header-solid .header-logo { color: #fff; }
.header-logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.header-logo-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem; font-weight: 700; color: var(--primary-dark);
}
.header-logo-sub {
  font-size: 0.72rem; font-weight: 400;
  color: var(--text-light); letter-spacing: 0.5px;
}
/* Pagine interne: testi header bianchi */
.site-header.header-solid .header-logo-name { color: #fff; }
.site-header.header-solid .header-logo-sub { color: rgba(255,255,255,0.6); }
.header-nav {
  display: flex; align-items: center; gap: 6px;
}
.header-nav a {
  color: var(--text-mid); text-decoration: none;
  font-size: 14px; font-weight: 500;
  padding: 8px 16px; border-radius: 8px;
  transition: all 0.25s ease; letter-spacing: 0.2px;
}
.header-nav a:hover { color: var(--primary-dark); background: rgba(27, 77, 110, 0.06); }
.header-nav a.active { color: var(--primary-dark); background: rgba(232, 145, 58, 0.12); }
/* Pagine interne: link bianchi */
.site-header.header-solid .header-nav a { color: rgba(255,255,255,0.8); }
.site-header.header-solid .header-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.site-header.header-solid .header-nav a.active { color: #fff; background: rgba(232, 145, 58, 0.2); }
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  cursor: pointer; display: flex; align-items: center; gap: 4px;
}
.nav-dropdown-toggle svg {
  width: 14px; height: 14px; stroke: currentColor;
  transition: transform 0.3s ease;
}
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 8px);
  left: 50%; transform: translateX(-50%) translateY(8px);
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 8px; min-width: 220px;
  opacity: 0; visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 12px 40px rgba(27, 77, 110, 0.12);
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown:hover .nav-dropdown-toggle svg { transform: rotate(180deg); }
.nav-dropdown-menu a {
  display: block; padding: 10px 14px; border-radius: 8px;
  font-size: 13.5px; color: var(--text-mid); white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: rgba(27, 77, 110, 0.05); color: var(--primary-dark); }
/* Pagine interne: dropdown scuro */
.site-header.header-solid .nav-dropdown-menu {
  background: rgba(15, 48, 73, 0.97); border-color: rgba(255,255,255,0.1);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.site-header.header-solid .nav-dropdown-menu a { color: rgba(255,255,255,0.75); }
.site-header.header-solid .nav-dropdown-menu a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.header-cta {
  margin-left: 10px;
  background: var(--accent); color: #fff !important;
  border-radius: 50px !important; padding: 9px 22px !important;
  font-weight: 600 !important; font-size: 13px !important;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 12px rgba(232, 145, 58, 0.3);
  transition: all 0.3s ease !important;
}
.header-cta:hover {
  background: var(--accent-light) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(232, 145, 58, 0.4) !important;
}
.menu-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: 8px; z-index: 1001;
}
.menu-toggle span {
  display: block; width: 24px; height: 2px; background: var(--primary-dark);
  margin: 6px 0; border-radius: 2px; transition: all 0.3s ease;
}
/* Pagine interne: hamburger bianco */
.site-header.header-solid .menu-toggle span { background: #fff; }
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* ==========================================
   PAGE HERO (pagine interne)
   ========================================== */
.page-hero {
  padding: 140px 24px 60px;
  background: linear-gradient(165deg, #0A1F30 0%, #0F3049 40%, var(--primary) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(232, 145, 58, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, rgba(42, 111, 151, 0.12) 0%, transparent 50%);
}
.page-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 700;
  color: #fff; position: relative; z-index: 1; margin-bottom: 12px;
}
.page-hero p {
  font-size: 1.1rem; color: rgba(255,255,255,0.7);
  max-width: 600px; margin: 0 auto; position: relative; z-index: 1;
  line-height: 1.7; font-weight: 300;
}
.page-hero .breadcrumb {
  position: relative; z-index: 1;
  margin-bottom: 20px; font-size: 13px;
  color: rgba(255,255,255,0.4);
}
.page-hero .breadcrumb a {
  color: rgba(255,255,255,0.5); text-decoration: none;
  transition: color 0.25s ease;
}
.page-hero .breadcrumb a:hover { color: var(--accent-light); }

/* ==========================================
   SEZIONI GENERALI
   ========================================== */
.section { padding: 80px 24px; }
.container { max-width: 1140px; margin: 0 auto; }
.section-label {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 700;
  color: var(--primary-dark); line-height: 1.25; margin-bottom: 20px;
}
.section-text {
  font-size: 1.05rem; line-height: 1.8;
  color: var(--text-mid); max-width: 620px;
}

/* ==========================================
   BOTTONI
   ========================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 50px;
  font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: none;
  transition: all 0.3s ease; letter-spacing: 0.3px;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 20px rgba(232, 145, 58, 0.35);
}
.btn-primary:hover {
  background: var(--accent-light); transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(232, 145, 58, 0.45);
}
.btn-outline {
  background: transparent; color: #fff;
  border: 2px solid rgba(255,255,255,0.35);
}
.btn-outline:hover {
  border-color: #fff; background: rgba(255,255,255,0.08);
  transform: translateY(-2px);
}
.btn-outline-dark {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline-dark:hover {
  background: var(--primary); color: #fff;
  transform: translateY(-2px);
}
.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 600;
  text-decoration: none; margin-top: 24px; font-size: 15px;
  transition: gap 0.3s ease;
}
.link-arrow:hover { gap: 12px; }

/* ==========================================
   CONTENT BLOCKS (pagine interne)
   ========================================== */
.content-section { background: var(--warm-white); }
.content-section.alt { background: var(--cream); }
.content-section.dark {
  background: linear-gradient(170deg, var(--primary-dark) 0%, #152F45 50%, var(--primary) 100%);
}
.content-section.dark .section-title { color: #fff; }
.content-section.dark .section-text { color: rgba(255,255,255,0.7); }
.content-section.dark .section-label { color: var(--accent-light); }

.content-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 60px; align-items: start;
}
.content-prose {
  font-size: 1.02rem; line-height: 1.85; color: var(--text-mid);
}
.content-prose p { margin-bottom: 18px; }
.content-prose ul {
  margin: 16px 0; padding-left: 0; list-style: none;
}
.content-prose ul li {
  position: relative; padding-left: 24px; margin-bottom: 12px;
  line-height: 1.7;
}
.content-prose ul li::before {
  content: '';
  position: absolute; left: 0; top: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); opacity: 0.6;
}
.content-prose a {
  color: var(--accent); text-decoration: none;
  font-weight: 600; border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.content-prose a:hover { border-bottom-color: var(--accent); }

.content-card {
  background: #fff; border-radius: var(--radius);
  padding: 36px; box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
}

.image-placeholder {
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5); font-size: 14px;
}

/* ==========================================
   INFO CARDS / FEATURE GRID
   ========================================== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.feature-card {
  background: #fff; border-radius: var(--radius);
  padding: 32px 24px; box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  text-align: center; transition: all 0.35s ease;
}
.feature-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-hover);
}
.feature-card .icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; background: rgba(27, 77, 110, 0.1);
}
.feature-card .icon svg {
  width: 28px; height: 28px; stroke: var(--primary);
}
.feature-card .icon.orange { background: var(--accent-glow); }
.feature-card .icon.orange svg { stroke: var(--accent); }
.feature-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem; font-weight: 600;
  color: var(--primary-dark); margin-bottom: 8px;
}
.feature-card p { font-size: 0.93rem; color: var(--text-light); line-height: 1.65; }

/* ==========================================
   TABELLA STYLED
   ========================================== */
.styled-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem; margin-top: 24px;
  border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.styled-table thead {
  background: var(--primary); color: #fff;
}
.styled-table th {
  padding: 14px 16px; text-align: left;
  font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.styled-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--border-soft);
  color: var(--text-mid);
}
.styled-table tbody tr:hover { background: rgba(27, 77, 110, 0.03); }
.styled-table tbody tr:last-child td { border-bottom: none; }
.table-badge {
  display: inline-block; padding: 3px 10px; border-radius: 50px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px;
}
.table-badge.active { background: rgba(46, 160, 100, 0.12); color: #2EA064; }
.table-badge.closed { background: rgba(150,150,150,0.12); color: #888; }
.table-badge.open { background: var(--accent-glow); color: var(--accent); }

/* ==========================================
   FORM
   ========================================== */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 0.88rem; font-weight: 600;
  color: var(--text-dark); margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 12px 16px;
  border: 1px solid rgba(27, 77, 110, 0.15);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.95rem;
  color: var(--text-dark); background: #fff;
  transition: border-color 0.25s ease;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 77, 110, 0.08);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.85rem; color: var(--text-light); margin-top: 16px;
}
.form-check input[type="checkbox"] { margin-top: 3px; accent-color: var(--primary); }

/* ==========================================
   CTA SECTION
   ========================================== */
.cta-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  text-align: center; padding: 80px 24px;
  position: relative; overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute; bottom: -100px; left: -100px;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(232, 145, 58, 0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.cta-content {
  position: relative; z-index: 2;
  max-width: 640px; margin: 0 auto;
}
.cta-section h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 700;
  color: #fff; margin-bottom: 16px;
}
.cta-section p {
  font-size: 1.08rem; color: rgba(255,255,255,0.75);
  line-height: 1.7; margin-bottom: 32px; font-weight: 300;
}
.cta-contacts {
  display: flex; justify-content: center;
  gap: 32px; margin-top: 28px; flex-wrap: wrap;
}
.cta-contact-item {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.7); font-size: 14px;
  text-decoration: none; transition: color 0.3s ease;
}
.cta-contact-item:hover { color: #fff; }
.cta-contact-item svg { width: 18px; height: 18px; stroke: var(--accent-light); }

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
  background: #0A1F30; color: rgba(255,255,255,0.7);
  position: relative; overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 145, 58, 0.3), transparent);
}
.footer-main {
  max-width: 1140px; margin: 0 auto;
  padding: 64px 32px 48px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px;
}
.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-brand-logo { display: flex; align-items: center; gap: 12px; }
.footer-brand-logo img { height: 44px; filter: brightness(0) invert(1); opacity: 0.8; }
.footer-brand-logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.footer-brand-logo-text strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem; font-weight: 700; color: #fff;
}
.footer-brand-logo-text span { font-size: 0.72rem; color: rgba(255,255,255,0.5); }
.footer-brand p {
  font-size: 0.88rem; line-height: 1.7;
  color: rgba(255,255,255,0.5); max-width: 300px;
}
.footer-social { display: flex; gap: 10px; margin-top: 4px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; text-decoration: none;
}
.footer-social a:hover {
  background: rgba(232, 145, 58, 0.15);
  border-color: rgba(232, 145, 58, 0.3); transform: translateY(-2px);
}
.footer-social a svg {
  width: 18px; height: 18px;
  fill: rgba(255,255,255,0.6); transition: fill 0.3s ease;
}
.footer-social a:hover svg { fill: var(--accent-light); }
.footer-col h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.95rem; font-weight: 600; color: #fff;
  margin-bottom: 20px; position: relative; padding-bottom: 12px;
}
.footer-col h4::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 28px; height: 2px; background: var(--accent); border-radius: 2px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul li a {
  color: rgba(255,255,255,0.55); text-decoration: none;
  font-size: 0.88rem; transition: all 0.25s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.footer-col ul li a:hover { color: var(--accent-light); padding-left: 4px; }
.footer-contact-item {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 14px; font-size: 0.88rem; color: rgba(255,255,255,0.55);
}
.footer-contact-item a {
  color: rgba(255,255,255,0.55); text-decoration: none; transition: color 0.25s ease;
}
.footer-contact-item a:hover { color: var(--accent-light); }
.footer-contact-item svg {
  width: 16px; height: 16px; stroke: var(--accent);
  flex-shrink: 0; margin-top: 2px;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 20px 32px; max-width: 1140px; margin: 0 auto;
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: 0.78rem; color: rgba(255,255,255,0.35); }
.footer-bottom a {
  color: rgba(255,255,255,0.45); text-decoration: none;
  font-size: 0.78rem; transition: color 0.25s ease;
}
.footer-bottom a:hover { color: var(--accent-light); }
.footer-bottom-links { display: flex; gap: 20px; }

/* ==========================================
   SCROLL REVEAL
   ========================================== */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  .content-grid { grid-template-columns: 1fr; gap: 36px; }
  .feature-grid { grid-template-columns: 1fr; }
  .page-hero { padding: 120px 24px 48px; }
  .styled-table { font-size: 0.8rem; display: block; overflow-x: auto; }

  .site-header { padding: 0 20px; }
  .header-nav {
    position: fixed; top: 0; right: -100%;
    width: 80%; max-width: 320px; height: 100vh;
    background: rgba(10, 31, 48, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column; align-items: flex-start;
    padding: 90px 28px 40px; gap: 4px;
    transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: -8px 0 40px rgba(0,0,0,0.3);
  }
  .header-nav.open { right: 0; }
  .header-nav a { width: 100%; font-size: 15px; padding: 12px 16px; color: rgba(255,255,255,0.85); }
  .header-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
  .header-nav a.active { color: #fff; background: rgba(232, 145, 58, 0.2); }
  .header-cta {
    margin-left: 0 !important; margin-top: 12px;
    text-align: center; width: 100%; display: block !important;
  }
  .menu-toggle { display: block; }
  .menu-toggle span { background: var(--primary-dark); }
  .nav-dropdown-menu {
    position: static; transform: none;
    background: rgba(255,255,255,0.04); border: none;
    box-shadow: none; opacity: 1; visibility: visible;
    padding: 4px 0 4px 12px; min-width: auto;
    margin-top: 4px; display: none;
  }
  .nav-dropdown-menu a { color: rgba(255,255,255,0.65) !important; }
  .nav-dropdown-menu a:hover { color: #fff !important; background: rgba(255,255,255,0.08) !important; }
  .nav-dropdown.mobile-open .nav-dropdown-menu { display: block; }

  .footer-main { grid-template-columns: 1fr; gap: 36px; padding: 48px 24px 36px; }
  .footer-bottom { flex-direction: column; text-align: center; padding: 16px 24px; }
  .footer-bottom-links { justify-content: center; }

  .cta-contacts { flex-direction: column; align-items: center; }
}
