/* =========================================================
   Esla S.A. — Investor Relations
   Material 3 structural system (type scale, shape, elevation,
   state layers, spacing rhythm) applied to the ORIGINAL Esla
   colour palette — navy / blue / aqua, unchanged.
   ========================================================= */

:root {
  /* ── Original brand palette (unchanged) ── */
  --navy:        #072146;
  --blue:        #1464a5;
  --blue-light:  #e9f7f7;
  --ink:         #121212;
  --muted:       #666;
  --line:        #d3d3d3;
  --surface:     #f4f5f6;
  --white:       #fff;
  --aqua:        #2dcccd;
  --medium-blue: #004481;
  --footer-bg:   #061a38;
  --accent-orange: #db752f;

  /* ── Type family (Apex system sans) ── */
  --md-font: "Open Sans", "Segoe UI", "Segoe UI Web (West European)",
             -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", Arial, sans-serif;

  /* ── State layer opacities (MD3) ── */
  --md-state-hover:   .08;
  --md-state-focus:   .10;
  --md-state-pressed: .10;

  /* ── Shape scale (MD3 corner radii) ── */
  --md-shape-xs:   4px;
  --md-shape-sm:   8px;
  --md-shape-md:   12px;   /* cards */
  --md-shape-lg:   16px;   /* large surfaces */
  --md-shape-xl:   28px;
  --md-shape-full: 999px;  /* chips, search, indicator */

  /* ── Elevation (MD3 levels — soft, low) ── */
  --md-elev-1: 0 1px 2px rgba(7,33,70,.06), 0 1px 3px rgba(7,33,70,.10);
  --md-elev-2: 0 1px 2px rgba(7,33,70,.06), 0 2px 6px rgba(7,33,70,.10);
  --md-elev-3: 0 2px 4px rgba(7,33,70,.07), 0 6px 12px rgba(7,33,70,.11);

  /* ── Type scale (MD3 roles) ── */
  --md-display-s:  400 36px/44px var(--md-font);
  --md-headline-l: 700 32px/40px var(--md-font);
  --md-headline-m: 700 28px/36px var(--md-font);
  --md-headline-s: 700 24px/32px var(--md-font);
  --md-title-l:    600 22px/28px var(--md-font);
  --md-title-m:    600 16px/24px var(--md-font);
  --md-body-l:     400 16px/24px var(--md-font);
  --md-body-m:     400 14px/20px var(--md-font);
  --md-body-s:     400 12px/16px var(--md-font);
  --md-label-l:    600 14px/20px var(--md-font);
  --md-label-m:    600 12px/16px var(--md-font);
  --md-label-s:    600 11px/16px var(--md-font);
  --md-tracking-label: .06em;

  /* ── Spacing rhythm (4dp grid) ── */
  --md-content-max: 1160px;
  --md-topbar-h:    74px;

  /* ── Motion ── */
  --md-ease-standard: cubic-bezier(.2, 0, 0, 1);
  --md-dur-short:  120ms;
  --md-dur-medium: 260ms;
}

/* =========================================================
   Base reset & element defaults
   ========================================================= */
* { box-sizing: border-box; }

/* Scrolling is animated in JavaScript (see main.js). Keeping this on
   'auto' prevents the browser's native smooth scroll from intercepting
   and fighting the scripted animation. */
html { scroll-behavior: auto; }

body {
  margin: 0;
  font-family: var(--md-font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

a { color: var(--blue); }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -.01em;
}
h2 { font: var(--md-headline-l); }
h3 { font: var(--md-title-l); }
p { margin: 0; }

:where(button, input, select, textarea) { font: inherit; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--md-shape-xs);
}

.container {
  width: min(var(--md-content-max), calc(100% - 48px));
  margin-inline: auto;
}

.section {
  padding: 88px 0;
  scroll-margin-top: calc(var(--md-topbar-h) + 12px);
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px; left: 12px;
  padding: 10px 16px;
  color: var(--white);
  background: var(--blue);
  border-radius: var(--md-shape-sm);
  font: var(--md-label-l);
  transform: translateY(-160%);
  transition: transform var(--md-dur-medium) var(--md-ease-standard);
}
.skip-link:focus { transform: none; }

/* Eyebrow — small uppercase tag */
.eyebrow {
  margin-bottom: 12px;
  color: var(--blue);
  font: var(--md-label-m);
  letter-spacing: var(--md-tracking-label);
  text-transform: uppercase;
}

/* =========================================================
   Top app bar (navy — original palette)
   ========================================================= */
.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  color: var(--white);
  background: rgba(7, 33, 70, .96);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  display: flex;
  min-height: var(--md-topbar-h);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font: var(--md-title-m);
  color: var(--white);
  text-decoration: none;
}
.brand > span { white-space: nowrap; }
.brand strong { color: var(--aqua); font-weight: 700; }

.brand-mark {
  display: grid;
  width: 36px; height: 36px;
  place-items: center;
  color: var(--navy);
  background: var(--aqua);
  border-radius: var(--md-shape-md);
  font-weight: 700;
  font-size: 1.05rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
nav a {
  position: relative;
  display: inline-flex;
  padding: 8px 12px;
  align-items: center;
  gap: 7px;
  color: #d4edfc;
  font: var(--md-label-l);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--md-shape-full);
  transition: color var(--md-dur-short) var(--md-ease-standard),
              background var(--md-dur-short) var(--md-ease-standard);
}
nav a svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--white);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
nav a:hover,
nav a:focus-visible {
  color: var(--white);
  background: rgba(255, 255, 255, .10);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  padding: 8px;
  background: none;
  border: 0;
  border-radius: var(--md-shape-full);
  color: var(--white);
  cursor: pointer;
}
.menu-toggle span:not(.sr-only) {
  display: block;
  width: 22px; height: 2px;
  margin: 5px;
  background: currentColor;
  border-radius: 2px;
}

/* =========================================================
   About / company overview
   ========================================================= */
.about {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--medium-blue);
}
.about::before {
  position: absolute;
  z-index: -1;
  inset: -48px;
  content: "";
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .24), transparent 28%),
    radial-gradient(circle at 82% 70%, rgba(7, 33, 70, .42), transparent 35%),
    linear-gradient(125deg, var(--aqua), var(--blue) 58%, var(--medium-blue));
  background-size: cover;
  filter: blur(18px);
  transform: scale(1.08);
}
.about-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}
.about-grid::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  content: "";
  background: rgba(255, 255, 255, .72);
  transform: translateX(-.5px);
}
.about .eyebrow { color: var(--white); }
.about-grid h2 { max-width: 14ch; color: var(--white); font: var(--md-headline-l); }
.about-grid > div > p:not(.eyebrow) {
  margin-top: 16px;
  font: var(--md-body-l);
  color: var(--white);
  text-align: justify;
  text-justify: inter-word;
}
.about-grid br { display: none; }

.about-copy {
  padding: 28px 32px;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--white);
  font: var(--md-body-m);
}
.about-copy p {
  color: var(--white);
  font: var(--md-body-m);
  text-align: justify;
  text-justify: inter-word;
}
.about-copy p + p { margin-top: 16px; }
.about-copy em { color: var(--white); font-style: italic; }

/* =========================================================
   Documents library
   ========================================================= */
.documents { background: var(--surface); }

.section-heading {
  display: flex;
  margin-bottom: 40px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.section-heading h2 { font: var(--md-headline-m); }
.section-heading > div > p:last-child {
  margin-top: 10px;
  color: var(--muted);
  font: var(--md-body-m);
}

/* MD3 search field — pill */
.search {
  display: flex;
  width: min(340px, 100%);
  height: 48px;
  padding: 0 18px;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--md-shape-full);
  transition: border-color var(--md-dur-short) var(--md-ease-standard),
              box-shadow var(--md-dur-short) var(--md-ease-standard);
}
.search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(45, 204, 205, .22);
}
.search svg {
  width: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
}
.search input {
  width: 100%;
  color: var(--ink);
  background: none;
  border: 0;
  outline: 0;
  font: var(--md-body-m);
}
.search input::placeholder { color: var(--muted); }

.document-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

article {
  max-height: clamp(500px, 75vh, 600px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* MD3 outlined card */
.document-card {
  position: relative;
  padding: 32px;
  scroll-margin-top: calc(var(--md-topbar-h) + 24px);
  background: var(--white);
  border: 1px solid transparent;
  border-radius: var(--md-shape-md);
  transition: box-shadow var(--md-dur-medium) var(--md-ease-standard),
              transform var(--md-dur-medium) var(--md-ease-standard),
              border-color var(--md-dur-short) var(--md-ease-standard);
}
.document-card:hover {
  transform: translateY(-2px);
  border-color: var(--aqua);
  box-shadow: var(--md-elev-2);
}

.card-top {
  display: flex;
  margin-bottom: 24px;
  align-items: center;
  justify-content: space-between;
}

.category-icon {
  display: grid;
  width: 44px; height: 44px;
  place-items: center;
  color: var(--navy);
  background: var(--aqua);
  border-radius: var(--md-shape-md);
  font-weight: 800;
  font-size: 1.1rem;
}
.category-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Small label pill (file type) */
.file-type {
  display: inline-flex;
  padding: 4px 10px;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--md-shape-full);
  font: var(--md-label-s);
  letter-spacing: var(--md-tracking-label);
  text-transform: uppercase;
}
.file-type svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.document-card > h3 { font: var(--md-title-l);  }
.document-card > p {
  min-height: 48px;

  margin-top: 8px;
  color: var(--muted);
  font: var(--md-body-m);
}

/* Announcements — news feed */
.announcement-heading {
  display: flex;
  margin-bottom: 24px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.announcement-heading .eyebrow { margin-bottom: 8px; }
.announcement-heading h3 { font: var(--md-headline-s); }
.announcement-heading p:last-child {
  margin-top: 8px;
  color: var(--muted);
  font: var(--md-body-m);
}

.news-feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.news-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--md-shape-md);
  font: var(--md-body-m);
}

.news-card {
  display: flex;
  min-width: 0;
  padding: 22px;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--md-shape-md);
}

.news-meta {
  display: flex;
  margin-bottom: 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--blue);
  font: var(--md-label-s);
  letter-spacing: var(--md-tracking-label);
  text-transform: uppercase;
}
.news-meta span { color: var(--muted); }

.news-card h4 {
  margin: 0 0 8px;
  font: var(--md-title-m);
  color: var(--ink);
}
.news-card > p {
  color: var(--muted);
  font: var(--md-body-m);
}

.news-attachment {
  display: grid;
  margin-top: 20px;
  padding: 12px 14px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--md-shape-sm);
  text-decoration: none;
  transition: border-color var(--md-dur-short) var(--md-ease-standard);
}
.news-attachment:hover { border-color: var(--aqua); }
.attachment-icon {
  padding: 5px 7px;
  color: var(--white);
  background: var(--blue);
  border-radius: var(--md-shape-xs);
  font: var(--md-label-s);
}
.news-attachment > span:nth-child(2) { display: grid; min-width: 0; }
.news-attachment strong {
  overflow: hidden;
  font: var(--md-label-l);
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-attachment small { color: var(--muted); font: var(--md-body-s); }

/* File lists — hairline-separated rows */
.file-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.file-list + .file-list { margin-top: 0; border-top: 0; }

.file-list a {
  display: flex;
  padding: 14px 8px;
  margin: 0 -8px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: var(--md-shape-sm);
  text-decoration: none;
  transition: background var(--md-dur-short) var(--md-ease-standard);
}
.file-list a:hover,
.file-list a:focus-visible {
  background: rgba(20, 100, 165, .06);
  text-decoration: none;
}
.file-list li > span { display: block; padding: 14px 0; }
.file-list a > span:first-child { display: grid; }
.file-list strong { color: var(--ink); font: var(--md-label-l); }
.file-list small { margin-top: 2px; color: var(--muted); font: var(--md-body-m); }

.view-file {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font: var(--md-label-l);
}
.view-file::before {
  width: 16px;
  height: 16px;
  content: "";
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M6 2h8l4 4v16H6zM14 2v5h5M8.5 17c2.5-4 3.3-8 2.5-9 0 3 2 7 5 8-2-1-6-.4-7.5 1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.file-list a:hover .view-file { text-decoration: underline; }

.no-results {
  padding: 48px;
  color: var(--muted);
  text-align: center;
  font: var(--md-body-l);
}

/* =========================================================
   Contact — navy block (original palette)
   ========================================================= */
.contact-card {
  display: grid;
  padding: 56px;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  color: var(--white);
  background: var(--navy);
  border-radius: var(--md-shape-lg);
  box-shadow: var(--md-elev-2);
}
.contact-card .eyebrow { color: var(--aqua); }
.contact-card h2 { color: var(--white); font: var(--md-headline-m); }
.contact-card > div > p:last-child {
  max-width: 46ch;
  margin-top: 16px;
  color: #aebdd0;
  font: var(--md-body-l);
}

.contact-details {
  display: grid;
  gap: 24px;
  margin: 0;
  justify-items: end;
  text-align: right;
  font-style: normal;
}
.contact-details div { display: grid; gap: 6px; }
.contact-details span {
  color: #8295ad;
  font: var(--md-label-s);
  letter-spacing: var(--md-tracking-label);
  text-transform: uppercase;
}
.contact-details strong,
.contact-details a {
  color: var(--white);
  font: var(--md-title-m);
  text-decoration: none;
}
.contact-details .map-link {
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.contact-details a:hover,
.contact-details a:focus-visible { color: var(--aqua); text-decoration: underline; }

/* =========================================================
   Footer
   ========================================================= */
footer {
  padding: 28px 0;
  color: #b8c9dc;
  background: var(--footer-bg);
  font: var(--md-body-m);
}
.footer-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer-wrap p {
  display: flex;
  margin: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.website-credit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.website-credit img {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.footer-wrap a { color: #bac7d7; text-decoration: none; }
.footer-wrap a:hover { color: var(--white); text-decoration: underline; }

.footer-wrap .website_link,
.footer-wrap .website_link:visited {
  display: inline-flex;
  align-items: center;
  color: var(--accent-orange);
  padding: 0 4px;
  border-radius: var(--md-shape-xs);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--md-dur-short) var(--md-ease-standard),
              background var(--md-dur-short) var(--md-ease-standard);
}
.footer-wrap .website_link img {
  width: 25px;
  height: 19px;
  flex: 0 0 auto;
}
.footer-wrap .website_link:hover,
.footer-wrap .website_link:focus-visible {
  color: var(--navy);
  background: var(--accent-orange);
  text-decoration: underline;
}

.back-to-top {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  min-height: 48px;
  padding: 12px 18px;
  align-items: center;
  gap: 8px;
  color: var(--white);
  background: var(--blue);
  border: 0;
  border-radius: var(--md-shape-full);
  box-shadow: var(--md-elev-3);
  font: var(--md-label-l);
  cursor: pointer;
  transition: background var(--md-dur-short) var(--md-ease-standard),
              transform var(--md-dur-short) var(--md-ease-standard);
}
.back-to-top[hidden] { display: none; }
.back-to-top:hover { background: var(--medium-blue); transform: translateY(-2px); }
.back-to-top span:first-child { font-size: 1.2rem; line-height: 1; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-grid::after { display: none; }
  .about-copy { padding: 32px 0 0; border-top: 1px solid rgba(255, 255, 255, .72); }
  .news-feed { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .section { padding: 64px 0; }

  .menu-toggle { display: block; }

  nav {
    position: absolute;
    top: var(--md-topbar-h);
    right: 0; left: 0;
    display: none;
    padding: 8px 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--navy);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    box-shadow: var(--md-elev-2);
  }
  nav.open { display: flex; }
  nav a {
    padding: 14px calc((100vw - min(var(--md-content-max), calc(100vw - 48px))) / 2);
    border-radius: 0;
    white-space: normal;
  }

  .section-heading { flex-direction: column; align-items: stretch; }
  .search { width: 100%; }

  .contact-card {
    padding: 40px;
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .contact-details { justify-items: start; text-align: left; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 32px, var(--md-content-max)); }
  .document-grid { grid-template-columns: 1fr; }
  .document-card { padding: 24px; }
  .contact-card { padding: 32px 24px; }
  .file-list a { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer-wrap { flex-direction: column; align-items: flex-start; }
  .back-to-top { min-width: 48px; padding: 12px; justify-content: center; }
  .back-to-top span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}