/* ===========================================================
   DS | Abogada de Marcas — styles.css
   Mobile-first. Breakpoints (hardcoded per @media, kept here as
   reference since CSS custom properties can't be used inside
   media query conditions):
     sm: 600px  (phablet)
     md: 768px  (tablet)
     lg: 1024px (small desktop)
     xl: 1280px (desktop)
   =========================================================== */

:root {
  /* Brand colors — sampled from img/logo-*.png, match CLAUDE.md */
  --color-brand:       #809671; /* sage — headings, icons, borders, large text/buttons */
  --color-brand-ink:   #5c6e52; /* darkened sage — body text/labels (AA contrast vs cream) */
  --color-brand-light: #ccd8c4; /* secondary sage — alt section backgrounds, dividers */
  --color-base:        #f6f8f5; /* cream — page background */
  --color-white:       #ffffff;
  --color-ink:         #33392f; /* near-black warm ink for max-contrast headings */

  /* Fonts — swap-later contract: once licensed Giaza Stencil / Agrandir
     Narrow files are available, change ONLY these two declarations
     (plus add matching @font-face rules above them). */
  --font-heading: 'Big Shoulders Display', 'Fraunces', serif;
  --font-body: 'Archivo Narrow', Arial, sans-serif;

  --container-max: 1200px;
  --header-height: 92px;

  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;

  --radius: 10px;
  --shadow-card: 0 10px 30px -12px rgba(51, 57, 47, .18);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  overflow-x: hidden;
}
body { overflow-x: hidden; }
body, h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; }

body {
  background: var(--color-base);
  color: var(--color-brand-ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--header-height);
}

h1, h2, h3 { font-family: var(--font-heading); color: var(--color-ink); font-weight: 600; line-height: 1.1; overflow-wrap: break-word; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-2);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--color-brand); color: var(--color-white);
  padding: var(--space-1) var(--space-2); z-index: 1000;
}
.skip-link:focus { left: var(--space-2); top: var(--space-2); }

:focus-visible {
  outline: 2px solid var(--color-brand-ink);
  outline-offset: 3px;
}

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-brand);
  margin-bottom: var(--space-1);
}

.section {
  padding-block: var(--space-5);
  background-image: url('../img/fondo.png');
  background-size: 480px;
}
.section--alt { background: var(--color-brand-light); }
.section--compact { padding-block: var(--space-4); }

.section__head { max-width: 640px; margin-bottom: var(--space-4); }
.section__title { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: var(--space-1); }
.section__lead { font-size: 1.05rem; }

/* ---------- Legal pages (política de privacidad) ---------- */
.legal { max-width: 70ch; margin-inline: auto; }
.legal__updated { font-style: italic; color: var(--color-brand-ink); margin-bottom: var(--space-3); }
.legal > .eyebrow, .legal > .section__title, .legal__updated, .legal-card__accept { text-align: center; }
.legal h2 { font-size: 1.2rem; margin-top: var(--space-4); margin-bottom: .5em; }
.legal p { margin-bottom: var(--space-2); }
.legal a { color: var(--color-brand); text-decoration: underline; }
.legal a:hover { color: var(--color-brand-ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .85em 1.6em;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .95rem;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn--primary {
  background: var(--color-brand);
  color: var(--color-white);
}
.btn--primary:hover { background: var(--color-brand-ink); transform: translateY(-1px); }
.btn--whatsapp-cta {
  background: var(--color-brand);
  color: var(--color-white);
  padding: .7em 1.3em;
  white-space: nowrap;
}
.btn--whatsapp-cta svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn--whatsapp-cta:hover { background: var(--color-brand-ink); transform: translateY(-1px); }

/* ---------- Header ---------- */
/* `position: fixed` (not `sticky`) so the hide-on-scroll `top` toggle below
   is deterministic — a sticky element only honors a new `top` once scroll
   has carried it past that threshold, so it can't be used as a simple
   show/hide switch. Body gets matching top padding to compensate. */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  border-bottom: 1px solid var(--color-brand-light);
  transition: top .3s ease;
}
/* Uses `top` (not `transform`) on purpose: `transform` (like `filter`/
   `backdrop-filter`) on an ancestor creates a new containing block for
   `position: fixed` descendants, which would break the fixed mobile nav
   panel nested inside this header. */
.site-header.is-hidden { top: calc(var(--header-height) * -1); }

/* Separate layer for the frosted-glass effect — kept off `.site-header`
   itself for the same reason: `backdrop-filter` on an ancestor of the fixed
   `#siteNav` panel breaks its viewport-relative positioning. */
.site-header__bg {
  position: absolute; inset: 0;
  background: rgba(246, 248, 245, .92);
  backdrop-filter: blur(6px);
  z-index: -1;
}

.site-header__inner {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-height);
}

.brand { display: flex; align-items: center; }
.brand__mark { border-radius: 6px; flex-shrink: 0; }

.nav-toggle {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-width: 44px; min-height: 44px;
  padding: .5em; z-index: 600;
}
.nav-toggle__bar {
  width: 24px; height: 2px; background: var(--color-ink);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  position: fixed; inset: var(--header-height) 0 0 0;
  background: var(--color-base);
  padding: var(--space-4) var(--space-2);
  display: flex; flex-direction: column; gap: var(--space-3);
  transform: translateX(100%);
  transition: transform .25s ease;
  overflow-y: auto;
  z-index: 450;
}
.site-nav.is-open { transform: translateX(0); }

.site-nav__list { display: flex; flex-direction: column; gap: var(--space-2); }
.nav-link {
  position: relative;
  display: inline-block;
  font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .95rem;
  color: var(--color-ink);
  white-space: nowrap;
  padding-block: .2em;
  transition: color .15s ease;
}
.nav-link::after {
  content: '';
  position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--color-brand);
  transition: width .2s ease;
}
.nav-link:hover { color: var(--color-brand); }
.nav-link:hover::after { width: 100%; }
.site-nav__cta { align-self: flex-start; }

/* ---------- Hero ---------- */
.hero {
  overflow: hidden;
  padding-block: var(--space-5);
  background-image: url('../img/fondo.png');
  background-size: 480px;
}
.hero__inner {
  display: flex; flex-direction: column; gap: var(--space-4);
}
.hero__title { font-size: clamp(2rem, 6vw, 3.2rem); margin-bottom: var(--space-2); }
.hero__subtitle { max-width: 46ch; margin-bottom: var(--space-3); font-size: 1.1rem; }
.hero__media img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  aspect-ratio: 739 / 375;
  object-fit: cover;
  width: 100%;
}

/* ---------- About ---------- */
.about { display: flex; flex-direction: column; gap: var(--space-4); }
.about__media img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  aspect-ratio: 739 / 375;
  object-fit: cover;
  object-position: 50% 36%;
  width: 100%;
}
.about__copy p { max-width: 60ch; }

/* ---------- Cards / services grid ---------- */
.grid { display: grid; gap: var(--space-3); }
.grid--services { grid-template-columns: 1fr; }

.card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
  border-top: 3px solid var(--color-brand);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px -14px rgba(51, 57, 47, .3);
}
.card__icon {
  width: 56px; height: 56px; color: var(--color-brand);
  background: var(--color-brand-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-2);
  transition: background-color .2s ease, color .2s ease;
}
.card__icon svg { width: 26px; height: 26px; }
.card:hover .card__icon { background: var(--color-brand); color: var(--color-white); }
.card__title { font-size: 1.15rem; margin-bottom: .4em; }
.card__text { font-size: .95rem; }

/* ---------- Complementary services (small cards) ---------- */
.grid--extra { grid-template-columns: 1fr; }

/* ---------- Testimonials ---------- */
.grid--testimonials { grid-template-columns: 1fr; }
.testimonial {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.testimonial__badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--color-brand-light); color: var(--color-brand-ink);
  font-family: var(--font-heading); font-weight: 700; font-size: .95rem;
  margin-bottom: var(--space-2);
}
.testimonial__quote { font-style: italic; margin-bottom: var(--space-2); }
.testimonial__handle { font-weight: 600; color: var(--color-brand); font-size: .9rem; }

/* ---------- Contact ---------- */
.contact { display: flex; flex-direction: column; gap: var(--space-4); }
#contacto { padding-bottom: calc(var(--space-5) + 80px); }
.contact__info { text-align: center; }
.contact__links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-3); margin-top: var(--space-2); }
.contact__link {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--color-brand);
  transition: color .15s ease, transform .15s ease;
}
.contact__link svg { width: 40px; height: 40px; flex-shrink: 0; }
.contact__link:hover { color: var(--color-brand-ink); transform: translateY(-2px); }
.contact__link--filled {
  width: 64px; height: 64px;
  background: var(--color-brand);
  color: var(--color-white);
  border-radius: 50%;
  box-shadow: 0 8px 20px -8px rgba(51, 57, 47, .45);
}
.contact__link--filled svg { width: 34px; height: 34px; }
.contact__link--filled:hover { background: var(--color-brand-ink); color: var(--color-white); }

.section__cta {
  margin-top: var(--space-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  text-align: center;
}
.section__cta p { max-width: 46ch; }

.legal-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-3);
  box-shadow: var(--shadow-card);
}
.legal-card__accept { margin-top: var(--space-4); text-align: center; }
.legal a.btn, .legal a.btn:hover { color: var(--color-white); text-decoration: none; }

.text-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-3);
  box-shadow: var(--shadow-card);
}

.contact__form {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.form-field { display: flex; flex-direction: column; gap: .4em; }
.form-field label { font-weight: 600; font-size: .9rem; color: var(--color-ink); }
.form-field__optional { font-weight: 400; color: var(--color-brand-ink); }
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field textarea {
  border: 1.5px solid var(--color-brand-light);
  border-radius: 6px;
  padding: .7em .9em;
  background: var(--color-base);
  color: var(--color-ink);
  resize: vertical;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--color-brand); }
.form-field--checkbox { flex-direction: row; align-items: flex-start; gap: .6em; }
.form-field--checkbox label { font-weight: 400; font-size: .85rem; }
.form-field--checkbox label a { color: var(--color-brand); text-decoration: underline; }
.form-field--checkbox label a:hover { color: var(--color-brand-ink); }
.form-field--checkbox input {
  flex-shrink: 0;
  width: 24px; height: 24px; margin: 0;
  accent-color: var(--color-brand);
  cursor: pointer;
}
.form-field--checkbox label { cursor: pointer; padding-block: .3em; }
.form-field__counter { font-size: .8rem; color: var(--color-brand-ink); align-self: flex-end; }
.contact__fallback { font-size: .9rem; color: var(--color-brand-ink); text-align: center; }
.contact__fallback a { color: var(--color-brand); font-weight: 600; text-decoration: underline; }
.contact__form-note { font-size: .9rem; font-weight: 600; min-height: 1.2em; }
.contact__form-note[data-state="success"] { color: var(--color-brand); }
.contact__form-note[data-state="error"] { color: #a5453a; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-brand);
  color: var(--color-base);
  padding-block: var(--space-4);
}
.site-footer__inner {
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: var(--space-3);
}

/* Mobile footer shows only the mark + social icons; nav links and
   copyright reappear from md (768px) up. */
.footer-nav, .footer-copyright { display: none; }

.footer-nav { flex-wrap: nowrap; gap: .85rem; font-size: .82rem; white-space: nowrap; }
.footer-nav a:hover { text-decoration: underline; }

.footer-social { display: flex; align-items: center; gap: var(--space-2); }
.footer-social svg { width: 22px; height: 22px; }
.footer-social a:hover { opacity: .75; }

.footer-copyright { font-size: .8rem; opacity: .85; white-space: nowrap; }

/* ---------- Floating WhatsApp button ---------- */
.whatsapp-float {
  position: fixed;
  right: var(--space-2);
  bottom: var(--space-2);
  width: 64px; height: 64px;
  background: #25D366;
  color: var(--color-white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px -6px rgba(0,0,0,.35);
  z-index: 400;
  transition: transform .15s ease;
}
.whatsapp-float:hover { transform: scale(1.07); }
.whatsapp-float svg { width: 35px; height: 35px; }

/* ===========================================================
   Breakpoints
   =========================================================== */

/* sm: 600px — phablet */
@media (min-width: 600px) {
  .grid--services { grid-template-columns: repeat(2, 1fr); }
  .hero__actions { display: flex; align-items: center; gap: var(--space-3); }
}

/* md: 768px — tablet */
@media (min-width: 768px) {
  .grid--testimonials { grid-template-columns: repeat(3, 1fr); }
  .grid--extra { grid-template-columns: repeat(2, 1fr); }
  .about { flex-direction: row; align-items: center; gap: var(--space-5); }
  .about__media, .about__copy { flex: 1; min-width: 0; }
  .about__media { order: 1; }
  .about__copy { order: 2; }
  .contact { flex-direction: row; align-items: flex-start; gap: var(--space-5); }
  .contact__info, .contact__form { flex: 1; min-width: 0; }
  .contact__info { flex: 1.5; }
  .footer-nav { display: flex; }
  .footer-copyright { display: block; }
}

/* lg: 1024px — small desktop */
@media (min-width: 1024px) {
  .nav-toggle { display: none; }

  .site-header__inner { justify-content: center; gap: var(--space-3); }
  .site-nav {
    display: contents;
  }
  .site-nav__list {
    display: flex; flex-direction: row; align-items: center; gap: var(--space-3);
  }
  .site-nav__cta { align-self: center; }

  .grid--services { grid-template-columns: repeat(4, 1fr); }
  .grid--extra { grid-template-columns: repeat(3, 1fr); }

  .hero__inner { flex-direction: row; align-items: center; }
  .hero__copy, .hero__media { flex: 1; min-width: 0; }
}

/* xl: 1280px — desktop */
@media (min-width: 1280px) {
  .container { padding-inline: var(--space-4); }
}
