/*!========================================================================
 * Overrides
 * ======================================================================!*/

.logo__wrapper-img {
  max-width: 120px;
}

@media screen and (min-width: 768px){
  .logo__wrapper-img {
    max-width: none;
  }
}

/* ------------------------------------------------------------------------
 * Figure Member — swap title to grey version on hover
 * Replaces the old "has-social" behaviour: the title is visible by default
 * and, on hover, it is replaced by a grey copy of itself using the same
 * slide + fade effect the social icons used to have.
 * ----------------------------------------------------------------------*/

/* Default title — visible; on hover it slides up and fades out */
.figure-member_reveal-title .figure-member__title {
  transition: all 0.2s cubic-bezier(0.785, 0.135, 0.15, 0.86);
}

.figure-member_reveal-title:hover .figure-member__title {
  transform: translateY(-20px);
  opacity: 0;
  visibility: hidden;
  transition-delay: 0ms;
}

/* Grey title — stacked on top of the default one, hidden until hover */
.figure-member_reveal-title .figure-member__title-grey {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  color: var(--color-gray-1);
  transform: translateY(30px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.785, 0.135, 0.15, 0.86);
}

/* On hover the grey title slides into place and fades in */
.figure-member_reveal-title:hover .figure-member__title-grey {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition-delay: 80ms;
}

/* Product cards — the lazy-loader builds a fixed 2:3 box from the img's
 * 680x1020 attributes, and the global `.lazy > img { width:100%; height:100% }`
 * rule would stretch any cover that isn't exactly 2:3. `contain` keeps the
 * image's own aspect ratio, letterboxing it inside the box when it differs. */
.figure-member_reveal-title .figure-member__avatar img {
  object-fit: contain;
  object-position: center;
}

/* Keep the rest of the original hover feel */
.figure-member_reveal-title:hover .figure-member__avatar img {
  transform: scale(1.1);
}

.figure-member_reveal-title:hover .figure-member__headline {
  width: 80px;
}

.section-masthead .lazy-bg {
  background-size: contain;
}

/* Fullscreen masthead must fill the viewport — no letterbox bands */
.section-masthead .section-masthead__background_fullscreen .lazy-bg {
  background-size: cover;
}

/* Bottom full-width masthead (e.g. "Il Nostro Lavoro") — the photo
 * background must span the full width, not be letterboxed by `contain`. */
.section-masthead .section-masthead__background.section .lazy-bg {
  background-size: cover;
}

/* Category masthead — title overlaid on a background banner (image
 * ~1920x400). The height comes from `section_h-400`; this only centers
 * the title vertically over the image. */
.section-masthead_overlay {
  display: flex;
  align-items: center;
}

.section-masthead_overlay .section-masthead__inner {
  width: 100%;
}

/* ------------------------------------------------------------------------
 * Product certification icons (suino, DOP…) shown side by side
 * ----------------------------------------------------------------------*/
.product-icon {
  height: 100px;
  width: auto;
}

/* ------------------------------------------------------------------------
 * Legal pages (Privacy / Cookie Policy) — readable long-form text column
 * ----------------------------------------------------------------------*/
.legal-content {
  text-align: left;
}

.legal-content__lead {
  font-size: 1.1em;
  color: var(--color-gray-1);
}

.legal-content__heading {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.legal-content__subheading {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.legal-content p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.legal-content ul,
.legal-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.legal-content ul li {
  list-style: disc;
}

.legal-content ol li {
  list-style: decimal;
}

.legal-content li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.legal-content a {
  text-decoration: underline;
}

.legal-content__note {
  color: var(--color-gray-1);
}

.header__widget-title {
    margin-bottom: 1rem;
}

/* ------------------------------------------------------------------------
 * Overlay menu — indent submenu items so the "back" arrow (pinned to the
 * container's left edge) doesn't overlap the menu text. Desktop only:
 * on mobile the menu is centred and the arrow sits in the top corner.
 * ----------------------------------------------------------------------*/
@media screen and (min-width: 992px) {
  .menu-overlay .sub-menu {
    padding-left: 64px;
  }
}

/* ------------------------------------------------------------------------
 * Overlay menu — tighten the line-height of the menu items so the list is
 * shorter and less likely to overflow / scroll on shorter viewports.
 * ----------------------------------------------------------------------*/
.menu-overlay > li > a,
.menu-overlay .sub-menu > li > a,
.menu-overlay .menu-overlay__item-wrapper {
  line-height: 1.1;
}

/* ------------------------------------------------------------------------
 * Language switcher — compact control kept visually separate from menus.
 * ----------------------------------------------------------------------*/
.language-switcher {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.language-switcher__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: inherit !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.2s cubic-bezier(0.785, 0.135, 0.15, 0.86);
}

.language-switcher__link:hover,
.language-switcher__link:focus-visible,
.language-switcher__link.is-active {
  opacity: 1;
}

.language-switcher__link.is-active::after {
  position: absolute;
  right: 10px;
  bottom: 5px;
  left: 10px;
  height: 1px;
  background: currentColor;
  content: '';
}

/* Top bar variant: sits to the left of the burger and follows the same colour
   rules the template applies to the burger lines. */
.header__col_controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.language-switcher_topbar {
  color: var(--color-dark-2);
}

.language-switcher_topbar .language-switcher__link {
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
}

.header[data-arts-theme-text=light] .language-switcher_topbar,
.header.bg-dark-1 .language-switcher_topbar,
.header.bg-dark-2 .language-switcher_topbar,
.header.bg-dark-3 .language-switcher_topbar,
.header.bg-dark-4 .language-switcher_topbar,
.header.opened[data-arts-header-overlay-theme=dark] .language-switcher_topbar {
  color: #fff;
}

.header.bg-light-1 .language-switcher_topbar,
.header.bg-light-2 .language-switcher_topbar,
.header.bg-light-3 .language-switcher_topbar,
.header.bg-light-4 .language-switcher_topbar,
.header.bg-white .language-switcher_topbar,
.header.opened[data-arts-header-overlay-theme=light] .language-switcher_topbar {
  color: var(--color-dark-2);
}

/* ------------------------------------------------------------------------
 * Overlay widgets (dark theme) — the template only overrides paragraph
 * colour for the LIGHT overlay theme, so on the dark theme the widget text
 * (address, phone…) falls back to the global --paragraph-color-dark
 * (#262626) and is nearly invisible on the near-black overlay. Lighten the
 * paragraphs and links to --color-gray-2 (#ccc) so they read clearly.
 * ----------------------------------------------------------------------*/
.header.opened[data-arts-header-overlay-theme=dark] .header__widget-content p,
.header.opened[data-arts-header-overlay-theme=dark] .header__widget a {
  color: var(--color-gray-2);
}

/* ------------------------------------------------------------------------
 * Cookie Policy — dynamic cookie table + "manage cookies" (reset) button.
 * Rendered from the registered cookies via whitecube/laravel-cookie-consent
 * so this section stays in sync with the actual cookie configuration.
 * ----------------------------------------------------------------------*/
.legal-content__cookie-category {
  margin-top: 1.75rem;
}

.legal-content__table-wrapper {
  overflow-x: auto;
  margin: 0.75rem 0 1.5rem;
}

.legal-content__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.legal-content__table th,
.legal-content__table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-gray-2);
  vertical-align: top;
}

.legal-content__table thead th {
  border-bottom: 2px solid var(--color-gray-1);
  font-weight: 700;
  white-space: nowrap;
}

.legal-content__table td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

.legal-content__table td:last-child {
  white-space: nowrap;
}

.legal-content__cookie-empty {
  color: var(--color-gray-1);
  font-style: italic;
}

/* Manage-cookies button — reopens the consent choices (resets the consent). */
.cookie-manage {
  display: inline-block;
  margin: 0.5rem 0 0;
}

.cookie-manage__link {
  display: inline-block;
  padding: 0.9em 2.25em;
  background-color: var(--color-dark-1);
  color: #fff;
  border: 1px solid var(--color-dark-1);
  border-radius: 0;
  font: inherit;
  font-size: 0.8em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.cookie-manage__link:hover {
  background-color: transparent;
  color: var(--color-dark-1);
}

/* ------------------------------------------------------------------------
 * Cookie consent banner — the site's global heading styles
 * (h1..h6 { font-family: Cinzel serif } and the display-size h2 font-size)
 * leak into the banner's own <h2 class="cookies__title">. Keep the banner
 * title in the banner's neutral typography (matching its intro text) instead
 * of the site's headings. The #id selector out-specifies the site's rules;
 * the package's own inline styles keep colour/weight/margins.
 * ----------------------------------------------------------------------*/
#cookies-policy .cookies__title {
  font-family: var(--font-primary);
  font-size: 1.25em;
  line-height: 1.4em;
  letter-spacing: normal;
  text-transform: none;
}

/* ------------------------------------------------------------------------
 * News grid date badge — add the year under the month. The badge is a fixed
 * square, so keep the year compact (smaller and lighter than the month) to
 * fit a third line without pushing the day/month off-centre.
 * ----------------------------------------------------------------------*/
.figure-post__date-year {
  display: block;
  line-height: 1.3;
  margin-top: 0.15em;
  font-size: calc(9 * 1px);
  font-weight: 400;
  letter-spacing: 1px;
  opacity: 0.7;
}
@media screen and (min-width: 320px) {
  .figure-post__date-year {
    font-size: calc(9 * 1px + (11 - 9) * ((100vw - 320px) / 2240));
  }
}
@media screen and (min-width: 2560px) {
  .figure-post__date-year {
    font-size: calc(11 * 1px);
  }
}

/* ------------------------------------------------------------------------
 * Split rows (text + side image): when the text column grows taller than
 * the fixed-height image (e.g. longer translations), stretch the image to
 * the full row height instead of centering it with white bands around it.
 * ------------------------------------------------------------------------ */
@media screen and (min-width: 992px) {
  .row.no-gutters.align-items-center:has(> [class*="col-"] > section.section-image) {
    align-items: stretch !important;
  }

  .row.no-gutters.align-items-center:has(> [class*="col-"] > section.section-image) > [class*="col-"] {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .row.no-gutters.align-items-center:has(> [class*="col-"] > section.section-image) > [class*="col-"] > section.section-image {
    flex: 1 0 auto;
    max-height: none;
  }

  .row.no-gutters.align-items-center:has(> [class*="col-"] > section.section-image) > [class*="col-"] > section.section-image.section_h-800 {
    height: min(800px, 100vh);
  }
}
