/* 
 * Pellegrin Days APS - Global Stylesheet
 * Custom premium design system utilizing an HSL-based palette
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette (HSL System) */
  --bg-color: hsl(0, 0%, 98%);
  --card-bg: hsl(0, 0%, 100%);
  --text-main: hsl(348, 25%, 12%);
  --text-muted: hsl(348, 12%, 40%);
  --text-light: hsl(0, 0%, 100%);
  
  --primary: hsl(348, 65%, 23%);
  --primary-hover: hsl(348, 65%, 16%);
  --primary-light: hsl(348, 65%, 96%);
  
  --accent: hsl(348, 60%, 38%);
  --accent-hover: hsl(348, 60%, 30%);
  --accent-light: hsl(348, 30%, 95%);
  
  --success: hsl(150, 75%, 32%);
  --warning: hsl(45, 95%, 40%);
  --border-color: hsl(348, 20%, 90%);
  
  /* Shadows & Radius */
  --shadow-sm: 0 2px 4px rgba(20, 20, 20, 0.04);
  --shadow-md: 0 10px 30px rgba(20, 20, 20, 0.06);
  --shadow-lg: 0 20px 40px rgba(20, 20, 20, 0.1);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font-body: 'Inter', sans-serif;
  --font-headings: 'Outfit', sans-serif;
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

label {
  font-family: var(--font-headings);
  font-weight: 600;
}


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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  font-weight: 700;
  line-height: 1.25;
  color: var(--primary);
}

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

/* Section Common Styles */
section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: var(--accent);
  border-radius: 2px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  gap: 8px;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(90, 15, 27, 0.25);
}

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

.btn-accent:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(90, 15, 27, 0.25);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--text-light);
  transform: translateY(-2px);
}

/* Header & Navigation */
header {
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

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

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-wrapper img {
  transition: var(--transition);
}

.logo-wrapper:hover img {
  transform: scale(1.06);
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px rgba(90, 15, 27, 0.15) !important;
}

.logo-wrapper .logo-title {
  transition: var(--transition);
}

.logo-wrapper:hover .logo-title {
  color: var(--accent);
}

/* Elegant Text Logo Placeholder */
.logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-headings);
  font-weight: 800;
  font-size: 1.3rem;
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-sm);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-headings);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--primary);
  line-height: 1.1;
}

.logo-subtitle {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: auto;
  margin-right: 16px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 28px;
}

.nav-links a {
  font-family: var(--font-headings);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 6px 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Header Utilities */
.search-btn, .menu-toggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover, .menu-toggle:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.menu-toggle {
  display: none;
}

/* Mobile Sidebar Styles */
.mobile-sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mobile-sidebar.open {
  right: 0;
}

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

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.mobile-links {
  display: flex;
  flex-direction: column;
  list-style: none;
  gap: 24px;
}

.mobile-links a {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-muted);
}

.mobile-links a.active, .mobile-links a:hover {
  color: var(--accent);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(90, 15, 27, 0.4);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Search Modal */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(90, 15, 27, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1200;
  display: flex;
  align-items: flex-start; /* Consente lo scorrimento dall'alto */
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  overflow-y: auto; /* Abilita lo scroll verticale sull'intero overlay */
  padding: 40px 10px;
}

.search-modal.open {
  opacity: 1;
  visibility: visible;
}

.search-modal-container {
  width: 90%;
  max-width: 600px;
  background-color: var(--card-bg);
  padding: 40px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.search-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}


/* Footer Section */
footer {
  background-color: var(--primary);
  color: var(--text-light);
  padding: 80px 0 30px 0;
  border-top: 5px solid var(--accent);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 60px;
}

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

.footer-brand .logo-placeholder {
  background-color: var(--primary-light);
  border-color: var(--text-light);
  color: var(--primary);
}

.footer-brand .logo-title {
  color: var(--text-light);
}

.footer-brand p {
  color: var(--border-color);
  font-size: 0.95rem;
}

.footer-socials {
  display: flex;
  gap: 12px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--text-light);
  font-size: 1rem;
  transition: var(--transition);
}

.social-icon:hover {
  background-color: var(--accent);
  transform: translateY(-3px);
}

.footer-links-col h4 {
  color: var(--accent);
  font-family: var(--font-headings);
  font-size: 1.1rem;
  margin-bottom: 24px;
}

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

.footer-links-col a {
  color: var(--border-color);
  font-size: 0.95rem;
}

.footer-links-col a:hover {
  color: var(--accent);
  padding-left: 5px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--border-color);
  font-size: 0.85rem;
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

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

/* Content Image Hovers */
.storia-image-wrapper img,
.aps-image-wrapper img {
  transition: var(--transition);
}

.storia-image-wrapper:hover img,
.aps-image-wrapper:hover img {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg) !important;
  border-color: var(--accent) !important;
}

/* Responsive Breakpoints */
.grid-2-col {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
}

.grid-2-col-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

@media (max-width: 992px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
  
  .grid-2-col, .grid-2-col-equal {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
    text-align: center;
  }
  
  .grid-2-col img, .grid-2-col-equal img {
    margin: 0 auto;
    max-width: 100%;
  }
  
  #storia div, #cosa-significa-aps div {
    text-align: center !important;
  }
}

@media (max-width: 768px) {
  section {
    padding: 60px 0;
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
  
  .main-nav {
    display: none;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .footer-top {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  h1 {
    font-size: 2.25rem !important;
  }
  h2 {
    font-size: 1.75rem !important;
  }
  h3 {
    font-size: 1.4rem !important;
  }
}

@media (max-width: 576px) {
  .header-container {
    height: 70px;
    padding: 0 16px;
  }
  
  .logo-wrapper img {
    height: 40px !important;
    width: 40px !important;
  }
  
  .logo-title {
    font-size: 1.05rem !important;
  }
  
  .logo-subtitle {
    font-size: 0.7rem !important;
  }
  
  .nav-actions {
    gap: 8px !important;
  }
  
  .search-btn, .menu-toggle {
    padding: 6px !important;
    font-size: 1.15rem !important;
  }
  
  .search-modal-container {
    padding: 24px !important;
    width: 95% !important;
    margin: 20px auto !important;
  }
}

