/* -------------------------------------------------------------
   "Una vacanza a Sirolo" - Custom Stylesheet
   Author: Antigravity AI
   Design System: Elegance, Nostalgia, Light-weight, Accessible
   ------------------------------------------------------------- */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables & Design Tokens --- */
:root {
  /* Color Palette */
  --color-bg-primary: #fbf9f6;     /* Warm paper/sand background */
  --color-bg-secondary: #f3efe9;   /* Slightly darker sand paper */
  --color-bg-card: #ffffff;        /* Pure white for cards */
  --color-text-main: #2d2a26;      /* Off-black charcoal for readability */
  --color-text-muted: #5e5a54;     /* Soft brown-gray for secondary text */
  --color-primary: #0f2a4a;        /* Deep sea blue (Conero) */
  --color-primary-light: #1b3d64;  /* Lighter sea blue for hover states */
  --color-accent: #bca374;         /* Soft gold/sand for details and borders */
  --color-accent-dark: #9a8256;    /* Darker gold for contrast on light bg */
  --color-white: #ffffff;
  --color-error: #a83232;
  --color-success: #1e6b43;

  /* Typography */
  --font-headings: 'Lora', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Transitions & Shadows */
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
  --shadow-subtle: 0 8px 30px rgba(45, 42, 38, 0.04);
  --shadow-medium: 0 16px 40px rgba(45, 42, 38, 0.08);
  --border-radius: 8px;
  --border-radius-lg: 16px;

  /* Layout */
  --container-width: 1140px;
  --header-height: 80px;
}

/* --- Base Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  -webkit-text-size-adjust: 100%;
}

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

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-headings);
  font-weight: 500;
  line-height: 1.25;
  color: var(--color-primary);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
  padding-bottom: 0.75rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: var(--color-accent);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.2rem;
  color: var(--color-text-muted);
}

p.lead {
  font-size: 1.25rem;
  font-family: var(--font-headings);
  font-style: italic;
  line-height: 1.6;
  color: var(--color-primary);
}

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

a:hover {
  color: var(--color-accent-dark);
}

/* --- Reusable Components --- */
.container {
  width: 90%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--border-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 4px 15px rgba(15, 42, 74, 0.15);
}

.btn-primary:hover {
  background-color: var(--color-primary-light);
  transform: translateY(-2px);
  color: var(--color-white);
  box-shadow: 0 8px 20px rgba(15, 42, 74, 0.25);
}

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

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

/* --- Header & Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(251, 249, 246, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.02);
  transition: var(--transition-smooth);
}

.site-header.scrolled {
  height: 70px;
  background-color: rgba(251, 249, 246, 0.98);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo-link {
  font-family: var(--font-headings);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-accent);
  border-radius: 50%;
}

.nav-menu ul {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  position: relative;
  padding: 0.5rem 0;
}

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

.nav-link:hover {
  color: var(--color-primary);
}

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

.nav-link.active {
  color: var(--color-primary);
}

/* Hamburger Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1100;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--color-primary);
  margin: 5px 0;
  transition: var(--transition-smooth);
}

/* --- Hero Section (Book Presentation) --- */
.hero {
  padding: calc(var(--header-height) + 4rem) 0 5rem 0;
  min-height: 90vh;
  display: flex;
  align-items: center;
  background: radial-gradient(circle at 80% 20%, rgba(188, 163, 116, 0.08) 0%, rgba(251, 249, 246, 0) 60%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-cta {
  display: flex;
  gap: 1.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.book-quote {
  border-left: 3px solid var(--color-accent);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-family: var(--font-headings);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--color-primary);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  animation: slideUp 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-cover-wrapper {
  position: relative;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-medium);
  overflow: hidden;
  transition: var(--transition-smooth);
  aspect-ratio: 1057 / 1500;
  width: 100%;
  max-width: 380px;
}

.book-cover-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset -15px 0 30px rgba(0, 0, 0, 0.05), inset 15px 0 30px rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.book-cover-wrapper:hover {
  transform: translateY(-8px) rotate(1deg);
  box-shadow: 0 25px 50px rgba(45, 42, 38, 0.15);
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Decorative background circle */
.deco-circle {
  position: absolute;
  width: 120%;
  height: 120%;
  background-color: var(--color-bg-secondary);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.6;
  filter: blur(40px);
}

/* --- Sections General Styling --- */
.section {
  padding: 6rem 0;
}

.section-bg {
  background-color: var(--color-bg-secondary);
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  padding-bottom: 0.75rem;
}

.section-header h2::after {
  left: 50%;
  transform: translateX(-50%);
}

/* --- Biography Section --- */
.bio-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4rem;
  align-items: center;
}

.bio-image-wrapper {
  position: relative;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-medium);
  aspect-ratio: 1 / 1;
}

.bio-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(10%) contrast(102%);
}

.bio-text {
  font-size: 1.05rem;
}

/* --- Events Section --- */
.events-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.event-card {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  column-gap: 2rem;
  background-color: var(--color-bg-card);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-subtle);
  border-left: 4px solid var(--color-accent);
  transition: var(--transition-smooth);
}

.event-card:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-medium);
  border-left-color: var(--color-primary);
}

.event-date {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.event-day {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-headings);
  color: var(--color-primary);
  line-height: 1;
}

.event-month {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-dark);
  font-weight: 600;
  margin-top: 0.25rem;
}

.event-details h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.event-location {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-location svg {
  color: var(--color-accent);
  flex-shrink: 0;
}

.event-action .btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
}

/* Empty state event */
.no-events {
  text-align: center;
  padding: 3rem;
  background-color: var(--color-bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-subtle);
  border: 1px dashed var(--color-accent);
  color: var(--color-text-muted);
}

/* --- Contact & Socials Section --- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 5rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-intro {
  margin-bottom: 2.5rem;
}

.contact-methods {
  list-style: none;
  margin-bottom: 3rem;
}

.contact-method-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-bg-secondary);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.contact-method-item:hover .contact-icon {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.contact-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.contact-title-row h2 {
  margin-bottom: 0;
}

.social-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-accent);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

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

/* Form Styles */
.contact-form-wrapper {
  background-color: var(--color-bg-card);
  padding: 3rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-medium);
  position: relative;
}

.form-group {
  margin-bottom: 1.8rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 1rem 1.2rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid var(--color-bg-secondary);
  background-color: var(--color-bg-primary);
  border-radius: var(--border-radius);
  color: var(--color-text-main);
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent-dark);
  background-color: var(--color-white);
  box-shadow: 0 0 0 3px rgba(188, 163, 116, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 140px;
}

/* Custom Checkbox for Privacy */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  margin-top: 0.2rem;
  cursor: pointer;
}

.checkbox-group label {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  cursor: pointer;
  text-transform: none;
  font-weight: normal;
  letter-spacing: normal;
}

.checkbox-group label a {
  text-decoration: underline;
  color: var(--color-primary);
}

.checkbox-group label a:hover {
  color: var(--color-accent-dark);
}

/* Form status feedback */
.form-status {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  display: none;
}

.form-status.success {
  display: block;
  background-color: rgba(30, 107, 67, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(30, 107, 67, 0.2);
}

.form-status.error {
  display: block;
  background-color: rgba(168, 50, 50, 0.1);
  color: var(--color-error);
  border: 1px solid rgba(168, 50, 50, 0.2);
}

/* --- Footer --- */
.site-footer {
  background-color: var(--color-primary);
  color: rgba(255, 255, 255, 0.75);
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
}

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

/* --- Privacy Page Layout --- */
.privacy-page {
  padding-top: calc(var(--header-height) + 3rem);
}

.privacy-content {
  max-width: 800px;
  margin: 0 auto 5rem auto;
  background-color: var(--color-bg-card);
  padding: 4rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-subtle);
}

.privacy-content h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.privacy-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.privacy-content ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--color-text-muted);
}

.privacy-content li {
  margin-bottom: 0.5rem;
}

.back-link-wrapper {
  margin-bottom: 2rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

.back-link:hover {
  color: var(--color-accent-dark);
  transform: translateX(-3px);
}

/* --- Raccolta (Book Composition & Stories) --- */
.raccolta-intro {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  margin-bottom: 5rem;
}

.raccolta-description h3 {
  font-family: var(--font-headings);
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  color: var(--color-primary);
}

.raccolta-style-quote {
  background-color: var(--color-bg-secondary);
  padding: 2.5rem;
  border-radius: var(--border-radius-lg);
  border-left: 4px solid var(--color-accent);
  align-self: start;
}

.raccolta-style-quote h3 {
  font-family: var(--font-headings);
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.raccolta-style-quote p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.raccolta-style-quote p:last-child {
  margin-bottom: 0;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.story-card {
  background-color: var(--color-bg-card);
  border: 1px solid rgba(188, 163, 116, 0.15);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.story-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--color-accent);
  opacity: 0.7;
  transition: var(--transition-smooth);
}

.story-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
  border-color: rgba(15, 42, 74, 0.15);
}

.story-card:hover::before {
  background-color: var(--color-primary);
  opacity: 1;
}

.story-num {
  font-family: var(--font-headings);
  font-size: 2.5rem;
  font-weight: 700;
  color: rgba(188, 163, 116, 0.15);
  line-height: 1;
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
}

.story-card h3 {
  font-family: var(--font-headings);
  font-size: 1.3rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.story-card p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin: 0;
  flex-grow: 1;
}

.story-card.placeholder-card {
  background: transparent;
  border: 2px dashed var(--color-accent);
  box-shadow: none;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0.7;
  min-height: 200px;
}

.story-card.placeholder-card::before {
  display: none;
}

.story-card.placeholder-card p {
  font-family: var(--font-headings);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--color-accent-dark);
  margin: 0;
}

/* --- Keyframe Animations --- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive Media Queries --- */
@media (max-width: 992px) {
  :root {
    --header-height: 70px;
  }

  .raccolta-intro {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
  }

  .hero {
    padding: calc(var(--header-height) + 2rem) 0 4rem 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .book-quote {
    border-left: none;
    border-top: 1px solid var(--color-accent);
    border-bottom: 1px solid var(--color-accent);
    padding: 1.5rem 0;
    margin: 2rem 0;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-visual {
    order: -1; /* Display book cover on top for mobile */
  }

  .bio-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .bio-image-wrapper {
    max-width: 320px;
    margin: 0 auto;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .contact-info {
    text-align: center;
  }

  .contact-method-item {
    justify-content: center;
  }

  .contact-title-row {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 768px) {
  /* Navigation Mobile Toggle */
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: var(--color-bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  }

  .nav-menu ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-link {
    font-size: 1.2rem;
  }

  /* Hamburger transform animation when active */
  .menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Event card mobile stacking */
  .event-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
    justify-items: center;
  }

  .event-date {
    align-items: center;
  }

  .event-location {
    justify-content: center;
  }

  .contact-form-wrapper {
    padding: 2rem 1.5rem;
  }

  .privacy-content {
    padding: 2rem;
  }
}
