/* Residency pages: layout from the residency mockup, site palette and type. */

.res {
  --res-ink: var(--charcoal);
  --res-dark: #211d18;
  --res-paper: #fffaf2;
  --res-tint: #efe6d8;
  --res-photo: #e6dcc8;
  --res-border: rgba(53, 42, 31, 0.18);
  --res-rust: #b0462a;
  color: var(--res-ink);
}

.res section {
  background: none;
  padding: clamp(3rem, 6vw, 5.5rem) 0;
  border-top: 1px solid var(--line);
}

.res section:first-child {
  border-top: 0;
}

.res h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin-bottom: 1.4rem;
}

.res h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.12;
  margin-bottom: 1.2rem;
}

.res h3 {
  font-size: 1.3rem;
  line-height: 1.2;
  margin-bottom: 0.8rem;
}

.res p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.res p + p {
  margin-top: 1rem;
}

.res-ph {
  background: rgba(176, 70, 42, 0.12);
  color: var(--res-rust);
  padding: 0 0.2em;
  border-radius: 3px;
}

.res-kicker,
.res-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 1.1rem !important;
}

.res-label-accent {
  color: var(--res-rust);
}

.res-lead {
  font-size: 1.12rem;
  max-width: 34rem;
}

/* Hero */

.res-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.res-hero-grid-call {
  align-items: start;
}

/* Photo box: one frame, photos fade into each other */

.res-carousel {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 34rem;
  width: 100%;
  overflow: hidden;
  background: var(--res-photo);
  border: 1px solid var(--res-border);
}

.res-carousel-track {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  inset: 0;
}

.res-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
}

.res-carousel-slide.is-active {
  opacity: 1;
}

.res-carousel-slide picture,
.res-carousel-slide img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  .res-carousel-slide { transition: none; }
}

.res-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.res-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.4rem;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 140ms ease, background-color 140ms ease;
}

.res-btn:hover {
  transform: translateY(-1px);
}

.res-btn-primary {
  background: var(--res-rust);
  color: #fff;
}

.res-btn-outline {
  border-color: var(--res-ink);
  color: var(--res-ink);
}

.res-btn-light {
  background: var(--cream);
  color: var(--res-ink);
  width: 100%;
}

.res-back {
  display: inline-block;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* Shared blocks */

.res-split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.res-split-wide {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
}

.res-split-form {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
}

.res-copy {
  max-width: 44rem;
}

.res-narrow {
  margin-bottom: 2.4rem;
}

.res-card {
  background: var(--res-paper);
  border: 1px solid var(--res-border);
  padding: clamp(1.4rem, 2.4vw, 2rem);
}

.res-card-tint {
  background: var(--res-tint);
}

.res-dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.res-dash-list li {
  position: relative;
  padding-left: 1.8rem;
  line-height: 1.5;
}

.res-dash-list li + li {
  margin-top: 0.8rem;
}

.res-dash-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--stone);
}

.res-grid-3,
.res-grid-4 {
  display: grid;
  gap: 1.2rem;
}

.res-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.res-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.res-callout {
  margin-top: 1.6rem !important;
  padding: 1.4rem 1.6rem;
  background: var(--res-tint);
  border-left: 3px solid var(--res-rust);
}

.res-callout strong {
  color: var(--res-ink);
}

/* Dark sections */

.res .res-dark {
  background: var(--res-dark);
  color: var(--cream);
  border-top: 0;
}

.res-dark p {
  color: rgba(244, 239, 230, 0.72);
}

.res-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.res-track {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(244, 239, 230, 0.2);
  padding: clamp(1.4rem, 2.4vw, 2rem);
  min-height: 14rem;
}

/* Faint farm photo behind each "What it's about" card */
.res-track > :not(.res-track-bg) {
  position: relative;
  z-index: 1;
}

.res .res-track img.res-track-bg {
  position: absolute;
  pointer-events: none;
  max-width: none;
  filter: grayscale(1) sepia(0.35);
}

.res .res-track img.res-track-bg.is-cutout {
  right: -10%;
  top: 50%;
  height: 118%;
  width: auto;
  transform: translateY(-50%);
  opacity: 0.16;
}

.res .res-track img.res-track-bg.is-photo {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
}

.res-closing-cta p {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.res-closing .res-ph {
  background: rgba(244, 239, 230, 0.14);
  color: var(--cream);
}

/* Money */

.res .res-tint {
  background: var(--res-tint);
}

.res-terms {
  margin: 0;
  background: var(--res-paper);
  border: 1px solid var(--res-border);
}

.res-terms > div {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1.2rem;
  padding: 1.3rem 1.5rem;
}

.res-terms > div + div {
  border-top: 1px solid var(--res-border);
}

.res-terms dt {
  font-weight: 500;
}

.res-terms dd {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.res-terms-figure {
  font-weight: 500;
}

/* Seasons */

.res-season {
  background: var(--res-paper);
  padding: 1.4rem;
  border-top: 3px solid var(--forest);
}

.res-season-1 { border-top-color: var(--res-rust); }
.res-season-2 { border-top-color: var(--clay); }
.res-season-3 { border-top-color: var(--res-ink); }

.res-season-dates {
  font-size: 0.9rem;
  color: var(--res-ink);
  margin-bottom: 0.6rem;
}

.res-season-dates + p {
  margin-top: 0;
}

/* Open call */

.res-glance {
  background: var(--res-dark);
  color: var(--cream);
  padding: 1.6rem 1.8rem;
}

.res-glance .res-label {
  color: rgba(244, 239, 230, 0.6);
}

.res-glance dl {
  margin: 0;
}

.res-glance dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  font-size: 0.92rem;
}

.res-glance dl > div + div {
  border-top: 1px solid rgba(244, 239, 230, 0.16);
}

.res-glance dt {
  color: rgba(244, 239, 230, 0.7);
}

.res-glance dd {
  margin: 0;
  text-align: right;
}

.res-glance .res-ph {
  background: rgba(244, 239, 230, 0.14);
  color: var(--cream);
}

.res-steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.res-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  row-gap: 0.25rem;
}

.res-steps li + li {
  margin-top: 1.4rem;
}

.res-steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--res-rust);
}

.res-steps span {
  color: var(--text-secondary);
  line-height: 1.6;
}

.res .res-paper {
  background: var(--res-paper);
}

.res-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1rem;
}

.res-field {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.res-field-half {
  grid-column: span 1;
}

.res-field input,
.res-field textarea,
.res-field select {
  font: inherit;
  font-weight: 400;
  font-size: 0.95rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--res-border);
  background: #fff;
  color: var(--res-ink);
  border-radius: 0;
}

.res-field input:focus,
.res-field textarea:focus,
.res-field select:focus {
  outline: 2px solid var(--res-rust);
  outline-offset: 1px;
}

.res-form .res-btn {
  justify-self: start;
}

.res-faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.8rem 3rem;
  margin: 1.2rem 0 0;
}

.res-faq dt {
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.res-faq dd {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.res-form-note {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.8rem;
}

.res-faq-contact {
  margin-top: 2.4rem;
  font-weight: 500;
}

/* Phone */

@media (max-width: 860px) {
  .res-hero-grid,
  .res-split,
  .res-split-wide,
  .res-split-form,
  .res-grid-3,
  .res-faq {
    grid-template-columns: minmax(0, 1fr);
  }

  .res-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .res-track {
    min-height: 0;
  }

  .res-track.has-bg {
    min-height: 11rem;
  }

  .res-terms > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
  }
}

@media (max-width: 520px) {
  .res-grid-4,
  .res-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .res-field-half {
    grid-column: 1 / -1;
  }

  .res-actions .res-btn {
    flex: 1 1 100%;
  }
}

/* Open call form: outcome banner, spam trap, file hint */
.res-form-status {
  grid-column: 1 / -1;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--res-rust);
  background: var(--res-tint);
  font-weight: 500;
}

.res-form-status.is-error {
  border-left-color: #8a2a12;
  color: #8a2a12;
}

.res-form-trap {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.res-field-hint {
  color: var(--stone);
  font-size: 0.8rem;
}

.res-field input[type="file"] {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
