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

:root {
  --color-bg: #fff;
  --color-text: #431A20;       /* color_19: marrone scuro */
  --color-accent: #FD8C38;     /* color_23: arancione */
  --color-light-bg: #FCF9F8;   /* color_26 */
  --color-dark: #431A20;       /* color_19 */
  --color-darker: #220D10;     /* color_20 */
  --color-gray: #525050;       /* color_14 */
  --color-light-gray: #C7C7C7; /* color_13 */
  --color-white: #fff;
  --color-brown-mid: #724F54;  /* color_18 */

  --font-heading: 'Playfair Display', serif;
  --font-body: 'Raleway', sans-serif;

  --site-width: 980px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.4;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-brown-mid);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* === Site Container === */
.site-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Header === */
.site-header {
  background: var(--color-white);
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-logo-link {
  display: block;
}

.header-logo {
  width: 100%;
  max-width: var(--site-width);
  height: auto;
  display: block;
  margin: 0 auto;
}

/* === Navigation === */
.main-nav {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-light-gray);
  position: sticky;
  top: 0;
  z-index: 49;
}

.nav-menu {
  list-style: none;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0;
  height: 40px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-brown-mid);
  text-decoration: none;
}

/* Submenu dropdown */
.has-submenu {
  position: relative;
}

.submenu {
  list-style: none;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-white);
  min-width: 250px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 100;
  padding: 4px 0;
}

.has-submenu:hover .submenu {
  display: block;
}

.submenu-link {
  display: block;
  padding: 8px 20px;
  font-size: 14px;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.2s;
}

.submenu-link:hover {
  background: var(--color-light-bg);
  color: var(--color-brown-mid);
  text-decoration: none;
}

/* === Main Content === */
.main-content {
  flex: 1;
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* === Page Content === */
.page-content {
  padding: 40px 0 60px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 30px;
  line-height: 1.2;
}

.page-body {
  font-size: 16px;
  line-height: 1.6;
}

.page-body p {
  margin-bottom: 1em;
}

.page-body h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 400;
  color: var(--color-text);
  margin: 2em 0 0.8em;
}

.page-body h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 400;
  color: var(--color-text);
  margin: 1.5em 0 0.6em;
}

.page-body ul, .page-body ol {
  margin: 0.5em 0 1em 1.5em;
}

.page-body li {
  margin-bottom: 0.3em;
}

.page-body blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 1.5em 0;
  padding: 0.5em 0 0.5em 1.5em;
  font-style: italic;
  color: var(--color-gray);
}

.page-body img {
  margin: 1em 0;
  border-radius: 2px;
}

.page-body a {
  color: var(--color-accent);
  text-decoration: underline;
}

.page-body a:hover {
  color: var(--color-dark);
}

/* === Home Page === */
.home-content {
  padding: 40px 0 60px;
  max-width: var(--site-width);
  margin: 0 auto;
}

.home-hero {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  margin-bottom: 40px;
}

.home-hero-text {
  flex: 1;
  background: var(--color-dark);
  color: var(--color-white);
  padding: 50px 30px;
}

.home-hero-text h2 {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 400;
  color: var(--color-white);
  margin-bottom: 20px;
}

.home-hero-text p {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 1em;
}

.home-hero-image {
  flex: 0 0 auto;
}

.home-hero-image img {
  max-width: 500px;
}

.home-news {
  background: var(--color-accent);
  padding: 30px;
  margin-bottom: 40px;
}

.home-news h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  color: var(--color-white);
  margin-bottom: 15px;
}

.home-news p, .home-news a {
  color: var(--color-white);
}

.home-news a {
  text-decoration: underline;
}

/* === Two Column Layout === */
.two-col {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.two-col .col-sidebar {
  flex: 0 0 300px;
}

.two-col .col-main {
  flex: 1;
}

/* === Event Cards === */
.event-card {
  background: var(--color-light-bg);
  padding: 20px;
  margin-bottom: 20px;
  border-left: 4px solid var(--color-accent);
}

.event-card h3 {
  margin-top: 0;
}

.event-card .event-date {
  font-size: 14px;
  color: var(--color-gray);
  margin-bottom: 8px;
}

/* === Book Grid === */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.book-grid figure {
  margin: 0;
  text-align: center;
}

.book-grid figcaption {
  font-size: 12px;
  margin-top: 6px;
  color: var(--color-gray);
}

/* === Contact Form === */
.contact-form {
  max-width: 600px;
}

.contact-form .form-group {
  margin-bottom: 16px;
}

.contact-form label {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--color-gray);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-light-gray);
  font-family: var(--font-body);
  font-size: 14px;
  border-radius: 0;
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form button {
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  padding: 10px 30px;
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.contact-form button:hover {
  background: var(--color-dark);
}

/* === Catalog Specs === */
.catalog-specs {
  background: var(--color-light-bg);
  padding: 20px 25px;
  margin: 20px 0;
}

.catalog-specs dt {
  font-weight: 700;
  display: inline;
}

.catalog-specs dd {
  display: inline;
  margin: 0 0 0 5px;
}

.catalog-specs dd::after {
  content: "";
  display: block;
  margin-bottom: 6px;
}

/* === Partner Cards === */
.partner-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--color-light-gray);
}

.partner-card img {
  flex: 0 0 150px;
  max-width: 150px;
}

.partner-card:last-child {
  border-bottom: none;
}

/* === Footer === */
.site-footer {
  background: var(--color-dark);
  color: var(--color-white);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 25px 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.footer-text {
  font-size: 14px;
}

.footer-text a {
  color: var(--color-white);
  text-decoration: none;
}

.footer-text a:hover {
  text-decoration: underline;
}

/* === Responsive === */
@media (max-width: 768px) {
  .nav-menu {
    flex-wrap: wrap;
    height: auto;
    padding: 5px 10px;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 14px;
  }

  .home-hero {
    flex-direction: column;
  }

  .home-hero-image img {
    max-width: 100%;
  }

  .two-col {
    flex-direction: column;
  }

  .two-col .col-sidebar {
    flex: auto;
  }

  .partner-card {
    flex-direction: column;
  }

  .partner-card img {
    max-width: 200px;
  }

  .page-title {
    font-size: 26px;
  }

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