/*
  prop-main.css
  The property page: gallery and title card, description, map, and the right-hand column (agent and enquiry form).
  The card shell (.fm-card, .fm-media) and .fm-panel are in css/base.css.
  Needs css/base.css.
*/

.fm-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout: main column | right column ---------- */
.fm-prop-page { display: grid; gap: var(--fm-gap); align-items: start; padding-block: 0.75rem calc(var(--fm-section) * 0.6); }
.fm-prop-page__main { display: grid; gap: var(--fm-gap); min-width: 0; }
.fm-prop-page__rail { min-width: 0; align-self: stretch; }   /* as tall as the main column, so the sticky box inside has room to move */
.fm-prop-rail { display: grid; gap: 1rem; }
@media (min-width: 62rem) { .fm-prop-page { grid-template-columns: minmax(0, 1fr) 22.5rem; } }
/* The column is sticky on desktop. When it is taller than the window, js/property-detail.js moves its `top` as you scroll:
   its bottom shows once you scroll down and its top shows again when you scroll up. No max-height, no inner scrollbar. */
@media (min-width: 62rem) { .fm-prop-rail { position: sticky; top: 1.5rem; } }
/* Tablet: agent and form side by side under the main column */
@media (min-width: 48rem) and (max-width: 61.99rem) { .fm-prop-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

.fm-prop-page h2 { margin-bottom: 0.75rem; font-size: 1.25rem; line-height: 1.2; }

/* ---------- Buttons ---------- */
.fm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 2.75rem; padding: 0.5rem 1.1rem;
  font: inherit; font-size: var(--fm-t-sm); font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
  color: var(--fm-blue); background: #fff; border: 1px solid var(--fm-blue); border-radius: 999px;
}
.fm-btn:hover { background: var(--fm-blue-tint); }
.fm-btn--primary { color: #fff; background: var(--fm-blue); }
.fm-btn--primary:hover { background: var(--fm-blue-deep); }
.fm-btn:focus-visible { outline: 2px solid var(--fm-blue); outline-offset: 3px; }
/* Buttons that sit beside or under a field use the field's corner radius; the standalone Enquire button stays a pill */
.fm-prop-dir .fm-btn, .fm-enquire .fm-btn { border-radius: 8px; }

/* ---------- Gallery ---------- */
.fm-gallery { position: relative; }
.fm-gallery:focus-visible { outline: 2px solid var(--fm-blue); outline-offset: -4px; }
.fm-gallery .fm-media { border-radius: 0; }
.fm-gallery .fm-media img { aspect-ratio: 16 / 10; }
.fm-gallery__btn {
  position: absolute; top: 50%; z-index: 1; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; transform: translateY(-50%);
  color: var(--fm-blue); background: #fff; border: 0; border-radius: 8px; box-shadow: 0 1px 6px rgb(0 20 40 / 0.25); cursor: pointer;
}
.fm-gallery__btn:hover { background: var(--fm-blue-tint); }
.fm-gallery__btn:focus-visible { outline: 2px solid var(--fm-blue); outline-offset: 2px; }
.fm-gallery__btn--prev { left: 0.8rem; }
.fm-gallery__btn--next { right: 0.8rem; }
/* The arrow is drawn with borders, pointing out toward the other photo */
.fm-gallery__btn span { width: 0.7rem; height: 0.7rem; border: solid currentColor; border-width: 0 0 2.5px 2.5px; }
.fm-gallery__btn--prev span { transform: translateX(0.12rem) rotate(45deg); }
.fm-gallery__btn--next span { transform: translateX(-0.12rem) rotate(-135deg); }
.fm-gallery__btn[hidden], .fm-gallery__count[hidden] { display: none; }
.fm-gallery__count { position: absolute; right: 0.8rem; bottom: 0.8rem; margin: 0; padding: 0.25rem 0.8rem; border-radius: 999px; background: rgb(0 30 46 / 0.82); font-size: var(--fm-t-xs); font-weight: 700; color: #fff; }

/* ---------- Title card ---------- */
.fm-prop-hero .fm-card__body { padding: 1.4rem 1.5rem 1.6rem; }
.fm-prop-hero h1 { font-size: clamp(1.9rem, 1.4rem + 1.7vw, 2.6rem); line-height: 1.1; color: var(--fm-blue); }
.fm-prop-price { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; margin-top: 0.8rem; }
.fm-prop-price__amount { font-family: var(--fm-serif); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
/* The Enquire button only helps when the form is far below, so it is for phones and tablets */
@media (min-width: 62rem) { .fm-prop-price__enquire { display: none; } }

/* ---------- Description ---------- */
.fm-prose { font-size: 1.0625rem; line-height: 1.7; }
.fm-prose > * + * { margin-top: 1rem; }
.fm-prose a { color: var(--fm-blue); text-decoration: underline; text-underline-offset: 3px; }
.fm-prop-text h2 { margin-top: 1.75rem; margin-bottom: 0.6rem; }

/* ---------- Map and directions ---------- */
.fm-prop-map { height: 21rem; overflow: hidden; border-radius: var(--fm-radius); background: var(--fm-blue-tint); }
.fm-prop-address { margin-top: 0.9rem; font-size: var(--fm-t-sm); font-weight: 600; }
.fm-prop-dir { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.9rem; }
.fm-prop-dir input {
  width: 9.5rem; min-height: 2.75rem; padding: 0.5rem 0.8rem; text-transform: uppercase;
  font: inherit; font-size: var(--fm-t-sm); color: var(--fm-ink); border: 1px solid var(--fm-rule); border-radius: 8px; background: #fff;
}
.fm-prop-dir input::placeholder { text-transform: none; }
.fm-prop-dist { min-height: 1.4rem; margin-top: 0.8rem; font-size: var(--fm-t-sm); color: var(--fm-muted); }
.fm-prop-dist b { color: var(--fm-ink); }
.fm-prop-dist a { color: var(--fm-blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 47.99rem) { .fm-prop-dist a { display: inline-block; padding-block: 0.7rem; margin-block: -0.7rem; } }

/* ---------- Agent ---------- */
.fm-agent h2 { margin: 0; font-size: 1.25rem; }
/* Logo: no box around it, it sits straight on the card. Agent logos are wide (about 3.5 : 1), so the area is wide and the logo is
   scaled to fit, never cropped; a squarer logo just sits centred with space at the sides. */
.fm-agent__logo { display: grid; place-items: center; aspect-ratio: 7 / 2; margin-bottom: 0.9rem; }
.fm-agent__logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.fm-agent__label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fm-muted); }
.fm-agent__site { display: inline-block; margin-top: 1rem; padding-block: 0.4rem; font-size: var(--fm-t-sm); font-weight: 700; color: var(--fm-blue); text-decoration: underline; text-underline-offset: 3px; }
.fm-agent__site:focus-visible, .fm-agent dd a:focus-visible { outline: 2px solid var(--fm-blue); outline-offset: 3px; }
.fm-agent dl { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.55rem 0.75rem; margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--fm-rule); font-size: var(--fm-t-sm); }
.fm-agent dt { color: var(--fm-muted); }
.fm-agent dd { margin: 0; overflow-wrap: anywhere; }
.fm-agent dd a { color: var(--fm-blue); font-weight: 600; }
@media (max-width: 47.99rem) { .fm-agent dd a { display: inline-block; padding-block: 0.7rem; margin-block: -0.7rem; } }

/* ---------- Enquiry form: solid blue panel, soft off-white fields (a touch toward grey, so they are not stark white) ---------- */
.fm-enquire.fm-panel { background: var(--fm-blue); color: #fff; }
.fm-enquire h2 { color: #fff; }
.fm-enquire .fm-field label { color: rgb(255 255 255 / 0.85); }
.fm-enquire .fm-field :where(input, textarea) { background: #eceff1; border-color: transparent; }
.fm-enquire .fm-field :where(input, textarea):hover:not(:focus-visible) { border-color: transparent; background: #e4e8eb; }
.fm-enquire .fm-field :where(input, textarea):focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-color: transparent; box-shadow: none; background: #f3f5f6; }
.fm-enquire .fm-btn--primary { color: var(--fm-blue); background: #fff; border-color: #fff; }
.fm-enquire .fm-btn--primary:hover { background: var(--fm-blue-tint); }
.fm-enquire .fm-btn--primary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.fm-enquire h2:focus { outline: none; }
.fm-enquire form { display: grid; gap: 0.5rem; }
/* Desktop only: slightly shorter fields so the whole column fits a 900px-high window and can stay in view. Phones keep 44px. */
@media (min-width: 62rem) { .fm-enquire .fm-field :where(input, textarea) { min-height: 2.5rem; } .fm-enquire .fm-field textarea { min-height: 4.5rem; } .fm-enquire.fm-panel, .fm-agent.fm-panel { padding-block: 1.25rem; } .fm-agent dl { margin-top: 0.8rem; padding-top: 0.8rem; gap: 0.4rem 0.75rem; } .fm-agent__site { margin-top: 0.7rem; } }
.fm-field { display: grid; gap: 0.3rem; min-width: 0; }
.fm-field label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fm-muted); }
.fm-field :where(input, textarea) {
  width: 100%; min-height: 2.75rem; padding: 0.5rem 0.8rem; font: inherit; font-size: var(--fm-t-sm); color: var(--fm-ink);
  border: 1px solid var(--fm-rule); border-radius: 8px; background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
}
.fm-field textarea { resize: vertical; min-height: 5rem; }
.fm-field :where(input, textarea):hover:not(:focus-visible) { border-color: #a9bccb; }
.fm-field :where(input, textarea):focus-visible, .fm-prop-dir input:focus-visible { outline: none; border-color: var(--fm-blue); box-shadow: inset 0 0 0 1px var(--fm-blue); }
.fm-enquire__note { font-size: var(--fm-t-xs); line-height: 1.5; color: rgb(255 255 255 / 0.9); }
.fm-enquire__sent { margin: 0; font-size: var(--fm-t-sm); font-weight: 700; color: #fff; }
.fm-enquire__sent:empty { display: none; }

/* ---------- Print: just the property, no site furniture ---------- */
@media print {
  .fm-topbar, .fm-header, .fm-newsletter, .fm-footer, .fm-feature, .fm-enquire, .fm-prop-dir, .fm-gallery__btn, .fm-prop-price__enquire { display: none !important; }
  .fm-prop-page { grid-template-columns: 1fr; }
  .fm-prop-map { height: 14rem; }
}
