/* ==========================================================================
   Salud Renal Ecuador — Dra. Celia Burbano Terán · static rebuild
   Matches the live site: raspberry/magenta #a4185b, Open Sans, photo hero,
   crimson headings, blog-style article listing, magenta footer.
   ========================================================================== */

:root {
  --crimson:      #a4185b;   /* primary: top bar, footer, headings, nav active */
  --crimson-deep: #851449;   /* hover */
  --magenta:      #a0228e;   /* logo accent (kidneys) */
  --ink:          #2c2c2c;   /* body text */
  --muted:        #5e5e5e;   /* secondary text */
  --dark-head:    #333333;   /* bold Q&A subheadings */
  --paper:        #ffffff;
  --paper-2:      #f7f7f7;
  --line:         #e6e6e6;

  --maxw: 1170px;
  --gut: clamp(16px, 4vw, 40px);

  --ff: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: ease;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--ff);
  font-size: 16px; line-height: 1.7; font-weight: 400;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; height: auto; }
a { color: var(--crimson); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--crimson-deep); }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: clamp(40px, 6vw, 72px); }

/* ---- type --------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 { font-family: var(--ff); line-height: 1.25; font-weight: 400; color: var(--ink); }
.page-title { color: var(--crimson); font-weight: 300; font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin-bottom: 1.6rem; }
.post-title { color: var(--crimson); font-weight: 300; font-size: clamp(1.6rem, 2.8vw, 2.1rem); line-height: 1.2; }
.post-title a { color: var(--crimson); }
.post-title a:hover { color: var(--crimson-deep); }

p { margin-bottom: 1rem; }
strong, b { font-weight: 700; color: var(--dark-head); }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  background: var(--crimson); color: #fff; border: 1px solid var(--crimson);
  padding: .7em 1.5em; font-weight: 600; font-size: .95rem; border-radius: 4px;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn:hover { background: var(--crimson-deep); border-color: var(--crimson-deep); color:#fff; }
.btn--outline { background: transparent; color: var(--crimson); }
.btn--outline:hover { background: var(--crimson); color:#fff; }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }
.btn-readmore {
  display: inline-block; clear: both;
  background: #fff; color: var(--ink); border: 1px solid #cfcfcf;
  padding: .55em 1.1em; font-size: .92rem; border-radius: 4px; margin-top: .4rem;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn-readmore:hover { border-color: var(--crimson); color: var(--crimson); }

/* ============================ TOP BAR =================================== */
.topbar { background: var(--crimson); color: #fff; font-size: .9rem; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 44px; padding-block: 6px; }
.topbar a { color: #fff; }
.topbar a:hover { color: #f1d2e0; }
.topbar .phone { display: inline-flex; align-items: center; gap: .5em; }
.topbar .phone svg { width: 15px; height: 15px; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-social { display: flex; gap: .55rem; }
.topbar-social a { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 3px; background: rgba(255,255,255,.14); }
.topbar-social a:hover { background: rgba(255,255,255,.28); }
.topbar-social svg { width: 14px; height: 14px; }
.topbar-search { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; }
.topbar-search svg { width: 14px; height: 14px; }

/* ============================ HEADER =================================== */
.site-header { position: sticky; top: 0; z-index: 100; background: #fcfcfc; border-bottom: 1px solid var(--line); transition: box-shadow .3s var(--ease); }
.site-header.is-stuck { box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 92px; padding-block: 10px; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 64px; width: auto; transition: height .3s var(--ease); }
.site-header.is-stuck .brand img { height: 52px; }
.brand .brand-fallback { font-weight: 700; font-size: 1.3rem; color: var(--crimson); }

.nav { display: flex; align-items: center; gap: clamp(.6rem, 1.8vw, 1.7rem); }
.nav a {
  display: inline-block; padding: .5rem .1rem;
  font-size: .94rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--dark-head);
}
.nav a:hover, .nav a.is-active { color: var(--crimson); }

.burger { display:none; width:46px; height:46px; background:transparent; border:1px solid var(--line); border-radius:6px; position:relative; flex:none; }
.burger span, .burger span::before, .burger span::after { content:""; position:absolute; left:50%; top:50%; width:20px; height:2px; background: var(--crimson); transform: translate(-50%,-50%); transition:.25s var(--ease); }
.burger span::before { top:-6px; } .burger span::after { top:6px; }
body.nav-open .burger span { background: transparent; }
body.nav-open .burger span::before { top:0; transform: rotate(45deg); }
body.nav-open .burger span::after  { top:0; transform: rotate(-45deg); }

/* ============================ HERO SLIDER ============================== */
.hero-slider { position: relative; width: 100%; height: clamp(320px, 46vw, 600px); overflow: hidden; background: var(--paper-2); }
.hero-slider .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s var(--ease); }
.hero-slider .slide.active { opacity: 1; }
.hero-slider .slide img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.slider-dots { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; gap: 10px; justify-content: center; z-index: 2; }
.slider-dots button { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: transparent; padding: 0; transition: background .2s var(--ease); }
.slider-dots button.active { background: #fff; }

/* ============================ POSTS (home / blog) ====================== */
.posts { }
.post { padding-block: clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--line); overflow: hidden; }
.post:last-child { border-bottom: 0; }
.post-title { margin-bottom: 1.2rem; }
.post .thumb { float: left; width: clamp(220px, 32%, 340px); margin: .2rem 1.6rem 1rem 0; border-radius: 2px; }
.post-body p { color: var(--ink); }
.post-body p:last-child { margin-bottom: 0; }
.post-body strong { color: var(--dark-head); }
.post-lead { font-size: 1.05rem; }

/* ============================ ARTICLE (single) ========================= */
.article { padding-top: clamp(28px, 4vw, 44px); }
.article .thumb { float: left; width: clamp(240px, 38%, 360px); margin: .2rem 1.8rem 1.1rem 0; }
.article-body p { color: var(--ink); }
.article-body h3 { color: var(--dark-head); font-weight: 700; font-size: 1.05rem; margin: 1.4rem 0 .5rem; }
.article-foot { clear: both; margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; }
.article-foot .back { font-weight: 600; }

/* ============================ ESPECIALISTA ============================= */
.bio h2 { color: var(--dark-head); font-weight: 700; font-size: 1.6rem; margin-bottom: 1.1rem; }
.bio .portrait { float: left; width: clamp(200px, 30%, 260px); margin: .2rem 1.8rem 1rem 0; border: 1px solid var(--line); }
.bio .bio-text { color: var(--ink); }
.bio .bio-text p { margin-bottom: 1rem; }
.bio-divider { clear: both; border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.find h3 { color: var(--dark-head); font-weight: 700; font-size: 1.15rem; margin-bottom: .6rem; }
.find p { margin-bottom: .3rem; color: var(--ink); }

/* ============================ SERVICIOS ================================ */
.services-list { color: var(--ink); }
.services-list > li { position: relative; padding-left: 1.5rem; margin-bottom: 1rem; font-weight: 700; color: var(--dark-head); font-size: 1.08rem; }
.services-list > li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: var(--crimson); }
.services-list ul { margin: .6rem 0 .6rem 0; }
.services-list ul li { position: relative; padding-left: 1.4rem; margin-bottom: .45rem; font-weight: 400; color: var(--ink); font-size: 1rem; }
.services-list ul li::before { content: ""; position: absolute; left: .15rem; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--magenta); opacity: .7; }
.services-list ul ul { margin: .4rem 0 .4rem .4rem; }
.services-list ul ul li::before { border-radius: 0; width: 6px; height: 2px; top: .75em; background: var(--muted); }

/* ============================ CONTACT ================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.contact-info .info-block { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: 1.3rem; }
.contact-info .ic { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(164,24,91,.1); color: var(--crimson); }
.contact-info .ic svg { width: 18px; height: 18px; }
.contact-info .t { font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.contact-info .v { color: var(--ink); margin-top: .1rem; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: clamp(1.4rem, 3vw, 2rem); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--dark-head); margin-bottom: .35rem; }
.field .req { color: var(--crimson); }
.field input, .field textarea { width: 100%; font-family: var(--ff); font-size: 1rem; color: var(--ink); background: #fff; border: 1px solid #d6d6d6; border-radius: 4px; padding: .7rem .8rem; transition: border-color .2s; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--crimson); box-shadow: 0 0 0 2px rgba(164,24,91,.14); }
.field textarea { min-height: 130px; resize: vertical; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-note { font-size: .85rem; color: var(--muted); margin-top: .4rem; }
.form-status { margin-top: 1rem; font-size: .92rem; padding: .7rem .9rem; border-radius: 4px; display: none; }
.form-status.ok { display: block; background: #e8f6ec; color: #1c7a3e; border: 1px solid #bfe6cb; }
.form-status.err { display: block; background: #fdecec; color: #b13a3a; border: 1px solid #f3c9c9; }
.map-embed { margin-top: clamp(2rem, 5vw, 3rem); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.map-embed iframe { display: block; width: 100%; height: 360px; border: 0; }

/* ============================ FOOTER =================================== */
.site-footer { background: var(--crimson); color: #fff; }
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1.6rem; }
.site-footer .copy { font-size: .92rem; color: #f3dbe6; }
.footer-social { display: flex; align-items: center; gap: 1rem; }
.footer-social a { color: #fff; display: inline-flex; align-items: center; gap: .4em; font-size: .92rem; font-style: italic; }
.footer-social a:hover { color: #f1d2e0; }
.footer-social svg { width: 18px; height: 18px; }

/* ============================ misc ===================================== */
.back-to-top { position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--crimson); background: #fff; color: var(--crimson); display: grid; place-items: center; opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s; z-index: 90; }
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--crimson); color: #fff; }
.back-to-top svg { width: 20px; height: 20px; }

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

/* ============================ responsive =============================== */
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar .wrap { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .header-bar { min-height: 72px; }
  .brand img { height: 50px; }
  .burger { display: block; }
  .nav {
    position: fixed; inset: auto 0 auto 0; top: var(--header-h, 72px);
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: .4rem var(--gut) 1.2rem; box-shadow: 0 14px 30px rgba(0,0,0,.12);
    transform: translateY(-140%); transition: transform .35s var(--ease);
    max-height: 80vh; overflow-y: auto;
  }
  body.nav-open .nav { transform: translateY(0); }
  .nav a { padding: .9rem .2rem; border-bottom: 1px solid var(--line); }
  .post .thumb, .article .thumb, .bio .portrait { float: none; width: 100%; max-width: 420px; margin: 0 0 1.1rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; }
  .hero-slider .slide { transition: none; }
}
