/* ===========================================================================
   Ratnarenu Medical Store & Clinic — site styles
   All values reference tokens.css. No literal hex values below.
   ========================================================================= */

/* --- Reset / base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Stop in-page anchors landing underneath the sticky header. */
:target, [id] { scroll-margin-top: calc(var(--header-h, 119px) + var(--s-4)); }
body {
  margin: 0;
  background: var(--surface);
  color: var(--body);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--heading);
  letter-spacing: var(--ls-tight);
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 600; }
h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 600; }
h4 { font-size: var(--fs-h4); line-height: var(--lh-h4); font-weight: 600; }
p  { margin: 0; }
a  { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; }
ul { margin: 0; padding: 0; list-style: none; }

/* One focus treatment everywhere — the single place lime carries meaning. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm);
  outline-offset: var(--focus-offset);
}

.skip-link {
  position: absolute; left: var(--s-4); top: -6rem;
  z-index: 100; padding: var(--s-3) var(--s-4);
  background: var(--brand-700); color: var(--surface);
  border-radius: var(--r-md); font-weight: 600;
  transition: top var(--transition);
}
.skip-link:focus { top: var(--s-4); color: var(--surface); text-decoration: none; }

/* --- Layout ------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--tint { background: var(--canvas); }
.section--brand { background: var(--brand-900); color: var(--brand-100); }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase;
  color: var(--brand-700); margin: 0 0 var(--s-3);
}
.section--brand .eyebrow { color: var(--lime-400); }
.lead { font-size: var(--fs-lead); line-height: var(--lh-lead); color: var(--muted); }
.muted { color: var(--muted); }
.prose p + p { margin-top: var(--s-4); }
.prose { font-size: var(--fs-body-lg); }
.accent { color: var(--brand-600); }

.section-head { max-width: 46rem; margin-bottom: var(--s-9); }
.section-head--row {
  max-width: none; display: flex; flex-wrap: wrap; gap: var(--s-5);
  align-items: flex-end; justify-content: space-between;
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--btn-h); padding: 0 var(--s-5);
  border-radius: var(--r-md); border: 1px solid transparent;
  font-family: var(--font-body); font-size: var(--fs-body); font-weight: 600;
  line-height: 1; cursor: pointer; text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn:hover { text-decoration: none; }
.btn svg { width: 20px; height: 20px; flex: none; }

.btn--primary { background: var(--brand-600); color: var(--surface); }
.btn--primary:hover { background: var(--brand-700); color: var(--surface); }

.btn--secondary { background: var(--surface); color: var(--brand-700); border-color: var(--border); }
.btn--secondary:hover { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }

.btn--ghost { background: transparent; color: var(--brand-700); padding-inline: var(--s-2); }
.btn--ghost:hover { color: var(--brand-700); background: var(--brand-50); }

.btn--danger { background: var(--danger); color: var(--surface); }
.btn--danger:focus-visible { box-shadow: 0 0 0 3px var(--danger-ring); }

.btn[disabled], .btn[aria-disabled="true"] {
  background: var(--disabled-fill); color: var(--placeholder);
  border-color: transparent; cursor: not-allowed;
}
.btn--loading { background: var(--brand-400); color: var(--surface); }
.btn--loading .spinner {
  width: 18px; height: 18px; border-radius: var(--r-full);
  border: 2px solid rgba(255,255,255,.4); border-top-color: var(--surface);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* --- Badges ------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 6px 14px; border-radius: var(--r-full);
  font-size: var(--fs-eyebrow); font-weight: 600; line-height: 1.4;
  background: var(--brand-50); color: var(--brand-700);
}
.badge svg { width: 16px; height: 16px; }
.badge--lime { background: var(--lime-50); color: var(--lime-700); }
.badge--on-dark { background: rgba(184,214,60,.16); color: var(--lime-400); }

/* --- Icon tile ---------------------------------------------------------- */
.icon-tile {
  width: var(--icon-tile); height: var(--icon-tile); flex: none;
  display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-700);
  border-radius: 14px; transition: background var(--transition), color var(--transition);
}
.icon-tile svg { width: 24px; height: 24px; }

/* --- Cards -------------------------------------------------------------- */
.card {
  display: flex; flex-direction: column; gap: var(--stack);
  padding: var(--card-pad); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--e1);
  transition: border-color var(--transition), box-shadow var(--transition);
}
/* Hover: border + elevation only. No lift, no scale. */
.card:hover, .card:focus-within { border-color: var(--brand-100); box-shadow: var(--e2); }
.card:hover .icon-tile, .card:focus-within .icon-tile { background: var(--brand-100); color: var(--brand-900); }
.card p { color: var(--muted); }

.grid { display: grid; gap: var(--card-gap); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
/* Exactly two columns once there is room - used for the contact detail cards. */
.grid--2up { grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid--2up { grid-template-columns: 1fr 1fr; } }

/* --- Top bar ------------------------------------------------------------ */
.topbar {
  background: var(--brand-900); color: var(--brand-100);
  font-size: var(--fs-small);
}
.topbar .wrap {
  display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5);
  align-items: center; justify-content: space-between; padding-block: var(--s-2);
}
.topbar ul { display: flex; flex-wrap: wrap; gap: var(--s-5); }
.topbar li { display: flex; align-items: center; gap: var(--s-2); }
.topbar svg { width: 16px; height: 16px; color: var(--lime-400); flex: none; }
.topbar a { color: var(--brand-100); }
.topbar a:hover { color: var(--surface); }
.topbar__hours { color: var(--lime-400); font-weight: 500; }

/* --- Header / nav ------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 60;   /* above .nav (50) so the toggle stays hittable */
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.header .wrap {
  display: flex; align-items: center; gap: var(--s-5);
  justify-content: space-between; padding-block: var(--s-3);
}
.brand { display: flex; align-items: center; gap: var(--s-3); }
.brand:hover { text-decoration: none; }
.brand img { width: 48px; height: 48px; border-radius: var(--r-sm); }
.brand__name {
  font-family: var(--font-heading); font-weight: 700; font-size: 1.125rem;
  color: var(--heading); letter-spacing: var(--ls-tight); line-height: 1.1;
}
.brand__sub {
  font-size: var(--fs-caption); font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.nav { display: flex; align-items: center; gap: var(--s-5); }
.nav a:not(.btn) {
  color: var(--body); font-weight: 500; padding-block: var(--s-2);
  border-bottom: 2px solid transparent;
}
.nav a:not(.btn):hover { color: var(--brand-700); text-decoration: none; border-bottom-color: var(--brand-100); }
.nav a:not(.btn)[aria-current="page"] { color: var(--brand-700); font-weight: 600; border-bottom-color: var(--brand-600); }
.header__cta {
  display: flex; align-items: center; gap: var(--s-3);
  /* Above .nav (z-index 50) so the close button is always hittable, even if
     --header-h is momentarily stale (web fonts reflowing the topbar). */
  position: relative; z-index: 70;
}

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: var(--btn-h); height: var(--btn-h);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--heading); cursor: pointer;
}
.nav-toggle svg { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .header__cta > .btn { display: none; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0;
    /* Set from header.getBoundingClientRect().bottom in site.js, so the panel
       always starts below the header instead of on top of it. */
    top: var(--header-h, 119px);
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 0;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: var(--s-4) var(--gutter) var(--s-8);
    overflow-y: auto; box-shadow: var(--e3); z-index: 50;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  }
  .nav[data-open="true"] { transform: none; opacity: 1; visibility: visible; }
  .nav a:not(.btn) { padding: var(--s-4) 0; border-bottom: 1px solid var(--border); }
  .nav a:not(.btn)[aria-current="page"] { border-bottom-color: var(--brand-600); }
  .nav .btn { margin-top: var(--s-5); }
}
@media (min-width: 961px) { .nav .btn { display: none; } }

/* --- Hero slider -------------------------------------------------------- */
.hero { background: var(--canvas); overflow: hidden; }
.hero__viewport { position: relative; }
.slide { display: none; }
.slide[data-active="true"] { display: block; }
.slide__inner {
  display: grid; gap: var(--s-9) var(--s-11); align-items: center;
  grid-template-columns: 1fr;
  /* Tight on both edges: a full section's padding left a dead gap under the
     nav and stranded the slider arrows below the stats.
     Top 32px @390 -> 64px @1440. */
  padding-block: clamp(2rem, 1.2381rem + 3.8095vw, 4rem) var(--s-6);
}
@media (min-width: 900px) { .slide__inner { grid-template-columns: 1.05fr .95fr; } }
.slide h1 { font-size: var(--fs-display); line-height: var(--lh-display); }
.slide__copy { display: flex; flex-direction: column; gap: var(--s-5); align-items: flex-start; }
.slide__media { position: relative; }
.slide__media img {
  width: 100%; height: auto; border-radius: var(--r-2xl);
  box-shadow: var(--e3); object-fit: cover;
}
/* Stats. <dt> (label) precedes <dd> (value) in the DOM because that is the only
   valid order inside a <dl>; CSS puts the value on top. From 560px up the whole
   row becomes a two-row grid with `display:contents` on each pair, so every
   value sits on one line and every label on another - they stay aligned no
   matter how long an individual value is. */
.stats {
  display: flex; flex-wrap: wrap;
  gap: var(--s-5) var(--s-7); margin-top: var(--s-2);
}
.stats dd { margin: 0; }
.stat {
  display: flex; flex-direction: column-reverse;
  gap: var(--s-1); margin: 0; min-width: 0;
}
.stat__value {
  font-family: var(--font-heading); font-size: var(--fs-h3);
  font-weight: 700; color: var(--brand-700); line-height: 1.1;
}
.stat__label { font-size: var(--fs-small); color: var(--muted); line-height: 1.4; }

@media (min-width: 560px) {
  .stats {
    display: grid;
    grid-template-columns: repeat(3, auto);
    grid-template-rows: auto auto;
    gap: var(--s-1) var(--s-7);
    justify-content: start;
  }
  .stat { display: contents; }
  .stat__value { grid-row: 1; align-self: end; }
  .stat__label { grid-row: 2; }
}

/* Vertical variant (About page) - stays a simple stack at every width. */
.stats.stats--stacked {
  display: flex; flex-direction: column; gap: var(--s-6);
}
.stats.stats--stacked .stat {
  display: flex; flex-direction: column-reverse; gap: var(--s-1);
}

.slider__controls {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding-bottom: var(--s-9);
}
.slider__btn {
  width: var(--btn-h); height: var(--btn-h); display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-full); color: var(--heading); cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.slider__btn:hover { background: var(--brand-50); border-color: var(--brand-100); }
.slider__btn svg { width: 20px; height: 20px; }
.slider__dots { display: flex; gap: var(--s-2); margin-inline: var(--s-2); }
/* 10px visual, 48x48 touch target (the dot is drawn by ::before so the button
   itself can satisfy the 48px minimum without changing the design). */
.slider__dot {
  width: var(--btn-h); height: var(--btn-h); padding: 0;
  background: none; border: none; cursor: pointer;
  display: grid; place-items: center;
}
.slider__dot::before {
  content: ""; display: block;
  width: 10px; height: 10px; border-radius: var(--r-full);
  background: var(--brand-100);
  transition: background var(--transition), width var(--transition);
}
.slider__dot[aria-current="true"]::before { background: var(--brand-600); width: 28px; }
.slider__dots { gap: 0; }
.slider__count { font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--muted); }

/* --- Feature strip ------------------------------------------------------ */
.strip { border-block: 1px solid var(--border); background: var(--surface); }
.strip ul {
  display: grid; gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  padding-block: var(--s-7);
}
.strip li { display: flex; align-items: center; gap: var(--s-3); font-weight: 600; color: var(--heading); }
.strip svg { width: 24px; height: 24px; color: var(--brand-600); flex: none; }

/* --- Split (image + copy) ---------------------------------------------- */
.split { display: grid; gap: var(--s-9) var(--s-11); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.split img { width: 100%; border-radius: var(--r-2xl); box-shadow: var(--e2); }
.ticks { display: grid; gap: var(--s-3); }
.ticks li { display: flex; align-items: flex-start; gap: var(--s-3); }
.ticks svg { width: 20px; height: 20px; color: var(--brand-600); flex: none; margin-top: 3px; }

/* --- Testimonials ------------------------------------------------------- */
.quote { font-size: var(--fs-body-lg); color: var(--body); }
.stars { display: flex; gap: 2px; color: var(--lime-700); }
.stars svg { width: 18px; height: 18px; fill: currentColor; }
.person { display: flex; align-items: center; gap: var(--s-3); margin-top: auto; }
.person img { width: 44px; height: 44px; border-radius: var(--r-full); border: 1px solid var(--brand-700); }
.person__name { font-weight: 600; color: var(--heading); }
.person__meta { font-size: var(--fs-small); color: var(--muted); }

/* --- Article cards ------------------------------------------------------ */
.article { padding: 0; overflow: hidden; }
.article img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.article__body { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--card-pad); }

/* --- CTA panel ---------------------------------------------------------- */
.cta { background: var(--brand-900); border-radius: var(--r-2xl); color: var(--brand-100); overflow: hidden; }
.cta__inner {
  display: grid; gap: var(--s-7) var(--s-9); align-items: center;
  grid-template-columns: 1fr;
  padding: clamp(2rem, 1.24rem + 3.81vw, 5rem) clamp(1.25rem, 0.49rem + 3.81vw, 4rem);
}
@media (min-width: 900px) { .cta__inner { grid-template-columns: 1.2fr .8fr; } }
.cta h2 { color: var(--surface); }
.cta p { color: var(--brand-100); }
.cta .btn--secondary { background: transparent; color: var(--lime-400); border-color: rgba(184,214,60,.4); }
.cta .btn--secondary:hover { background: rgba(184,214,60,.12); color: var(--lime-400); }
.cta img { width: 100%; height: auto; }

/* --- Page header (half-bleed) ------------------------------------------ */
.page-head { background: var(--canvas); }
.page-head__inner {
  display: grid; gap: var(--s-8) var(--s-11); align-items: center;
  grid-template-columns: 1fr; padding-block: var(--section-y);
}
@media (min-width: 900px) { .page-head__inner { grid-template-columns: 1.05fr .95fr; } }
.page-head h1 { font-size: var(--fs-h1); }
.page-head img { width: 100%; border-radius: var(--r-2xl); }
.page-head img.is-plain { box-shadow: none; border-radius: 0; }

/* --- Doctor profile ----------------------------------------------------- */
.doctor { display: grid; gap: 0; grid-template-columns: 1fr; overflow: hidden; padding: 0; }
@media (min-width: 900px) { .doctor { grid-template-columns: 420px 1fr; } }
.doctor__portrait { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/5; }
.doctor__body { display: flex; flex-direction: column; gap: var(--s-5); padding: var(--card-pad); }
.deflist { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.deflist h4 { margin-bottom: var(--s-3); }
.deflist li { display: flex; align-items: flex-start; gap: var(--s-2); color: var(--muted); }
.deflist li + li { margin-top: var(--s-2); }
.deflist svg { width: 18px; height: 18px; color: var(--brand-600); flex: none; margin-top: 4px; }
.hours-tile {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4); background: var(--brand-50); border-radius: var(--r-lg);
}
.hours-tile .label {
  font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--brand-700);
}
.hours-tile .value { font-weight: 600; color: var(--heading); }

/* --- Forms -------------------------------------------------------------- */
.form { display: grid; gap: var(--s-5); }
.field { display: grid; gap: var(--s-2); }
.field label { font-size: var(--fs-small); font-weight: 600; color: var(--heading); }
.field .optional { color: var(--muted); font-weight: 400; }
.field input, .field textarea, .field select {
  width: 100%; min-height: var(--field-h); padding: var(--s-3) var(--s-4);
  font-family: var(--font-body); font-size: var(--fs-body); color: var(--body);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field textarea { min-height: 160px; resize: vertical; line-height: var(--lh-body); }
.field ::placeholder { color: var(--placeholder); }
.field input:focus-visible, .field textarea:focus-visible {
  outline: none; border-color: var(--brand-600);
  box-shadow: var(--focus-ring);
}
.field input:focus:not(:focus-visible), .field textarea:focus:not(:focus-visible) {
  outline: none; border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(0,122,66,.18);
}
.field .help { font-size: var(--fs-small); color: var(--muted); }
.field .error {
  display: none; align-items: center; gap: var(--s-2);
  font-size: var(--fs-small); color: var(--danger); font-weight: 500;
}
.field .error svg { width: 16px; height: 16px; flex: none; }
.field[data-invalid="true"] input, .field[data-invalid="true"] textarea { border-color: var(--danger); }
.field[data-invalid="true"] .error { display: flex; }
.field[data-invalid="true"] .help { display: none; }
.counter { font-size: var(--fs-small); color: var(--muted); text-align: right; }

.form-success {
  display: none; gap: var(--s-4); align-items: flex-start;
  padding: var(--card-pad); border-radius: var(--r-xl);
  background: var(--brand-50); border: 1px solid var(--brand-100);
}
.form-success[data-visible="true"] { display: flex; }
.form-success svg { width: 28px; height: 28px; color: var(--success); flex: none; }
.form[data-submitted="true"] { display: none; }

/* --- Contact / map ------------------------------------------------------ */
.contact-grid { display: grid; gap: var(--s-9) var(--s-11); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.map { width: 100%; height: 480px; border: 1px solid var(--border); border-radius: var(--r-xl); }
.map--facade {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-3); background: var(--brand-50); text-align: center; padding: var(--s-6);
}
@media (max-width: 640px) { .map { height: 320px; } }

/* --- Footer ------------------------------------------------------------- */
.footer { background: var(--brand-900); color: var(--brand-100); padding-block: var(--s-10) var(--s-6); }
.footer__grid {
  display: grid; gap: var(--s-8) var(--s-9);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.footer h4 { color: var(--surface); margin-bottom: var(--s-4); }
.footer a { color: var(--brand-100); }
.footer a:hover { color: var(--lime-400); }
.footer li + li { margin-top: var(--s-3); }
.footer__brand { font-family: var(--font-heading); font-weight: 700; color: var(--surface); font-size: 1.125rem; line-height: 1.1; }
.footer__sub { font-size: var(--fs-caption); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--lime-400); }
.social { display: flex; gap: var(--s-3); margin-top: var(--s-5); }
.social a {
  width: var(--btn-h); height: var(--btn-h); display: grid; place-items: center;
  border-radius: var(--r-full); background: rgba(255,255,255,.08); color: var(--brand-100);
}
.social a:hover { background: var(--lime-400); color: var(--brand-900); }
.social svg { width: 20px; height: 20px; }
.footer__bottom {
  display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5);
  justify-content: space-between; margin-top: var(--s-9);
  padding-top: var(--s-5); border-top: 1px solid rgba(255,255,255,.12);
  font-size: var(--fs-small);
}

/* --- TODO markers awaiting client facts -------------------------------- */
.todo {
  display: inline-block; padding: 2px 8px; border-radius: var(--r-sm);
  background: var(--lime-50); color: var(--lime-700);
  font-family: var(--font-mono); font-size: var(--fs-caption); font-weight: 500;
  border: 1px dashed var(--lime-700);
}
.section--brand .todo, .footer .todo, .cta .todo {
  background: rgba(184,214,60,.14); color: var(--lime-400); border-color: rgba(184,214,60,.5);
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
