/* Individual House pages: a quiet Grand Tableau and an editorial reading rhythm. */

.house-page {
  --house-accent: var(--gold-patina);
  --house-accent-soft: rgba(198, 167, 94, 0.08);
  --house-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  background: radial-gradient(ellipse 1000px 650px at 75% 0%, rgba(198, 167, 94, 0.065), transparent 75%), var(--bg-night);
}

.house-page::before { opacity: 0.35; }
.house-page main { padding-bottom: 72px; }
.house-page .skip-link { z-index: 100; transition: none; }
.house-opening { width: min(1160px, calc(100% - 80px)); padding-top: 30px; }

.house-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(198, 167, 94, 0.4);
  text-underline-offset: 6px;
}

.house-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: clamp(36px, 6vw, 88px);
  row-gap: 26px;
  padding: 48px 0 78px;
  min-height: 540px;
}

.house-hero__content { grid-column: 1; grid-row: 1; min-width: 0; align-self: end; }
.house-hero__label {
  margin: 0 0 24px;
  color: var(--gold-patina);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.house-hero__label::before {
  content: '';
  display: inline-block;
  width: 26px;
  height: 1px;
  margin-right: 12px;
  vertical-align: middle;
  background: var(--gold-patina);
}
.house-hero__question {
  max-width: 20ch;
  margin: 0;
  font-size: clamp(2.2rem, 3.65vw, 3.4rem);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.house-hero__question span { display: block; }
.house-hero__question--multiple { font-size: clamp(1.9rem, 2.9vw, 2.65rem); }
.house-hero__question--multiple span + span { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.house-hero__intro {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  max-width: 53ch;
  margin: 0;
  color: var(--text-ivory-soft);
  font-size: 1rem;
  line-height: 1.8;
}
.house-hero__intro strong { font-weight: 500; }

/* Fixed 8 × 4 + 4 geometry. This figure is a locator, not a reading interface. */
.house-hero__figure { grid-column: 2; grid-row: 1 / 3; align-self: center; margin: 0; min-width: 0; }
.house-tableau {
  padding: clamp(16px, 2.3vw, 32px);
  border: 1px solid rgba(198, 167, 94, 0.24);
  border-radius: 3px;
  background: linear-gradient(145deg, rgba(198, 167, 94, 0.035), rgba(11, 16, 32, 0.2));
  box-shadow: 0 22px 60px -36px rgba(0, 0, 0, 0.6);
}
.house-tableau__grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(5px, 0.7vw, 9px); }
.house-tableau__slot {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 591 / 827;
  border: 1px solid #6d707a;
  border-radius: 3px;
}
.house-tableau__number {
  position: absolute;
  top: 3px;
  left: 4px;
  color: var(--text-muted);
  font-size: clamp(8px, 0.75vw, 10px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
}
.house-tableau__slot--active {
  border-color: var(--gold-patina);
  box-shadow: 0 0 0 3px rgba(198, 167, 94, 0.16), 0 6px 18px rgba(0, 0, 0, 0.3);
}
.house-tableau__slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 2px;
  opacity: 1;
  animation: house-card-arrive 200ms var(--house-ease-out) both;
}
@keyframes house-card-arrive { from { opacity: 0.35; } to { opacity: 1; } }

/* Continuous prose, with illustrations given their own space. */
.house-reading { width: min(760px, calc(100% - 80px)); font-size: 1.025rem; line-height: 1.85; }
.house-section { padding: 44px 0; border-top: 1px solid var(--border-soft); }
.house-section h2 {
  max-width: 29ch;
  margin: 0 0 24px;
  font-size: clamp(1.8rem, 2.8vw, 2.2rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.house-section > p, .house-section > ul { max-width: 68ch; }
.house-section p { margin-bottom: 18px; }
.house-section p:last-child { margin-bottom: 0; }
.house-section strong { font-weight: 550; }
.house-section--validated-opening { padding: 42px 0; border-top-color: rgba(198, 167, 94, 0.4); }
.house-section--validated-opening > p:first-child { font-size: 1.12rem; line-height: 1.8; color: var(--text-ivory); }
.house-section:has(> h2:only-child) { padding-bottom: 4px; }
.house-section:has(> h2:only-child) + .house-section--association { border-top: 0; padding-top: 24px; }

.house-section--association > h3 { margin: 0 0 24px; font-size: clamp(1.35rem, 2.5vw, 1.6rem); font-weight: 400; line-height: 1.35; letter-spacing: 0; }
.house-association { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: start; gap: 32px; }
.house-association__cards { display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding-top: 5px; }
.house-association__card { display: block; flex: 0 0 auto; border-radius: 4px; }
.house-association__card img {
  width: 64px;
  aspect-ratio: 591 / 827;
  object-fit: contain;
  border: 1px solid rgba(244, 241, 236, 0.22);
  border-radius: 4px;
  box-shadow: 0 8px 24px -7px rgba(0, 0, 0, 0.65);
}
.house-association__plus { width: 12px; flex: 0 0 12px; color: var(--gold-patina); font-size: 1rem; line-height: 1; text-align: center; }
.house-association__plus::before { content: '+'; }
.house-association__copy { min-width: 0; }
.house-association__copy p { margin-bottom: 16px; }
.house-association__copy p:last-child { margin-bottom: 0; }

/* The self placement remains at its editorial position, with its original pair. */
.house-section--self-placement {
  margin: 24px -40px 40px;
  padding: 36px 40px 40px;
  border: 1px solid rgba(198, 167, 94, 0.35);
  border-radius: 3px;
  background: linear-gradient(130deg, rgba(198, 167, 94, 0.07), rgba(198, 167, 94, 0.015));
}
.house-section--self-placement > h2 { max-width: 32ch; font-size: clamp(1.65rem, 2.5vw, 2rem); }
.house-section--self-placement .house-association { grid-template-columns: 176px minmax(0, 1fr); gap: 30px; }
.house-section--self-placement .house-association__card img { width: 72px; }
.house-section--self-placement + .house-section { border-top: 0; padding-top: 16px; }

.house-inline-question { margin-top: 24px; padding-left: 20px; border-left: 2px solid var(--gold-patina); color: var(--text-ivory); font-weight: 500; }
.house-question-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; margin-top: 30px; }
.house-question-paths--direct { margin-top: 0; }
.house-question-path { padding-left: 20px; border-left: 1px solid var(--house-accent); }
.house-question-path h3 { font-size: 1.4rem; }
.house-other-reading { margin-top: 30px; padding: 24px; border-left: 1px solid var(--gold-patina); background: var(--house-accent-soft); }
.house-other-reading h3 { font-size: 1.25rem; }
.house-steps { margin: 24px 0 0; padding: 0; border-top: 1px solid var(--border-soft); list-style: none; counter-reset: house-step; }
.house-steps li { counter-increment: house-step; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border-soft); color: var(--text-ivory-soft); }
.house-steps li::before { content: counter(house-step) '.'; color: var(--gold-patina); font-variant-numeric: tabular-nums; }
.house-examples { margin-top: 24px; border-top: 1px solid var(--border-soft); }
.house-example { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 26px; padding: 28px 0; border-bottom: 1px solid var(--border-soft); }
.house-example__card { display: block; }
.house-example__card img { width: 76px; aspect-ratio: 591 / 827; object-fit: contain; border: 1px solid var(--border-soft); border-radius: 4px; box-shadow: var(--shadow-tighter); }
.house-example__copy h3 { margin-bottom: 12px; font-size: 1.4rem; }
.house-example__copy p { margin-bottom: 12px; }
.house-example__question { color: var(--gold-patina); font-size: 0.9rem; font-style: italic; }
.house-example__reading { color: var(--text-ivory); font-weight: 500; }
.house-section--clarification { margin: 16px 0; padding: 30px; border: 1px solid rgba(150, 156, 198, 0.3); border-radius: 3px; background: rgba(78, 86, 137, 0.07); }
.house-section--limits ul { display: grid; gap: 12px; margin: 18px 0 0; padding-left: 21px; color: var(--text-ivory-soft); }
.house-section--card-house p { margin-bottom: 0; }
.house-inline-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 14px; color: var(--gold-patina); text-underline-offset: 5px; }
.house-memo { margin: 20px 0 50px; padding: 30px; border-left: 1px solid var(--gold-patina); background: var(--house-accent-soft); }
.house-memo > p { margin: 0 0 10px; color: var(--gold-patina); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.house-memo blockquote { max-width: 34ch; margin: 0; color: var(--text-ivory); font-family: var(--font-title); font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.4; }

.house-related-reading { margin: 12px 0 38px; padding: 30px 0 0; border-top: 1px solid rgba(198, 167, 94, 0.4); }
.house-related-reading h2 { margin: 0 0 20px; font-size: clamp(1.45rem, 2.4vw, 1.75rem); font-weight: 400; letter-spacing: 0; }
.house-related-reading ul { display: grid; margin: 0; padding: 0; list-style: none; }
.house-related-reading li { border-bottom: 1px solid var(--border-soft); }
.house-related-reading a { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 52px; padding: 12px 0; color: var(--gold-patina); font-size: 0.95rem; line-height: 1.6; text-decoration-thickness: 1px; text-decoration-color: rgba(198, 167, 94, 0.4); text-underline-offset: 5px; }
.house-related-reading a::after { content: ''; flex: 0 0 7px; width: 7px; height: 7px; margin-right: 3px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.house-related-reading a strong { display: block; font-weight: 500; }
.house-related-reading__reason { display: block; margin-top: 3px; color: var(--text-muted); font-size: 0.9em; }
.house-end-links { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-top: 8px; }
.house-end-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-muted); font-size: 0.8rem; text-decoration-thickness: 1px; text-decoration-color: rgba(198, 167, 94, 0.3); text-underline-offset: 5px; }
.house-page a:focus-visible { outline: 2px solid var(--gold-patina); outline-offset: 5px; color: var(--text-ivory); transition: none; }

@media (hover: hover) and (pointer: fine) {
  .house-back-link, .house-inline-link, .house-related-reading a, .house-end-links a { transition: color 150ms ease; }
  .house-back-link:hover, .house-inline-link:hover, .house-related-reading a:hover, .house-end-links a:hover { color: var(--text-ivory); }
}

@media (max-width: 980px) {
  .house-opening { width: min(1160px, calc(100% - 48px)); }
  .house-hero { column-gap: 32px; min-height: 450px; padding-top: 32px; padding-bottom: 56px; }
  .house-hero__question { font-size: 2.25rem; }
  .house-hero__question--multiple { font-size: 1.9rem; }
  .house-hero__label { font-size: 0.65rem; }
  .house-hero__label::before { width: 18px; margin-right: 8px; }
  .house-tableau { padding: 16px; }
  .house-reading { width: min(760px, calc(100% - 64px)); }
  .house-section--self-placement { margin-inline: 0; padding: 28px; }
  .house-section--self-placement .house-association { grid-template-columns: 160px minmax(0, 1fr); gap: 24px; }
  .house-section--self-placement .house-association__card img { width: 64px; }
}

@media (max-width: 680px) {
  .house-page main { padding-bottom: 40px; }
  .house-opening, .house-reading { width: calc(100% - 40px); }
  .house-opening { padding-top: 12px; }
  .house-back-link { font-size: 0.75rem; }
  .house-hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 26px; min-height: 0; padding: 24px 0 36px; }
  .house-hero__content { grid-column: 1; grid-row: 1; align-self: auto; }
  .house-hero__label { margin-bottom: 16px; font-size: 0.65rem; letter-spacing: 0.12em; }
  .house-hero__label::before { width: 22px; margin-right: 10px; }
  .house-hero__question { max-width: none; font-size: clamp(2rem, 8.8vw, 2.6rem); line-height: 1.17; }
  .house-hero__question--multiple { font-size: clamp(1.7rem, 7.4vw, 2.2rem); }
  .house-hero__question--multiple span + span { margin-top: 14px; padding-top: 14px; }
  .house-hero__figure { grid-column: 1; grid-row: 2; }
  .house-tableau { padding: 16px; }
  .house-tableau__grid { gap: 5px; }
  .house-tableau__number { font-size: 8px; left: 3px; }
  .house-hero__intro { grid-column: 1; grid-row: 3; max-width: none; font-size: 0.95rem; line-height: 1.8; }
  .house-reading { font-size: 0.95rem; line-height: 1.85; }
  .house-section { padding: 32px 0; }
  .house-section h2 { margin-bottom: 22px; font-size: clamp(1.65rem, 6.9vw, 1.95rem); }
  .house-section p { margin-bottom: 18px; }
  .house-section--validated-opening > p:first-child { font-size: 1.025rem; }
  .house-section--association > h3 { margin-bottom: 20px; font-size: 1.35rem; }
  .house-association { grid-template-columns: 1fr; gap: 20px; }
  .house-association__cards { padding-top: 0; gap: 12px; }
  .house-association__card img { width: 62px; }
  .house-section--self-placement { margin: 14px 0 28px; padding: 26px 22px; }
  .house-section--self-placement > h2 { font-size: 1.6rem; }
  .house-section--self-placement .house-association { grid-template-columns: 1fr; gap: 22px; }
  .house-section--self-placement .house-association__card img { width: 68px; }
  .house-question-paths { grid-template-columns: 1fr; gap: 24px; }
  .house-other-reading, .house-section--clarification, .house-memo { padding: 22px; }
  .house-example { grid-template-columns: 62px minmax(0, 1fr); gap: 18px; padding: 24px 0; }
  .house-example__card img { width: 62px; }
  .house-example__copy h3 { font-size: 1.2rem; }
  .house-related-reading { padding-top: 26px; margin-bottom: 24px; }
  .house-related-reading a { font-size: 0.9rem; }
  .house-end-links { display: grid; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .house-page *, .house-page *::before, .house-page *::after { scroll-behavior: auto !important; transition: none !important; }
  .house-tableau__slot img { animation: none; }
}
