/* Clínica Veterinaria Villén. Diseño web: PM */
:root {
  --tinta: #0F2A3D;        /* deep navy: headings, body, footer ground */
  --suave: #50677A;        /* secondary text, 5.9:1 on white */
  --azul: #0092CA;         /* brand blue: icons, focus, small graphics only */
  --azul-prof: #006E99;    /* links and primary button, 5.7:1 on white */
  --azul-hover: #005A7E;
  --naranja: #F17E00;      /* brand orange: fine accents only */
  --naranja-osc: #A44E00;  /* orange for text, 5.8:1 on white, 5.3:1 on the orange tint */
  --naranja-tinte: #FEF5EA;
  --naranja-linea: #F5D3A6;
  --niebla: #F4F8FA;       /* quiet section ground */
  --linea: #DCE7ED;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: 48px;
  --header-h: 80px;
  --sec: 136px;
}
/* QA: keep the left gutter >= 104px on desktop so the fixed PM seal (18px + 64px on the left, or 12px + 52px on the right up to 900px) never sits over content */
@media (min-width: 861px) {
  :root { --pad: max(48px, calc(104px - max(0px, (100vw - 1240px) / 2))); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 17px/1.65 var(--sans);
  color: var(--tinta);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #CDE9F5; color: var(--tinta); }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

h1, h2 { font-family: var(--serif); font-weight: 400; font-optical-sizing: auto; letter-spacing: -0.022em; text-wrap: balance; }
h1 { font-size: clamp(42px, 5.5vw, 80px); line-height: 1.0; }
h2 { font-size: clamp(34px, 3.6vw, 50px); line-height: 1.06; }
h3 { font: 600 18px/1.3 var(--sans); letter-spacing: -0.005em; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--pad); }
section[id], #contenido { scroll-margin-top: calc(var(--header-h) + 8px); }

:focus-visible { outline: 2px solid var(--azul); outline-offset: 3px; border-radius: 4px; }
.footer :focus-visible { outline-color: #fff; }

.skip {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  background: var(--tinta); color: #fff; font-weight: 600;
  padding: 12px 16px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.js-only { display: none; }
.js .js-only { display: inline-flex; }

/* Buttons: one pair, one shape */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  font: 600 16px/1 var(--sans); letter-spacing: 0.005em; text-decoration: none; white-space: nowrap;
  font-variant-numeric: tabular-nums;
  border-radius: 10px; border: 1px solid var(--tinta); cursor: pointer;
}
.btn-primary { background: var(--tinta); color: #fff; }
.btn-outline { background: transparent; color: var(--tinta); border-color: #B9CAD5; }
.btn:active { transform: scale(0.98); }
.ico { width: 17px; height: 17px; fill: currentColor; flex: none; }

/* Text links: underline draws left to right */
.link {
  color: var(--azul-prof); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums;
  background: linear-gradient(currentColor, currentColor) 0 calc(50% + 13px) / 0 1px no-repeat;
}

/* Header */
.header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--linea); opacity: 0; }
.header.stuck::after { opacity: 1; }
.header-in { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { flex: none; display: block; border-radius: 6px; }
.logo img { width: 212px; }
.menu { display: flex; align-items: center; gap: 28px; }
.menu nav { display: flex; gap: 6px; }
.menu nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  font-weight: 500; font-size: 16px; text-decoration: none; color: var(--tinta); border-radius: 8px;
}
.menu .btn { min-height: 46px; padding: 0 20px; font-size: 15px; }
.burger { display: none; }

/* Hero: type on the left, one large photograph on the right */
.hero { padding: 40px 0 var(--sec); }
.hero-in {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 72px; align-items: center;
  min-height: min(calc(100svh - var(--header-h) - 40px - 72px), 700px);
}
.hero-sub { margin-top: 28px; font-size: 19px; line-height: 1.5; color: var(--suave); max-width: 28ch; }
.hero-btns { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-frame {
  overflow: hidden; border-radius: 18px; background: var(--niebla);
  aspect-ratio: 10 / 11; max-height: min(calc(100svh - var(--header-h) - 112px), 700px); width: 100%;
}
.hero-frame picture, .hero-frame img { width: 100%; height: 100%; }
.hero-frame img { object-fit: cover; object-position: 60% 50%; }

/* About */
.about { padding: 0 0 var(--sec); }
.about-grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  position: relative; padding-top: 72px;
}
/* hairline on the content edges, not the padding */
.about-grid::before { content: ""; position: absolute; top: 0; left: var(--pad); right: var(--pad); height: 1px; background: var(--linea); }
.about-text { grid-column: 6 / span 7; grid-row: 1; }
.about-text h2 { margin-bottom: 40px; }
.about-text p { max-width: 62ch; color: #2B4557; }
.about-text p + p { margin-top: 20px; }
.about-text .lead { font-size: 21px; line-height: 1.55; color: var(--tinta); max-width: 54ch; }
.about-text .lead + p { margin-top: 28px; }
.about-text .firma { margin-top: 44px; font: 700 34px/1.2 "Dancing Script", cursive; color: var(--naranja-osc); }
.about-side { grid-column: 1 / span 4; grid-row: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 28px; max-width: 300px; }
@media (min-width: 861px) { .about-side { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; } }
.retrato { width: 132px; height: 132px; border-radius: 50%; overflow: hidden; position: relative; }
/* image set larger than the circle: the baked shadow of the original file falls outside */
.retrato img { position: absolute; width: 158px; max-width: none; left: -14px; top: -14px; }
.urgencias {
  width: 100%; padding: 26px 28px 24px;
  background: var(--naranja-tinte); border: 1px solid var(--naranja-linea); border-radius: 14px;
}
.urg-label { font: 600 15px/1.3 var(--sans); color: var(--naranja-osc); }
.urg-num { font: 400 40px/1.05 var(--serif); letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: lining-nums; }
.urg-num a { text-decoration: none; display: inline-block; min-height: 46px; }
.urg-horas { font-weight: 600; font-size: 16px; margin-top: 2px; }
.urg-nota { font-size: 14px; line-height: 1.45; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--naranja-linea); color: #5B4630; }
.promos { display: inline-flex; align-items: center; gap: 12px; font: 600 13px/1 var(--sans); letter-spacing: 0.08em; color: var(--tinta); }
.promos-img { width: 56px; height: 56px; border-radius: 50%; background: var(--naranja); display: grid; place-items: center; }
.promos-img img { width: 36px; }

/* Servicios: an index, not cards */
.servicios { background: var(--niebla); padding: var(--sec) 0 104px; }
.serv-list { margin-top: 64px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 96px; border-bottom: 1px solid var(--linea); }
.serv-list li {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start;
  padding: 30px 0 32px; border-top: 1px solid var(--linea);
}
.serv-ico { width: 36px; height: 36px; margin-top: 2px; fill: none; stroke: var(--azul-prof); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.serv-ico .dot { fill: var(--azul-prof); stroke: none; }
.serv-ico use { stroke-width: 1.5px; }
.serv-list h3 { font: 400 23px/1.2 var(--serif); letter-spacing: -0.012em; padding-top: 4px; }
.serv-list p { font-size: 16px; line-height: 1.6; color: var(--suave); padding-top: 5px; }
.royal { display: inline-block; margin-top: 48px; padding: 6px 14px; background: #fff; border: 1px solid var(--linea); border-radius: 10px; }
.royal img { width: 112px; opacity: .9; }

/* Photo band */
.band { padding: var(--sec) 0 0; }
.band-photo { aspect-ratio: 2164 / 1100; border-radius: 18px; overflow: hidden; background: var(--niebla); }
.band-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Contacto */
.contacto { padding: var(--sec) 0; }
.contacto-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: stretch; }
.contacto-text { grid-column: 1 / span 5; }
.contacto-text h3 { margin: 36px 0 12px; font-size: 20px; }
.contacto-text .dir { margin-top: 20px; font: 400 26px/1.25 var(--serif); letter-spacing: -0.015em; }
.contacto-text .frente { margin-top: 16px; color: var(--suave); max-width: 38ch; }
.datos { margin-top: 36px; border-top: 1px solid var(--linea); }
.datos div { display: flex; align-items: center; gap: 12px; min-height: 60px; border-bottom: 1px solid var(--linea); }
.datos dt { width: 104px; color: var(--suave); font-size: 15px; }
.datos .link { display: inline-flex; align-items: center; min-height: 44px; font-size: 18px; }
.panel {
  grid-column: 7 / span 6; position: relative; overflow: hidden;
  background: var(--niebla); border: 1px solid var(--linea); border-radius: 18px; min-height: 460px; display: flex;
}
.panel-in { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding: 48px 32px; }
.fachada { width: 326px; border-radius: 10px; box-shadow: 0 18px 40px -18px rgba(15, 42, 61, .35); }
.panel-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.panel-btns .btn-outline { background: #fff; }
.panel iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; }
.panel.map iframe { opacity: 1; }
.panel.map .panel-in { opacity: 0; visibility: hidden; }

/* Footer */
.footer { background: var(--tinta); color: #D5E0E8; font-size: 16px; }
.footer-in { display: flex; align-items: flex-start; justify-content: space-between; gap: 48px; padding-block: 72px 56px; }
.footer-brand { display: grid; gap: 10px; }
.footer-brand img:first-child { width: 168px; opacity: .9; }
.footer-brand img:last-child { width: 132px; }
.footer-list { display: grid; gap: 4px; justify-items: start; }
.footer-list li { min-height: 44px; display: flex; align-items: center; }
.foot-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 44px; color: #fff; font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.foot-mail .ico { width: 21px; height: 21px; }
.footer-base { position: relative; padding-block: 14px; display: flex; justify-content: flex-end; }
.footer-base::before { content: ""; position: absolute; top: 0; left: var(--pad); right: var(--pad); height: 1px; background: rgba(255, 255, 255, .14); }
.credit { font-size: 14px; color: #A9BBC8; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }

/* Sticky bottom bar: mobile only */
.bar { display: none; }

/* Hover: pointer devices only, and only on real links */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: #17405C; border-color: #17405C; }
  .btn-outline:hover { border-color: var(--tinta); }
  .menu nav a:hover { background: var(--niebla); }
  .link:hover, .link:focus-visible { background-size: 100% 1px; }
  .royal:hover img, .royal:focus-visible img { opacity: 1; }
  .foot-link:hover, .urg-num a:hover, .credit:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
}

/* Motion. All of it sits here, so under prefers-reduced-motion the page is in its final state from first paint. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn { transition: transform 140ms var(--ease), background-color 180ms ease, border-color 180ms ease; }
  .link { transition: background-size 240ms var(--ease); }
  .royal img { transition: opacity 180ms ease; }
  .header::after { transition: opacity 200ms ease; }
  .menu nav a { transition: background-color 160ms ease; }
  .panel-in, .panel iframe { transition: opacity 320ms ease; }

  /* The one authored moment: the hero photograph opens up and settles. It is visible from first paint. */
  .js .hero-frame { animation: hero-open 1100ms var(--ease) both; }
  .js .hero-frame img { animation: hero-settle 1400ms var(--ease) both; }

  /* Quiet reveals, once, for the few secondary blocks */
  .js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 700ms var(--ease) var(--d, 0ms), transform 700ms var(--ease) var(--d, 0ms); }
  .js .band-photo.reveal { transform: none; clip-path: inset(5% 3% round 18px); transition: opacity 900ms var(--ease), clip-path 1100ms var(--ease); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .band-photo.reveal.in { clip-path: inset(0 round 18px); }
  .serv-list li:nth-child(2n) { --d: 60ms; }
}
@keyframes hero-open { from { clip-path: inset(4% 5% round 18px); } to { clip-path: inset(0 round 18px); } }
@keyframes hero-settle { from { transform: scale(1.06); } }

/* Narrow desktop and tablet */
@media (max-width: 1080px) {
  :root { --sec: 104px; }
  .hero-in { column-gap: 40px; }
  .about-text { grid-column: 5 / span 8; }
  .about-side { grid-column: 1 / span 4; max-width: 260px; }
  .serv-list { column-gap: 48px; }
  .serv-list li { grid-template-columns: 40px minmax(0, 1fr); row-gap: 6px; }
  .serv-list p { grid-column: 2; }
  .panel { grid-column: 7 / span 6; }
  .fachada { width: 100%; max-width: 326px; }
}

/* Mobile */
@media (max-width: 860px) {
  :root { --pad: 24px; --header-h: 68px; --sec: 80px; }
  body { font-size: 16px; }
  .logo img { width: 180px; }

  /* Without JS the nav simply wraps under the logo. With JS it becomes a panel. */
  .header-in { flex-wrap: wrap; height: auto; min-height: var(--header-h); }
  .menu { flex-wrap: wrap; gap: 8px; padding-bottom: 12px; }
  .js .burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 44px; height: 44px; padding: 0 10px; margin-right: -10px;
    background: none; border: 0; border-radius: 8px; cursor: pointer;
  }
  .burger span { display: block; height: 1.5px; border-radius: 2px; background: var(--tinta); }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
  .js .menu {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 20px;
    padding: 8px var(--pad) 28px; background: #fff; border-bottom: 1px solid var(--linea);
    box-shadow: 0 24px 40px -24px rgba(15, 42, 61, .25);
    opacity: 0; visibility: hidden;
  }
  .js .menu nav { flex-direction: column; gap: 0; }
  .js .menu nav a { min-height: 56px; padding: 0; font: 400 24px/1 var(--serif); border-bottom: 1px solid var(--linea); border-radius: 0; }
  .js .menu .btn { min-height: 52px; font-size: 16px; }
  .js .menu.open { opacity: 1; visibility: visible; }

  .hero { padding: 28px 0 var(--sec); }
  .hero-in { display: block; min-height: 0; }
  .hero-sub { margin-top: 18px; font-size: 17px; }
  .hero-btns { margin-top: 28px; flex-direction: column; }
  .hero-frame { margin-top: 40px; aspect-ratio: 4 / 3; max-height: none; border-radius: 14px; }
  .hero-frame img { object-position: 30% 50%; }

  .about-grid, .contacto-grid { display: block; }
  .about-grid { padding-top: 56px; }
  .about-text h2 { margin-bottom: 28px; }
  .about-text .lead { font-size: 18px; }
  .about-text .firma { font-size: 30px; margin-top: 32px; }
  .about-side { margin-top: 48px; max-width: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 24px; }
  .retrato { width: 96px; height: 96px; }
  .retrato img { width: 116px; left: -10px; top: -10px; }
  .urgencias { order: 3; flex-basis: 100%; }

  .servicios { padding-bottom: 72px; }
  .serv-list { margin-top: 40px; grid-template-columns: 1fr; }
  .serv-list li { padding: 24px 0 26px; column-gap: 20px; }
  .serv-list h3 { font-size: 22px; }
  .royal { margin-top: 40px; }

  .band-photo { border-radius: 14px; }

  .contacto-text .dir { font-size: 23px; }
  .panel { margin-top: 48px; min-height: 0; border-radius: 14px; }
  .panel.map { min-height: 400px; }
  .panel-in { padding: 28px 20px; gap: 24px; }
  .panel-btns { width: 100%; }
  .panel-btns .btn { flex: 1 1 100%; }

  .footer-in { flex-direction: column; gap: 36px; padding-block: 56px 32px; }
  .footer-base { justify-content: flex-start; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

  .js .bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); border-top: 1px solid var(--linea);
    visibility: hidden; opacity: 0;
  }
  .bar .btn { min-height: 48px; padding: 0 10px; font-size: 15px; }
  .js .bar.show { visibility: visible; opacity: 1; }
}
@media (max-width: 860px) and (prefers-reduced-motion: no-preference) {
  .burger span { transition: transform 220ms var(--ease), opacity 140ms ease; }
  /* closes faster than it opens */
  .js .menu { transform: translateY(-8px); transition: opacity 160ms ease, transform 160ms var(--ease), visibility 0s 160ms; }
  .js .menu.open { transform: none; transition: opacity 240ms ease, transform 240ms var(--ease); }
  .js .bar { transform: translateY(100%); transition: opacity 200ms ease, transform 200ms var(--ease), visibility 0s 200ms; }
  .js .bar.show { transform: none; transition: opacity 280ms ease, transform 280ms var(--ease); }
}
