/* Site-specific fixes and additions. Loaded after the Webflow stylesheets, overriding them. */

/* E1: Webflow sized these at 100vw, which includes the scrollbar and made pages
   scroll sideways by the scrollbar's width. 100% fits the visible area. */
.section-wide {
  width: 100%;
}

@media screen and (max-width: 991px) {
  .video-vimeo {
    width: 100%;
  }
}

/* E4: menu toggles are real <button>s (keyboard and screen-reader friendly).
   Reset browser button styling so they look exactly as the old <div>s did. */
.menu-link-animation,
.hamburger-container {
  font: inherit;
  color: inherit;
  line-height: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.menu-link-animation {
  padding: 0;
}

.hamburger-line {
  display: block;
}

/* Hidden desktop dropdown: keep its links out of the Tab order. */
.animation-dropdown-container.hide {
  visibility: hidden;
}

.animation-dropdown-container {
  transition: transform .4s, opacity .4s, visibility .4s;
}

/* Phone menu, design 3b: full screen, left-aligned, animations always listed.
   Loaded after sabrina-rosenheim.webflow.css and overrides its hamburger rules. */
@media screen and (max-width: 767px) {
  .hamburger-dropdown-menu {
    position: fixed;
    top: 70px;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    align-items: flex-start;
    padding: 34px 30px 18px;
    border-top: 1px solid #000;
    background-color: #fff;
    overflow-y: auto;
    visibility: visible;
    transition: opacity .3s, visibility .3s;
    transform: none;
  }

  /* Hidden menu must not block taps on the page underneath. */
  .hamburger-dropdown-menu.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
  }

  .hamburger-dropdown-menu .menu-link {
    margin: 0;
    padding: 10px 0;
    font-size: 26px;
    line-height: 30px;
    text-align: left;
    color: var(--dim-grey);
  }

  .menu-link-animation-hamburger {
    cursor: default;
    margin: 0;
    padding: 10px 0 8px;
    font-size: 26px;
    line-height: 30px;
  }

  .animation-dropdown-container-hamburger {
    width: auto;
    height: auto;
    align-items: flex-start;
    margin: 0 0 8px 2px;
    padding-left: 18px;
    border-top: 0;
    border-bottom: 0;
    border-left: 1px solid #ddd;
    transition: none;
  }

  .animation-dropdown-container-hamburger .menu-link {
    font-size: 18px;
    line-height: 24px;
    color: #6b6b6b;
  }
}

/* E2: scroll-down arrow fades out on the first scroll (js/site.js adds .is-hidden). */
.small-arrow-down {
  pointer-events: none;
  transition: opacity .6s;
}

.small-arrow-down.is-hidden {
  opacity: 0;
}

/* Footer: sits at the bottom of the window on short pages, after the content on long ones. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.section-wide.footer {
  margin-top: auto;
  flex-shrink: 0;
}

/* T3: About and Contact text lines up with the name (30px on phones). */
.section-wide.about .about-container {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

@media screen and (max-width: 767px) {
  .section-wide.about {
    padding-left: 30px;
    padding-right: 30px;
  }
}

/* T4: CV as two columns, so long entries wrap under their own text, not under the year. */
.about-bio {
  margin: 0 0 24px;
}

.cv-section {
  margin-bottom: 20px;
}

.cv-list {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  row-gap: 4px;
}

/* T5: mailing list form in the site's own style (Mailchimp's stylesheet is no longer loaded). */
#mc_embed_signup {
  max-width: 300px;
  margin-top: 40px;
}

#mc_embed_signup form {
  margin: 0;
}

#mc_embed_signup_scroll {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 8px;
}

#mc_embed_signup h2 {
  margin: 0;
  font-size: 12px;
  line-height: 20px;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
}

#mc_embed_signup .indicates-required {
  color: #6b6b6b;
  text-align: right;
}

#mc_embed_signup .mc-field-group,
#mc_embed_signup #mce-responses,
#mc_embed_signup .optionalParent {
  grid-column: 1 / -1;
}

#mc_embed_signup .mc-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

#mc_embed_signup label {
  font-size: 12px;
  font-weight: 400;
  margin: 0;
}

#mc_embed_signup input[type="email"] {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #474747;
  border-radius: 0;
  font-family: inherit;
  font-size: 14px;
  color: #474747;
  box-sizing: border-box;
}

#mc_embed_signup .button {
  height: 40px;
  margin-top: 6px;
  padding: 0 24px;
  border: 1px solid #000;
  border-radius: 0;
  background: #000;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: .04em;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

#mc_embed_signup .button:hover {
  background: #333;
}

#mc_embed_signup .response,
#mc_embed_signup .mce_inline_error {
  font-size: 12px;
  line-height: 18px;
  margin-top: 4px;
}

#mc_embed_signup #mce-error-response,
#mc_embed_signup .mce_inline_error {
  color: #b00020;
}

@media screen and (max-width: 767px) {
  #mc_embed_signup {
    max-width: none;
  }
}

/* E6: page not found. */
.section-wide.notfound {
  flex-grow: 1;
  height: auto;
  min-height: 400px;
  text-align: center;
  gap: 18px;
}

.notfound-title {
  margin: 0;
  font-size: 25px;
  line-height: 30px;
  font-weight: 400;
  font-style: italic;
}

.section-wide.notfound p {
  margin: 0;
}

/* T2: year index on the Painting page (design "Index 2").
   Years sit on the name's 30px line; the current year gets a marker that starts on the line
   and pushes it right. js/site.js sets .is-current while scrolling. Phones show only the current year. */
html {
  scroll-behavior: smooth;
}

.year-anchor {
  height: 0;
}

.year-index {
  position: fixed;
  top: 96px;
  left: 30px;
  z-index: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  line-height: 20px;
}

.year-link {
  display: flex;
  align-items: center;
  color: #474747;
  text-decoration: none;
}

.year-link:hover,
.year-link.is-current {
  color: #000;
}

.year-mark {
  display: block;
  flex-shrink: 0;
  width: 0;
  height: 1px;
  margin-right: 0;
  background: #000;
  transition: width .3s, margin-right .3s;
}

.year-link.is-current .year-mark {
  width: 16px;
  margin-right: 8px;
}

@media screen and (max-width: 767px) {
  .year-index {
    top: 76px;
  }

  .year-link:not(.is-current) {
    display: none;
  }
}

/* T1: on phones, paintings may be as wide as the 30px edges (name and year index line).
   Webflow's .div-block wrapper capped the first paintings at 80vw, which Safari respects,
   so wide paintings came out small. Height stays capped at half the screen. */
@media screen and (max-width: 767px) {
  .div-block:not(.thirdspace) {
    max-width: none;
    max-height: none;
  }

  .div-block:not(.thirdspace) > .painting:not(.big),
  .section-wide > .painting {
    max-width: calc(100vw - 60px);
    max-height: 50vh;
  }
}

/* Animation pages on phones: layout "B" (owner-approved).
   Header photo shown whole at its real proportions, edge to edge under the header (no cropping or
   enlarging); title and subtitle below it; full-width 16:9 video; centred caption; text on the 30px edge.
   Desktop is unchanged. The photos stay CSS backgrounds; each ratio below is the photo's height/width. */
@media screen and (max-width: 767px) {
  .section-wide.hero {
    display: block;
    height: auto;
    margin: 0;
    padding: calc(70px + 100vw * 0.6035) 30px 0;
    background-size: 100% auto;
    background-position: 50% 70px;
    background-repeat: no-repeat;
  }

  .section-wide.hero.milano {
    padding-top: calc(70px + 100vw * 0.5625);
  }

  .section-wide.hero.languagebetween {
    margin: 0;
    padding-top: calc(70px + 100vw * 0.6276);
  }

  /* Second photo further down Langue Absente: no header above it, no title. */
  .section-wide.hero.languagebetween2 {
    margin-top: 70px;
    padding: calc(100vw * 0.5547) 0 0;
    background-position: 50% 0;
  }

  .section-wide.hero .title-container {
    position: static;
    padding: 28px 0 0;
  }

  .section-wide.hero h2 {
    margin: 0;
    font-size: 25px;
    line-height: 30px;
  }

  .section-wide.hero .title-container > div {
    margin-top: 8px;
    font-size: 12px;
    line-height: 20px;
  }

  /* Video section (The Third Space, Langue Absente) and Milano's image section. */
  .section-wide.gallerysingle,
  .section-wide.hero.milano + .section-wide {
    display: block;
    height: auto;
    padding: 70px 30px 0;
  }

  .section-wide.gallerysingle .video-container {
    display: block;
    height: auto;
    min-height: 0;
    margin-bottom: 0;
  }

  .video-embed-small {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .video-embed-small iframe {
    display: block;
    width: 100%;
    height: 100%;
  }

  .div-block.thirdspace {
    max-width: none;
    max-height: none;
  }

  .div-block.thirdspace > .painting {
    display: block;
    width: 100%;
    max-width: none;
    max-height: none;
  }

  .section-wide.gallerysingle .text-container,
  .div-block.thirdspace .text-container {
    margin-top: 16px;
    grid-row-gap: 4px;
    align-items: center;
    text-align: center;
  }

  .section-wide.gallerysingle .about-container,
  .div-block.thirdspace .about-container {
    width: 100%;
    max-width: none;
    margin: 50px 0 0;
    padding: 0;
    text-align: left;
  }

  .section-wide.gallerysingle .about-container + .about-container {
    margin-top: 44px;
  }

  .section-wide.gallerysingle .about-container p,
  .div-block.thirdspace .about-container p {
    margin: 0;
  }

  /* Webflow left empty lines at the start of these paragraphs; spacing is set here instead. */
  .about-container p > br:first-child,
  .about-container p > em:first-child > br:first-child {
    display: none;
  }

  .citazione-nome {
    margin-top: 10px !important;
    text-align: left;
  }

  .citazione-nome + p {
    margin-top: 44px !important;
  }

  .div-block.thirdspace .about-container p:last-child:not(:first-child) {
    display: none;
  }

  /* The whole photo and title fit in the first screen, so the scroll arrow isn't needed here. */
  body:has(.section-wide.hero) .small-arrow-down {
    display: none;
  }
}

/* S5: one main heading (h1) per page about the page's subject. On the animation pages and the
   404 page the work/page title is the h1 and the name in the header is a plain .site-name.
   These rules reproduce the old h1/h2 looks exactly, so nothing changes visually. */
.site-name {
  margin: 20px 0 10px;
  font-size: 25px;
  line-height: 26px;
  font-weight: 400;
  letter-spacing: 1px;
}

.work-title {
  margin: 20px 0 5px;
  font-size: 2vw;
  line-height: 40px;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0;
}

.notfound-title {
  letter-spacing: 0;
}

@media screen and (max-width: 767px) {
  .site-name {
    font-size: 20px;
    line-height: 20px;
  }

  .section-wide.hero .work-title {
    margin: 0;
    font-size: 25px;
    line-height: 30px;
  }
}

@media screen and (max-width: 479px) {
  .site-name {
    font-size: 15px;
    line-height: 15px;
  }
}

/* Desktop menu: underline the current page (owner-approved "Current page 2").
   The underline is a separate 1px line (.menu-underline, added by js/site.js under the current
   item) so the page transition can glide it from one menu item to the next. The current link is
   found by aria-current="page" (Webflow's .w--current class is removed by its script when the
   address has extras like ?fbclid=); on the animation pages the "Animation" button has .is-current. */
@media screen and (min-width: 768px) {
  .menu-container .menu-link[aria-current="page"],
  .menu-link-animation.is-current {
    color: #000;
  }

  .menu-container .menu-link > div,
  .menu-link-animation {
    position: relative;
  }

  .menu-underline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: #000;
    pointer-events: none;
    view-transition-name: menu-underline;
  }
}

@media screen and (max-width: 767px) {
  .menu-underline {
    display: none;
  }
}

/* Desktop "Animation" dropdown, owner-approved option 2b: solid white panel aligned under the
   word "Animation" (js/site.js sets its left edge), thin grey line on the left, unfolds downward,
   titles appear one after another. Replaces Webflow's slide from 200px above the screen. */
@media screen and (min-width: 768px) {
  .animation-dropdown-container {
    top: 78px;
    right: auto;
    width: auto;
    padding: 2px 16px 4px 15px;
    background-color: #fff;
    border-left: 1px solid #ccc;
    white-space: nowrap;
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 0 0);
    visibility: visible;
    transition: clip-path .35s ease-out, visibility .35s;
  }

  .animation-dropdown-container.hide {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
  }

  .animation-dropdown-container .menu-link {
    margin-left: 0;
    padding: 6px 0;
    text-align: left;
    opacity: 1;
    transform: none;
    transition: opacity .3s ease-out, transform .3s ease-out;
  }

  .animation-dropdown-container .menu-link:nth-child(1) { transition-delay: .12s; }
  .animation-dropdown-container .menu-link:nth-child(2) { transition-delay: .2s; }
  .animation-dropdown-container .menu-link:nth-child(3) { transition-delay: .28s; }

  .animation-dropdown-container.hide .menu-link {
    opacity: 0;
    transform: translate(0, -4px);
    transition-delay: 0s;
  }
}

/* Phone menu icon (burger / X) at 75% of Webflow's size: lines 30x3px -> 22.5x2.25px,
   spacing 10px -> 7.5px. The tap area stays 40x40px. */
@media screen and (max-width: 767px) {
  .hamburger-line {
    width: 22.5px;
    height: 2.25px;
  }

  .hamburger-line.top {
    transform: translate(0, -7.5px);
  }

  .hamburger-line.low {
    transform: translate(0, 7.5px);
  }

  .hamburger-line.top.active {
    transform: rotate(45deg);
  }

  .hamburger-line.low.active {
    transform: rotate(-45deg);
  }
}

/* Page-to-page transition (owner-approved: fade with a slight rise, header still, underline glides).
   Uses the browser's built-in cross-page View Transitions: Chrome/Edge 126+, Safari 18.2+.
   Browsers without support (e.g. Firefox today) simply switch pages as before. */
@view-transition {
  navigation: auto;
}

.navbar-top-container {
  view-transition-name: site-header;
}

::view-transition-old(root) {
  animation: vt-fade-out .25s ease-in both;
}

::view-transition-new(root) {
  animation: vt-fade-rise .5s cubic-bezier(.2, .6, .2, 1) .1s both;
}

::view-transition-group(menu-underline) {
  animation-duration: .5s;
  animation-timing-function: cubic-bezier(.4, 0, .2, 1);
}

@keyframes vt-fade-out {
  to { opacity: 0; }
}

@keyframes vt-fade-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Visitors who asked their device for less motion get plain page changes. */
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* Phone menu: when it opens, its links appear one after another with a slight rise
   (the same gesture as the page transitions and the desktop dropdown). */
@media screen and (max-width: 767px) {
  .hamburger-dropdown-menu > * {
    opacity: 1;
    transform: none;
    transition: opacity .35s ease-out, transform .35s cubic-bezier(.2, .6, .2, 1);
  }

  .hamburger-dropdown-menu > :nth-child(1) { transition-delay: .06s; }
  .hamburger-dropdown-menu > :nth-child(2) { transition-delay: .12s; }
  .hamburger-dropdown-menu > :nth-child(3) { transition-delay: .18s; }
  .hamburger-dropdown-menu > :nth-child(4) { transition-delay: .24s; }
  .hamburger-dropdown-menu > :nth-child(5) { transition-delay: .3s; }

  .hamburger-dropdown-menu.hide > * {
    opacity: 0;
    transform: translateY(8px);
    transition-delay: 0s;
  }
}

@media screen and (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .hamburger-dropdown-menu > * {
    transition: none;
  }
}
