* { box-sizing: border-box; }
html, body { margin: 0}
img { display: block; max-width: 100%; height: auto; }

/* =========================
   VARIABILI
   ========================= */
:root{
  --fg: #7F31FF;
  --muted: #000000;
  --bg: #c9c9c9;

  --text-width: 100%;

  --gap-s: 8px;
  --gap-m: 16px;
  --gap-l: 32px;
}

/* =========================
   BASE
   ========================= */
body{
  background: var(--bg);
  color: var(--muted);
  font-family: "times new roman", serif;
  font-size: 15px;
  line-height: 1.55;
}

a{
  color: inherit;
  text-decoration: none;
}
a:hover{ 
  text-decoration: underline; 
  color: var(--fg);
}

.page{
  max-width: 100%;
  margin: 0 auto;
  padding: 0px 16px 30px 16px;
}

/* =========================
   HOME
   ========================= */

@media (min-width: 900px){
  .top{
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
  }
}

@media (max-width: 1200px){
  .grid{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
    .bio{
  margin: 0;
  color: var(--muted);
  font-size: 32px!important;
  line-height: auto;}
}
@media (max-width: 600px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
  .bio{
  margin: 0;
  color: var(--muted);
  font-size: 24px!important;
  line-height: auto;}
}

.name{
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.bio{
  margin-top: 20px;
  color: var(--muted);
  font-size: 40px;
  line-height: 1.2;
}

/* =========================
   FILTERS / SORT
   ========================= */
.controls{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0 24px;
}

.filters{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip{
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 2px;
}
.chip.is-active{
  color: var(--fg);
  text-decoration-thickness: 4px;
}
.chip:hover{
  color: var(--fg);
}
/* =========================
   Sort
   ========================= */
.sort{
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort__select{
  font: inherit;
  padding: 4px 7px;
  border: 1px solid var(--muted);
  background: var(--bg);
}

/* =========================
   HOME GRID (aligned)
   ========================= */
.grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-l) var(--gap-m);
}

@media (max-width: 1200px){
  .grid{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
}

.card{ display: block; 

}
.card:hover{ display: block; 
  color: var(--fg);
}

.thumb{
  position: relative;
  overflow: hidden;
}

.thumb img{
  width: 100%;
  height: auto;
  display: block;
}

.meta{
  margin-top: 8px;
}

.meta__title{
  font-size: 14px;
  font-weight: 600;
}

.meta__sub{
  font-size: 13px;
}

/* =========================
   WORK PAGE
   ========================= */
.back{
  margin-bottom: 18px;
}
.back a:hover{ text-decoration: underline; }

.work{
  margin-top: 4px;
}

/* header */
.work__head{
  max-width: var(--text-width);
  margin: 0 auto 28px auto;
}

.work__title{
  margin: 0 0 0px 0;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
}

.facts{
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* =========================
   WORK GALLERY
   ========================= */
.work .gallery{
  max-width: var(--text-width);
  margin: 0 auto 32px auto;
  column-count: 2;
  column-gap: var(--gap-m);
}

@media (max-width: 700px){
  .work .gallery{
    column-count: 1;
  }
}

.work .shot{
  display: inline-block;
  width: 100%;
  margin: 0 0 var(--gap-m) 0;
  break-inside: avoid;
}

.work .shot img{
  width: 100%;
  height: auto;
  display: block;
}

.work .shot figcaption{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.imgtitle{
    font-weight: 600;
    font-size: 15px!important;
}

/* video dentro gallery */
.work .video{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}
.work .video iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* =========================
   WORK TEXT
   ========================= */
.work .text{
  max-width: var(--text-width);
  margin: 0 auto;
}

.work .text p{
  margin: 0 0 1em 0;
}

.facts{
  margin: 0;
  padding: 0;
}

.facts dd,
.facts dt{
  margin: 0;
  padding: 0;
}

/* =========================
   RELATED WORKS
   ========================= */
.related{
  max-width: var(--text-width);
  margin: 40px auto 0;
}

.related__title{
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
}

.related__grid{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gap-m);
}

@media (max-width: 900px){
  .related__grid{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 600px){
  .related__grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.related__card{
  display: block;
}

.related__card img{
  width: 100%;
  height: auto;
  display: block;
}

.related__meta{
  margin-top: 8px;
}

.related__name{
  font-size: 12px;
  font-weight: 600;
}

.related__year{
  font-size: 12px;
}

/* =========================
   SITE BAR
   ========================= */
.stickybar{
  position: sticky;
  top: 0px;
  z-index: 100;
  background: var(--bg);
  padding: 4px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.stickybar__nav{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.stickybar__link{
  color: inherit;
  text-decoration: none;
  opacity: .7;
}

.stickybar__link:hover{
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--fg);
}

.stickybar__link.is-active{
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.stickybar__right{
  display: flex;
  align-items: baseline;
  gap: 10px;
}
/* ===== LIGHTBOX (with caption + arrows) ===== */

.gallery img{ cursor: zoom-in; }

.lightbox{
  position: fixed;
  inset: 0;
  background: rgb(201, 201, 201, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox__inner{
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lightbox__imgwrap{
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img{
  max-width: 92vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  display: block;
  cursor: zoom-out;
}

.lightbox__caption{
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  max-width: min(80ch, 90vw);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none; /* click passa attraverso */
}

/* buttons */
.lightbox__btn{
  position: fixed;
  bottom: 6px;
  border: none;
  background: none;
  color: var(--muted);;
  padding: 20px 24px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  font-size: 30px;
}

.lightbox__btn:hover{ color: rgb(0,0,255); }

.lightbox__prev{ left: 30px; }
.lightbox__next{ right: 30px; }



/* optional: prevent selection */
.lightbox, .lightbox *{ user-select: none; }

/* CV */

.pageblock{
  max-width: var(--text-width);
  margin: 0 auto;
  padding: 24px 0 40px;
}

.pageblock__title{
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 600;
}

.pageblock__links{
  margin: 0 0 22px 0;
  font-size: 15px;
  color: var(--muted);
}

.pageblock__links a{ color: inherit; }

.cv{ font-size: 15px; }

.cv__row{
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  margin: 6px 0;
}

@media (max-width: 700px){
  .cv__row{ grid-template-columns: 90px 1fr; }
}


/*bio-contact*/

.bio-contact{
  margin-top: 20px;
  color: var(--muted);
  font-size: 25px;
  line-height: 1.2;
}
@media (max-width: 600px){
  .bio-contact{
  margin: 0;
  color: var(--muted);
  font-size: 16px!important;
  line-height: auto;}
}