/* Hero video sections (home + exposicao-1) go horizontal at >=768px; narrower than the video's native ratio, so its horizontal edges get cropped (existing Squarespace video-cover JS already handles the crop).
   overflow:hidden keeps the heading contained in this box. */
@media (min-width: 768px) {
  section[data-section-id='6a44a81ee82a95291efec115'],
  section[data-section-id='6a4930cb3093a06fc8f28c8d'] {
    aspect-ratio: 1.67 / 1;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden;
  }

  /* Each heading block spans several grid rows and, as a grid item, stretches to
     fill them; align-self:start makes it hug its text instead. The <h1> markup
     also carries the source-indentation newlines with white-space:pre-wrap,
     rendering ~4 blank lines, so collapse that whitespace to the single word. */
  section[data-section-id='6a44a81ee82a95291efec115']
    .content-wrapper
    .fluid-engine
    > .fe-block,
  section[data-section-id='6a4930cb3093a06fc8f28c8d']
    .content-wrapper
    .fluid-engine
    > .fe-block {
    align-self: start;
  }

  section[data-section-id='6a44a81ee82a95291efec115']
    .content-wrapper
    .fluid-engine
    .sqs-html-content
    h1,
  section[data-section-id='6a4930cb3093a06fc8f28c8d']
    .content-wrapper
    .fluid-engine
    .sqs-html-content
    h1 {
    white-space: normal !important;
  }
}

/* Borges quote section (home page, below the hero): each <h3> carries the source
   indentation newlines with white-space:pre-wrap, rendering ~4 blank lines so the
   heading (and its wrapper) is far taller than its single line of text. Collapse
   that whitespace, and stop the block stretching across its grid rows, so both the
   wrapper and the h3 hug the actual content height.
   Block IDs are paired: home (PT) + exposicao-1 (EN) versions of each line. */
.fe-block-5d6d9bb85f66aa7472c8,
.fe-block-30b8a905ee2b51747853,
.fe-block-5b5e86ca4c4b617301b0,
.fe-block-37be1b50e42141c4d5ae,
.fe-block-0a259a05601a009932c1,
.fe-block-e3b8562102270f77f487 {
  align-self: start;
}

.fe-block-5d6d9bb85f66aa7472c8 .sqs-html-content h3,
.fe-block-30b8a905ee2b51747853 .sqs-html-content h3,
.fe-block-5b5e86ca4c4b617301b0 .sqs-html-content h3,
.fe-block-37be1b50e42141c4d5ae .sqs-html-content h3,
.fe-block-0a259a05601a009932c1 .sqs-html-content h3,
.fe-block-e3b8562102270f77f487 .sqs-html-content h3 {
  white-space: normal !important;
}

/* "Jorge L. Borges" attribution below the quote: same pre-wrap blank-line
   inflation, so collapse it and hug the grid rows. (home PT + exposicao-1 EN) */
.fe-block-1f9a45fc36fab8cebec4,
.fe-block-3bd100ccc2f0ed037803 {
  align-self: start;
}

.fe-block-1f9a45fc36fab8cebec4 .sqs-html-content p,
.fe-block-3bd100ccc2f0ed037803 .sqs-html-content p {
  white-space: normal !important;
}

/* Mobile: hero section (and its video background, which fills it) uses a 1:1.23 ratio. */
@media (max-width: 767px) {
  section[data-section-id='6a44a81ee82a95291efec115'],
  section[data-section-id='6a4930cb3093a06fc8f28c8d'] {
    /* Fluid proportion: 1:1.23 at 767px wide, easing to 1:2.24 at 350px wide
       (height = ratio x width, linear in viewport width; clamped at 2.24 below 350px). */
    height: min(calc(38.23vw + 650.2px), 224vw) !important;
    min-height: 0 !important;
    overflow: hidden;
  }

  /* Same wrapper-hugging fix as desktop: stop each heading block from stretching
     across its grid rows, and collapse the source-indentation whitespace in the
     <h1> so the wrapper matches the height of the word it holds. */
  section[data-section-id='6a44a81ee82a95291efec115']
    .content-wrapper
    .fluid-engine
    > .fe-block,
  section[data-section-id='6a4930cb3093a06fc8f28c8d']
    .content-wrapper
    .fluid-engine
    > .fe-block {
    align-self: start;
  }

  section[data-section-id='6a44a81ee82a95291efec115']
    .content-wrapper
    .fluid-engine
    .sqs-html-content
    h1,
  section[data-section-id='6a4930cb3093a06fc8f28c8d']
    .content-wrapper
    .fluid-engine
    .sqs-html-content
    h1 {
    white-space: normal !important;
  }
}

/* --------------------------------------------------------------------------
   Artist page hero (template/index.html -> every SLUG/index.html).
   Squarespace sizes this section from its fluid-engine rows (minmax(row, auto)),
   so the photo and a wrapping name grew it differently on every page. Here the
   grid has a fixed height and the place + name stack from the bottom, leaving
   room for a name of up to two lines without changing the hero height. */
.artist-hero .fluid-engine {
  /* columns as in the template; some pages were exported with an 11px gap/gutter offset */
  --grid-gutter: var(--sqs-mobile-site-gutter, 6vw);
  --cell-max-width: calc(var(--sqs-site-max-width, 1500px) / 8);
  grid-template-rows: 72px 432px auto auto 1fr;
  /* top gap + photo + 2 name lines (89px each) + place line + bottom gap */
  height: 850px;
  gap: 0 !important;
}
.artist-hero .fluid-engine > .fe-block {
  align-self: start;
}
.artist-hero .artist-hero__photo {
  grid-area: 2 / 2 / 3 / 10;
  height: 100%;
}
/* fill the fixed frame whatever the source photo's proportions; crop around its focal point */
.artist-hero
  .artist-hero__photo
  :is(
    .sqs-block,
    .sqs-block-content,
    .fluid-image-component-root,
    .fluid-image-animation-wrapper,
    .fluid-image-container,
    .js-content-mode-element-wrapper,
    .js-content-mode-element
  ) {
  width: 100%;
  height: 100%;
}
.artist-hero .artist-hero__photo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.artist-hero .artist-hero__name {
  grid-area: 3 / 2 / 4 / 10;
}
.artist-hero .artist-hero__place {
  grid-area: 4 / 2 / 5 / 10;
}
.artist-hero .artist-hero__name h1,
.artist-hero .artist-hero__place h3 {
  white-space: normal !important;
}
/* inline justify stretches the first line of a two-line name across the column */
.artist-hero .artist-hero__name h1 {
  text-align: left !important;
}

@media (min-width: 768px) {
  .artist-hero .fluid-engine {
    --grid-gutter: var(--sqs-site-gutter, 4vw);
    --cell-max-width: calc(var(--sqs-site-max-width, 1500px) / 24);
    /* same row unit Squarespace uses (container width x 0.0215); 19 rows tall */
    --hero-row: calc(
      min(
          var(--sqs-site-max-width, 1500px),
          calc(100vw - var(--sqs-site-gutter, 4vw) * 2)
        ) *
        0.0215
    );
    grid-template-rows: var(--hero-row) 1fr auto auto var(--hero-row);
    height: calc(var(--hero-row) * 19);
  }
  .artist-hero .artist-hero__photo {
    grid-area: 2 / 16 / -1 / 24;
    height: calc(var(--hero-row) * 15);
  }
  .artist-hero .artist-hero__place {
    grid-area: 3 / 4 / 4 / 16;
  }
  .artist-hero .artist-hero__name {
    grid-area: 4 / 4 / 5 / 16;
  }
}

/* Artist quote (first thing after the hero): its own one-row grid reusing the
   page's fe-* column setup, so it lines up with the bio column while its spacing
   to the hero and to the content grid below is fixed here. */
.artist-quote.fluid-engine {
  grid-template-rows: auto !important;
  margin: 48px 0;
}
.artist-quote > .fe-block {
  grid-area: 1 / 2 / 2 / 10;
}
.artist-quote h4 {
  white-space: normal !important;
  text-align: left !important;
  margin: 0 !important;
}
/* optional second h4 = who said the quote */
.artist-quote h4 + h4 {
  margin-top: 0.4em !important;
}
@media (min-width: 768px) {
  .artist-quote.fluid-engine {
    margin-top: clamp(48px, 5vw, 72px);
  }
  .artist-quote > .fe-block {
    grid-area: 1 / 4 / 2 / 26;
  }
}

/* Quote + content grids share the template's columns (some pages were exported
   with 11px gutters/gaps), so text and sidebar line up identically everywhere. */
.artist-quote.fluid-engine,
.artist-content.fluid-engine {
  --grid-gutter: var(--sqs-mobile-site-gutter, 6vw);
  --cell-max-width: calc(var(--sqs-site-max-width, 1500px) / 8);
  gap: 0 !important;
}

/* Content: bio (first block), .artist-sidebar (images + captions), long text
   (last block). Mobile stacks bio / sidebar / text. */
.artist-content.fluid-engine {
  grid-template-rows: auto auto auto !important;
}
.artist-content > .fe-block:first-child {
  grid-area: 1 / 2 / 2 / 10;
  align-self: start;
}
.artist-content > .artist-sidebar {
  grid-area: 2 / 2 / 3 / 10;
  margin: 48px 0;
}
.artist-content > .fe-block:last-child {
  grid-area: 3 / 2 / 4 / 10;
  align-self: start;
}
.artist-content > .fe-block:last-child .sqs-html-content > p:first-child:empty {
  display: none;
}
.artist-content
  > .fe-block:last-child
  .sqs-html-content
  > p:first-child:empty
  + * {
  margin-top: 0;
}
@media (min-width: 768px) {
  .artist-quote.fluid-engine,
  .artist-content.fluid-engine {
    --grid-gutter: var(--sqs-site-gutter, 4vw);
    --cell-max-width: calc(var(--sqs-site-max-width, 1500px) / 24);
  }
  /* 1fr row absorbs a sidebar taller than the bio, so the text follows the bio directly */
  .artist-content.fluid-engine {
    grid-template-rows: auto 1fr !important;
  }
  .artist-content > .fe-block:first-child {
    grid-area: 1 / 4 / 2 / 16;
  }
  .artist-content > .artist-sidebar {
    grid-area: 1 / 18 / 3 / 25;
    margin: 0;
  }
  .artist-content > .fe-block:last-child {
    grid-area: 2 / 4 / 3 / 16;
    /* same as the paragraph spacing (p margin: 1rem 0) */
    margin-top: 1rem;
  }
}

.artist-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-self: start;
  align-content: start;
}
.artist-sidebar > .fe-block {
  grid-column: 1 / -1;
  grid-row: auto;
  align-self: start;
  margin-top: 48px;
}
.artist-sidebar > .fe-block:first-child {
  margin-top: 0;
}
/* diptych row: widths proportional to each image's --ar (w / h) so both share one height */
.artist-sidebar > .artist-sidebar__pair {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 48px;
}
.artist-sidebar > .artist-sidebar__pair:first-child {
  margin-top: 0;
}
.artist-sidebar__pair > .artist-sidebar__half {
  flex: calc(var(--ar)) 1 0;
  min-width: 0;
}
.artist-sidebar > .fe-block:has(.html-block) {
  margin-top: 12px;
}
.artist-sidebar .html-block p {
  margin: 0;
  white-space: normal !important;
}
/* images at natural proportions instead of Squarespace's fixed grid frames
   (selectors must outrank static.css's 4-class !important absolute/100% rules) */
.artist-content .artist-sidebar .fe-block > .sqs-block,
.artist-content .artist-sidebar .fe-block > .sqs-block > .sqs-block-content,
.artist-content
  .artist-sidebar
  .fe-block
  .sqs-block-content
  :is(
    .fluid-image-component-root,
    .fluid-image-animation-wrapper,
    .fluid-image-container,
    .js-content-mode-element-wrapper,
    .js-content-mode-element
  ) {
  position: relative !important;
  height: auto !important;
}
/* Squarespace JS sizes "fit" images to their old frame via an inline px width */
.artist-content
  .artist-sidebar
  .fe-block
  .sqs-block-content
  .fluid-image-container {
  width: 100% !important;
}
.artist-content .artist-sidebar .fe-block > .sqs-block {
  justify-content: flex-start !important;
}
.artist-content
  .artist-sidebar
  .fe-block
  .fluid-image-container
  .js-content-mode-element
  img {
  position: static !important;
  display: block;
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}

/* "Seleção de obras" gallery (artist pages). Source files are square canvases with
   transparent padding; each link carries the visible artwork's ratio/offset
   (--art-ratio / --art-pos), so cover-cropping trims only that padding and the
   caption sits right under the painting. Gaps are the same on every artist page. */
body:has(.artist-hero) .gallery-section .gallery-grid-wrapper {
  column-gap: 5vw !important;
  row-gap: 64px !important;
  padding: 0 5vw !important;
  align-items: start;
}
body:has(.artist-hero) .gallery-section .gallery-grid-item-wrapper {
  padding-bottom: 0 !important;
  height: auto !important;
}
body:has(.artist-hero) .gallery-section .gallery-grid-item-wrapper > a {
  position: relative !important;
  display: block;
  aspect-ratio: var(--art-ratio, 1 / 1);
}
body:has(.artist-hero) .gallery-section .gallery-grid-item-wrapper img {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: var(--art-pos, 50% 50%) !important;
}
body:has(.artist-hero) .gallery-section .gallery-caption {
  padding-top: 12px !important;
}
body:has(.artist-hero) .gallery-section .gallery-caption p {
  margin: 0;
}
@media (max-width: 767px) {
  body:has(.artist-hero) .gallery-section .gallery-grid-wrapper {
    row-gap: 48px !important;
  }
}

/* Body text paragraphs with sqsrte-large class have inline white-space:pre-wrap
   which breaks text layout; collapse to normal whitespace. */
.sqsrte-large {
  white-space: normal !important;
}

/* Slider item descriptions in "Conheça os artistas" section have pre-wrap on
   their paragraphs; remove it for normal text layout. */
.list-item-content__description p {
  white-space: normal !important;
}

/* "Conheça os artistas"/"Meet the artists" carousel (home + exposicao-1 EN mirror):
   each description carries a trailing empty <p> that renders a blank line, and the real
   text wraps to 1 or 2 lines depending on width - so the "Saiba mais" button (next in
   flow) lands at different heights per card. Hide the empty <p> and reserve a uniform
   2-line box so the button starts at the same Y in every card. */
.user-items-list-item-container[data-section-id='6a44a81ee82a95291efec11b']
  .list-item-content__description
  p:empty,
.user-items-list-item-container[data-section-id='6a4930cb3093a06fc8f28c93']
  .list-item-content__description
  p:empty {
  display: none;
}

.user-items-list-item-container[data-section-id='6a44a81ee82a95291efec11b']
  .list-item-content__description,
.user-items-list-item-container[data-section-id='6a4930cb3093a06fc8f28c93']
  .list-item-content__description {
  line-height: 1.4;
  min-height: 2.8em;
  margin-bottom: 0.9em; /* gap before button even when the location text fills both lines */
}

/* --------------------------------------------------------------------------
   Simplified "Conheça os artistas" cards (artistas page).
   Replaces the Squarespace fluid-engine per-block grid with a plain card grid,
   so every spacing value is a single margin/gap. Scoped under .artist-grid. */
.artist-cards-section {
  display: block; /* override .page-section's flex-row so the intro text stacks above the grid */
}
.artist-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 100px 32px;
  max-width: 750px;
  margin: 0 auto;
  box-sizing: border-box;
}
.artist-grid__intro {
  max-width: 1100px; /* wider than .artist-grid so it reads as a separate intro block */
  margin: 0 auto 80px;
  padding-top: 40px;
  text-align: justify;
}
@media (min-width: 992px) and (max-width: 1199px) {
  .artist-grid__intro {
    max-width: 80%;
  }
}
@media (min-width: 1200px) {
  .artist-grid__intro {
    max-width: 900px;
  }
}
@media (max-width: 992px) {
  .artist-grid__intro {
    margin-left: 40px;
    margin-right: 40px;
  }
}
.artist-card {
  display: block;
  max-width: 308px; /* matches the >=1200px grid ratio */
  text-decoration: none;
  color: inherit;
}
@media (min-width: 768px) {
  .artist-card:nth-of-type(odd) {
    justify-self: start;
    margin-top: 120px;
  }
  .artist-card:nth-of-type(even) {
    justify-self: end;
    margin-top: 0;
  }
}
@media (min-width: 768px) and (max-width: 900px) {
  .artist-grid {
    max-width: 550px;
  }
  .artist-card {
    max-width: 226px; /* matches the 550px grid ratio */
  }
}
@media (min-width: 901px) and (max-width: 1199px) {
  .artist-grid {
    max-width: 650px;
  }
  .artist-card {
    max-width: 267px; /* matches the 650px grid ratio */
  }
}
@media (min-width: 1200px) {
  .artist-grid {
    max-width: 750px;
  }
}
.artist-card__media {
  display: block;
  position: relative;
  z-index: 0; /* own paint context so overflow clips the scaled img on all corners */
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 268 / 335; /* fixed card-image proportion, fluid to card width */
  transform: translateZ(0);
}
.artist-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.artist-card:hover .artist-card__media img {
  transform: scale(1.1); /* re-adds the Squarespace hover zoom */
}
.artist-card__name {
  margin: 32px 0 0; /* image → name gap */
  font-weight: 700;
}
.artist-card__bio {
  margin: 8px 0 0; /* name → text gap */
}

@media (max-width: 767px) {
  .artist-grid {
    grid-template-columns: 1fr;
    gap: 100px 0;
    width: 66%;
    margin: 0 auto;
  }
  .artist-grid__intro {
    margin-bottom: 80px; /* intro → first card on mobile */
  }
  .artist-card {
    max-width: none; /* single column: card fills the full width */
  }
  .artist-card__media {
    width: 250px;
  }
}
@media (max-width: 350px) {
  .artist-card__media {
    width: 220px;
  }
}

/* Page title heading (e.g. "Exposição Casa-território /// Território-casa") -
   explicit margins so spacing above/below is consistent regardless of container. */
.page-title-heading {
  max-width: 991px;
  margin: 60px auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Ficha técnica: title + credits list, replacing the fluid-engine grid-area
   wrapper so the credits always flow directly below the title. */
.ficha-tecnica-content {
  display: block;
}
.ficha-tecnica-credits {
  margin-top: 24px;
}
.ficha-tecnica-credits p {
  margin: 0 0 16px;
  padding-left: 40px;
  padding-right: 40px;
}

/* Midia: title + news links list, same fluid-engine-to-flow fix as ficha-tecnica. */
.midia-content {
  display: block;
}
.midia-links {
  margin-top: 24px;
  margin-bottom: 80px;
}
.midia-links p {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}
.midia-links p a {
  text-decoration: underline;
}
