/* Styles for the apartments template. */
/* ---------- Finder ---------- */
  .finder {
    position: relative;
    z-index: 2;
    margin-top: -48px;
  }
  .finder form {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr auto;
    gap: 10px;
    padding: 12px;
    border-radius: 999px;
    background: var(--paper);
    box-shadow: 0 24px 60px rgba(7, 47, 95, 0.16);
  }
  .finder .control { position: relative; }
  .finder input,
  .finder select {
    width: 100%;
    height: 56px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--mist);
    color: var(--ink);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 400;
    appearance: none;
    -webkit-appearance: none;
  }
  .finder input { padding-left: 52px; }
  .finder select { padding-right: 48px; cursor: pointer; }
  .finder input::placeholder { color: var(--muted); }
  .finder svg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
  }
  .finder .i-search { left: 22px; }
  .finder .i-chev { right: 20px; }
  .finder .btn { height: 56px; }
  .result-count { margin: 18px 0 0; text-align: center; font-size: 0.9375rem; color: var(--muted); }

  /* ---------- Listing ---------- */
  .listing { padding: clamp(64px, 8vw, 110px) 0 clamp(96px, 12vw, 160px); }
  .listing .section-head { margin-left: auto; margin-right: auto; text-align: center; }
  .listing .section-head .silver-dash { margin-left: auto; margin-right: auto; }

  .apt {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(28px, 4vw, 72px);
    align-items: start;
  }
  .apt + .apt { margin-top: clamp(80px, 10vw, 140px); }
  .apt[hidden] { display: none; }
  /* The photo stays in view while the description is read */
  .apt-media { grid-column: 1 / span 7; position: sticky; top: calc(var(--header-h) + 24px); }
  .apt-text { grid-column: 8 / span 5; }
  .apt.is-flipped .apt-media { grid-column: 6 / span 7; grid-row: 1; }
  .apt.is-flipped .apt-text { grid-column: 1 / span 5; grid-row: 1; }

  /* Photo carousel (shared styles in site.css) */
  .apt-media .h-car { border-radius: 4px; }
  .apt-media .h-car-thumbs { padding: 10px 0 0; }
  .apt-media .tags { z-index: 2; }

  .tags {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .tags li {
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 400;
  }

  .apt-area { margin: 0 0 14px; color: var(--blue); font-weight: 500; font-size: 0.9375rem; }
  .apt-text .silver-dash { margin: 24px 0; }
  .apt-text p.desc { margin: 0; color: var(--graphite); }
  .features {
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
  }
  .features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9375rem;
  }
  .features li::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--silver);
  }
  .apt-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

  /* Full description */
  .apt-text p.desc { font-family: var(--display); font-size: 1.375rem; line-height: 1.4; color: var(--ink); }
  .more-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: none;
    color: var(--blue);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
  }
  .more-toggle svg { width: 16px; height: 16px; }
  .more-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .apt-details { display: grid; gap: 22px; margin-top: 22px; }
  .apt-details section { padding-left: 18px; border-left: 2px solid var(--line); }
  .apt-details .d-label { margin: 0 0 2px; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.02em; color: var(--blue); }
  .apt-details h4 { margin: 0 0 8px; font-size: 1.3125rem; }
  .apt-details ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: 0.9375rem; color: var(--graphite); }
  .apt-details li::marker { color: var(--blue); }
  @media (prefers-reduced-motion: no-preference) {
    .more-toggle svg { transition: transform .3s ease; }
    .apt-details:not([hidden]) { animation: book-open .45s cubic-bezier(.2,.7,.2,1) both; }
  }

  /* Inline booking form */
  .book-panel {
    margin-top: 20px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--mist);
  }
  .book-title { margin: 0 0 16px; font-family: var(--display); font-size: 1.375rem; font-weight: 500; color: var(--ink); }
  .book-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .book-panel .bf { display: grid; gap: 6px; }
  .book-panel label { font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
  .book-panel input {
    width: 100%;
    min-height: 50px;
    padding: 10px 14px;
    border: 1px solid #cbd2d9;
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
  }
  .book-panel input:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
  .book-note { min-height: 1.4em; margin: 10px 0; font-size: 0.875rem; color: #b3261e; }
  .book-panel .btn { width: 100%; }
  .book-help { margin: 12px 0 0; font-size: 0.8125rem; color: var(--muted); }
  @media (prefers-reduced-motion: no-preference) {
    .book-panel:not([hidden]) { animation: book-open .45s cubic-bezier(.2,.7,.2,1) both; }
    @keyframes book-open { from { opacity: 0; transform: translateY(-8px); } }
  }
  @media (max-width: 420px) { .book-fields { grid-template-columns: 1fr; } }

  .empty {
    padding: 72px 24px;
    border: 1px dashed #cbd2d9;
    border-radius: 6px;
    text-align: center;
    color: var(--muted);
  }
  .empty p { margin: 0 0 20px; }
  .empty[hidden] { display: none; }

  /* ---------- Motto band ---------- */
  .band .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
  }
  .band .display { max-width: 14em; }
  .band p { margin: 18px 0 0; max-width: 36em; }

  /* ---------- Gallery ---------- */
  dialog.gallery {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    border: 0;
    background: #101317;
    color: #fff;
  }
  dialog.gallery::backdrop { background: #101317; }
  .gallery-inner { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }
  .gallery-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
  }
  .gallery-top h2 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 1.375rem; letter-spacing: 0.03em; }
  .gallery-top .counter { color: var(--on-dark); font-size: 0.875rem; }
  .icon-btn {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
  }
  .icon-btn:hover { background: rgba(255,255,255,0.1); }
  .gallery-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 0 88px;
  }
  .gallery-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
  .gallery-stage .prev,
  .gallery-stage .next { position: absolute; top: 50%; transform: translateY(-50%); }
  .gallery-stage .prev { left: 20px; }
  .gallery-stage .next { right: 20px; }
  .thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 16px 24px 22px; }
  .thumbs button {
    flex: none;
    width: 92px;
    height: 62px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 3px;
    background: none;
    cursor: pointer;
    opacity: 0.55;
  }
  .thumbs button[aria-current="true"] { border-color: #fff; opacity: 1; }
  .thumbs img { width: 100%; height: 100%; object-fit: cover; }

  /* ---------- Responsive ---------- */
  @media (max-width: 960px) {
    .finder form { grid-template-columns: 1fr 1fr; border-radius: 28px; }
    .finder .c-search { grid-column: 1 / -1; }
    .finder .btn { grid-column: 1 / -1; }
    .apt { grid-template-columns: minmax(0, 1fr); }
    .apt-media { position: static; }
    .apt .apt-media,
    .apt.is-flipped .apt-media,
    .apt .apt-text,
    .apt.is-flipped .apt-text { grid-column: 1 / -1; grid-row: auto; }
  }
  @media (max-width: 560px) {
    .finder form { grid-template-columns: 1fr; padding: 10px; border-radius: 24px; }
    .apt-media .h-car { aspect-ratio: 4 / 5; }
    .apt-actions .btn { flex: 1 1 auto; }
    .gallery-stage { padding: 0 8px; }
    .gallery-stage .prev,
    .gallery-stage .next { top: auto; bottom: 8px; transform: none; background: rgba(0,0,0,0.45); }
  }
