/* ==========================================================================
   Waverley House — retirement notice
   Built from Figma "Waverley House" › Retirement Notice — Live 1:1
   (Desktop 1440 node 74:2, Mobile 390 node 75:7).

   Palette  #F76D5E coral · #FFFFFF · #231F20 ink
   Type     Cormorant Garamond (display) · Open Sans (body)
   ========================================================================== */

:root{
  --coral:        #F76D5E;
  --coral-light:  #F5847A;   /* panel gradient, top    */
  --coral-deep:   #F16B5D;   /* panel gradient, bottom */
  --white:        #FFFFFF;
  --ink:          #231F20;
  --portrait-bg:  #EDE9E4;
  --plate-grey:   #7C7778;
  --error:        #9E2416;

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body:    "Open Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Panel gutters: left is intentionally wider than right (118 / 109 @1440) */
  --gutter-left:  clamp(28px, 8.2vw, 124px);
  --gutter-right: clamp(28px, 7.6vw, 116px);

  /* Content column inside the coral panel */
  --measure: 620px;
}

*, *::before, *::after{ box-sizing: border-box; }

html{
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body{
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.75;
}

img, svg{ display: block; max-width: 100%; }

a{ color: inherit; }

:focus-visible{
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

.screen-reader-text{
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Layout — copy left, portrait (+ form) right; stacks at 1000px
   -------------------------------------------------------------------------- */

.notice{
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Left panel
   -------------------------------------------------------------------------- */

.panel{
  position: relative;
  overflow: hidden;
  padding: 56px var(--gutter-right) 56px var(--gutter-left);
  background: linear-gradient(180deg, var(--coral-light), var(--coral-deep));
}

.panel__inner{
  position: relative;
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
}
.panel__inner > *{ position: relative; z-index: 1; }

/* "W" monogram — sits behind the heading, bleeding off the left edge */
.panel__inner > .panel__watermark{
  position: absolute;
  z-index: 0;
  top: 25px;
  left: -22%;
  width: 100%;
  height: auto;
  opacity: .22;
  pointer-events: none;
}

.panel__logo{ width: 238px; max-width: 62%; height: auto; }

/* Message ---------------------------------------------------------------- */

.message{ padding: 56px 0 40px; }

.message__eyebrow{
  margin: 0 0 26px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.75;
  letter-spacing: .26em;
  text-transform: uppercase;
}

.message__heading{
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 58px;
  line-height: .97;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.message__heading span{ display: block; }

.rule{
  width: 66px;
  height: 1px;
  margin: 38px 0 34px;
  border: 0;
  background: rgba(255, 255, 255, .45);
}

.message__lede{
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 25px;
  line-height: 1.38;
}

.letter{ margin-top: 26px; }
.letter p{
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.8;
}
.letter p:last-child{ margin-bottom: 0; }

.signature{ margin: 26px 0 0; }
.signature__name,
.signature__role{ display: block; }
.signature__name{
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.75;
  letter-spacing: .2px;
}
.signature__role{
  margin-top: 2px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.75;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .8);
}

/* Key facts -------------------------------------------------------------- */

.facts{
  margin: 0;
  padding-top: 26px;
  max-width: 520px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid rgba(255, 255, 255, .3);
}
.facts > div{ padding-top: 22px; }
.facts > div + div{
  padding-left: 32px;
  border-left: 1px solid rgba(255, 255, 255, .3);
}
.facts dt{
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.75;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.facts dd{
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1.75;
}

/* Medical records ------------------------------------------------------- */

.records{
  margin-top: 32px;
  font-size: 12.5px;
  line-height: 1.75;
}
.records p{ margin: 0; }
.records > :not(:first-child){ margin-top: 26px; }
.records b{ font-weight: 600; }

.records__list{
  margin-bottom: 0;
  padding-left: 18.75px;
  list-style: disc;
}

.records a{
  text-decoration: underline;
  text-decoration-skip-ink: none;
  overflow-wrap: anywhere;
}

.records a[href^="tel:"]{ white-space: nowrap; }

.records__footnote{
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
}

/* --------------------------------------------------------------------------
   Right column — portrait with the request form over it
   -------------------------------------------------------------------------- */

.portrait{
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 56px clamp(24px, 4.45vw, 64px) 172px;
  background: var(--portrait-bg);
}

.portrait__media{
  position: absolute;
  inset: 0;
}
.portrait__media img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 47% 50%;
}

.portrait__plate{
  position: absolute;
  left: 0;
  bottom: 0;
  min-width: 300px;
  padding: 24px 34px 26px;
  background: var(--white);
  color: var(--ink);
}
.portrait__plate::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: var(--coral);
}
.portrait__name{
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1.75;
}
.portrait__place{
  margin-top: 9px;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.75;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--plate-grey);
  white-space: nowrap;
}

/* Request form ---------------------------------------------------------- */

.request{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  scroll-margin-top: 24px;
}

.request__card{
  container-type: inline-size;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 8px;
  background: rgba(255, 255, 255, .35);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: var(--ink);
}

/* Desktop shows the footnote in the panel; mobile shows it under the form */
.records__footnote--form{ display: none; }

.wh-form-missing{
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Gravity Forms — restyle to the Figma form card (node 78:2).
   Scoped to #records-request so these outrank GF's own theme CSS
   (gravity-theme or Orbital) without !important.
   -------------------------------------------------------------------------- */

#records-request .gform_wrapper{
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
}

#records-request .gform_heading,
#records-request .gform_required_legend,
#records-request .gform_validation_container,
#records-request .gfield--type-honeypot,
#records-request .ui-datepicker-trigger{
  display: none !important;
}

/* Fields: stacked by default (mobile / narrow card)… */
#records-request .gform_wrapper .gform_fields{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
}
#records-request .gform_wrapper .gfield{
  flex: 1 1 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* …and in rows once the card is wide enough (desktop card is 402px inside) */
@container (min-width: 380px){
  #records-request .gform_wrapper .gfield.wh-field--name{ flex: 1 1 calc(100% - 150px); }
  #records-request .gform_wrapper .gfield.wh-field--dob { flex: 0 0 140px; }
  #records-request .gform_wrapper .gfield.wh-field--half{ flex: 1 1 calc(50% - 5px); }
}

/* Placeholders carry the field names in the design; labels stay for screen readers */
#records-request .gform_wrapper .gfield_label,
#records-request .gform_wrapper .gform-field-label:not(.gform-field-label--type-inline){
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#records-request .gform_wrapper .ginput_container{ margin: 0; }

#records-request .gform_wrapper input:not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
#records-request .gform_wrapper textarea,
#records-request .gform_wrapper select{
  display: block;
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 3px;
  background: rgba(255, 255, 255, .61);
  box-shadow: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 19.5px;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color .15s ease, border-color .15s ease;
}

#records-request .gform_wrapper textarea{
  height: 110px;
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
}

#records-request .gform_wrapper ::placeholder{
  color: rgba(35, 31, 32, .6);
  opacity: 1;
}

#records-request .gform_wrapper input:focus,
#records-request .gform_wrapper textarea:focus,
#records-request .gform_wrapper select:focus{
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  background: rgba(255, 255, 255, .85);
}

/* Submit */
#records-request .gform_wrapper .gform_footer,
#records-request .gform_wrapper .gform_page_footer{
  position: relative;
  display: block;
  margin: 10px 0 0;
  padding: 0;
}

#records-request .gform_wrapper .gform_footer .gform_button,
#records-request .gform_wrapper .gform_footer button[type="submit"]{
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 27px;
  border: 0;
  border-radius: 100px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: .2px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color .18s ease;
}
#records-request .gform_wrapper .gform_footer .gform_button:hover{ background: #3A3435; }
#records-request .gform_wrapper .gform_footer .gform_button:focus-visible{
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* AJAX spinner sits inside the button, on the right */
#records-request .gform_wrapper .gform_ajax_spinner{
  position: absolute;
  top: 50%;
  right: 18px;
  width: 18px;
  height: 18px;
  margin: -9px 0 0;
}

/* Validation */
#records-request .gform_wrapper .gform_validation_errors{
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 3px;
  background: var(--white);
  box-shadow: none;
}
#records-request .gform_wrapper .gform_validation_errors > h2{
  margin: 0;
  color: var(--error);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
#records-request .gform_wrapper .gform_validation_errors > h2::before,
#records-request .gform_wrapper .gform_validation_errors .gform-icon{ display: none; }
#records-request .gform_wrapper .gform_validation_errors ol{
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.6;
}
#records-request .gform_wrapper .gform_validation_errors a{ color: var(--error); }

#records-request .gform_wrapper .gfield_error input,
#records-request .gform_wrapper .gfield_error textarea{
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}

#records-request .gform_wrapper .validation_message,
#records-request .gform_wrapper .gfield_validation_message{
  display: inline-block;
  margin: 4px 0 0;
  padding: 2px 8px;
  border: 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, .9);
  color: var(--error);
  font-size: 11.5px;
  line-height: 1.6;
}

/* Thank-you message after submitting */
#records-request .gform_confirmation_message{
  margin: 0;
  padding: 18px 20px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .85);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.4;
}
#records-request .gform_confirmation_message strong{ font-weight: 500; }

/* --------------------------------------------------------------------------
   Thank-you pop-up (script at the end of front-page.php)
   -------------------------------------------------------------------------- */

.thanks{
  width: min(460px, calc(100vw - 40px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--white);
  overflow: visible;
}
.thanks::backdrop{
  background: rgba(35, 31, 32, .6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.thanks[open]{ animation: thanks-in .28s ease-out; }
@keyframes thanks-in{
  from{ opacity: 0; transform: translateY(12px); }
  to  { opacity: 1; transform: none; }
}

.thanks__panel{
  position: relative;
  overflow: hidden;
  padding: 40px 36px 34px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--coral-light), var(--coral-deep));
  box-shadow: 0 24px 60px rgba(35, 31, 32, .35);
  text-align: center;
}

.thanks__logo{
  width: 170px;
  height: auto;
  margin: 0 auto 26px;
}

.thanks__body{
  font-size: 15px;
  line-height: 1.8;
}
.thanks__body p{ margin: 0 0 14px; }
.thanks__body p:last-child{ margin-bottom: 0; }

/* The confirmation's bold opening line becomes the pop-up heading */
.thanks__body strong:first-child{
  display: block;
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
}

.thanks__button{
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 28px;
  padding: 10px 27px;
  border: 0;
  border-radius: 100px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: .2px;
  cursor: pointer;
  transition: background-color .18s ease;
}
.thanks__button:hover{ background: rgba(255, 255, 255, .88); }

/* --------------------------------------------------------------------------
   Tablet / mobile — portrait on top, form after the records list
   -------------------------------------------------------------------------- */

@media (max-width: 1000px){
  .notice{
    display: flex;
    flex-direction: column;
  }

  /* Unwrap the right column so its photo and form can be ordered separately */
  .portrait{ display: contents; }

  .portrait__media{
    order: -1;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    max-height: 80vh;
    background: var(--portrait-bg);
  }
  .portrait__media img{ object-position: 50% 6%; }
  .portrait__plate{ min-width: 0; padding: 18px 24px 20px; }

  .panel{ padding: 36px 28px 0; }
  .panel__inner > .panel__watermark{ top: 51px; left: -40%; }

  .message{ padding: 40px 0 51px; }
  .message__heading{ font-size: clamp(32px, 9vw, 44px); }
  .message__lede{ font-size: 21px; }
  .signature__role{ margin-top: 9px; }

  .request{
    order: 1;
    max-width: none;
    padding: 26px 28px 46px;
    background: var(--coral-deep);
    color: var(--white);
  }
  .request__inner{
    max-width: var(--measure);
    margin-inline: auto;
  }

  .records__footnote--panel{ display: none; }
  .records__footnote--form { display: block; margin-top: 26px; }
}

@media (max-width: 600px){
  .facts{ grid-template-columns: 1fr; }
  .facts > div + div{
    margin-top: 20px;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .3);
  }
}

/* --------------------------------------------------------------------------
   Print — patients do print these
   -------------------------------------------------------------------------- */

@media print{
  body{ background: #fff; color: #000; }
  .notice{ display: block; }
  .panel{ background: #fff; color: #000; padding: 0; }
  .panel__watermark, .portrait, .thanks, #wpadminbar{ display: none !important; }
  .records__footnote--panel{ display: block; }
  .signature__role, .facts dt, .message__eyebrow{ color: #444; }
  .rule{ background: #ccc; }
  .facts, .facts > div + div{ border-color: #ccc; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ transition-duration: .01ms !important; }
}
