/*
  Grace Medical — static copy of gracemedicalpc.org (formerly on Squarespace).
  Colors, type sizes, spacing and the 24/8-column section grids are taken from the
  Squarespace site styles so the layout matches the original.
*/

:root {
  /* Site palette (Squarespace color variables) */
  --white: hsl(179.29, 87.63%, 80.98%);        /* #a4f9f8 aqua (palette "white") */
  --black: hsl(42.63, 23.17%, 32.16%);         /* #655a3f olive (palette "black") */
  --accent: hsl(175.43, 92%, 80.39%);          /* #9ffbf4 */
  --light-accent: hsl(44.21, 100%, 92.55%);    /* #fff5d9 cream */
  --dark-accent: hsl(42.55, 100%, 67.65%);     /* #ffcf5a gold */
  --link: #000;
  --cta: #1E4B39;                              /* Grace brand deep green: buttons and the tap-to-call number */
  --book: #2E7B5C;                             /* a lighter green of the same hue: the "Book an Appointment" buttons only */
  --button-bg: var(--cta);
  --button-text: #fff;

  /* Fonts. The live site uses Adobe Fonts (Garamond Premier Pro Display, Brevia,
     Aktiv Grotesk Extended); these are the closest Google Fonts. */
  --font-heading: "EB Garamond", Garamond, "Times New Roman", serif;
  --font-body: "Encode Sans", "Helvetica Neue", Arial, sans-serif;
  --font-button: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body-stretch: 125%;
  --button-stretch: 112.5%;
  --heading-scale: 0.86;  /* EB Garamond runs wider than Garamond Premier Pro Display */

  --page-padding: 2vw;
  --mobile-gutter: 6vw;
  --gap: 11px;

  /* header height: 1.1vw padding above and below the site title line */
  --header-h: calc(2.2vw + 1.4 * min(.84vw + 1rem, 27.76px));
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-stretch: var(--body-stretch);
  font-weight: 400;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

img { max-width: 100%; }
b, strong { font-weight: 700; }

/* ---------- Type scale (same formula the Squarespace theme uses) ---------- */
body { --v: 1.3; }
h1 { --v: 9.2; }
h2 { --v: 2.4; }
h3 { --v: 6.5; }
h4 { --v: 1.7; }
p { --v: 1.3; }

body, h1, h2, h3, h4, p, .site-title, .btn-pill {
  font-size: calc(var(--fs-scale, 1) * min(calc((var(--v) - 1) * 1.2vw + 1rem), max(calc((var(--v) - 1) * 16.8px + 1rem), calc(var(--v) * 1rem))));
}
@media screen and (max-width: 767px) and (orientation: portrait) {
  body, h1, h2, h3, h4, p, .site-title, .btn-pill {
    font-size: calc(var(--fs-scale, 1) * ((var(--v) - 1) * min(1.2vh, 10.8px) + 1rem));
  }
}

h1, h2, h3, h4 {
  --fs-scale: var(--heading-scale);
  font-family: var(--font-heading);
  font-weight: 400;
  font-style: normal;
  font-variant-numeric: lining-nums;
  letter-spacing: 0;
  /* keep the original line boxes even though the substitute font is set smaller */
  line-height: calc(1.2em * (1 + (1 - var(--v)) / 25) / var(--heading-scale));
  margin: 2rem 0;
  color: var(--black);
  white-space: pre-wrap;
}

p {
  margin: 1rem 0;
  line-height: 1.4em;
  white-space: pre-wrap;
}

p a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.center { text-align: center; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Buttons (black pills) ---------- */
.btn-pill {
  --v: .8;
  display: inline-block;
  font-family: var(--font-button);
  font-stretch: var(--button-stretch);
  font-weight: 400;
  line-height: 1.2em;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  color: var(--button-text);
  background: var(--button-bg);
  border-radius: 300px;
  padding: .8em 1.336em;
  transition: opacity .1s linear;
}
@media (hover: hover) {
  .btn-pill:hover { opacity: .8; }
}
.btn-pill:focus-visible { outline-color: var(--black); }

/* "Book an Appointment": a link to online booking, in the hero and the contact section.
   Larger than the other pills, in a lighter green with a deeper shadow, so it stands out. */
.book-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.book-btn {
  --v: 1.35;   /* about 1.7x the other buttons */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: max(3.3em, 60px);
  padding-left: 2.2em;
  padding-right: 2.2em;
  background: var(--book);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 16px 32px -10px rgba(20, 53, 42, .65), 0 4px 10px rgba(20, 53, 42, .28);
}
/* hover: the deeper brand green instead of the other pills' fade, so the white text stays easy to read */
@media (hover: hover) {
  .book-btn:hover { opacity: 1; background: var(--cta); }
}
.book-btn .cal {
  width: 1.3em;
  height: 1.3em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* tablets: a little less side padding, so the button stays inside its text column */
@media (min-width: 600px) and (max-width: 899px) {
  .book-btn { padding-left: 1.5em; padding-right: 1.5em; }
}
/* phones: the button fills the column; smaller text and padding on narrower phones keep it on one line */
@media (max-width: 599px) {
  .book-btn { width: 100%; padding-left: .8em; padding-right: .8em; }
}
@media (max-width: 400px) {
  .book-btn { --v: 1.2; }
}
@media (max-width: 359px) {
  .book-btn { --v: 1.06; gap: .5em; padding-left: .5em; padding-right: .5em; }
}

/* tap-to-call phone number in the contact section: the heading look, in the call-to-action green */
a.tel { color: var(--cta); text-decoration: none; }

/* a button that fills its grid cell, like the Squarespace button block */
.btn-block {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}

.skip-link {
  --v: .7;
  position: absolute;
  top: 1rem;
  left: -9999px;
  z-index: 20;
}
.skip-link:focus { left: var(--page-padding); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  color: var(--black);
}

.header-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 1.1vw var(--page-padding);
}

.site-title {
  --v: 1.7;
  flex: 1 1 auto;
  margin-right: auto;
  font-family: var(--font-body);
  line-height: 1.4em;
  color: var(--black);
  text-decoration: none;
}

.header-cta {
  --v: .7;
  flex: 0 0 auto;
  margin-left: 1.3vw;
}

/* "Patient Portal": an outlined pill next to "Contact Us" */
.header-link {
  --v: .7;
  flex: 0 0 auto;
  margin-left: 1.3vw;
  color: var(--button-bg);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--button-bg);
}

.burger {
  display: none;
  flex: 0 0 auto;
  margin: 0;
  padding: 1px 6px;
  border: 0;
  background: none;
  color: var(--black);
  cursor: pointer;
}
.burger-box {
  position: relative;
  display: block;
  width: 35px;
  height: 35px;
}
.burger-box span {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 100%;
  height: 1px;
  margin: auto;
  background: currentColor;
  transition: transform 250ms cubic-bezier(.2, .6, .3, 1), width 250ms cubic-bezier(.2, .6, .3, 1);
}
.burger-box .top-bun { transform: translateY(-9.5px); }
.burger-box .bottom-bun { transform: translateY(9.5px); }
.burger[aria-expanded="true"] .top-bun { transform: translateX(3.5px) rotate(-135deg); width: 28px; }
.burger[aria-expanded="true"] .bottom-bun { transform: translateX(3.5px) rotate(135deg); width: 28px; }
.burger[aria-expanded="true"] .patty { transform: scale(0); }
.burger .label-close,
.burger[aria-expanded="true"] .label-open { display: none; }
.burger[aria-expanded="true"] .label-close { display: block; }

.site-menu { display: none; }

@media screen and (max-width: 799px), only screen and (pointer: coarse) and (max-width: 1024px) {
  :root { --header-h: calc(var(--mobile-gutter) * 2 + 37px); }
  .header-inner { padding: var(--mobile-gutter); }
  .site-title {
    --v: 1.3;
    --fs-scale: var(--heading-scale);
    font-family: var(--font-heading);
    line-height: calc(1.2em / var(--heading-scale));
  }
  .header-cta,
  .header-link { display: none; }
  .burger { display: block; }

  .site-menu:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow-y: auto;
    background: var(--light-accent);
  }
  .site-menu .menu-cta {
    align-self: flex-start;
    margin: 4vw var(--mobile-gutter) var(--mobile-gutter);
    font-size: 1.2rem;
  }
  .site-menu .menu-cta + .menu-cta { margin-top: 0; }
  html.menu-open,
  html.menu-open body { overflow: hidden; }
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  display: flex;
  align-items: center;
}
.section-bg {
  position: absolute;
  inset: 0;
  background: var(--section-bg);
}
.content-wrapper {
  position: relative;
  width: 100%;
}

.theme-light { --section-bg: var(--light-accent); }
.theme-white { --section-bg: var(--white); }
.theme-black { --section-bg: var(--black); color: var(--white); }
.theme-black :is(h1, h2, h3, h4) { color: var(--white); }

.h-medium { min-height: 66vh; }
.h-medium > .content-wrapper { padding: 6.6vmax 0; }
.h-small { min-height: 33vh; }
.h-small > .content-wrapper { padding: 3.3vmax 0; }

/* section with an inset background */
.inset { padding: var(--page-padding); }
.inset > .section-bg { inset: var(--page-padding); }

/* ---------- Section grid (Squarespace "fluid engine": 8 columns on phones, 24 above) ---------- */
.fe {
  --gutter: calc(var(--mobile-gutter) - var(--gap));
  --cell: calc((1400px - var(--gap) * 7) / 8);
  position: relative;
  display: grid;
  gap: var(--gap);
  grid-template-columns: minmax(var(--gutter), 1fr) repeat(8, minmax(0, var(--cell))) minmax(var(--gutter), 1fr);
  grid-template-rows: repeat(var(--rows-m), minmax(24px, auto));
  overflow-x: hidden;
  overflow-x: clip;
}
@media (min-width: 768px) {
  .fe {
    --gutter: calc(var(--page-padding) - var(--gap));
    --cell: calc((1400px - var(--gap) * 23) / 24);
    --container: min(1400px, calc(100vw - var(--page-padding) * 2 - var(--inset-padding, 0vw)));
    grid-template-columns: minmax(var(--gutter), 1fr) repeat(24, minmax(0, var(--cell))) minmax(var(--gutter), 1fr);
    grid-template-rows: repeat(var(--rows-d), minmax(calc(var(--container) * .0215), auto));
  }
  .inset .fe { --inset-padding: calc(var(--page-padding) * 2); }
}

.blk {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
}
.blk > :first-child,
.txt > :first-child { margin-top: 0; }
.blk > :last-child,
.txt > :last-child { margin-bottom: 0; }
.v-center { justify-content: center; }
@media (min-width: 768px) {
  .v-center-d { justify-content: center; }
}

/* ---------- Home: hero ---------- */
/* the original's minimum height includes the space behind its fixed header */
.hero.h-medium { min-height: calc(66vh - var(--header-h)); }

.hero .section-bg {
  /* static stand-in for the animated "bokeh" background (accent with soft lights) */
  background-color: var(--accent);
  background-image:
    radial-gradient(ellipse 50% 75% at 18% 0%, rgba(255, 255, 255, .38), rgba(255, 255, 255, 0) 75%),
    radial-gradient(circle 16vw at 30% 36%, rgba(255, 255, 255, .08) 0 94%, rgba(255, 255, 255, .16) 98%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 10vw at 76% 24%, rgba(255, 245, 217, .12) 0 93%, rgba(255, 255, 255, .15) 98%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 13vw at 93% 80%, rgba(255, 255, 255, .07) 0 94%, rgba(255, 255, 255, .13) 98%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 7vw at 56% 88%, rgba(255, 207, 90, .07) 0 93%, rgba(255, 255, 255, .12) 98%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 20vw at 3% 98%, rgba(255, 255, 255, .06) 0 95%, rgba(255, 255, 255, .11) 99%, rgba(255, 255, 255, 0) 100%);
}
/* headline, text and button on the left; Dr. Almasry's photo on the right (below the button on phones) */
.fe-hero { --rows-m: 2; --rows-d: 1; }
.hero-copy { grid-area: 1/2/2/10; }
.hero-doc { grid-area: 2/2/3/10; margin: 12px 0 0; }
@media (min-width: 768px) {
  .hero-copy { grid-area: 1/3/2/15; }
  .hero-doc { grid-area: 1/16/2/25; margin: 0; }  /* top-aligned with the headline */
}
.hero-copy h1 {
  --fs-scale: calc(var(--heading-scale) * .85);  /* 15% smaller than the other big headings */
  margin: 0;
}
.hero-copy .line { display: block; }
.hero-copy h2 { margin: clamp(1.9rem, 3.4vw, 3rem) 0 0; }  /* room for the italic f's tail */
.hero-book { display: flex; margin-top: 2.2rem; }
/* Dr. Almasry: her photo in a cream circle, with her name on a white pill */
.hero-doc { align-items: center; }
.hero-photo {
  display: grid;
  place-items: center;
  width: min(66vw, 280px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--light-accent);
}
.hero-photo img {
  display: block;
  width: 70%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 0 0 8px var(--white);
}
.hero-doc figcaption {
  margin-top: -24px;
  padding: 12px 24px;
  border-radius: 300px;
  background: #fff;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .3);
  font-weight: 700;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .hero-photo { width: clamp(280px, 27vw, 380px); }
  .hero-photo img { width: 216px; box-shadow: 0 0 0 10px var(--white); }
  .hero-doc figcaption { margin-top: -28px; padding: 14px 28px; }
}

/* ---------- Home: contact ---------- */
.fe-contact { --rows-m: 15; --rows-d: 14; }
.contact-text { grid-area: 2/2/9/10; }
.contact-anchor { grid-area: 9/2/10/4; scroll-margin-top: 90px; }
.contact-phone { grid-area: 9/2/12/10; }
.contact-btn { grid-area: 12/2/14/10; }
@media (min-width: 768px) {
  .contact-text { grid-area: 4/3/11/13; }
  .contact-anchor { grid-area: 1/12/3/16; }
  .contact-phone { grid-area: 5/16/10/26; }
  .contact-btn { grid-area: 12/8/14/20; }
}

/* ---------- Home: "A touch of Grace" ---------- */
.fe-touch { --rows-m: 7; --rows-d: 11; }
.touch-text { grid-area: 1/2/7/10; }
.touch-care { grid-area: 7/2/8/10; margin-top: calc(28px - var(--gap)); }  /* phones: 28px below the intro, like the space between the items */
@media (min-width: 768px) {
  .touch-text { grid-area: 2/3/11/11; }
  .touch-care { grid-area: 2/12/11/26; margin-top: 0; }
}

/* the three kinds of care: a line icon, the name and one short line each.
   Phones: the icon and name side by side, the line below; wider screens: the icon beside both. */
.care {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.care li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
  row-gap: 10px;
}
.care-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--light-accent);
  color: var(--cta);
}
.care-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.care h4 {
  --v: 2.6;
  margin: 0;
}
.care p {
  grid-column: 1 / -1;
  margin: 0;
  text-wrap: pretty;
}
@media (min-width: 768px) {
  .care { gap: 34px; margin: 0; }
  .care li { column-gap: 24px; row-gap: 4px; }
  .care-icon { grid-row: span 2; width: 64px; height: 64px; }
  .care-icon svg { width: 34px; height: 34px; }
  .care h4 { --v: 2.2; align-self: end; }
  .care p { grid-column: 2; align-self: start; }
}

/* ---------- Footer ---------- */
.fe-footer { --rows-m: 12; --rows-d: 8; }
.footer-hours { grid-area: 2/2/7/7; }
.footer-info { grid-area: 7/2/13/10; }
@media (min-width: 768px) {
  .footer-hours { grid-area: 3/18/8/24; }
  .footer-info { grid-area: 2/3/9/13; }
}
.site-footer p a { display: inline-block; }

/* ---------- Privacy policy ---------- */
.pp-hero {
  min-height: calc(10vh - var(--header-h));
}
.pp-hero > .content-wrapper { padding: 1vmax 0; }
.pp-hero .section-bg {
  background: var(--black) url("assets/privacy-policy-header.webp") 50% 50% / cover no-repeat;
}
.pp-hero .section-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--black);
  opacity: .15;
}
.pp-hero h1 {
  --v: 2.4;
  text-shadow: 0 0 2px rgba(54, 47, 30, .6), 0 0 .5em rgba(54, 47, 30, .5);
}
.fe-pp-hero { --rows-m: 10; --rows-d: 10; }
.pp-title { grid-area: 4/2/8/10; }
@media (min-width: 768px) {
  .pp-title { grid-area: 2/5/10/23; }
}

.fe-pp { --rows-m: 41; --rows-d: 101; }
.pp-body { grid-area: 2/2/41/10; }
@media (min-width: 768px) {
  .pp-body { grid-area: 1/6/102/22; }
}

.policy p,
.policy h2,
.policy h3 {
  --v: .75;
  --fs-scale: 1;
  font-family: var(--font-body);
  line-height: 1.4em;
  margin: 1rem 0;
  color: inherit;
}
.policy h2 { font-weight: 700; }
.policy h3 { font-weight: 400; }
.policy .u { text-decoration: underline; }
.policy ul {
  margin: 1em 0;
  padding-left: 40px;
}
.policy li { list-style: none; }
.policy li > * { margin-top: .5em; margin-bottom: .5em; }
.policy li > :first-child::before {
  content: "\2022";
  display: inline-block;
  min-width: 40px;
  margin-left: -40px;
  padding-right: 10px;
  text-align: right;
}

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