/* Interactive guest floor plans. Scoped to avoid changing the existing cards. */
.floorplan[hidden],
.floorplan [hidden] {
  display: none !important;
}

.floorplan {
  margin: 0 auto 4rem;
  border: 1px solid var(--beige-light);
  border-radius: 18px;
  background: #fffdf9;
  overflow: hidden;
}

.floorplan-intro {
  padding: 2.2rem 2.4rem 1.6rem;
}

.floorplan-eyebrow {
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.floorplan-intro h3 {
  margin: 0.3rem 0 0.5rem;
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.2;
  font-weight: 400;
  color: var(--brown);
}

.floorplan-intro > p:last-child,
.floorplan-room-description {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.floorplan-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0 2.4rem 1.5rem;
}

.floorplan button {
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.floorplan-tabs button {
  flex: 1;
  padding: 0.85rem 0.7rem;
  min-height: 48px;
  border: 1px solid var(--beige-light);
  border-radius: 8px;
  background: transparent;
  color: var(--brown);
  font-size: 0.85rem;
  transition: background-color var(--transition), color var(--transition);
}

.floorplan-tabs button[aria-selected="true"] {
  background: var(--brown);
  border-color: var(--brown);
  color: var(--cream);
}

.floorplan-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
  border-top: 1px solid var(--beige-light);
}

.floorplan-drawing {
  padding: 1.8rem 2rem 1.2rem;
  background: var(--cream);
}

.floorplan-level {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
}

.floorplan-level h4 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--brown);
  font-weight: 400;
}

.floorplan-level > span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.floorplan-map {
  display: block;
  width: 100%;
  max-height: 710px;
  margin: 0.6rem auto;
}

.floorplan-outline {
  fill: #fffdf9;
  stroke: var(--brown);
  stroke-width: 5;
  stroke-linejoin: round;
}

.floorplan-room {
  cursor: pointer;
  outline: none;
}

.floorplan-static-room {
  cursor: default;
  pointer-events: none;
}

.floorplan-room-shape {
  fill: #f0e7db;
  stroke: #a18c76;
  stroke-width: 2;
  stroke-linejoin: round;
  transition: fill 0.2s ease;
}

.floorplan-room--outdoor .floorplan-room-shape { fill: #e5ebdf; }
.floorplan-room--water .floorplan-room-shape { fill: #d7e7e9; }
.floorplan-room--service .floorplan-room-shape { fill: #eeeae5; }

.floorplan-room:hover .floorplan-room-shape,
.floorplan-room:focus-visible .floorplan-room-shape {
  fill: #dbc8af;
  stroke: var(--brown-deep);
  stroke-width: 4;
}

.floorplan-room[aria-pressed="true"] .floorplan-room-shape {
  fill: #d4bda0;
  stroke: var(--brown-deep);
  stroke-width: 4;
}

.floorplan-room:focus-visible .floorplan-room-shape {
  stroke-dasharray: 6 3;
}

.floorplan-room-label {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  fill: var(--brown-deep);
  text-anchor: middle;
  pointer-events: none;
}

.floorplan-symbols {
  fill: none;
  stroke: #a18c76;
  stroke-width: 1.5;
  pointer-events: none;
}

.floorplan-staircase,
.floorplan-void,
.floorplan-door,
.floorplan-passage,
.floorplan-furniture,
.floorplan-pool-water { pointer-events: none; }

.floorplan-stair-outline {
  fill: #fffdf9;
  stroke: #a18c76;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.floorplan-staircase--pool .floorplan-stair-outline { fill: #e1eceb; }

.floorplan-stair-tread {
  fill: none;
  stroke: #a18c76;
  stroke-width: 1.2;
}

.floorplan-stair-direction {
  fill: none;
  stroke: var(--brown);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.floorplan-arrowhead { fill: var(--brown); }
.floorplan-hatch-background { fill: var(--cream); }
.floorplan-hatch-line { fill: none; stroke: #d6ccbd; stroke-width: 1; }

.floorplan-void-shape {
  fill: url(#floorplan-void-hatch);
  stroke: #a18c76;
  stroke-width: 1.8;
  stroke-dasharray: 6 4;
}

.floorplan-annotation {
  font-family: var(--font-body);
  font-size: 12px;
  fill: var(--brown);
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--cream);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.floorplan-door-gap { fill: none; stroke: #eeeae5; stroke-width: 7; }
.floorplan-passage-gap { fill: none; stroke: #e5ebdf; stroke-width: 7; }
.floorplan-door-leaf { fill: none; stroke: var(--brown); stroke-width: 1.8; }
.floorplan-door-swing { fill: none; stroke: #a18c76; stroke-width: 1.2; }

.floorplan-furniture {
  fill: #fffaf0;
  stroke: #967b5d;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.floorplan-furniture path { fill: none; }
.floorplan-table { fill: #e8d5b7; }
.floorplan-pool-water { fill: #c0dce0; stroke: #70969b; stroke-width: 1.2; }

.floorplan-void-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-size: 0.73rem;
  color: var(--text-muted);
  text-align: center;
}

.floorplan-void-legend::before {
  content: '';
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border: 1px dashed var(--beige-dark);
  background: repeating-linear-gradient(135deg, transparent 0 4px, #d6ccbd 4px 5px);
}

.floorplan-context {
  font-family: var(--font-body);
  fill: var(--text-muted);
  font-size: 13px;
  text-anchor: middle;
  pointer-events: none;
}

.floorplan-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.73rem;
  text-align: center;
}

.floorplan-legend > span:first-child {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  background: #d4bda0;
  border: 1px solid var(--brown);
  border-radius: 2px;
}

.floorplan-details {
  padding: 2rem;
  min-width: 0;
  border-left: 1px solid var(--beige-light);
}

.floorplan-room-heading h4 {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  line-height: 1.2;
  font-weight: 400;
  color: var(--brown);
  margin: 0.4rem 0 0.65rem;
}

.floorplan-photos,
.floorplan-empty { margin-top: 1.4rem; }

.floorplan-photo-open {
  position: relative;
  width: 100%;
  display: block;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--brown-deep);
}

.floorplan-photo-open picture { display: block; }
.floorplan-photo-open img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.floorplan-photo-open > span {
  display: block;
  padding: 0.6rem;
  color: var(--cream);
  font-size: 0.78rem;
}

.floorplan-photo-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.floorplan-photo-controls button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--beige-light);
  color: var(--brown);
  background: transparent;
  font-size: 1.6rem;
}

.floorplan-empty {
  padding: 1.5rem;
  border-radius: 8px;
  background: var(--cream);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.floorplan-room-description {
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--beige-light);
  line-height: 1.8;
  white-space: pre-line;
}

.floorplan button:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 3px;
}

.floorplan-note {
  padding: 1rem 2rem;
  border-top: 1px solid var(--beige-light);
  color: var(--text-muted);
  font-size: 0.73rem;
  text-align: center;
}

.floorplan-back { display: none; }
.floorplan-details, #floorplan-map { scroll-margin-top: calc(var(--nav-height) + 1rem); }

@media (max-width: 768px) {
  .floorplan-intro { padding: 1.5rem 1.2rem 1.2rem; }
  .floorplan-tabs { padding: 0 1rem 1.2rem; gap: 0.3rem; }
  .floorplan-tabs button { padding: 0.7rem 0.35rem; font-size: 0.75rem; }
  .floorplan-panel { grid-template-columns: minmax(0, 1fr); }
  .floorplan-drawing { padding: 1.2rem 1rem; }
  .floorplan-map { max-height: 640px; }
  .floorplan-details { padding: 1.5rem 1.2rem; border-left: 0; border-top: 1px solid var(--beige-light); }
  .floorplan-room-label { font-size: 17px; }
  .floorplan-note { padding: 1rem 1.2rem; }
  .floorplan-back {
    display: block;
    margin-top: 1rem;
    min-height: 44px;
    padding: 0.5rem 0;
    border: 0;
    background: transparent;
    color: var(--brown);
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floorplan *, .floorplan *::before, .floorplan *::after { transition: none; }
}
