/* GAON project hero.
 *
 * Measured off the desktop frame 1:3113 at 1440. The numbers that matter:
 *
 *   photograph   1440 x 655, with a 21% black wash over it
 *   card         860 wide of a 1337 container (64.3%), 304 tall, top at 516,
 *                so it rides 139px up over the photograph's lower edge
 *   card inner   698 of 860 (81.2%), centred; title 43/52, summary 19.2/27.6
 *   chip rows    at the container's inline end, first row 41px below the
 *                photograph, 12px between the rows
 *
 * Absolute sizes - type, chip height, radii - are held as measured. Anything
 * that is a share of the container is written as a percentage, because the
 * site's container is 1280 and the frame's is 1337.
 */

.gph{
  --gph-max: 1280px;
  --gph-pad: clamp(18px, 14.67px + 0.926vw, 28px);
  /* 336 on the phone frame, 139 on the desktop frame, straight line between. */
  --gph-overlap: clamp(139px, 401.7px - 18.24vw, 336px);
  --gph-card-w: 64.3%;
  --gph-bg: #8EB1F2;
  --gph-ink: #040404;
  --gph-overlay: rgba(0,0,0,0.21);
  --gph-card-radius: 24px;
  --gph-font: "Noto Sans Hebrew", system-ui, Arial, sans-serif;
  display: block;
  inline-size: 100%;
  font-family: var(--gph-font);
  color: var(--gph-ink);
}

/* Photograph -------------------------------------------------------------
   The ratio is the frame's, but only up to the width it was drawn at. Left
   to scale, a 2.2:1 hero is 873px tall on a 1920 screen and 1164px on a 2560
   - a photograph that fills the laptop and pushes the card below the fold.
   Past 1440 the height holds and the picture crops instead. */
.gph__media{
  position: relative;
  inline-size: 100%;
  aspect-ratio: 1440 / 655;
  overflow: hidden;
  background-color: #040404;
}

/* The <picture> exists only to carry the breakpoint on its <source>; it must
   not become a box between the media block and the image. */
.gph__pic{ display: contents; }

.gph .gph__img{
  display: block;
  inline-size: 100%;
  block-size: 100%;
  max-inline-size: none;
  object-fit: cover;
  object-position: center;
}

.gph__overlay{
  position: absolute;
  inset: 0;
  background-color: var(--gph-overlay);
  pointer-events: none;
}

/* Card and chip rows ----------------------------------------------------- */
.gph__inner{
  position: relative;
  z-index: 1;
  inline-size: 100%;
  max-inline-size: var(--gph-max);
  margin-inline: auto;
  margin-block-start: calc(-1 * var(--gph-overlap));
  padding-inline: var(--gph-pad);
}

.gph__card{
  inline-size: 100%;
  padding-block: 24px;
  padding-inline: 18px;
  border-radius: var(--gph-card-radius);
  background-color: var(--gph-bg);
  color: var(--gph-ink);
  box-shadow: 0 4.8px 64.8px 1.2px rgba(0,0,0,0.03);
}

/* The text block is narrower than the card and centred inside it, which is
   what gives the card its wide quiet margins in the frame. */
.gph__card-inner{
  display: flex;
  flex-direction: column;
  gap: 10px;
  inline-size: 100%;
  margin-inline: auto;
}

.gph__title{
  margin: 0;
  font-family: inherit;
  font-weight: 500;
  /* Both frames set this at 43/52. It is not fluid: on the phone the name
     simply takes two lines and the years a third. */
  font-size: 43px;
  line-height: 1.2093;
  letter-spacing: 0;
  color: inherit;
  overflow-wrap: break-word;
}
/* The frame breaks the line before the years rather than letting them run
   on after the name, so the title is always two lines. */
/* <bdi> auto-detects its direction from its own text, and "2025-6" is
   Latin digits - so as a block it computed direction:ltr and text-align:start
   put the years at the left of an otherwise right-aligned card. The block
   follows the page, the digits keep their own ordering inside it. */
.gph__years{ display: block; direction: inherit; unicode-bidi: isolate; }

/* Summary at the inline start, arrow at the inline end, tops aligned. */
.gph__card-row{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

/* 70% ink, as the frame sets it. On all three division colours that measures
   above 4.5:1; a fixed grey would drop under it on the orange. */
.gph__excerpt{
  margin: 0;
  max-inline-size: 61.5%;
  font-size: 19.2px;
  line-height: 1.4375;
  color: color-mix(in srgb, currentColor 70%, transparent);
}
@supports not (color: color-mix(in srgb, red 50%, transparent)){
  .gph__excerpt{ opacity: .7; }
}

.gph__arrow{ display: inline-flex; flex: 0 0 auto; color: inherit; }
.gph__arrow svg{ display: block; width: 42px; height: 42px; fill: currentColor; }

/* Tags first, logos under them, both packed to the container's inline end -
   the opposite side from the card. */
/* Three rows - division, tags, logos - sharing one edge, which in the frame
   (278:4184 and below) is their inline start. The group is sized to its
   widest row rather than to the grid column, so the badge can stretch across
   the others instead of being measured against empty space beside them. */
.gph__meta{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  inline-size: fit-content;
  max-inline-size: 100%;
  margin-block-start: 27px;
}
.gph__meta .gpr-division{ align-self: stretch; }
.gph__meta:empty{ display: none; }

@media (min-width: 1024px){
  .gph__media{ max-block-size: 655px; }

  /* Card at the inline start of the container, chip rows at the inline end
     and lower - below the photograph, not beside the card. The offset is the
     overlap the card ate, plus the 41px the frame leaves under the image. */
  .gph__inner{
    display: grid;
    grid-template-columns: minmax(0, var(--gph-card-w)) minmax(0, 1fr);
    /* The frame leaves 39 between the group's edge and the card. */
    column-gap: 37px;
    align-items: start;
  }
  .gph__card{
    grid-column: 1;
    grid-row: 1;
    min-block-size: 304px;
  }
  .gph__card-inner{ max-inline-size: 81.2%; }
  .gph__meta{
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    margin-block-start: calc(var(--gph-overlap) + 30px);
  }
}

/* Phone and tablet - frame 2:17275, a 360 canvas.

   Card 321 of 360 with a 269 text block inside it, and the summary takes the
   whole of that block rather than the 61.5% it holds on the desktop. The
   arrow moves up between the title and the summary: in the frame the three
   are one wrapping row, and at 269 wide the arrow and the summary cannot
   share a line, so the arrow lands on its own. */
@media (max-width: 1023px){
  .gph__media{ aspect-ratio: 362 / 634; }
  .gph__card-inner{ max-inline-size: 94.4%; }
  .gph__excerpt{ max-inline-size: none; }
  .gph__card-row{ flex-direction: column; align-items: stretch; gap: 10px; }
  .gph__arrow{ order: -1; align-self: flex-start; }

  /* On the desktop the group hangs off the card's edge. Here the card is the
     full column, there is no edge to hang off, and the group reads better
     centred under it - which is also what was asked for. */
  .gph__meta{ margin-inline: auto; }
  .gph__meta .gpr-tags,
  .gph__meta .gpr-logos{ justify-content: center; }
}
