/* =========================================================
   Dr Jo Carreira — General Surgeon
   Design tokens: warm ivory / sage editorial palette
   Type: Fraunces (headings) + Work Sans (body)
   ========================================================= */

:root{
  --ivory: #F6F3EC;
  --stone: #E8E5DE;
  --sage: #879786;
  --sage-deep: #53675A;
  --charcoal: #333532;

  --sage-deep-10: rgba(83,103,90,0.10);
  --sage-deep-16: rgba(83,103,90,0.16);
  --charcoal-60: rgba(51,53,50,0.62);
  --charcoal-40: rgba(51,53,50,0.42);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --size-h1: 3.4rem;
  --size-h2: 2.15rem;
  --size-h3: 1.28rem;
  --size-body: 17px;

  --max: 1120px;
  --measure: 66ch;

  --radius: 6px;
  --radius-lg: 10px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--sans);
  font-size: var(--size-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a{ color: var(--sage-deep); text-decoration-color: var(--sage); text-underline-offset: 3px; }
a:hover{ color: var(--charcoal); }

h1, h2, h3, h4{
  font-family: var(--serif);
  font-weight: 500;
  color: var(--charcoal);
  line-height: 1.18;
  margin: 0 0 0.5em 0;
  letter-spacing: -0.01em;
}

h1{ font-size: clamp(2.1rem, 4vw, var(--size-h1)); font-weight: 480; }
h2{ font-size: clamp(1.55rem, 2.6vw, var(--size-h2)); }
h3{ font-size: var(--size-h3); }
h4{ font-size: 1.05rem; font-family: var(--sans); font-weight: 600; }

p{ margin: 0 0 1.1em 0; max-width: var(--measure); }
p.lede{ font-size: 1.18rem; color: var(--charcoal); }

ul, ol{ margin: 0 0 1.1em 0; padding-left: 1.3em; max-width: var(--measure); }
li{ margin-bottom: 0.45em; }

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

.narrow{ max-width: 760px; }

section{ padding: 72px 0; }
section.tight{ padding: 44px 0; }

.divider{
  height: 1px;
  background: var(--sage-deep-16);
  border: none;
  margin: 0;
}

/* -------- Skip link -------- */
.skip-link{
  position: absolute; left: -999px; top: 0;
  background: var(--sage-deep); color: var(--ivory);
  padding: 12px 18px; z-index: 200; border-radius: 0 0 6px 0;
}
.skip-link:focus{ left: 0; }

/* -------- Header / Nav -------- */
.site-header{
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,243,236,0.94);
  backdrop-filter: saturate(160%) blur(6px);
  border-bottom: 1px solid var(--sage-deep-16);
}
.nav-row{
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  max-width: var(--max); margin: 0 auto;
}
.brand{
  font-family: var(--serif);
  font-size: 1.28rem;
  color: var(--charcoal);
  text-decoration: none;
  line-height: 1.15;
  display: flex; flex-direction: column;
}
.brand:hover{ color: var(--sage-deep); }
.brand small{
  font-family: var(--sans);
  font-size: 0.68rem;
  color: var(--sage-deep);
  font-weight: 500;
  margin-top: 2px;
}

.nav-links{
  display: flex; align-items: center; gap: 22px; list-style: none;
  margin: 0; padding: 0;
}
.nav-links a{
  color: var(--charcoal); text-decoration: none;
  font-size: 0.92rem; font-weight: 500; white-space: nowrap;
  padding: 6px 2px; border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a.active{
  border-bottom-color: var(--sage);
  color: var(--sage-deep);
}

.nav-cta{
  background: var(--sage-deep); color: var(--ivory) !important;
  padding: 9px 18px !important; border-radius: 100px;
  border-bottom: none !important;
  display: inline-flex !important; align-items: center; gap: 7px;
}
.nav-cta svg{ flex-shrink: 0; }
.nav-cta:hover{ background: var(--charcoal); color: var(--ivory) !important; }

.nav-toggle{
  display: none;
  background: none; border: 1px solid var(--sage-deep-16); border-radius: 6px;
  width: 42px; height: 40px; cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after{
  content: ""; display: block; width: 20px; height: 2px; background: var(--charcoal);
  position: relative; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle span::before{ position: absolute; top: -6px; }
.nav-toggle span::after{ position: absolute; top: 6px; }

/* -------- Hero -------- */
.hero{
  padding: 60px 0 76px;
}
.hero-grid{
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero-eyebrow{
  color: var(--charcoal-60); font-weight: 500; font-size: 0.82rem; margin-bottom: 14px;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.hero h1{ margin-bottom: 0.32em; }
.hero h1 .accent-line{
  display: block; font-style: italic; color: var(--sage-deep); font-weight: 400;
}
.hero .practice-line{ display: none; }
.hero .lede{ margin-bottom: 20px; }
.pillars{
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  margin: 18px 0 26px; padding: 0; list-style: none;
  color: var(--charcoal-60); font-size: 0.92rem;
}
.pillars li{ margin: 0; }
.pillars li:not(:last-child)::after{
  content: "\2022"; margin-left: 10px; color: var(--sage);
}

.hero-photo{
  aspect-ratio: 4/5; background: linear-gradient(135deg, var(--stone), var(--ivory));
  border-radius: var(--radius-lg);
  display: flex; align-items: flex-end; justify-content: flex-start;
  color: var(--charcoal-40);
  border: 1px solid var(--sage-deep-16);
  position: relative;
}
.hero-photo img{ width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; border-radius: var(--radius-lg); position: absolute; inset: 0; }
.photo-badge{
  position: absolute; left: 20px; bottom: -22px; z-index: 2;
  background: #fff; border-radius: var(--radius);
  padding: 14px 18px; box-shadow: 0 8px 24px rgba(51,53,50,0.12);
  font-size: 0.9rem; line-height: 1.35; max-width: 220px;
}
.photo-badge strong{ display: block; font-family: var(--serif); font-weight: 500; color: var(--charcoal); font-size: 1rem; }
.photo-badge span{ color: var(--charcoal-60); font-size: 0.85rem; }
.hero-photo:not(:has(img)) .photo-badge{ display: none; }
.hero-photo:not(:has(img))::after{
  content: "Photo to follow";
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--charcoal-40); padding: 18px 20px;
}

/* -------- Buttons -------- */
.btn-row{ display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.btn{
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  padding: 13px 24px; border-radius: 100px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.btn-primary{ background: var(--sage-deep); color: var(--ivory); }
.btn-primary:hover{ background: var(--charcoal); color: var(--ivory); }
.btn-outline{ background: transparent; color: var(--sage-deep); border-color: var(--sage-deep); }
.btn-outline:hover{ background: var(--sage-deep); color: var(--ivory); }
.btn-quiet{ background: var(--stone); color: var(--charcoal); }
.btn-quiet:hover{ background: var(--sage-deep-16); }

/* -------- Cards (How I can help) -------- */
.section-head-row{
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.section-head-row h2{ margin-bottom: 0; }
.section-head-row .head-link{
  font-size: 0.95rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 0.3em;
}
.section-head-row .head-link::after{ content: "\2192"; }

.card-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 36px;
}
.care-card{
  background: var(--ivory);
  border: 1px solid var(--sage-deep-16);
  border-radius: var(--radius);
  padding: 28px 26px 26px;
}
.care-card .card-index{
  font-size: 0.8rem; color: var(--charcoal-40); letter-spacing: 0.05em; margin-bottom: 14px; display: block;
}
.care-card h3{ margin-bottom: 0.4em; font-size: 1.15rem; }
.care-card p{ color: var(--charcoal-60); margin-bottom: 0.9em; font-size: 0.97rem; }
.care-card a{ font-size: 0.92rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.care-card a::after{ content: "\2192"; }

/* -------- Stacked full-width numbered list (topic index pages) -------- */
.stacked-list{ margin-top: 30px; border-top: 1px solid var(--sage-deep-16); }
.stacked-card{
  display: block; text-decoration: none; padding: 30px 4px;
  border-bottom: 1px solid var(--sage-deep-16);
  position: relative;
}
.stacked-card:hover{ background: var(--stone); }
.stacked-card .card-index{
  font-size: 0.8rem; color: var(--charcoal-40); letter-spacing: 0.05em; display: block; margin-bottom: 10px;
}
.stacked-card h3{ color: var(--charcoal); margin-bottom: 0.35em; }
.stacked-card p{ color: var(--charcoal-60); font-size: 0.96rem; margin: 0; max-width: 640px; }
.stacked-card .arrow{
  position: absolute; right: 16px; top: 30px; color: var(--charcoal-40); font-size: 1.2rem;
}

/* -------- Philosophy (image + text) -------- */
.philosophy-grid{
  display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; align-items: center;
}
.philosophy-photo{
  aspect-ratio: 4/5; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--sage-deep-16); background: linear-gradient(135deg, var(--stone), var(--ivory));
  display: flex; align-items: flex-end;
}
.philosophy-photo img{ width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.philosophy-photo:not(:has(img))::after{
  content: "Photo to follow";
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--charcoal-40); padding: 18px 20px;
}
.philosophy-text h2{ margin-bottom: 0.5em; }
.philosophy-text a.head-link{
  font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.philosophy-text a.head-link::after{ content: "\2192"; }

/* -------- Full-width dark section -------- */
.dark-section{
  background: var(--charcoal); color: rgba(246,243,236,0.92);
}
.dark-section .hero-eyebrow{ color: rgba(246,243,236,0.55); }
.dark-section h2{ color: var(--ivory); }
.dark-section p{ color: rgba(246,243,236,0.72); }
.dark-section ul{ list-style: none; padding: 0; margin: 26px 0; max-width: 640px; }
.dark-section ul li{
  padding: 14px 0; border-bottom: 1px solid rgba(246,243,236,0.14); margin: 0;
  color: rgba(246,243,236,0.85); font-size: 1.02rem;
}
.dark-section ul li:first-child{ border-top: 1px solid rgba(246,243,236,0.14); }
.dark-section .note{ font-size: 0.9rem; color: rgba(246,243,236,0.5); max-width: 640px; }

/* -------- Global sage CTA band (appears on every page) -------- */
.cta-band{
  background: var(--sage-deep); color: var(--ivory); text-align: center;
}
.cta-band .hero-eyebrow{ color: rgba(246,243,236,0.7); justify-content: center; display: block; }
.cta-band h2{ color: var(--ivory); max-width: 780px; margin: 0 auto 0.5em; }
.cta-band p{ color: rgba(246,243,236,0.85); max-width: 560px; margin: 0 auto 28px; }
.cta-band .btn-row{ justify-content: center; }
.cta-band .btn-outline{ border-color: rgba(246,243,236,0.6); color: var(--ivory); }
.cta-band .btn-outline:hover{ background: rgba(246,243,236,0.12); }
.cta-band .btn-primary{ background: var(--ivory); color: var(--sage-deep); }
.cta-band .btn-primary:hover{ background: #fff; }

/* -------- Page hero (interior pages) -------- */
.page-hero{
  padding: 52px 0 44px;
  border-bottom: 1px solid var(--sage-deep-16);
}
.breadcrumb{
  font-size: 0.86rem; color: var(--charcoal-60); margin-bottom: 14px;
}
.breadcrumb a{ color: var(--charcoal-60); text-decoration: none; }
.breadcrumb a:hover{ color: var(--sage-deep); }
.breadcrumb .sep{ margin: 0 6px; color: var(--charcoal-40); }
.page-hero .hero-eyebrow{ display: none; }
.page-hero h1{ margin-bottom: 0.3em; }
.page-hero .lede{ max-width: 760px; color: var(--charcoal-60); }

/* -------- Single-column article layout -------- */
.article-single{ max-width: 720px; }
.article-single h2{
  margin-top: 1.3em; scroll-margin-top: 100px; color: var(--sage-deep); font-weight: 500;
}
.article-single h2:first-child{ margin-top: 0; }

/* -------- Elegant "photo to follow" placeholder -------- */
.photo-slot{
  background: linear-gradient(135deg, var(--stone), var(--ivory));
  border: 1px solid var(--sage-deep-16);
  border-radius: var(--radius-lg);
  position: relative;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.photo-slot .placeholder-caption{
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--charcoal-40); padding: 16px 18px;
}

/* -------- Callouts -------- */
.callout{
  border-left: 3px solid var(--charcoal);
  background: var(--stone);
  padding: 20px 24px 20px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 28px 0;
  max-width: var(--measure);
}
.callout h4{
  margin-bottom: 0.5em; display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 500; font-size: 1.05rem;
}
.callout h4::before{ content: "\26A0"; font-size: 1rem; color: var(--charcoal-60); }
.callout p:last-child{ margin-bottom: 0; }

.callout-urgent{
  border-left-color: var(--sage-deep);
}

/* -------- Index / listing grid (Common Problems, Procedures) -------- */
.topic-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 30px;
}
.topic-card{
  border: 1px solid var(--sage-deep-16);
  border-radius: var(--radius);
  padding: 22px 24px;
  text-decoration: none;
  display: block;
  background: var(--ivory);
}
.topic-card:hover{ border-color: var(--sage-deep); background: var(--stone); }
.topic-card h3{ color: var(--charcoal); margin-bottom: 0.3em; }
.topic-card p{ color: var(--charcoal-60); font-size: 0.94rem; margin: 0; }

/* -------- FAQ accordion -------- */
.faq-item{ border-bottom: 1px solid var(--sage-deep-16); }
.faq-item:first-child{ border-top: 1px solid var(--sage-deep-16); }
.faq-item summary{
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 4px; font-family: var(--serif); font-size: 1.08rem; color: var(--charcoal);
}
.faq-item summary::-webkit-details-marker{ display: none; }
.faq-item summary::after{
  content: "+"; font-family: var(--sans); font-size: 1.4rem; color: var(--sage-deep);
  flex-shrink: 0; font-weight: 400;
}
.faq-item[open] summary::after{ content: "–"; }
.faq-item .faq-a{ padding: 0 4px 22px; color: var(--charcoal-60); }
.faq-item .faq-a p{ margin-bottom: 0.8em; }

/* -------- Symptoms list -------- */
.symptom-tags{
  display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0; padding: 0; list-style: none;
}
.symptom-tags li{
  background: var(--ivory); border: 1px solid var(--sage-deep-16);
  padding: 9px 16px; border-radius: 100px; font-size: 0.9rem; margin: 0;
}

/* -------- Contact -------- */
.contact-grid{
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start;
}
.contact-detail{ margin-bottom: 26px; }
.contact-detail .label{ font-size: 0.82rem; color: var(--sage-deep); font-weight: 600; margin-bottom: 4px; }
.contact-detail .value{ font-size: 1.08rem; }
.map-frame{
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--sage-deep-16);
  aspect-ratio: 4/3.4;
}
.map-frame iframe{ width: 100%; height: 100%; border: 0; }

/* -------- Patient info list -------- */
.doc-list{ list-style: none; margin: 30px 0 0; padding: 0; }
.doc-list li{
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 4px; border-bottom: 1px solid var(--sage-deep-16); margin: 0;
}
.doc-list .doc-name{ font-weight: 600; }
.doc-list .doc-note{ font-size: 0.88rem; color: var(--charcoal-60); font-weight: 400; }
.doc-status{
  font-size: 0.82rem; color: var(--sage-deep); background: var(--stone);
  padding: 6px 12px; border-radius: 100px; white-space: nowrap;
}

/* -------- Footer -------- */
.site-footer{
  background: var(--charcoal); color: rgba(246,243,236,0.82);
  padding: 56px 0 28px; margin-top: 60px;
}
.footer-grid{
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px;
  margin-bottom: 40px;
}
.footer-grid h4{ color: var(--ivory); font-family: var(--serif); font-weight: 500; font-size: 1.1rem; margin-bottom: 0.6em;}
.footer-grid p{ color: rgba(246,243,236,0.7); font-size: 0.94rem; }
.footer-grid ul{ list-style: none; margin: 0; padding: 0; }
.footer-grid li{ margin-bottom: 10px; }
.footer-grid a{ color: rgba(246,243,236,0.78); text-decoration: none; font-size: 0.94rem; }
.footer-grid a:hover{ color: var(--ivory); }
.footer-eyebrow{
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(246,243,236,0.45); margin-bottom: 14px; font-weight: 600;
}
.footer-contact-row{ display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; font-size: 0.94rem; color: rgba(246,243,236,0.85); }
.footer-contact-row .icon{ flex-shrink: 0; width: 18px; height: 18px; color: rgba(246,243,236,0.5); margin-top: 2px; }
.footer-contact-row a{ color: rgba(246,243,236,0.85); }
.footer-disclaimer{
  border-top: 1px solid rgba(246,243,236,0.16); padding-top: 24px;
  font-size: 0.83rem; color: rgba(246,243,236,0.55); line-height: 1.6;
}
.footer-disclaimer p{ max-width: 100%; margin-bottom: 0.8em; }
.footer-bottom{
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-top: 24px; font-size: 0.82rem; color: rgba(246,243,236,0.45);
}
.footer-bottom a{ color: rgba(246,243,236,0.55); }

/* -------- Photo placeholder helper -------- */
.photo-slot{
  background: var(--stone); border: 1px dashed var(--sage);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--charcoal-40); text-align: center; font-size: 0.88rem; padding: 20px;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px){
  .hero-grid{ grid-template-columns: 1fr; }
  .hero-photo{ order: -1; aspect-ratio: 16/10; }
  .philosophy-grid{ grid-template-columns: 1fr; gap: 28px; }
  .philosophy-photo{ aspect-ratio: 16/10; }
  .card-grid{ grid-template-columns: repeat(2, 1fr); }
  .content-grid{ grid-template-columns: 1fr; }
  .side-nav{ position: static; border-left: none; border-top: 1px solid var(--sage-deep-16); padding-left: 0; padding-top: 18px; }
  .topic-grid{ grid-template-columns: 1fr; }
  .footer-grid{ grid-template-columns: 1fr; gap: 28px; }
  .contact-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  .nav-links{
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--ivory); border-bottom: 1px solid var(--sage-deep-16);
    flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 10px 28px 20px;
  }
  .nav-links.open{ display: flex; }
  .nav-links a{ width: 100%; padding: 12px 2px; }
  .nav-toggle{ display: flex; }
  .nav-cta{ margin-top: 8px; }
  section{ padding: 48px 0; }
  .hero{ padding: 36px 0 48px; }
}

@media (max-width: 480px){
  .container{ padding: 0 20px; }
  body{ font-size: 16px; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ transition: none !important; animation: none !important; }
}
