/* =========================================================
   Legal Stay – Shared Layout & Components
   To switch theme: change the theme-*.css <link> in the HTML.
   ========================================================= */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; scroll-padding-top: 72px; }

*:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
*:focus:not(:focus-visible) { outline: none; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
}

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

a { color: var(--color-accent-text, var(--color-accent-dark)); text-decoration: underline; text-underline-offset: 2px; transition: color .2s; }
a:hover { color: var(--color-accent-dark); }

/* Decorative / structural link contexts — no underline (colour handled by their own rules) */
.nav-links a,
.lang-switcher a,
footer a,
.nav-logo,
.hero-photo-caption a,
.contact-value a,
.service-card a { text-decoration: none; }

ul { list-style: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.25;
}

h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1.25rem; }
h3 { font-size: 1.15rem; margin-bottom: .5rem; }
h4 { font-size: 1rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ---------- Layout ---------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 4rem 0; }

/* ---------- NAV ---------- */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-nav-bg);
  border-bottom: 1px solid var(--color-nav-border);
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.nav-logo img { height: 44px; width: auto; }

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--color-nav-text);
  transition: color .2s;
}

.nav-links a:hover { color: var(--color-accent); }

/* Language picker */
.lang-switcher {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-left: 1.5rem;
  padding-left: 1.5rem;
  border-left: 1px solid var(--color-nav-border);
}

.lang-switcher a {
  font-size: .78rem;
  font-weight: 700;
  color: var(--color-nav-text);
  opacity: .5;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: opacity .2s, color .2s;
}

.lang-switcher a.active,
.lang-switcher a:hover { opacity: 1; color: var(--color-accent); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: .25rem;
  margin-left: auto;
}

.nav-toggle:focus,
.nav-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-nav-text);
  border-radius: 2px;
  transition: all .3s;
}

/* ---------- HERO / ABOUT ---------- */
#about {
  background: var(--color-hero-bg);
  border-bottom: 1px solid var(--color-divider);
}

.hero-inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3.5rem;
  align-items: start;
}

.hero-photo img {
  width: 100%;
  border-radius: var(--radius-img);
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}

.hero-photo-caption {
  margin-top: .75rem;
  text-align: center;
  font-size: .85rem;
  color: var(--color-muted);
}

.hero-photo-caption a {
  color: var(--color-accent-text, var(--color-accent-dark));
  font-weight: 600;
}

.hero-content h1 {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  margin-bottom: 1.25rem;
}

.hero-content h1 span { color: var(--color-accent); }

/* ---------- SERVICES ---------- */
#features { background: var(--color-section-alt); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.service-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  padding: 2rem 1.5rem;
  transition: box-shadow .25s, transform .25s;
}

.service-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.1);
  transform: translateY(-3px);
}

.service-icon {
  width: 46px;
  height: 46px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.service-icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.service-card h3 {
  color: var(--color-accent-dark);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .75rem;
}

.service-card ul li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: .5rem;
  font-size: .95rem;
}

.service-card ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

/* ---------- CONTACT ---------- */
#contact { background: var(--color-hero-bg); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 1.5rem;
}

.contact-item { margin-bottom: 1.25rem; }

.contact-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-muted);
  margin-bottom: .2rem;
  font-weight: 600;
}

.contact-value {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-text);
}

.contact-value a { color: var(--color-accent-text, var(--color-accent-dark)); }

.bank-details {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  padding: 1.4rem 1.6rem;
}

.bank-details h3 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.bank-row { margin-bottom: .75rem; }
.bank-row:last-child { margin-bottom: 0; }

.bank-row dt {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-muted);
  margin-bottom: .1rem;
}

.bank-row dd {
  font-weight: 600;
  font-size: .9rem;
  word-break: break-all;
}

/* ---------- TESTIMONIALS ---------- */
#testimonials { background: var(--color-section-alt); }

/* Grid (used in paginated variant) */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

/* Carousel */
.carousel-outer {
  overflow: hidden;
  margin-top: 1.5rem;
}

.carousel-track {
  display: flex;
  gap: 1.25rem;
  transition: transform .45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  align-items: stretch;
}

/* Card widths set by JS; this is the fallback */
.carousel-track .testimonial-card {
  flex-shrink: 0;
  flex-grow: 0;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.carousel-btn {
  background: var(--color-accent);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
  flex-shrink: 0;
  line-height: 1;
}

.carousel-btn:hover {
  background: var(--color-accent-dark);
  transform: scale(1.08);
}

.carousel-btn-toggle {
  font-size: .7rem;
  letter-spacing: -2px;
}
.carousel-btn-toggle[aria-pressed="true"] {
  background: var(--color-accent-dark);
  font-size: 1rem;
  letter-spacing: 0;
}

.carousel-counter {
  font-family: var(--font-heading);
  font-size: .9rem;
  color: var(--color-muted);
  min-width: 3.5rem;
  text-align: center;
  letter-spacing: .05em;
}

.testimonial-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-card);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.testimonial-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.testimonial-author {
  font-weight: 700;
  color: var(--color-accent-dark);
  font-size: .95rem;
}

.testimonial-date {
  font-size: .78rem;
  color: var(--color-muted);
}

.testimonial-stars {
  color: var(--color-gold);
  font-size: .85rem;
  letter-spacing: .1em;
}

.testimonial-text {
  font-size: .95rem;
  line-height: 1.65;
  color: var(--color-text);
}

/* ---------- Section headings ---------- */
.section-header { margin-bottom: 2rem; }

.section-header h2 { margin-bottom: .4rem; }

.section-header p {
  color: var(--color-muted);
  font-size: .95rem;
}

.section-divider {
  width: 44px;
  height: 3px;
  background: var(--color-accent);
  margin: .75rem 0 0;
  border-radius: 2px;
}

/* ---------- FOOTER ---------- */
footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 2rem 0;
  font-size: .85rem;
  border-top: 3px solid var(--color-accent);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  text-align: center;
}

footer a { color: var(--color-footer-text); opacity: .65; }
footer a:hover { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 210px 1fr; gap: 2rem; }
  .services-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-nav-bg);
    padding: 1rem 1.5rem 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--color-nav-border);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    z-index: 99;
    align-items: flex-start;
  }

  .nav-links.open { display: flex; }

  .lang-switcher {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    padding-top: .75rem;
    border-top: 1px solid var(--color-divider);
    width: 100%;
  }

  .nav-toggle { display: flex; }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo { max-width: 220px; margin: 0 auto; }

  .services-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  section { padding: 2.5rem 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .services-grid .service-card:hover,
  .testimonial-card:hover { transform: none; box-shadow: none; }
  .carousel-track { transition: none; }
  a { transition: none; }
}
