/* Ca' Pigneto - foglio di stile del sito pubblico.
   Riprende la grafica originale (griglia 960px, testata nera, riquadri immagine,
   sfondo grigio sfumato) rendendola responsive. I colori principali sono nelle variabili. */

:root {
  --bg: #e9e9e9;
  --text: #666;
  --heading: #333399;
  --link: #990000;
  --link-hover: #999;
  --top-bg: #000;
  --top-link: #b6b3b0;
  --footer-bg: #2e2d30;
  --footer-text: #999;
  --line: #ccc;
  --wrap: 960px;
  --serif: 'Crimson Text', 'Arno Pro', Georgia, 'Times New Roman', serif;
  --sans: Verdana, Geneva, 'DejaVu Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg) url('../../img/layout/bkg_body.jpg') repeat-x 0 0;
  color: var(--text);
  font: 13px/1.6 var(--sans);
  text-shadow: 1px 1px 1px #fff;
}
img { max-width: 100%; height: auto; border: 0; }
a { color: var(--link); }
a:hover { color: var(--link-hover); text-decoration: none; }
h1, h2, h3, h4, h5 { font-family: var(--serif); font-weight: 400; margin: 0 0 12px; }
h1 { font-size: 24px; line-height: 1.2; color: var(--heading); text-transform: uppercase; letter-spacing: 1px; }
h2 { font-size: 18px; line-height: 1.25; color: var(--heading); text-transform: uppercase; }
h3 { font-size: 16px; letter-spacing: 2px; }
h5 { font-size: 15px; }
p, ul, ol, blockquote, table { margin: 0 0 14px; }
ul { list-style: square; padding-left: 22px; }
.lang-ru h1, .lang-ru h2, .lang-cn h1, .lang-cn h2 { font-family: Georgia, 'Times New Roman', serif; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 1000; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid #b6b3b0; outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 10px; }

/* BARRA SUPERIORE E MENU */
.top { background: transparent; min-height: 61px; }
.top-inner { display: flex; align-items: center; justify-content: space-between; min-height: 61px; position: relative; }
.mainnav { display: flex; flex-wrap: wrap; }
.mainnav a {
  display: block; line-height: 50px; margin: 5px 0; padding: 0 5px;
  color: var(--top-link); text-transform: uppercase; text-decoration: none;
  border-right: 1px dotted #484848; text-shadow: 1px 1px 1px #202020;
  font: 11px/50px Arial, Helvetica, sans-serif;
}
.mainnav a:last-child { border-right: 0; }
.mainnav a:hover { background: #333; color: #fff; }
.mainnav a.sel { color: #fff; text-shadow: 1px 1px 1px #000; }
.mainnav a.sel:hover { background: transparent; }
.langs { display: flex; gap: 6px; align-items: center; }
.langs a { display: block; line-height: 0; opacity: .65; transition: opacity .2s; }
.langs a:hover, .langs a.sel { opacity: 1; }
.menu-toggle { display: none; }

/* TESTATA */
#header { background: #000; }
.header-content { position: relative; height: 333px; padding: 0 5px; overflow: hidden; }
.logo { position: absolute; left: 15px; top: 20px; z-index: 5; width: 244px; }
.logo img { display: block; }
.slideshow { position: relative; height: 100%; }
.slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.2s ease; }
.slide.active { opacity: 1; z-index: 2; }
.slide img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.slide-caption {
  position: absolute; bottom: 50px; left: 0; z-index: 3;
  color: #fff; opacity: .85; padding: 25px 45px 15px;
  background: url('../../images/v1.png') no-repeat left center, url('../../images/v2.png') no-repeat right center;
  font: 16px/1.3 var(--serif); letter-spacing: 2px; text-shadow: none; text-transform: uppercase;
}

/* RIQUADRI IMMAGINE (sotto la testata) */
.images-menu { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; padding-top: 0; padding-bottom: 0; margin-top: 0; }
.tile {
  display: block; height: 150px; background-color: #202020; background-repeat: no-repeat;
  background-position: center 0; background-size: 100% 300px; position: relative;
  transition: background-position 0s;
}
.tile:hover, .tile.sel, .tile:focus-visible { background-position: center -150px; }
.tile span { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font: 10px Arial, sans-serif; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.55); text-shadow: none; opacity: 0; transition: opacity .2s; }
.tile:hover span, .tile:focus-visible span { opacity: 1; }

/* CONTENUTO */
.main { display: flex; gap: 20px; padding-top: 30px; padding-bottom: 50px; }
.crest { flex: 0 0 60px; }
.content { flex: 1; min-width: 0; border-left: 1px dashed var(--line); padding-left: 20px; }
.content:focus { outline: 0; }
.text { font-size: 13px; }
.text h1 { font-size: 20px; }
.page-image { float: right; width: 45%; margin: 0 0 15px 20px; padding: 1px; border: 1px solid var(--line); background: #fff; }
.thumb { padding: 1px; border: 1px solid var(--line); background: #fff; }
.lead { font-style: italic; }
.crumb { margin-bottom: 8px; font-size: 11px; text-transform: uppercase; }
.crumb a, .back a { color: var(--text); }
time { display: block; font-size: 11px; color: #999; margin-bottom: 6px; text-transform: uppercase; }

/* HOME */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 325px; gap: 30px; }
.home-side > section { margin-bottom: 25px; }
.box_news {
  min-height: 190px; width: 325px; max-width: 100%; padding: 12px 22px 18px 14px; margin-left: -4px;
  background: url('../../img/layout/box_news.png') no-repeat 0 0 / 100% 100%;
}
.box_news h2, .box_pubblicazioni h2 { margin-bottom: 6px; }
.box_news h5 { margin-bottom: 6px; font-size: 15px; }
.box_news h5 a { color: var(--text); text-decoration: none; }
.box_news .ok { margin: 0 6px -1px 0; }
.text_news { border-top: 1px dashed var(--line); padding-top: 6px; }
.text_news p { margin-bottom: 8px; font-size: 12px; }
.lnk-small { display: inline-block; font: bold 10px Arial, sans-serif; text-transform: uppercase; color: #999; text-decoration: none; padding-left: 20px; background: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 16 16%22%3E%3Ccircle cx=%226.5%22 cy=%226.5%22 r=%224.5%22 fill=%22none%22 stroke=%22%23999%22 stroke-width=%222%22/%3E%3Cpath d=%22M10 10l4 4%22 stroke=%22%23999%22 stroke-width=%222%22/%3E%3C/svg%3E') no-repeat 0 50% / 13px; }
.lnk-small:hover { color: var(--link); }
.box_video .video-open { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; cursor: pointer; font: 18px var(--serif); color: var(--heading); text-transform: uppercase; text-align: left; }
.box_video .video-open:hover span { color: var(--link); }
.box_pubblicazioni {
  position: relative; min-height: 96px; padding: 14px 18px 14px 150px; margin-left: 0; width: 325px; max-width: 100%;
  background: #f2f2f2; box-shadow: 2px 3px 6px rgba(0,0,0,.25);
}
.box_pubblicazioni::before {
  content: ''; position: absolute; left: -21px; top: 0; width: 160px; height: 96px;
  background: url('../../img/layout/box_pubblicazioni.png') no-repeat 0 0;
}
.box_pubblicazioni a { display: block; color: var(--text); font-size: 12px; text-decoration: none; margin-bottom: 4px; }
.box_pubblicazioni a.lnk-small { display: inline-block; }
.box_contatti { font-size: 12px; }

/* GALLERY */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery-item { display: block; padding: 1px; border: 1px solid var(--line); background: #fff; line-height: 0; overflow: hidden; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .4s, filter .4s; }
.gallery-item:hover img { transform: scale(1.04); filter: brightness(1.05); }

.lightbox { position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; text-shadow: none; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 88vh; text-align: center; }
.lightbox img, .lightbox video { max-width: 92vw; max-height: 82vh; display: block; margin: 0 auto; box-shadow: 0 0 30px #000; }
.lightbox figcaption { color: #ccc; padding-top: 10px; font: 15px var(--serif); }
.lightbox button { position: absolute; background: rgba(0,0,0,.4); border: 0; color: #fff; font-size: 34px; line-height: 1; width: 52px; height: 52px; cursor: pointer; border-radius: 50%; }
.lightbox button:hover { background: rgba(255,255,255,.15); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

/* PRODOTTI */
.products-list { border-left: 1px dashed #999; }
.product-card { display: flex; align-items: flex-end; gap: 15px; padding: 10px 0 10px 10px; min-height: 120px; color: var(--text); text-decoration: none; }
.product-card.alt { background: #fff; }
.product-card:hover h2 { color: var(--link); }
.product-thumb { flex: 0 0 auto; height: 100px; display: flex; align-items: flex-end; }
.product-thumb img { max-height: 100px; width: auto; }
.product-info h2 { margin-bottom: 4px; }
.lnk_details { display: inline-block; font: bold 10px Arial, sans-serif; text-transform: uppercase; color: #999; text-decoration: none; padding-left: 20px; background: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 16 16%22%3E%3Ccircle cx=%226.5%22 cy=%226.5%22 r=%224.5%22 fill=%22none%22 stroke=%22%23999%22 stroke-width=%222%22/%3E%3Cpath d=%22M10 10l4 4%22 stroke=%22%23999%22 stroke-width=%222%22/%3E%3C/svg%3E') no-repeat 0 50% / 13px; }
.lnk_details:hover { opacity: .6; }
.product-main { display: grid; grid-template-columns: 200px minmax(0, 1fr) 190px; gap: 25px; align-items: start; margin-bottom: 30px; }
.product-photo img { display: block; margin: 0 auto; }
.pars { list-style: none; padding: 0 0 0 20px; margin: 0; border-left: 1px dashed var(--line); }
.pars li { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.pars strong { display: block; font-size: 17px; color: #444; }
.pars small { display: block; font-size: 10px; text-transform: uppercase; color: #999; line-height: 1.2; }
.product-links { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 15px; }
.lnk_pdf, .lnk_ric, .lnk_shop { display: inline-block; line-height: 31px; color: var(--text); font: bold 11px/31px Arial, sans-serif; text-decoration: none; text-transform: uppercase; }
.lnk_pdf { background: url('../../img/layout/ico_pdf.jpg') no-repeat 0 1px; padding-left: 34px; }
.lnk_ric { background: url('../../img/layout/ico_ric.png') no-repeat 0 0; padding-left: 40px; }
.lnk_shop { border: 1px solid #999; padding: 0 12px; line-height: 29px; }
.lnk_pdf:hover, .lnk_ric:hover, .lnk_shop:hover { color: var(--link); }
.awards { background: #fff; padding: 15px 20px; margin-bottom: 30px; border-left: 3px solid var(--heading); }
.awards ul { margin-bottom: 0; }
.others { margin-top: 20px; }

/* LISTE (news e dicono di noi) */
.list { display: flex; gap: 15px; margin: 20px 0; padding-bottom: 15px; border-bottom: 1px dotted var(--line); }
.list-thumb { flex: 0 0 auto; }
.list-thumb img { max-width: 140px; }
.list h2 { font-size: 17px; margin-bottom: 4px; }
.list h2 a { color: var(--heading); text-decoration: none; }
.list h2 a:hover { color: var(--link); }
.list p { margin-bottom: 6px; }
.pagination { display: flex; justify-content: center; gap: 20px; align-items: center; margin-top: 25px; font-size: 12px; }
.pagination a { color: var(--text); font-weight: bold; text-transform: uppercase; }
.detail-image { float: right; margin: 0 0 15px 20px; max-width: 45%; }
.detail-video { width: 100%; margin: 10px 0; background: #000; }
.back { clear: both; padding-top: 10px; font-size: 11px; text-transform: uppercase; }

/* DOVE SIAMO */
.map-wrap { position: relative; margin-bottom: 25px; border: 1px solid #9f9595; background: #ddd; line-height: 0; }
.map-wrap iframe { width: 100%; height: 480px; border: 0; display: block; }
.map-consent { position: relative; min-height: 300px; }
.map-consent img { width: 100%; display: block; }
.map-consent-box { position: absolute; inset: auto 20px 20px 20px; background: rgba(255,255,255,.93); padding: 14px 18px; line-height: 1.5; text-shadow: none; display: flex; gap: 15px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.map-consent-box p { margin: 0; font-size: 12px; }
.map-info { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.tour video { width: 100%; background: #000; display: block; }

/* CONTATTI */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.contact { padding: 10px 15px 15px; background: rgba(255,255,255,.35); }
.contact label { display: block; font: bold 12px/1.7 Arial, Helvetica, sans-serif; margin-top: 10px; }
.contact input[type=text], .contact input[type=email], .contact input[type=tel], .contact textarea {
  width: 100%; padding: 7px; font: 13px Arial, Helvetica, sans-serif; color: #444;
  border: 1px solid; border-color: #ccc #ccc #eee #eee; background: #fff;
}
.contact [aria-invalid=true] { border-color: var(--link); }
.contact .check { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; }
.contact .check input { margin-top: 4px; }
.contact .error-message { display: block; color: var(--link); font-size: 11px; padding-top: 3px; }
.contact .submit { margin-top: 15px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.flash { margin: 10px 0; padding: 12px 18px; background: #dfdfdf; border: 1px solid #d8d8d8; color: #484848; font-size: 13px; }
.flash-ok { border-left: 4px solid #4a7c3a; }
.flash-error { border-left: 4px solid var(--link); }
.btn { display: inline-block; background: #2e2d30; color: #fff; border: 0; padding: 9px 22px; font: bold 11px Arial, sans-serif; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; text-shadow: none; }
.btn:hover { background: var(--link); color: #fff; }
.btn-ghost { background: transparent; color: #ccc; border: 1px solid #666; }

/* FOOTER */
#footer { background: var(--footer-bg); color: var(--footer-text); text-shadow: 1px 1px 1px #181818; padding: 15px 0; font-size: 11px; }
#footer a { color: #bbb; }
#footer a:hover { color: #fff; }
.footer-text { display: flex; flex-wrap: wrap; gap: 10px 30px; line-height: 1.6; }
.footer-text > * { flex: 1 1 300px; }
.footer-text b { display: block; color: #bbb; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-top: 15px; margin-top: 12px; border-top: 1px dotted #484848; text-transform: uppercase; }
.footer-links .social { margin-left: auto; display: flex; gap: 8px; }
.footer-links .social img { display: block; width: 24px; height: 24px; }

/* MUSICA DI SOTTOFONDO */
.music { position: fixed; right: 18px; bottom: 18px; z-index: 800; }
.music-btn {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 12px; border-radius: 22px;
  background: rgba(20,20,22,.85); color: #ddd; border: 1px solid #484848; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.music-btn:hover { background: #000; color: #fff; }
.music-btn .i-pause { display: none; }
.music-btn[aria-pressed=true] .i-pause { display: block; }
.music-btn[aria-pressed=true] .i-play { display: none; }
.music-bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.music-bars i { display: block; width: 3px; height: 4px; background: currentColor; }
.music-btn[aria-pressed=true] .music-bars i { animation: bars .9s ease-in-out infinite alternate; }
.music-bars i:nth-child(2) { animation-delay: .3s !important; }
.music-bars i:nth-child(3) { animation-delay: .6s !important; }
@keyframes bars { from { height: 3px; } to { height: 14px; } }

/* COOKIE */
.cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; background: rgba(20,20,22,.96); color: #ccc; text-shadow: none; padding: 14px 20px; display: flex; gap: 15px 25px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 12px; }
.cookie[hidden] { display: none; }
.cookie p { margin: 0; max-width: 700px; }
.cookie a { color: #fff; }

/* RESPONSIVE */
@media (max-width: 980px) {
  .mainnav a { font-size: 10px; padding: 0 4px; }
  .home-grid { grid-template-columns: 1fr; }
  .box_news, .box_pubblicazioni { margin-left: 0; }
  .product-main { grid-template-columns: 180px minmax(0, 1fr); }
  .pars { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 25px; border-left: 0; padding: 15px 0 0; border-top: 1px dashed var(--line); }
}
@media (max-width: 767px) {
  body { background: var(--bg); font-size: 14px; }
  .top { background: #000; }
  .menu-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 4px; width: auto; height: 44px; padding: 0 10px;
    background: none; border: 1px solid #333; border-radius: 4px; cursor: pointer; position: relative; padding-right: 64px;
  }
  .menu-toggle span { display: block; width: 22px; height: 2px; background: #ccc; }
  .menu-toggle b { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 11px Arial, sans-serif; text-transform: uppercase; color: #ccc; text-shadow: none; }
  .mainnav {
    display: none; position: absolute; top: 61px; left: 0; right: 0; z-index: 50; flex-direction: column;
    background: #000; border-top: 1px solid #333; padding: 8px 10px 14px;
  }
  .mainnav.open { display: flex; }
  .mainnav a { border-right: 0; border-bottom: 1px dotted #333; line-height: 44px; margin: 0; font-size: 13px; }
  .header-content { height: auto; aspect-ratio: 950 / 333; padding: 0; }
  .logo { width: 30%; left: 4%; top: 6%; }
  .slide-caption { display: none; }
  .images-menu { grid-template-columns: repeat(3, 1fr); gap: 6px; padding-top: 6px; }
  .tile { height: auto; aspect-ratio: 1; background-size: 100% 200%; }
  .tile:hover, .tile.sel { background-position: center 100%; }
  .tile span { opacity: 1; }
  .main { flex-direction: column; padding-top: 20px; }
  .crest { display: none; }
  .content { border-left: 0; padding-left: 0; }
  .page-image, .detail-image { float: none; width: 100%; max-width: 100%; margin: 0 0 15px; }
  .product-main, .map-info, .contact-grid { grid-template-columns: 1fr; }
  .product-photo img { max-height: 380px; width: auto; }
  .box_pubblicazioni::before { left: -6px; }
  .footer-text .w50p > div { flex-basis: 100%; }
  .footer-links .social { margin-left: 0; }
  .music { right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .slide, .gallery-item img { transition: none; }
  .music-btn[aria-pressed=true] .music-bars i { animation: none; height: 10px; }
}
