:root {
  --paper: #f6ebd7;
  --ink: #322116;
  --rust: #983b25;
  --line: #c8b496;
}
body {
  background: radial-gradient(ellipse at 32% 17%, #fff7e8 0%, transparent 62%), var(--paper);
}
.header {
  color: var(--ink);
  background: #fcf4e5;
}
.header::after {
  height: 1px;
  background: var(--line);
  opacity: 1;
}
.header .topline { min-height: 80px; }
.header .brand { background: #3b291e; border-radius: 3px 9px 3px 3px; }
.header .brand img { height: auto; }
.header nav a { line-height: 1.4; }
.header nav a[aria-current="page"] { text-underline-offset: .32em; }
.header nav .nav-cta, .heritage-home .field-copy .btn {
  background: var(--rust);
  border: 1px solid var(--rust);
  border-radius: 99px;
  color: white;
}
.header nav .nav-cta:hover, .heritage-home .field-copy .btn:hover { background: #71301f; }
.header nav a[href="janas.html"] { color: #80301e; }
footer { background: #362417; }

.heritage-home .field-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #f1dfc0;
}
.heritage-home .field-layout {
  display: block;
  min-height: clamp(405px, 37vw, 535px);
  padding-block: clamp(30px, 5vw, 60px);
}
.heritage-home .field-photo {
  position: absolute;
  inset: 0 0 0 29%;
  border-radius: 0;
  background: #413824;
  z-index: -2;
}
.heritage-home .field-photo img {
  height: 100%;
  object-position: center 53%;
  filter: sepia(.14) saturate(1.16) brightness(1.1);
}
.heritage-home .field-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f1dfc0 0%, #f1dfc0da 22%, transparent 55%);
  pointer-events: none;
}
.heritage-home .field-photo figcaption { inset: auto 18px 13px auto; z-index: 1; }
.heritage-home .field-hero::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(13vw, 186px);
  background: url("cisto-acquerello.webp") left center / contain no-repeat;
  pointer-events: none;
  opacity: .8;
  z-index: -1;
}
.heritage-home .field-copy { margin-left: clamp(44px, 9vw, 135px); max-width: 475px; }
.heritage-home .field-copy h1 {
  margin: 0 0 17px;
  font-size: clamp(58px, 7.5vw, 102px);
  line-height: .87;
}
.heritage-home .field-copy h1 em {
  display: block;
  color: #873a26;
}
.heritage-home .field-copy p { max-width: 38ch; margin-bottom: 18px; font-style: normal; font-size: 1rem; line-height: 1.57; }
.heritage-home .field-copy .btn { padding-inline: 20px; }

.heritage-themes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding-block: 23px 19px;
}
.heritage-themes a {
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
  font: 700 clamp(17px, 2.05vw, 30px)/.98 var(--serif);
  padding: 0 7px 4px;
  text-decoration: none;
}
.heritage-themes a + a { border-left: 1px solid var(--line); }
.heritage-themes a:hover { text-decoration: underline; color: var(--rust); }
.heritage-themes img {
  width: 110px;
  height: 65px;
  object-fit: contain;
  mix-blend-mode: multiply;
  margin-bottom: 6px;
  mask-image: linear-gradient(90deg, transparent, #000 8% 92%, transparent), linear-gradient(transparent, #000 9% 91%, transparent);
  mask-composite: intersect;
}
.heritage-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.heritage-cards a {
  position: relative;
  isolation: isolate;
  min-height: clamp(153px, 14vw, 210px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 16% 7% 17% 8% / 9% 11% 12% 9%;
  background: #594633;
  color: #fff9eb;
  text-decoration: none;
  padding: 12px clamp(11px, 1.7vw, 22px);
}
.heritage-cards a:nth-child(even) { border-radius: 9% 18% 8% 12% / 12% 9% 13% 8%; }
.heritage-cards a:hover span { text-decoration: underline; }
.heritage-cards img, .heritage-cards a::before { position: absolute; inset: 0; width: 100%; height: 100%; }
.heritage-cards img { z-index: -2; object-fit: cover; }
.heritage-cards a::before { content: ""; z-index: -1; background: linear-gradient(transparent 15%, #24170ed9); }
.heritage-cards span { font: italic 700 clamp(22px, 2.5vw, 36px)/1.05 var(--serif); }
.heritage-cards b { font: normal 500 .65em system-ui; }
.heritage-cards a:focus-visible { outline-offset: -5px; outline-color: #fff3cd; }
.threshold-hero {
  background: radial-gradient(ellipse at 19% 23%, #8f442e, transparent 75%), #512a22;
  border: 0;
}
@media (max-width: 860px) {
  .heritage-home .field-copy { margin-left: 44px; }
}
@media (max-width: 710px) {
  .header .topline { min-height: 65px; }
  .heritage-home .field-layout { display: flex; flex-direction: column; min-height: 0; gap: 0; padding-block: 22px 14px; }
  .heritage-home .field-copy { order: -1; margin: 0; padding: 0 0 21px 15px; width: 100%; }
  .heritage-home .field-copy h1 { font-size: clamp(50px, 12vw, 74px); }
  .heritage-home .field-copy p { max-width: 34ch; }
  .heritage-home .field-hero::before { display: none; }
  .heritage-home .field-photo { inset: auto; position: relative; z-index: 0; border-radius: 4px 19px 5px; width: 100%; height: clamp(190px, 53vw, 310px); }
  .heritage-home .field-photo::after { display: none; }
  .heritage-themes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px 0; }
  .heritage-themes a:nth-child(4) { border-left: 0; }
  .heritage-themes img { width: 76px; height: 48px; }
  .heritage-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .heritage-cards a { min-height: 124px; }
}

/* Una piccola tavola a luce naturale introduce il percorso delle Janas. */
.heritage-cards .janas-card-link {
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: stretch;
  gap: 4px;
  padding: 0;
  background: #f7e7cb;
  color: #35251b;
  border-radius: 8px 19px 5px 5px;
  border: 1px solid #cdb38c;
}
.heritage-cards .janas-card-link::before { content: none; }
.heritage-cards .janas-card-link img {
  position: static;
  z-index: auto;
  width: 100%;
  height: clamp(104px, 11vw, 160px);
  object-fit: contain;
  object-position: center bottom;
}
.heritage-cards .janas-card-link span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 8px 13px 13px;
  font-size: clamp(22px, 2.4vw, 32px);
  font-style: normal;
}
.heritage-cards .janas-card-link b { color: #873a26; }
.heritage-cards .janas-card-link:focus-visible { outline-color: #873a26; }
@media (max-width: 480px) {
  .heritage-cards .janas-card-link { grid-column: 1 / -1; }
  .heritage-cards .janas-card-link img { height: 150px; }
  .heritage-cards .janas-card-link span { font-size: 29px; }
}

.room .herbarium {
  padding: clamp(13px, 2.8vw, 34px);
  background: radial-gradient(ellipse at center, #fff9ec, #f0e1c7);
}
.room .herbarium img {
  position: static;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  mix-blend-mode: normal;
}
@media (max-width: 480px) {
  .heritage-cards a:last-child { grid-column: 1 / -1; }
}

@media (min-width: 360px) and (max-width: 710px) {
  .heritage-home .field-hero::before {
    display: block;
    inset: 95px 0 auto auto;
    width: clamp(65px, 19vw, 125px);
    height: 155px;
    opacity: .49;
  }
}

.heritage-home .field-actions { margin-top: 0; }
.film-jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .86rem;
  font-weight: 700;
  color: #642c20;
}
.film-jump .play { font-size: .7rem; }
.film-room {
  scroll-margin-top: 20px;
  background: #37281f;
  color: #fff1d9;
  padding: clamp(30px, 5vw, 62px) 0;
}
.film-room-heading { margin-bottom: clamp(16px, 3vw, 28px); }
.film-room-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(13px, 2vw, 24px);
}
.film-feature { border-radius: 4px 20px 4px 4px; overflow: hidden; background: #4a372b; }
.film-feature video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #201711; }
.film-caption { padding: 14px clamp(13px, 2vw, 24px) 19px; }
.film-caption h3 { margin-top: 3px; }
.film-companions { display: grid; gap: clamp(13px, 2vw, 24px); }
.film-tile {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  min-height: clamp(92px, 13vw, 166px);
  overflow: hidden;
  border: 1px solid #d1ac805c;
  border-radius: 4px 20px 4px 4px;
  padding: clamp(13px, 2.1vw, 24px);
  background: #513126;
  color: #fff6e5;
  font: 700 clamp(24px, 3vw, 39px)/.95 var(--serif);
  text-decoration: none;
}
.film-tile img, .film-tile::before { position: absolute; inset: 0; width: 100%; height: 100%; }
.film-tile img { z-index: -2; object-fit: cover; }
.film-tile::before { content: ""; z-index: -1; background: linear-gradient(90deg, #211811d9, #21181130); }
.film-tile-donkeys { background: radial-gradient(ellipse at 100% 22%, #8f5031, #513126); }
.film-tile:hover { text-decoration: underline; }
.film-tile:focus-visible, .film-feature video:focus-visible { outline-color: #ffdfa0; outline-offset: -4px; }
.film-tile-play {
  flex: 0 0 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f3ddb4;
}
.film-tile-play::after {
  content: "";
  width: 0;
  height: 0;
  border: 7px solid transparent;
  border-right: 0;
  border-left: 11px solid #482b20;
  margin-left: 3px;
}
@media (max-width: 710px) {
  .film-room-grid { grid-template-columns: 1fr; }
}
.film-jump .play {
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  flex: 0 0 27px;
  background: #f4dcb1;
  border: 1px solid #a86845;
  border-radius: 50%;
}
.film-jump .play::before {
  content: "";
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-right: 0;
  border-left: 7px solid #642c20;
  margin-left: 2px;
}
@media (min-width: 481px) and (max-width: 920px) {
  .heritage-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.home-experiences-title {
  font-size: clamp(30px, 4.2vw, 51px);
  margin-block: 8px 14px;
}
.home-calendar-link {
  flex-basis: 100%;
  width: fit-content;
  color: #703422;
  font-size: .86rem;
  font-weight: 750;
}

.heritage-experiences { margin-bottom: clamp(22px, 4vw, 50px); }
@media (min-width: 711px) and (max-width: 1250px) {
  .header nav { gap: 6px 11px; }
  .header nav a { font-size: .78rem; }
}

/* Piccoli inserti ispirati alla tessitura sarda. */
.heritage-cards .janas-card-link::after,
.janas-book::before {
  content: "";
  display: block;
  width: 128px;
  height: 16px;
  background: url("rombi-tessili.png") left center / 64px 16px repeat-x;
}
.heritage-cards .janas-card-link::after { margin: -6px 13px 7px; width: 96px; }
.janas-book {
  margin-block: clamp(24px, 5vw, 65px);
  padding: clamp(20px, 4vw, 48px);
  border: 1px solid #cdb38c;
  border-radius: 5px 22px 5px 5px;
  background: #fff4df;
  scroll-margin-top: 100px;
}
.janas-book::before { margin-bottom: 15px; }
.janas-book p { max-width: 64ch; }
.janas-book-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.janas-book-actions .btn { background: var(--rust); color: white; }
.janas-book-jump { display: inline-block; margin-top: 16px; color: #fff2d8; }
.home-territory h2::before {
  content: "";
  display: block;
  width: 96px;
  height: 16px;
  margin-bottom: 8px;
  background: url("rombi-tessili.png") left center / 64px 16px repeat-x;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr));
  gap: 16px;
}
.product-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 5px 18px 5px 5px;
  background: #fff5e3;
}
.product-card > .text-link { margin-top: auto; }
.product-card h3 { margin-block: 5px 10px; }
.product-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.product-layout dt { font-weight: 700; margin-top: 12px; }
.product-layout dd { margin: 2px 0; }
.product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; }
.product-photo { width: 100%; max-height: 360px; object-fit: cover; border-radius: 5px 18px 5px 5px; }
.home-janas { border: 1px solid #cdb38c; border-radius: 8px 19px 5px 5px; background: #f7e7cb; }
.heritage-cards .home-janas .janas-card-link { border: 0; }
.home-janas p { margin: 4px 13px 8px; font-size: .89rem; line-height: 1.5; }
.heritage-cards .home-ebook-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0 13px 4px;
  padding: 0;
  background: transparent;
  color: #71301f;
  text-decoration: underline;
  border-radius: 0;
}
@media (max-width: 480px) { .home-janas { grid-column: 1 / -1; } }

.heritage-cards .home-ebook-link::before { content: none; }

.tessile-esperienze::before,
.tessile-esperienze::after {
  content: "";
  display: block;
  height: 12px;
  background: url("bordino-sardo-alto.webp") center / auto 100% repeat-x;
}
.tessile-esperienze::after {
  height: 19px;
  background-image: url("bordino-sardo-basso.webp");
}
.tessile-esperienze .heritage-experiences { margin-bottom: clamp(15px, 3vw, 34px); }
.home-janas {
  background: transparent;
  border: 0;
}
.heritage-cards .home-janas .janas-card-link {
  min-height: 0;
  background: transparent;
  border-radius: 0;
}
.heritage-cards .home-janas .janas-card-link::after { content: none; }
.heritage-cards .home-janas .janas-card-link img {
  display: block;
  height: auto;
}
.heritage-cards .home-janas .janas-card-link:focus-visible { outline-offset: 3px; }
.heritage-cards > a { align-self: start; }
@media (max-width: 480px) {
  .home-janas .janas-card-link { max-width: 390px; }
  .tessile-esperienze::after { height: 15px; }
}

.story-page { --story-green: #303c30; scroll-padding-top: 90px; }
.story-page section[id] { scroll-margin-top: 90px; }
.story-hero { background: var(--story-green); color: #fff3db; }
.story-hero-inner, .story-panel, .story-book {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(18px, 5vw, 65px);
  padding-block: clamp(26px, 6vw, 78px);
}
.story-hero h1 { max-width: 12ch; font-size: clamp(56px, 9vw, 130px); line-height: .87; margin: 12px 0 22px; }
.story-hero h1 em { color: #f7c590; }
.story-hero p { max-width: 46ch; }
.story-hero .btn { background: #f4d9ad; color: #342417; }
.story-hero-link { display: inline-block; margin: 12px 16px; color: inherit; }
.story-hero img, .story-panel img, .story-book img { display: block; width: 100%; object-fit: contain; border-radius: 7px 26px 7px 7px; }
.story-hero img { max-height: 510px; object-fit: cover; }
.story-index { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.story-index a { padding: 8px 0; font-weight: 700; }
.story-chapters { padding-block: clamp(26px, 5vw, 55px); }
.story-feature { max-width: 72ch; padding: 18px 0 26px; }
.story-feature .text-link { display: inline-block; margin: 4px 16px 4px 0; }
.story-panel { border-top: 1px solid var(--line); }
.story-panel img { max-height: 360px; }
.story-panel-reverse img { grid-column: 2; grid-row: 1; }
.story-panel-reverse div { grid-column: 1; grid-row: 1; }
.story-trail { background: #573428; color: #fff3db; padding-block: clamp(28px, 5vw, 68px); }
.story-trail p { max-width: 68ch; }
.story-trail .btn { background: #f4d9ad; color: #342417; }
.story-book { grid-template-columns: minmax(0, 230px) minmax(0, 1fr); }
.story-book img { border: 1px solid var(--line); }
.story-book p { max-width: 65ch; }
.project-page .story-hero h1 { font-size: clamp(54px, 7vw, 100px); }
.project-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 32px; }
.project-values article { padding: 18px; border: 1px solid var(--line); border-radius: 5px 18px 5px 5px; background: #fff5e3; }
.project-values h2 { font-size: clamp(27px, 3vw, 40px); }
@media (max-width: 720px) {
  .story-hero-inner, .story-panel, .story-book, .project-values { grid-template-columns: 1fr; }
  .story-panel-reverse img, .story-panel-reverse div { grid-column: auto; grid-row: auto; }
  .story-hero img { max-height: 290px; }
  .story-book img { max-width: 165px; }
}

.experience-program { max-width: 900px; scroll-margin-top: 95px; }
.experience-program ol { padding-left: 1.7em; }
.experience-program li { margin: 0 0 10px; padding: 14px 0 10px .7em; border-top: 1px solid var(--line); }
.experience-program li::marker { color: #71301f; font-weight: 750; }
.experience-program h3 { margin: 0 0 .25em; }
.experience-program p { margin: 0; }
.program-notes { background: #fff5e3; border: 1px solid var(--line); border-radius: 5px 18px 5px 5px; margin-top: 24px; padding: clamp(16px, 3vw, 27px); }

.experience-cinema { scroll-margin-top: 95px; }
.experience-film-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr)); gap: 18px; }
.experience-film-card {
  min-width: 0;
  background: #fff5e3;
  border: 1px solid var(--line);
  border-radius: 5px 20px 5px 5px;
  padding: clamp(12px, 2vw, 19px);
}
.experience-film-card .film-tile { min-height: 0; aspect-ratio: 16 / 9; }
.experience-film-card h3, .experience-film-card p { margin-block: 8px; }
.experience-film-card video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #31251b; }
.experience-film-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.film-gallery-jump { margin-top: 20px; }
.film-gallery-jump a { color: inherit; }
