/* ===========================================================
   RM Abogados — hoja de estilos
   Réplica fiel del sitio original (paleta, tipografías y layout)
   =========================================================== */

:root {
  --parchment: 44 22% 92%;
  --parchment-soft: 44 18% 88%;
  --forest: 165 30% 9%;
  --mahogany: 8 50% 16%;
  --brass: 40 38% 54%;
  --brass-dim: 40 36% 39%;
  --ink: 40 5% 9%;

  --font-heading: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Lora", Georgia, "Times New Roman", serif;

  --container: 1440px;
  --gutter: 2rem;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: hsl(var(--ink));
  background-color: hsl(var(--parchment));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  margin: 0;
  font-weight: 500;
}

p {
  margin: 0;
}

::selection {
  background-color: hsl(var(--brass));
  color: hsl(var(--forest));
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background-color: hsl(var(--forest));
  color: hsl(var(--parchment));
  padding: 0.75rem 1.25rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-decoration: none;
}

.btn-dark {
  background-color: hsl(var(--forest));
  color: hsl(var(--parchment));
  padding: 1.25rem 2.5rem;
}

.btn-dark:hover {
  background-color: hsl(var(--brass-dim));
}

.btn-brass {
  background-color: hsl(var(--brass));
  color: hsl(var(--mahogany));
  min-height: 3rem;
  padding: 1rem 2.5rem;
  align-self: flex-start;
}

.btn-brass:hover {
  background-color: hsl(var(--brass-dim));
  color: hsl(var(--parchment));
}

.btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ---------- Reglas / divisores ---------- */
.rule {
  height: 1px;
  border: 0;
}

.rule-brass {
  width: 6rem;
  background-color: hsl(var(--brass));
  margin: 0 auto 3rem;
}

.rule-mahogany {
  width: 3rem;
  background-color: hsl(var(--mahogany));
}

.rule-brass-soft {
  width: 4rem;
  background-color: hsl(var(--brass) / 0.4);
  margin: 1rem 0;
}

/* ---------- Cabecera / navegación ---------- */
.topbar {
  width: 100%;
}

.topbar-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 2.5rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid hsl(var(--ink) / 0.1);
  position: relative;
}

.brand {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  color: hsl(var(--forest));
  line-height: 1;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--forest) / 0.7);
  padding-block: 0.5rem;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: hsl(var(--brass));
}

.nav-disabled {
  color: hsl(var(--ink) / 0.35) !important;
  cursor: not-allowed;
  pointer-events: none;
}

/* Hamburguesa (solo móvil) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid hsl(var(--ink) / 0.2);
  cursor: pointer;
}

.nav-toggle-bar {
  width: 22px;
  height: 2px;
  background-color: hsl(var(--forest));
  transition: transform 0.25s ease, opacity 0.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);
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--container);
  margin-inline: auto;
  padding: 8rem var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: hsl(var(--brass-dim));
  margin-bottom: 2rem;
}

.hero-title {
  font-size: clamp(2.5rem, 9vw, 8rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
  color: hsl(var(--forest));
  margin-bottom: 3rem;
}

.hero-lead {
  font-size: 1.25rem;
  line-height: 1.4;
  color: hsl(var(--ink) / 0.8);
  max-width: 42rem;
  margin-bottom: 4rem;
}

/* ---------- Áreas (fondo verde) ---------- */
.areas {
  background-color: hsl(var(--forest));
  color: hsl(var(--parchment));
  padding-block: 8rem;
  padding-inline: var(--gutter);
}

.areas-head {
  max-width: var(--container);
  margin: 0 auto 5rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}

.areas-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 500;
  line-height: 1;
  color: hsl(var(--brass));
}

.areas-intro {
  max-width: 40ch;
  font-size: 1.125rem;
  line-height: 1.6;
  color: hsl(var(--parchment) / 0.7);
}

.areas-grid {
  max-width: var(--container);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid hsl(var(--brass) / 0.2);
  border-bottom: 1px solid hsl(var(--brass) / 0.2);
}

.area {
  padding: 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: background-color 0.5s ease;
}

.area + .area {
  border-left: 1px solid hsl(var(--brass) / 0.2);
}

.area:hover {
  background-color: hsl(var(--parchment) / 0.05);
}

.area-num {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-style: italic;
  color: hsl(var(--brass));
  line-height: 1;
}

.area-title {
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: hsl(var(--parchment));
}

.area-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: hsl(var(--parchment) / 0.6);
}

/* ---------- Despacho (imagen + texto) ---------- */
.despacho {
  max-width: var(--container);
  margin-inline: auto;
  padding: 10rem var(--gutter);
}

.despacho-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 4rem;
  align-items: center;
}

.despacho-figure {
  background-color: hsl(var(--ink) / 0.05);
  border: 1px solid hsl(var(--ink) / 0.1);
  padding: 1rem;
  aspect-ratio: 3 / 4;
}

.despacho-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.2);
}

.despacho-text {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.despacho-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
  color: hsl(var(--forest));
}

.despacho-lead {
  font-size: 1.25rem;
  line-height: 1.5;
  color: hsl(var(--ink) / 0.8);
}

.despacho-muted {
  font-size: 1.125rem;
  line-height: 1.6;
  color: hsl(var(--ink) / 0.7);
}

.socios {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.socios-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: hsl(var(--forest));
}

.socios-role {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--brass-dim));
}

/* ---------- Contacto (footer caoba) ---------- */
.contacto {
  background-color: hsl(var(--mahogany));
  color: hsl(var(--parchment));
  border-top: 12px solid hsl(var(--forest));
  padding: 8rem var(--gutter);
  display: flex;
  justify-content: center;
}

.contacto-inner {
  max-width: 48rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3rem;
}

.contacto-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
  color: hsl(var(--brass));
}

.contacto-intro {
  max-width: 50ch;
  font-size: 1.125rem;
  line-height: 1.6;
  color: hsl(var(--parchment) / 0.7);
}

/* Formulario */
.contacto-form {
  width: 100%;
  max-width: 42rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--brass-dim));
}

.field-opt {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: hsl(var(--parchment));
  background-color: hsl(var(--parchment) / 0.05);
  border: 1px solid hsl(var(--brass) / 0.3);
  border-radius: 0;
  padding: 0.75rem 1rem;
  min-height: 3rem;
  width: 100%;
}

.field textarea {
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: hsl(var(--parchment) / 0.4);
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid hsl(var(--brass));
  outline-offset: 1px;
  border-color: hsl(var(--brass));
}

.field input.invalid,
.field textarea.invalid {
  border-color: hsl(0 60% 55%);
}

/* Honeypot oculto */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 0;
  font-size: 0.95rem;
  min-height: 1.2em;
}

.form-status.is-success {
  color: hsl(var(--brass));
  font-weight: 600;
}

.form-status.is-error {
  color: hsl(30 80% 75%);
  font-weight: 600;
}

/* Columnas de contacto */
.contacto-cols {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.contacto-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.col-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--brass-dim));
}

.contacto-col a {
  color: hsl(var(--parchment));
  transition: color 0.3s ease;
}

.contacto-col a:hover {
  color: hsl(var(--brass));
}

/* Dirección */
.contacto-address {
  font-style: normal;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--parchment) / 0.4);
}

.contacto-address a {
  text-transform: none;
  letter-spacing: 0;
  color: hsl(var(--brass-dim));
  transition: color 0.3s ease;
}

.contacto-address a:hover {
  color: hsl(var(--brass));
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .despacho-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .despacho-figure {
    max-width: 28rem;
    margin-inline: auto;
    width: 100%;
  }
}

@media (max-width: 768px) {
  :root {
    --gutter: 1.25rem;
  }

  .topbar-inner {
    padding-block: 1.5rem;
    align-items: center;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background-color: hsl(var(--parchment));
    border-bottom: 1px solid hsl(var(--ink) / 0.1);
    box-shadow: 0 16px 24px -18px hsl(var(--forest) / 0.5);
    padding: 0.5rem var(--gutter) 1.25rem;
    transform: translateY(-130%);
    transition: transform 0.28s ease;
    visibility: hidden;
    z-index: 40;
  }

  .nav-menu.is-open {
    transform: translateY(0);
    visibility: visible;
  }

  .nav-menu li + li {
    border-top: 1px solid hsl(var(--ink) / 0.1);
  }

  .nav-menu a {
    display: block;
    padding-block: 0.9rem;
  }

  .hero,
  .areas,
  .despacho {
    padding-block: 5rem;
  }

  .contacto {
    padding-block: 5rem;
  }

  .areas-head {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 3rem;
  }

  .areas-grid {
    grid-template-columns: 1fr;
  }

  .area {
    padding: 2.5rem;
  }

  .area + .area {
    border-left: 0;
    border-top: 1px solid hsl(var(--brass) / 0.2);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .contacto-cols {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .btn-brass {
    align-self: stretch;
  }
}

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

/* ===========================================================
   Blog (listado y entrada)
   =========================================================== */

/* Cabecera del listado */
.blog-head {
  max-width: var(--container);
  margin-inline: auto;
  padding: 6rem var(--gutter) 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.blog-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 500;
  line-height: 1;
  color: hsl(var(--forest));
  margin-bottom: 2rem;
}

.blog-head .rule-brass {
  margin-bottom: 0;
}

/* Listado de entradas */
.post-list-wrap {
  max-width: 52rem;
  margin-inline: auto;
  padding: 2rem var(--gutter) 6rem;
}

.post-list {
  display: flex;
  flex-direction: column;
}

.post-item {
  padding: 2.75rem 0;
  border-top: 1px solid hsl(var(--ink) / 0.12);
}

.post-item:last-child {
  border-bottom: 1px solid hsl(var(--ink) / 0.12);
}

.post-meta {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--brass-dim));
  margin-bottom: 0.85rem;
}

.post-item-title {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0.85rem;
}

.post-item-title a {
  color: hsl(var(--forest));
  transition: color 0.2s ease;
}

.post-item-title a:hover {
  color: hsl(var(--brass-dim));
}

.post-excerpt {
  color: hsl(var(--ink) / 0.75);
  line-height: 1.6;
  margin-bottom: 1.1rem;
}

.post-link {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--brass-dim));
  transition: color 0.2s ease;
}

.post-link:hover {
  color: hsl(var(--forest));
}

.post-empty {
  text-align: center;
  color: hsl(var(--ink) / 0.7);
  padding: 3rem 0;
}

/* Paginación */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
}

.pagination a {
  color: hsl(var(--forest));
  transition: color 0.2s ease;
}

.pagination a:hover {
  color: hsl(var(--brass-dim));
}

.pagination .page-info {
  color: hsl(var(--ink) / 0.55);
}

/* Entrada individual */
.post-article {
  max-width: 44rem;
  margin-inline: auto;
  padding: 5rem var(--gutter) 6rem;
}

.back-link {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--brass-dim));
  margin-bottom: 2.5rem;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: hsl(var(--forest));
}

.post-article .post-meta {
  margin-bottom: 1rem;
}

.post-article-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: hsl(var(--forest));
  margin-bottom: 0;
}

.rule-brass-left {
  width: 4rem;
  height: 1px;
  border: 0;
  background-color: hsl(var(--brass));
  margin: 1.75rem 0 2.25rem;
}

.post-article-body {
  font-size: 1.2rem;
  line-height: 1.75;
  color: hsl(var(--ink) / 0.85);
}

.post-article-body p {
  margin: 0 0 1.5rem;
}

.post-article-body p:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .blog-head {
    padding-top: 3.5rem;
  }

  .post-article {
    padding-top: 3rem;
  }

  .post-article-body {
    font-size: 1.1rem;
  }
}
