@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400&family=Inter:wght@400;500;600&display=swap");

/* LegalgM - diseño propio */
html, body { margin: 0; padding: 0; background: #F7F5F0 !important; }
body, #lgm { font-family: Inter, "Helvetica Neue", Arial, sans-serif; color: #3A4252; font-size: 17px; line-height: 1.7; }
#lgm * { box-sizing: border-box; }
#lgm a { color: #7A1F2B; }
#lgm a:hover { color: #1B2433; }
.lgm-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Cabecera */
.lgm-header { background: #F7F5F0; border-bottom: 1px solid #DDD7CC; }
.lgm-header-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.lgm-logo { font-family: "EB Garamond", Georgia, serif; font-size: 32px; font-weight: 500; line-height: 1; color: #1B2433 !important; text-decoration: none; letter-spacing: 0.01em; }
.lgm-logo span { color: #7A1F2B; }
.lgm-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 32px; }
.lgm-nav li { margin: 0; padding: 0; background: none; border: 0; }
.lgm-nav li a { display: block; padding: 12px 0; font-size: 14px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: #4A5263 !important; text-decoration: none; border-bottom: 2px solid transparent; background: none !important; }
.lgm-nav li a:hover { color: #1B2433 !important; }
.lgm-nav li a.current, .lgm-nav li a.parent { color: #1B2433 !important; border-bottom-color: #7A1F2B; }
.lgm-nav ul ul { display: none; }

/* Contenido */
.lgm-main { padding: 72px 0 88px; }
#lgm #content_area p, #lgm #content_area li { text-align: left !important; font-family: Inter, "Helvetica Neue", Arial, sans-serif !important; color: #3A4252; font-size: 17px; line-height: 1.75; }
#lgm #content_area p span[style*="10pt"] { font-size: 13px !important; letter-spacing: 0.18em !important; font-family: Inter, Arial, sans-serif !important; }
#lgm #content_area h1, #lgm #content_area h2, #lgm #content_area h3 { font-family: "EB Garamond", Georgia, serif !important; font-weight: 400 !important; color: #1B2433 !important; text-align: left !important; letter-spacing: -0.005em; margin: 6px 0 18px; }
#lgm #content_area h2 { font-size: 42px !important; line-height: 1.12 !important; }
#lgm #content_area h1 { font-size: 56px !important; line-height: 1.05 !important; }
#lgm #content_area strong a, #lgm #content_area a { text-decoration: none; }

/* Botones: enlaces a Contacto y a Socios dentro del contenido */
#lgm #content_area a[href$="/contacto/"], #lgm #content_area a[href$="/abogados-socios/"] { display: inline-flex; align-items: center; min-height: 48px; padding: 0 26px; margin: 4px 0; font-size: 15px; font-weight: 500; letter-spacing: 0.02em; text-decoration: none !important; }
#lgm #content_area a[href$="/contacto/"] { background: #1B2433; color: #F7F5F0 !important; border: 1px solid #1B2433; }
#lgm #content_area a[href$="/contacto/"]:hover { background: #7A1F2B; border-color: #7A1F2B; }
#lgm #content_area a[href$="/abogados-socios/"] { background: transparent; color: #1B2433 !important; border: 1px solid #1B2433; }
#lgm #content_area a[href$="/abogados-socios/"]:hover { background: #1B2433; color: #F7F5F0 !important; }

/* Portada: titular junto a la imagen */
body.startpage #lgm #content_area h2:first-of-type { font-size: 64px !important; line-height: 1.02 !important; font-style: italic; }
body.startpage #lgm #content_area .module-type-imageSubtitle:first-child { float: right; width: 44%; margin: 28px 0 40px 56px; }
body.startpage #lgm #content_area .module-type-imageSubtitle:first-child .align-container { max-width: 100% !important; }
body.startpage #lgm #content_area .module-type-imageSubtitle:first-child img { width: 100% !important; max-width: 100% !important; height: auto !important; border: 1px solid #CFC8BA; }
body.startpage #lgm #content_area .module-type-spacer { display: none; }

/* Franja final de llamada a la acción */
#lgm #content_area h2:has(+ p a[href$="/contacto/"]) { background: #1B2433; color: #F7F5F0 !important; box-shadow: 0 0 0 100vmax #1B2433; clip-path: inset(0 -100vmax); margin: 64px 0 0 !important; padding: 64px 0 16px; font-size: 38px !important; }
#lgm #content_area h2:has(+ p a[href$="/contacto/"]) + p { background: #1B2433; box-shadow: 0 0 0 100vmax #1B2433; clip-path: inset(0 -100vmax); margin: 0 0 -88px; padding: 8px 0 64px; }
#lgm #content_area h2:has(+ p a[href$="/contacto/"]) + p a[href$="/contacto/"] { background: #F7F5F0; color: #1B2433 !important; border-color: #F7F5F0; }

/* Separadores */
#lgm #content_area .hr, #lgm #content_area hr { border: 0; border-top: 1px solid #DDD7CC; background: none; height: 0; margin: 32px 0; }

/* Formulario de contacto */
#lgm #content_area input[type="text"], #lgm #content_area input[type="email"], #lgm #content_area textarea { width: 100%; min-height: 48px; border: 1px solid #C9C2B4; background: #FFFFFF; padding: 10px 14px; font-size: 16px; font-family: Inter, Arial, sans-serif; color: #1B2433; border-radius: 0; box-shadow: none; }
#lgm #content_area textarea { min-height: 160px; }
#lgm #content_area input[type="submit"], #lgm #content_area button[type="submit"], #lgm #content_area .button { min-height: 48px; padding: 0 32px; background: #1B2433 !important; color: #F7F5F0 !important; border: 0; font-size: 15px; font-weight: 500; font-family: Inter, Arial, sans-serif; cursor: pointer; border-radius: 0; }
#lgm #content_area label { font-family: Inter, Arial, sans-serif; font-weight: 500; color: #1B2433; }

.lgm-sidebar { display: none; }

/* Pie */
.lgm-footer { background: #141B27; color: #B9BFCB; font-size: 14px; }
.lgm-footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; padding-top: 48px; padding-bottom: 48px; }
.lgm-footer-brand { display: flex; flex-direction: column; gap: 8px; }
.lgm-logo-inv { color: #F7F5F0 !important; font-size: 28px; margin-bottom: 6px; }
.lgm-logo-inv span { color: #D9A0A8; }
.lgm-footer-links, .lgm-footer-links * { color: #B9BFCB !important; font-size: 14px; background: none !important; }
.lgm-footer-links a { display: inline-block; padding: 12px 8px; text-decoration: none; }
.lgm-footer-links a:hover { color: #FFFFFF !important; }
.lgm-footer-links img { display: none; }

/* Móvil */
@media (max-width: 760px) {
  body, #lgm { font-size: 16px; }
  .lgm-header-in { flex-direction: column; align-items: flex-start; gap: 4px; }
  .lgm-nav ul { gap: 20px; }
  .lgm-main { padding: 40px 0 56px; }
  #lgm #content_area h2 { font-size: 32px !important; }
  body.startpage #lgm #content_area h2:first-of-type { font-size: 42px !important; }
  body.startpage #lgm #content_area .module-type-imageSubtitle:first-child { float: none; width: 100%; margin: 0 0 32px; }
  #lgm #content_area h2:has(+ p a[href$="/contacto/"]) { font-size: 28px !important; padding-top: 48px; }
  #lgm #content_area h2:has(+ p a[href$="/contacto/"]) + p { margin-bottom: -56px; padding-bottom: 48px; }
}                            

/* Ajustes: pie y final de portada */
.lgm-footer-links, .lgm-footer-links #contentfooter, .lgm-footer-links .leftrow { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; }
.lgm-footer-links .footer-separator, .lgm-footer-links br, .lgm-footer-links .rightrow, .lgm-footer-links #customFooterContent { display: none !important; }
.lgm-footer-links a { padding: 12px 0 !important; }
body.startpage .lgm-main { padding-bottom: 0 !important; }
body.startpage #lgm #content_area .module-type-text ~ .n { display: none !important; }
#lgm #content_area h2:has(+ p a[href$="/contacto/"]) + p { margin: -1px 0 0 !important; }
#lgm #content_area h2:has(+ p a[href$="/contacto/"]) + p ~ * { display: none !important; }                            
.lgm-footer-links, .lgm-footer-links #contentfooter, .lgm-footer-links .leftrow { flex-wrap: nowrap !important; white-space: nowrap; }
.lgm-footer-links #contentfooter { flex: 0 0 auto; }
body.startpage #lgm #content_area .module-type-text { padding-bottom: 0 !important; margin-bottom: 0 !important; }
@media (max-width: 760px) { .lgm-footer-links, .lgm-footer-links #contentfooter, .lgm-footer-links .leftrow { flex-wrap: wrap !important; white-space: normal; } }                            
/* Ajustes: imágenes y anchura de lectura */
body:not(.startpage) #lgm #content_area .module-type-imageSubtitle img { max-width: 480px !important; height: auto !important; }
body:not(.startpage) #lgm #content_area .module-type-imageSubtitle .align-container { max-width: 480px !important; }
#lgm #content_area > .sortable-matrix > .module-type-text { max-width: 820px; }