/* GAON project body - the Gutenberg content of a project page.
 *
 * Scoped to .gaon-project-content, the CSS class on the Post Content widget in
 * the single template. Scoped rather than global because the same blocks appear
 * elsewhere on the site and should not inherit this page's measure and rhythm.
 *
 * Type is read from the desktop frame 1:3113: body 20/28, text column 611 of a
 * 1337 container. The client writes plain paragraphs and drops in Gutenberg's
 * own gallery - nothing here asks them to build a layout.
 */

.gaon-project-content{
  --gpc-ink: #040404;
  --gpc-gap: clamp(20px, 12.67px + 2.037vw, 42px);
  /* The frame's text column, 611 of 1337, as a share so it holds in a 1280
     container. Left to fill the full width a paragraph runs to about 160
     characters a line, roughly twice what anyone reads comfortably. */
  --gpc-measure: 45.7%;
  color: var(--gpc-ink);
  font-size: clamp(15px, 13.33px + 0.463vw, 20px);
  line-height: clamp(20px, 17.33px + 0.741vw, 28px);
}

.gaon-project-content > * + *{ margin-block-start: clamp(16px, 13.33px + 0.741vw, 24px); }

.gaon-project-content p{ margin: 0; }

.gaon-project-content > :is(p, ul, ol, blockquote){ max-inline-size: var(--gpc-measure); }
.gaon-project-content > :is(h2, h3, h4){ max-inline-size: 24ch; }

/* Inside a Columns block the column is already the measure. */
.gaon-project-content .wp-block-column > *{ max-inline-size: none; }

.gaon-project-content h2,
.gaon-project-content h3,
.gaon-project-content h4{
  margin: 0;
  font-weight: 500;
  line-height: 1.2;
}
.gaon-project-content h2{ font-size: clamp(26px, 21.33px + 1.296vw, 40px); }
.gaon-project-content h3{ font-size: clamp(21px, 18.33px + 0.741vw, 29px); }
.gaon-project-content h4{ font-size: clamp(18px, 16.67px + 0.370vw, 22px); }

/* Headings that follow a paragraph need more air above than below. */
.gaon-project-content > * + :is(h2, h3, h4){ margin-block-start: clamp(28px, 20.67px + 2.037vw, 50px); }

.gaon-project-content :is(ul, ol){ margin: 0; padding-inline-start: 1.25em; }
.gaon-project-content li + li{ margin-block-start: 6px; }

.gaon-project-content a{ color: inherit; text-underline-offset: 4px; }

.gaon-project-content blockquote{
  margin: 0;
  padding-inline-start: clamp(16px, 12px + 1.111vw, 28px);
  border-inline-start: 2px solid currentColor;
  font-size: clamp(17px, 15.67px + 0.370vw, 21px);
  line-height: 1.45;
}

/* The two-column body from the desktop frame. It is a Columns block the
   editor adds, not something the stylesheet conjures out of consecutive
   paragraphs - so the client keeps control of where the split falls and can
   put an image in one side without it being torn across the gutter.

   The gutter is 60 of the frame's 1282 content width, written as a share so
   it holds in the narrower container. Below 1024 the block stacks on its own
   and the gutter becomes vertical, which is why it falls back to the page's
   own rhythm there. */
.gaon-project-content .wp-block-columns{ gap: var(--gpc-gap); margin-block: 0; }
@media (min-width: 1024px){
  .gaon-project-content .wp-block-columns{ gap: 4.68%; }
}
.gaon-project-content .wp-block-column > * + *{ margin-block-start: clamp(16px, 13.33px + 0.741vw, 24px); }

/* Images ---------------------------------------------------------------- */
.gaon-project-content .wp-block-image{ margin: 0; }
.gaon-project-content > .wp-block-image img{
  display: block;
  inline-size: 100%;
  block-size: auto;
  border-radius: clamp(12px, 9.33px + 0.741vw, 20px);
}

/* Gallery ---------------------------------------------------------------
   Three photographs fall into the frame's arrangement on their own: the pair
   stacks in the inline-start column at 419 wide, the tall one fills the
   inline-end column at 869, with 32 between the columns and 28 between the
   rows. All three share one ratio in the frame - 419x365 and 869x757 are both
   1.148:1 - so the tall one lines up with the pair without being stretched.

   Any other count stays on the block's own even grid, so a two- or five-image
   gallery is not quietly broken by this rule.

   The width override on the figures is not optional: the gallery block ships
   as a flex layout and puts a calc() width on every child, which a grid cell
   does not undo by itself. */
.gaon-project-content .wp-block-gallery{ gap: var(--gpc-gap); }

.gaon-project-content .wp-block-gallery:has(> .wp-block-image:nth-child(3):last-child){
  display: grid;
  grid-template-columns: 419fr 869fr;
  grid-template-rows: auto auto;
  gap: 28px 32px;
}
/* The gallery block writes its own width on every child through a
   `:not(#individual-image)` selector - an id-weight trick that outranks any
   number of classes. The same trick is the only thing that undoes it, so the
   `:not(#gaon)` below is deliberate, not a typo: it costs nothing at match
   time and buys back the specificity the block took. */
.gaon-project-content .wp-block-gallery:has(> .wp-block-image:nth-child(3):last-child) > .wp-block-image:not(#gaon){
  width: auto;
  max-width: none;
  flex: none;
  margin: 0;
}
.gaon-project-content .wp-block-gallery:has(> .wp-block-image:nth-child(3):last-child) > .wp-block-image:not(#gaon) > img{
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 419 / 365;
  object-fit: cover;
  border-radius: clamp(12px, 9.33px + 0.741vw, 20px);
}
.gaon-project-content .wp-block-gallery:has(> .wp-block-image:nth-child(3):last-child) > .wp-block-image:nth-child(3){
  grid-column: 2;
  grid-row: 1 / -1;
}
.gaon-project-content .wp-block-gallery:has(> .wp-block-image:nth-child(3):last-child) > .wp-block-image:nth-child(3):not(#gaon) > img{
  block-size: 100%;
  aspect-ratio: auto;
}

/* Phone - frame 2:17354. One row of three, 156 / 79 / 79 with 9 between
   them and 153 tall, first photograph at the inline start. Not one image per
   row: the frame treats them as a strip rather than a stack.

   Worth knowing before this ships: at 360 those two trailing photographs are
   79px wide. They read as texture beside the first one, not as pictures
   anybody can make out. */
/* The measure only needs capping where there is width to waste. On a phone
   the frame's text column is 305 of 360, which is simply the container. */
@media (max-width: 1023px){
  .gaon-project-content{ --gpc-measure: 100%; }
}

@media (max-width: 767px){
  .gaon-project-content .wp-block-gallery:has(> .wp-block-image:nth-child(3):last-child){
    grid-template-columns: 156fr 79fr 79fr;
    grid-template-rows: auto;
    gap: 9px;
  }
  .gaon-project-content .wp-block-gallery:has(> .wp-block-image:nth-child(3):last-child) > .wp-block-image:nth-child(3){
    grid-column: auto;
    grid-row: auto;
  }
  .gaon-project-content .wp-block-gallery:has(> .wp-block-image:nth-child(3):last-child) > .wp-block-image:not(#gaon) > img{
    block-size: auto;
    aspect-ratio: 79 / 153;
  }
  .gaon-project-content .wp-block-gallery:has(> .wp-block-image:nth-child(3):last-child) > .wp-block-image:first-child:not(#gaon) > img{
    aspect-ratio: 156 / 153;
  }
}