/* ==========================================================================
   Óptica Abraxas — site styles
   Fonts: Montserrat (headings/UI), Roboto (body)
   ========================================================================== */

:root {
  /* The brand blue is hue 195°. --accent is the original pale tint: white on
     it is only 1.9:1, so nothing carrying text or meaning uses it. It is kept
     because the service-icon PNGs have it baked in and theme-color matches.
     Buttons, links and icons use --accent-deep — same hue, 4.7:1 on white. */
  --accent:        #99c3d1;
  --accent-deep:   #3b7c91;
  --accent-deeper: #2f6376;
  --rule:          #a0cbec;
  --ink:           #575757;
  --head:          #323232;
  --dark:          #252525;
  --gray:          #f0f0f0;
  --band:          #0670bf;
  --white:         #fff;

  --font-head: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Roboto', 'Helvetica Neue', Arial, sans-serif;

  --shell: 1140px;
  --topbar-h: 54px;
}

/* --------------------------------------------------------------- base --- */

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 400;
  color: var(--head);
  text-transform: uppercase;
  line-height: 1.3;
  margin: 0 0 .6em;
}

h1 { font-size: 28px; }
h2 { font-size: 25px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-deep); text-decoration: none; transition: color .18s ease; }
a:hover, a:focus-visible { color: var(--accent-deeper); text-decoration: underline; }

/* Links inside running text carry an underline so they don't rely on colour */
.prose a, .lead a { text-decoration: underline; text-underline-offset: 2px; }

strong, b { font-weight: 700; color: #4a4a4a; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
  color: var(--head);
  background: var(--gray);
  padding: 1px 6px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; }

:focus-visible {
  outline: 2px solid var(--band);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--dark);
  color: var(--white);
  padding: 12px 20px;
}
.skip-link:focus {
  left: 0;
  color: var(--white);
}

.container { max-width: var(--shell); }

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

/* ------------------------------------------------------------- topbar --- */

.topbar {
  background: var(--dark);
  color: #d8d8d8;
  font-size: 14px;
  padding: 10px 0;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar a { color: #d8d8d8; }
.topbar a:hover { color: var(--white); }

/* The rule above is more specific than .btn, so the phone button would
   inherit the bar's dimmed grey and drop to 3.3:1. Keep it white. */
.topbar a.btn,
.topbar a.btn:hover { color: var(--white); }

.topbar__mail {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

/* Language switch ------------------------------------------------------ */

.langswitch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  /* It is a <p>, so reboot gives it a bottom margin that would push it half a
     margin above the e-mail and the phone button. Zero it out. */
  margin: 0;
  font-family: var(--font-head);
  font-size: 13px;
}

.langswitch a {
  padding: 3px 8px;
  border-radius: 2px;
  line-height: 1;
}

.langswitch [aria-current='true'] {
  color: var(--white);
  background: rgba(255, 255, 255, .14);
  pointer-events: none;
}

.langswitch__sep { color: #6d6d6d; }

/* -------------------------------------------------------------- button --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--accent-deep);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 14px;
  line-height: 1;
  text-transform: uppercase;
  padding: 15px 25px 16px;
  border: 0;
  transition: background .18s ease;
}

.btn:hover, .btn:focus-visible {
  background: var(--accent-deeper);
  color: var(--white);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--white);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .16); }

/* ------------------------------------------------------------ masthead --- */

.masthead {
  background: var(--white);
  padding: 14px 0;
  position: relative;
  z-index: 20;
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.masthead__logo { flex: 0 0 auto; }
.masthead__logo img { width: 74px; display: block; }

.masthead__nav { margin-left: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  font-family: var(--font-head);
  font-size: 15px;
  color: var(--head);
  text-transform: uppercase;
  padding: 6px 0;
  display: block;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--accent-deep);
  text-decoration: none;
}
.nav a[aria-current='page'] { border-bottom-color: var(--accent-deep); }

.social {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-deep);
  color: var(--white);
  transition: background .18s ease;
}
.social a:hover { background: var(--accent-deeper); }
.social svg { width: 15px; height: 15px; fill: currentColor; }

.masthead__social { flex: 0 0 auto; margin-left: 26px; }

/* Mobile menu toggle */

.navtoggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--head);
}
.navtoggle svg { width: 26px; height: 26px; fill: currentColor; display: block; }
.navtoggle .navtoggle__close { display: none; }
.navtoggle[aria-expanded='true'] .navtoggle__open { display: none; }
.navtoggle[aria-expanded='true'] .navtoggle__close { display: block; }

/* ---------------------------------------------------------------- hero --- */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
  padding: 90px 0;
  background: #0c3f65 center / cover no-repeat;
  overflow: hidden;
  isolation: isolate;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: -1;
}

/* Home hero: three photos cross-fading, pure CSS */
.hero--slides { background-image: none; }

.hero__slide {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: center / cover no-repeat;
  opacity: 0;
  animation: heroFade 18s infinite;
}
.hero__slide:nth-child(1) { animation-delay:  0s; }
.hero__slide:nth-child(2) { animation-delay:  6s; }
.hero__slide:nth-child(3) { animation-delay: 12s; }

@keyframes heroFade {
  0%      { opacity: 0; }
  4%, 33% { opacity: 1; }
  38%     { opacity: 0; }
  100%    { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__slide { animation: none; opacity: 0; }
  .hero__slide:nth-child(1) { opacity: 1; }
  html { scroll-behavior: auto; }
}

.hero__panel {
  background: rgba(0, 0, 0, .56);
  color: var(--white);
  text-align: center;
  padding: 44px 40px 48px;
  max-width: 900px;
  margin: 0 auto;
}

.hero__panel h1 { color: var(--white); margin-bottom: .55em; }

.hero__panel p {
  font-size: 17px;
  font-weight: 300;
  margin: 0;
}

/* Jump list at the top of the combined legal page */
.toc {
  background: var(--gray);
  padding: 20px 26px;
  margin-bottom: 40px;
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li + li { margin-top: 8px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Anchored sections should not land under a heading's own top margin */
.prose h2[id] { scroll-margin-top: 24px; margin-top: 1.8em; }
.prose h2[id]:first-of-type { margin-top: 0; }

/* Compact heading band, used by the legal pages instead of a photo hero */
.pagehead {
  background: var(--gray);
  padding: 52px 0 46px;
  text-align: center;
}
.pagehead h1 { margin-bottom: 0; }
.pagehead .rule { margin-top: 20px; }

/* ------------------------------------------------------------ sections --- */

.section { padding: 70px 0; }
.section--tight { padding: 50px 0; }
.section--gray { background: var(--gray); }

/* Section with a washed-out photo behind it */
.section--photo {
  position: relative;
  background: center / cover no-repeat;
  isolation: isolate;
}
.section--photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .7);
  z-index: -1;
}

.section__head { text-align: center; margin-bottom: 46px; }
.section__head h2, .section__head h3 { margin-bottom: 0; }

.rule {
  width: 90px;
  height: 2px;
  background: var(--rule);
  border: 0;
  margin: 18px auto 0;
  opacity: 1;
}

.rule--start { margin-left: 0; margin-right: 0; }

/* Left-aligned block heading used on the interior pages */
.block__head { margin-bottom: 30px; }
.block__head h2, .block__head h3 { margin-bottom: 0; }

.lead {
  font-size: 17px;
  font-weight: 300;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}

.prose li { margin-bottom: .7em; }
.prose ul { padding-left: 1.15em; }
.prose ul.plain { list-style: none; padding-left: 0; }
.prose ul.plain li { padding-left: 1.15em; position: relative; }
.prose ul.plain li::before {
  content: '';
  position: absolute;
  left: 0; top: .6em;
  width: 6px; height: 6px;
  background: var(--accent-deep);
  border-radius: 50%;
}

/* ------------------------------------------------------------ services --- */

.services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 24px;
  text-align: center;
}

.services img {
  width: 83px;
  height: 83px;
  margin: 0 auto 18px;
  display: block;
}

.services h3 { font-size: 20px; margin: 0; }

/* -------------------------------------------------------------- brands --- */

.brands {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 34px 30px;
  align-items: center;
}

/* The supplied logos are baked onto opaque backgrounds (mostly white, red for
   Ray-Ban), so each one sits in its own white tile rather than floating. */
.brands li {
  list-style: none;
  display: grid;
  place-items: center;
  min-height: 96px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid #e6e6e6;
}

.brands img {
  display: block;
  max-height: 58px;
  width: auto;
}

/* ------------------------------------------------------------ CTA band --- */

.band {
  position: relative;
  background: var(--band) center / cover no-repeat;
  padding: 100px 0 60px;
  text-align: center;
  isolation: isolate;
}
.band::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: -1;
}
.band--flat { padding: 70px 0; }
.band--flat::after { background: none; }

.band p {
  font-family: var(--font-head);
  font-size: 18px;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--white);
  max-width: 900px;
  margin: 0 auto 28px;
}
.band p:last-of-type { margin-bottom: 28px; }

/* ------------------------------------------------------------ locations --- */

.place {
  background: var(--white);
  border: 1px solid #e4e4e4;
  padding: 30px 30px 32px;
  height: 100%;
}

.place h3 {
  font-size: 18px;
  margin-bottom: 18px;
}

.place__list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}

.place__list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  line-height: 1.5;
}

.place__list svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 4px;
  fill: var(--accent-deep);
}

.place__list a { color: var(--ink); }
.place__list a:hover { color: var(--accent-deep); }

/* Media pair: text on one side, photo on the other */
.media__img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  display: block;
}

.gallery3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.gallery3 img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

/* -------------------------------------------------------------- footer --- */

.footer {
  background: var(--white);
  padding: 60px 0 50px;
  border-top: 1px solid #ececec;
}

.footer__title {
  font-size: 18px;
  text-align: center;
  margin-bottom: 34px;
}

.footer h3 {
  font-size: 16px;
  margin-bottom: 15px;
}

.footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
}
.footer__list li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-bottom: 11px;
}
.footer__list svg {
  flex: 0 0 auto;
  width: 15px; height: 15px;
  margin-top: 4px;
  fill: var(--accent-deep);
}
.footer__list a { color: var(--ink); }
.footer__list a:hover { color: var(--accent-deep); }

.social--center { justify-content: center; margin-top: 34px; }

.colophon {
  background: var(--dark);
  color: #a5a5a5;
  font-size: 13px;
  padding: 18px 0;
}

.colophon__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
}

.colophon a { color: #d8d8d8; }
.colophon a:hover { color: var(--white); }
.colophon a[aria-current='page'] { color: var(--white); }

/* ---------------------------------------------------------- responsive --- */

@media (max-width: 991.98px) {
  .masthead__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid #ececec;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .1);
    display: none;
    margin-left: 0;
  }
  .masthead__nav.is-open { display: block; }

  .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
  }
  .nav a {
    padding: 13px 20px;
    border-bottom: 1px solid #f2f2f2;
  }
  .nav a[aria-current='page'] { border-bottom-color: #f2f2f2; }
  .nav li:last-child a { border-bottom: 0; }

  .navtoggle { display: block; }
  .masthead__social { display: none; }

  .services { grid-template-columns: repeat(2, 1fr); }
  .brands { grid-template-columns: repeat(3, 1fr); }
  .gallery3 { grid-template-columns: 1fr; }
  .gallery3 img { height: 220px; }
  .media__img { min-height: 260px; }
}

@media (max-width: 767.98px) {
  h1 { font-size: 23px; }
  h2 { font-size: 21px; }
  h3 { font-size: 18px; }

  .hero { min-height: 420px; padding: 60px 0; }
  .hero__panel { padding: 30px 22px 34px; }

  .section { padding: 48px 0; }
  .band { padding: 60px 0 45px; }
  .band p { font-size: 16px; }

  /* Stack the top bar: address line first, then language + phone side by side */
  .topbar { font-size: 13px; }
  .topbar__inner { justify-content: space-between; gap: 10px; }
  .topbar__mail { order: -1; width: 100%; justify-content: center; }
  .topbar .btn { padding: 11px 16px 12px; font-size: 13px; }

  .masthead__logo img { width: 58px; }

  .brands { grid-template-columns: repeat(2, 1fr); }
  .footer { padding: 45px 0 40px; }
}

/* ------------------------------------------------------------- printing --- */

@media print {
  .topbar, .masthead, .band, .hero, .footer .social { display: none; }
  body { color: #000; font-size: 12pt; }
}
