.concept-section {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: clamp(32px, 7vw, 110px);
  background: #e9e6df;
}
.concept-copy { max-width: 490px; }
.concept-copy p { color: var(--muted, #63675e); line-height: 1.75; }
.concept-drawing { margin: 0; }
.concept-drawing a { display: block; background: transparent; }
.concept-drawing a:focus-visible { outline: 3px solid #254f3d; outline-offset: 6px; }
.concept-drawing img { display: block; width: 100%; height: auto; }
.concept-drawing figcaption { display: inline-block; max-width: 100%; box-sizing: border-box; margin-top: 16px; padding: 6px 12px; border: 1px solid #294b38; border-radius: 999px; background: rgba(41,75,56,.09); font-size: 11px; color: #294b38; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .concept-section { grid-template-columns: 1fr; }
  .concept-copy { max-width: none; }
}

#lightbox .lightbox-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: #f5f2ed;
  color: #171e19;
  font-size: 24px;
  line-height: 1;
  border: 1px solid #cecfc5;
  box-shadow: 0 2px 10px rgb(0 0 0 / 20%);
}
#lightbox .lightbox-close:hover { background: #fff; color: #171e19; }
#lightbox .lightbox-close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.builders { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(35px, 6vw, 90px); align-items: center; background: var(--paper); }
.builders-intro > p { max-width: 48ch; color: var(--muted); margin: 25px 0; }
.builders-portraits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px); }
.builder-person { text-align: center; }
.builder-person img { display: block; width: 100%; max-width: 250px; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; margin: 0 auto 25px; }
.builder-person h3 { font-size: clamp(19px, 1.8vw, 25px); line-height: 1.2; margin: 0 0 12px; letter-spacing: -.6px; }
.builder-person p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }
@media (max-width: 900px) { .builders { grid-template-columns: 1fr; } .builders-portraits { max-width: 580px; width: 100%; justify-self: center; } }
@media (max-width: 420px) { .builders-portraits { gap: 18px; } .builder-person h3 { font-size: 18px; } .builder-person p { font-size: 12px; } }

/* Public journal cards; admin journal editing retains its existing layout. */
.page-home .journal-section { display: block; }
.page-home .journal-section > .section-heading { margin-bottom: 48px; }
.page-home .journal-entries {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-top: 0;
  align-items: start;
}
.page-home .journal-entry {
  padding: clamp(25px, 2.6vw, 38px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg);
  min-width: 0;
}
.page-home .journal-entry time {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green);
  color: var(--paper);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.page-home .journal-entry h3 {
  font-size: clamp(23px, 2vw, 29px);
  line-height: 1.2;
  letter-spacing: -.7px;
  margin: 24px 0 18px;
  overflow-wrap: anywhere;
}
.page-home .journal-entry p { font-size: 14px; line-height: 1.75; margin-bottom: 0; }
.page-home .journal-entry.empty-journal { grid-column: 1 / -1; max-width: 720px; }
@media (max-width: 1150px) { .page-home .journal-entries { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .page-home .journal-entries { grid-template-columns: 1fr; gap: 20px; }
  .page-home .journal-entry { padding: 26px; border-radius: 18px; }
  .page-home .journal-section > .section-heading { margin-bottom: 32px; }
}

.page-home .journal-slider .journal-entries { display: block; overflow: hidden; border-radius: 24px; touch-action: pan-y; cursor: grab; }
.page-home .journal-slider .journal-entries:active { cursor: grabbing; }
.page-home .journal-slider .journal-entry { padding: clamp(28px, 5vw, 65px); min-height: 330px; border-radius: 24px; }
.page-home .journal-slider .journal-entry h3 { font-size: clamp(28px, 3.4vw, 45px); max-width: 28ch; }
.page-home .journal-slider .journal-entry p { max-width: 78ch; font-size: 16px; }
.journal-controls { margin-top: 25px; }
.journal-toolbar { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 13px; }
.journal-counter { color: var(--green); font-variant-numeric: tabular-nums; }
.journal-arrows { display: flex; gap: 10px; margin-left: auto; }
.journal-arrows button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--green); color: var(--paper); font-size: 22px; }
.journal-arrows button[aria-disabled="true"] { background: transparent; color: var(--muted); opacity: .45; cursor: default; }
.journal-timeline { position: relative; display: flex; gap: 0; overflow-x: auto; padding: 24px 2px 12px; scrollbar-width: thin; }
.journal-timeline button { position: relative; flex: 1 0 135px; padding: 30px 16px 12px; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.journal-timeline button::before { content: ''; position: absolute; top: 9px; left: 0; right: 0; height: 1px; background: var(--line); }
.journal-timeline button::after { content: ''; position: absolute; top: 4px; left: calc(50% - 5px); width: 11px; height: 11px; border-radius: 50%; background: var(--sage); border: 2px solid var(--paper); }
.journal-day-count { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; }
.journal-day-choices { margin-top: 15px; }
.journal-day-group { display: flex; flex-wrap: wrap; gap: 10px; }
.journal-day-group button { text-align: left; padding: 12px 18px; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--green); font-size: 13px; max-width: 100%; overflow-wrap: anywhere; }
.journal-day-group button[aria-pressed="true"] { background: var(--green); color: var(--paper); border-color: var(--green); }
.journal-timeline button[aria-current] { color: var(--green); font-weight: 700; }
.journal-timeline button[aria-current]::after { background: var(--green); box-shadow: 0 0 0 5px rgb(41 75 56 / 12%); }
.journal-slider :is(button,.journal-entries):focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
@media (max-width: 700px) { .journal-gesture-hint { display: none; } .page-home .journal-slider .journal-entry p { font-size: 14px; } .journal-timeline button { flex-basis: 115px; } }

/* Homepage partner strip uses the supplied vector as a single-color alpha mask. */
.project-partner {
  display: grid;
  grid-template-columns: minmax(180px, .65fr) minmax(0, 1.35fr);
  align-items: center;
  gap: clamp(32px, 7vw, 110px);
  padding: 60px var(--gutter);
  border-block: 1px solid var(--line);
}
.partner-logo-link { display: block; width: min(100%, 240px); justify-self: center; color: var(--green); }
.partner-logo {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: currentColor;
  -webkit-mask: url('/assets/images/bungalow24-logo.svg') center / contain no-repeat;
  mask: url('/assets/images/bungalow24-logo.svg') center / contain no-repeat;
}
.partner-copy { max-width: 660px; }
.partner-copy h2 { font-size: clamp(28px, 3.1vw, 44px); line-height: 1.15; letter-spacing: -1.4px; margin: 14px 0 20px; }
.partner-copy p { color: var(--muted); margin: 0 0 23px; max-width: 62ch; }
.partner-website { display: inline-block; color: var(--green); border-bottom: 1px solid currentColor; padding-bottom: 4px; font-size: 14px; }
.partner-website > span:first-child { margin-left: 14px; }
.partner-link-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.partner-logo-link:focus-visible, .partner-website:focus-visible { outline: 2px solid var(--green); outline-offset: 6px; }
@media (max-width: 600px) {
  .project-partner { grid-template-columns: 1fr; gap: 24px; padding-block: 40px; }
  .partner-logo-link { width: 155px; justify-self: start; }
}

/* Column masonry keeps filtered items in normal document flow, without JS positioning. */
.gallery-section .gallery-grid {
  display: block;
  columns: 3;
  column-gap: 22px;
}

.gallery-section .gallery-item {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 22px;
  break-inside: avoid;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
}

.gallery-section .gallery-image {
  border-radius: inherit;
  aspect-ratio: 6 / 5;
}

.gallery-section .gallery-item:nth-child(4n + 2) .gallery-image {
  aspect-ratio: 4 / 5;
}

.gallery-section .gallery-item:nth-child(4n + 3) .gallery-image {
  aspect-ratio: 5 / 4;
}

.gallery-section .gallery-item:nth-child(4n + 4) .gallery-image {
  aspect-ratio: 1;
}

.gallery-section .gallery-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  padding: 28px;
  padding-right: 62px;
  border-radius: inherit;
  background: rgb(23 48 33 / 58%);
  color: var(--paper);
  opacity: 0;
  transition: opacity 350ms ease;
  pointer-events: none;
}

.gallery-section .gallery-caption h3 {
  margin: 0;
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1.15;
  letter-spacing: -.8px;
  color: inherit;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(20px);
  transition: transform 450ms cubic-bezier(.22, .61, .36, 1), opacity 350ms ease;
}

.gallery-section .gallery-caption > span {
  color: #e4e9df;
  font-size: 12px;
  opacity: 0;
  transform: translateY(12px);
  transition: transform 450ms cubic-bezier(.22, .61, .36, 1), opacity 350ms ease;
}

.gallery-section .gallery-caption > .visualization-credit {
  font-size: 11px;
  line-height: 1.45;
  margin-top: 4px;
  color: #e4e9df;
}

.gallery-section .expand {
  z-index: 2;
  right: 20px;
  bottom: 26px;
  width: 32px;
  height: 32px;
  color: var(--paper);
  background: transparent;
  opacity: 0;
  transform: translate(-5px, 5px);
  transition: opacity 350ms ease, transform 350ms ease;
}

.gallery-section .gallery-item:is(:hover, :focus-visible) .gallery-caption,
.gallery-section .gallery-item:is(:hover, :focus-visible) .gallery-caption > *,
.gallery-section .gallery-item:is(:hover, :focus-visible) .expand {
  opacity: 1;
  transform: translate(0);
}

.gallery-section .gallery-item:is(:hover, :focus-visible) .gallery-caption h3 {
  transition-delay: 50ms;
}

.gallery-section .gallery-item:is(:hover, :focus-visible) .gallery-caption > span {
  transition-delay: 110ms;
}

.gallery-section .gallery-item:focus-visible img {
  transform: scale(1.035);
}

@media (max-width: 1100px) {
  .gallery-section .gallery-grid { columns: 2; }
}

@media (max-width: 600px) {
  .gallery-section .gallery-grid { columns: 1; }
  .gallery-section .gallery-item { margin-bottom: 18px; border-radius: 14px; }
  .gallery-section .gallery-caption { padding: 24px 60px 24px 24px; }
  .gallery-section .gallery-caption h3 { font-size: 27px; }
}

/* Touch has no hover. Keep room names legible without intercepting the lightbox tap. */
@media (hover: none), (pointer: coarse) {
  .gallery-section .gallery-caption {
    opacity: 1;
    background: linear-gradient(transparent 35%, rgb(23 48 33 / 82%));
  }
  .gallery-section .gallery-caption > *,
  .gallery-section .expand { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-section .gallery-caption,
  .gallery-section .gallery-caption > *,
  .gallery-section .expand,
  .gallery-section .gallery-image img {
    transition: none;
    transform: none !important;
  }
}
