/* ==========================================================================
   Layout — the structural pieces the whole site is assembled from.
   These carry no page-specific content styling.
   ========================================================================== */

/* --- shell --------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* A page that fills the viewport and pins nothing: the masthead sits at the
   top, the body takes the slack, the footer sits at the bottom. */
.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-block: var(--s5) var(--s6);
  gap: var(--s5);
}

/* --- stack / cluster primitives ------------------------------------------ */

.stack   { display: flex; flex-direction: column; gap: var(--s4); }
.stack--tight { gap: var(--s2); }
.stack--loose { gap: var(--s6); }

/* Evenly distributed vertical rhythm — used by the editorial column so the
   ruled sections breathe the same amount between each. */
.stack--spread { justify-content: space-between; }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
}
.cluster--between { justify-content: space-between; }

/* --- masthead ------------------------------------------------------------ */

.masthead { display: flex; flex-direction: column; gap: var(--s4); }

.masthead__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  color: var(--c-olive);
}

/* Casa · kicker · Indalo. Collapses to a stack on narrow screens. */
.wordmark {
  display: flex;
  align-items: flex-end;
  gap: var(--s5);
}
.wordmark__lead,
.wordmark__tail {
  font-family: var(--f-display);
  font-size: var(--t-wordmark);
  line-height: var(--lh-display);
  font-weight: 400;
}
.wordmark__lead { letter-spacing: -0.02em; }
.wordmark__tail {
  font-style: italic;
  letter-spacing: -0.03em;
  flex-grow: 1;
  text-align: right;
}
.wordmark__kicker {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding-block-end: var(--s5);
  padding-inline-start: var(--s4);
  border-inline-start: 1px solid var(--c-line);
  color: var(--c-olive);
}

/* The heavy rule carrying the section markers. */
.rule-nav {
  border-block-start: 1px solid var(--c-rule);
  padding-block-start: var(--s3);
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}
.rule-nav a { color: var(--c-ink); }
.rule-nav a:hover { color: var(--c-accent); }

/* --- split: image plate beside an editorial column ----------------------- */

.split {
  flex-grow: 1;
  display: grid;
  grid-template-columns: minmax(0, 620fr) minmax(0, 674fr);
  gap: var(--s7);
  min-height: 0;
}

/* --- plate: a contained photograph --------------------------------------- */

.plate {
  position: relative;
  background: var(--c-taupe);
  overflow: hidden;
  min-height: 260px;
}
.plate__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.plate__mark {
  position: absolute;
  top: var(--s5);
  left: var(--s5);
  color: var(--c-cream);   /* the mark inherits this via currentColor */
}
.plate__caption {
  position: absolute;
  bottom: var(--s4);
  left: var(--s5);
  color: var(--c-cream);
  font-size: var(--t-tiny);
  letter-spacing: var(--ls-caps-sm);
  text-transform: uppercase;
}

/* A ruled editorial section inside a column. */
.ruled {
  border-block-start: 1px solid var(--c-line);
  padding-block-start: var(--s4);
}

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s5);
  }
  .plate { min-height: 46svh; }
  .wordmark {
    flex-wrap: wrap;
    gap: var(--s3);
  }
  .wordmark__tail { text-align: left; flex-grow: 0; }
  .wordmark__kicker {
    order: 3;
    flex-basis: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--s2) var(--s4);
    align-items: baseline;
    padding-block-end: 0;
    padding-inline-start: 0;
    border-inline-start: none;
    border-block-start: 1px solid var(--c-line);
    padding-block-start: var(--s3);
  }
  .rule-nav { gap: var(--s2) var(--s4); }
}

@media (max-width: 600px) {
  /* The section markers become a quiet two-column list rather than a squeezed
     single row that wraps unevenly. */
  .rule-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s2) var(--s4);
  }
}
