/* Shared visual theme for the full, navigable EP proposal.
   Loaded after the original Astro stylesheet and preview.css.
   Calculator scripts and their state classes remain untouched. */
:root {
  --ep-navy: #0b1b31;
  --ep-ivory: #f7f3e9;
  --ep-gold: #c4a77a;
  --ep-gold-ink: #80633c;
  --ep-paper: #fffdf8;
  --ep-soft: #eee7dc;
  --ep-line: #d9cebb;
  --ep-body-ink: #26364b;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", Arial, sans-serif;
  --background: var(--ep-ivory);
  --foreground: var(--ep-body-ink);
  --card: var(--ep-paper);
  --card-foreground: var(--ep-body-ink);
  --popover: var(--ep-paper);
  --popover-foreground: var(--ep-body-ink);
  --primary: var(--ep-navy);
  --primary-foreground: var(--ep-ivory);
  --secondary: #20344e;
  --secondary-foreground: var(--ep-ivory);
  --muted: var(--ep-soft);
  --muted-foreground: #5a616c;
  /* Dark gold is legible on light paper; decorative gold stays separate. */
  --accent: var(--ep-gold-ink);
  --accent-foreground: var(--ep-ivory);
  --border: var(--ep-line);
  --input: var(--ep-paper);
  --ring: var(--ep-gold-ink);
  --radius: .85rem;
}

body {
  background: var(--ep-ivory);
  color: var(--ep-body-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

:is(h1, h2, h3, h4, h5, h6), .font-serif, .font-cormorant {
  font-family: var(--font-serif);
}

main :is(h1, h2, h3) {
  text-wrap: balance;
}

main h2 {
  letter-spacing: -.025em;
}

:is(button, input, select, textarea),
main a.inline-flex,
.ep-preview-floating {
  font-family: var(--font-sans);
}

button, main a.inline-flex {
  font-weight: 700;
}

:is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--ep-gold-ink);
  outline-offset: 4px;
}

body > header {
  background: var(--ep-ivory);
  color: var(--ep-navy);
  border-bottom: 1px solid var(--ep-line);
  box-shadow: 0 3px 18px #0b1b3108;
}

/* The supplied logo is embedded unchanged; the surrounding layout scales it. */
body > header nav {
  min-height: 80px;
  padding-top: 10px;
  padding-bottom: 10px;
}

#mobile-menu-btn {
  min-width: 44px;
  min-height: 44px;
}

body > main {
  padding-top: 80px;
}

.ep-brand-link {
  flex-direction: row;
  gap: 12px;
  text-decoration: none;
}

.ep-brand-logo {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  object-fit: contain;
}

.ep-brand-wordmark > div:first-child {
  font-size: 12px;
  line-height: 1.3;
  margin-bottom: 3px;
}

.ep-brand-wordmark > div:last-child {
  font-size: 29px;
  white-space: nowrap;
}

.ep-footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.ep-footer-brand h3 {
  margin: 0;
}

.ep-footer-logo {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border-radius: 50%;
  object-fit: contain;
}

.container .logo {
  font-family: var(--font-serif);
}

.ep-language-logo {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: contain;
  margin: 0 auto 16px;
}

#ep-design-hero .ep-logo-seal {
  position: absolute;
  right: -6px;
  bottom: 30px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 16px 40px #0b1b3166;
  transform: translateZ(58px);
}

#ep-design-hero .ep-logo-seal img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
}

/* Shared photo composition for the interior practice pages. */
main > #hero.ep-service-hero {
  display: block;
  min-height: 0;
  overflow: hidden;
}

main > #hero.ep-service-hero > .ep-service-layout {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding: 80px 40px;
}

.ep-service-copy {
  min-width: 0;
  text-align: left;
}

main > #hero.ep-service-hero h1 {
  font-size: clamp(2.6rem, 3.6vw, 3.65rem);
  line-height: 1.08;
}

.ep-service-copy > p {
  max-width: 560px;
  margin-left: 0;
  margin-right: 0;
}

.ep-service-copy > div {
  justify-content: flex-start;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.ep-service-copy a.inline-flex {
  padding: 15px 21px;
  font-size: 14px;
}

.ep-service-media {
  position: relative;
  min-width: 0;
  padding: 0 12px 12px 0;
}

.ep-service-media::before {
  content: "";
  position: absolute;
  inset: 22px 0 0 22px;
  border: 1px solid #c4a77a80;
  border-radius: 22px;
}

.ep-editorial-photo {
  position: relative;
  aspect-ratio: 4 / 4.5;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 28px 60px #030c1840;
}

main > #hero .ep-editorial-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ep-editorial-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, #0b1b3126);
}

.ep-practice-overview { padding: 76px 24px; background: var(--ep-ivory); }
.ep-practice-inner { max-width: 1160px; margin: 0 auto; }
.ep-practice-overview h2 { margin: 0 0 38px; font-size: clamp(36px, 4vw, 48px); color: var(--ep-navy); text-align: center; }
.ep-practice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ep-practice-card { display: block; overflow: hidden; border: 1px solid var(--ep-line); background: var(--ep-paper); color: var(--ep-body-ink); text-decoration: none; }
.ep-practice-photo { aspect-ratio: 4 / 3; overflow: hidden; }
.ep-practice-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-practice-content { padding: 24px; }
.ep-practice-content h3 { margin: 0 0 12px; font-size: 29px; line-height: 1.1; color: var(--ep-navy); }
.ep-practice-content p { margin-bottom: 22px; font-size: 15px; line-height: 1.65; }
.ep-practice-content > span { color: var(--ep-gold-ink); font-size: 14px; font-weight: 700; }

main > #hero.ep-about-hero > div {
  gap: 56px;
}

main > #hero.ep-about-hero img:not([data-ep-logo]) {
  width: 100%;
  height: 440px;
  object-fit: cover;
}

@media (max-width: 1279px) {
  body > header nav > .hidden.md\:flex { display: none !important; }
  #mobile-menu-btn { display: block !important; }
  #mobile-menu:not(.hidden) { display: block !important; }
}

@media (max-width: 800px) {
  #ep-design-hero .ep-hero {
    grid-template-columns: 1fr;
    padding: 48px 24px 36px;
    gap: 30px;
  }
  #ep-design-hero h1 { font-size: clamp(40px, 7.5vw, 54px); }
  #ep-design-hero .ep-depth-scene { width: 100%; max-width: 500px; margin: auto; }
  #ep-design-hero .ep-photo-stack { aspect-ratio: 4 / 3; }
  #ep-design-hero .ep-hero-actions > a { min-height: 48px; }
  main > #hero.ep-service-hero > .ep-service-layout {
    grid-template-columns: 1fr;
    padding: 52px 24px;
    gap: 36px;
  }
  .ep-service-media { width: 100%; max-width: 540px; margin: 0 auto; }
  .ep-editorial-photo { aspect-ratio: 16 / 10; }
  main > #hero.ep-about-hero > div { grid-template-columns: 1fr; gap: 30px; }
  main > #hero.ep-about-hero .hidden.md\:block { display: block; }
  main > #hero.ep-about-hero img:not([data-ep-logo]) { height: 280px; }
  .ep-practice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  #areas-de-practica .practice-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  #areas-de-practica .practice-card { min-width: 0; }
  #areas-de-practica .practice-card-img { height: 220px; }
  #areas-de-practica .practice-card-content { padding: 24px; }
  #areas-de-practica .practice-card-title { font-size: 28px; }
  #areas-de-practica .practice-card-description { font-size: 16px; line-height: 1.65; }
  .ep-practice-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .ep-brand-link { gap: 9px; }
  .ep-brand-logo { width: 50px; height: 50px; flex-basis: 50px; }
  .ep-brand-wordmark > div:first-child { font-size: 10px; }
  .ep-brand-wordmark > div:last-child { font-size: 26px; }
  #ep-design-hero .ep-logo-seal { width: 104px; height: 104px; bottom: 22px; }
  main > #hero.ep-service-hero h1 { font-size: 38px; }
  .ep-service-copy > div { margin-top: 24px; }
  .ep-practice-grid { grid-template-columns: 1fr; }
}

body > header nav a,
body > header #mobile-menu a {
  font-family: var(--font-serif);
  color: var(--ep-navy);
}

body > header nav a:hover,
body > header #mobile-menu a:hover {
  color: var(--ep-gold-ink);
}

body > header #mobile-menu {
  background: var(--ep-ivory);
  border-color: var(--ep-line);
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
}

body > header #mobile-menu a {
  min-height: 44px;
  display: flex;
  align-items: center;
}

body > header :is(#lang-es-btn, #lang-en-btn, #lang-pt-btn,
  #lang-es-mobile, #lang-en-mobile, #lang-pt-mobile) {
  font-family: var(--font-serif);
}

/* The original page heroes receive the same navy and gold identity.
   The separate 3D homepage hero keeps its custom composition. */
main > #hero:not(:has(:where(#ep-design-hero))) {
  position: relative;
  background: var(--ep-navy);
  color: var(--ep-ivory);
  border-bottom: 1px solid var(--ep-gold);
  min-height: 420px;
}

main > #hero:not(:has(:where(#ep-design-hero))) > div:not(.absolute) {
  position: relative;
  z-index: 1;
  padding-top: clamp(48px, 6vw, 80px);
  padding-bottom: clamp(48px, 6vw, 80px);
}

main > #hero:not(:has(:where(#ep-design-hero))) h1 {
  color: var(--ep-ivory);
  font-size: clamp(2.75rem, 4.8vw, 4.3rem);
  line-height: 1.1;
  letter-spacing: -.035em;
}

main > #hero:not(:has(:where(#ep-design-hero))) p {
  color: #e4e0d8;
  line-height: 1.65;
}

main > #hero:not(:has(:where(#ep-design-hero))) .text-accent {
  color: var(--ep-gold);
}

main > #hero:not(:has(:where(#ep-design-hero))) img {
  border: 1px solid #c4a77a80;
  border-radius: 16px;
  box-shadow: 14px 14px 0 #c4a77a26;
}

main > #hero:not(:has(:where(#ep-design-hero))) a.inline-flex:not([href*="wa.me"]) {
  background: var(--ep-ivory);
  color: var(--ep-navy);
  border-color: var(--ep-gold);
}

main > #hero:not(:has(:where(#ep-design-hero))) a.inline-flex:not([href*="wa.me"]):hover {
  background: #e9ddc7;
}

/* Retain the original section boundaries and information hierarchy. */
main > section.bg-white {
  background: var(--ep-ivory);
}

main > section.bg-gray-50,
main > section.bg-muted {
  background: var(--ep-soft);
}

main > section:is(.bg-white, .bg-gray-50, .bg-muted) {
  border-color: var(--ep-line);
}

main > section > :is(.max-w-4xl, .max-w-5xl, .max-w-6xl, .max-w-7xl) {
  width: 100%;
}

/* Light content cards only: do not flatten warning or dark result panels. */
main :is(div, article, a):is(.bg-white, .bg-gray-50, .bg-muted)
  :is(h2, h3, h4) {
  text-wrap: balance;
}

main :is(div, article, a):is(.bg-white, .bg-gray-50, .bg-muted):is(
  .rounded-lg, .rounded-xl, .rounded-2xl, .rounded-3xl
) {
  border-color: var(--ep-line);
  border-radius: 14px;
  background: var(--ep-paper);
  box-shadow: 0 7px 22px #0b1b3106;
}

main a:is(.bg-white, .bg-gray-50).rounded-lg:hover {
  border-color: var(--ep-gold-ink);
  box-shadow: 0 10px 26px #0b1b3112;
}

main :is(.bg-primary, .from-primary).text-white,
main :is(.bg-primary, .from-primary).text-primary-foreground {
  color: var(--ep-ivory);
}

main :is(.bg-primary, .from-primary) .text-accent,
main .result-card .text-accent {
  color: var(--ep-gold);
}

main :is(.bg-primary, .from-primary) :is(h2, h3, h4) {
  color: var(--ep-ivory);
}

/* Green remains reserved for a visible, real WhatsApp destination. */
main a[href*="wa.me"].inline-flex,
a[data-whatsapp-button],
a[data-calculator-send] {
  background: #25d366 !important;
  color: #06351b !important;
  border-color: #25d366;
  font-family: var(--font-sans);
  font-weight: 700;
  min-height: 48px;
  border-radius: 10px;
}

main a[href*="wa.me"].inline-flex:hover,
a[data-whatsapp-button]:hover,
a[data-calculator-send]:hover {
  background: #20c35e !important;
  color: #06351b !important;
}

main a.inline-flex {
  max-width: 100%;
  white-space: normal;
  line-height: 1.5;
  text-align: center;
}

a.ep-preview-floating {
  border-radius: 50px;
}

/* Calculator styling is scoped to its existing component and form IDs. */
astro-island[component-url*="IndemnificationCalculator"] > .bg-background {
  background: var(--ep-ivory);
}

#calculator-form {
  background: var(--ep-paper);
  border: 1px solid var(--ep-line);
  border-top: 3px solid var(--ep-gold);
  border-radius: 18px;
  box-shadow: 0 12px 34px #0b1b310b;
}

astro-island[component-url*="Calculator"] :is(input, select, textarea) {
  min-height: 48px;
  min-width: 0;
  max-width: 100%;
  border-color: #87765f;
  background: var(--ep-paper);
  color: var(--ep-navy);
  border-radius: 9px;
  font-size: 16px;
  line-height: 1.5;
}

astro-island[component-url*="Calculator"] :is(input, textarea)::placeholder {
  color: #626a76;
  opacity: 1;
}

astro-island[component-url*="Calculator"] input[type="checkbox"] {
  min-height: 0;
  accent-color: var(--ep-gold-ink);
}

astro-island[component-url*="Calculator"] button {
  min-height: 44px;
  border-radius: 9px;
  line-height: 1.5;
  white-space: normal;
}

#calculator-form button.border-accent {
  border-color: var(--ep-gold-ink);
  box-shadow: inset 0 0 0 1px var(--ep-gold-ink);
}

#calculator-form button[data-event-action="calculator_calculate"] {
  background: var(--ep-navy);
  color: var(--ep-ivory);
  border: 1px solid var(--ep-navy);
  font-family: var(--font-sans);
  box-shadow: 0 6px 20px #0b1b3124;
}

#calculator-form button[data-event-action="calculator_calculate"]:hover {
  background: #20344e;
}

astro-island[component-url*="Calculator"] .result-card {
  border-color: #c4a77a80;
  border-top: 3px solid var(--ep-gold);
  border-radius: 20px;
  box-shadow: 0 16px 40px #0b1b3124;
}

/* Notices preserve yellow/blue semantic colors, headings and all text. */
main :is(.bg-yellow-50, .bg-amber-50, .bg-blue-50):is(.rounded-lg, .rounded-xl) {
  border-radius: 14px;
}

main details {
  border-color: var(--ep-line);
  border-radius: 12px;
}

main summary {
  color: var(--ep-navy);
  font-family: var(--font-serif);
  font-weight: 700;
  min-height: 44px;
}

body > footer {
  background: var(--ep-navy);
  color: var(--ep-ivory);
  border-top: 1px solid var(--ep-gold);
}

body > footer :is(h2, h3, h4),
body > footer .text-accent {
  color: var(--ep-gold);
}

body > footer a:focus-visible,
main :is(.bg-primary, .from-primary) :is(a, button):focus-visible,
#ep-design-hero :is(a, button):focus-visible {
  outline-color: var(--ep-gold);
}

@media (max-width: 640px) {
  main > #hero:not(:has(:where(#ep-design-hero))) {
    min-height: 340px;
  }

  main > #hero:not(:has(:where(#ep-design-hero))) h1 {
    font-size: clamp(2.4rem, 10vw, 3.1rem);
  }

  main > #hero:not(:has(:where(#ep-design-hero))) p {
    font-size: 1.05rem;
  }

  #calculator-form {
    padding: 24px 18px;
  }

  astro-island[component-url*="Calculator"] .result-card {
    padding: 28px 20px;
  }

  astro-island[component-url*="Calculator"] .result-card .text-6xl {
    font-size: clamp(2.1rem, 9vw, 3.75rem);
    overflow-wrap: anywhere;
  }

  main a.inline-flex {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  main :is(a, button), body > header a {
    transition-duration: .01ms;
  }
}
