/* =========================================================
   Advokatska kancelarija Saša Topić
   ========================================================= */

:root {
  --navy: #1b2a3a;
  --navy-dark: #131e2a;
  --accent: #2c5577;
  --text: #2a2f35;
  --muted: #5d6670;
  --line: #d9dde1;
  --bg: #ffffff;
  --bg-alt: #f5f6f7;

  --font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --font-head: "Source Serif 4", Georgia, "Times New Roman", serif;

  --container: 1120px;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.25;
  color: var(--navy);
  margin: 0;
}

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

a:hover {
  color: var(--navy);
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.narrow {
  max-width: 820px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Zaglavlje ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

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

.brand {
  text-decoration: none;
  color: var(--navy);
}

.brand-name {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

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

.nav-list > li {
  position: relative;
}

.nav-list a {
  display: block;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--accent);
}

.has-sub > a::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
}

.sub-nav {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  visibility: hidden;
  opacity: 0;
}

.has-sub:hover > .sub-nav,
.has-sub:focus-within > .sub-nav {
  visibility: visible;
  opacity: 1;
}

.sub-nav a {
  padding: 8px 18px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 0.95rem;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--line);
}

.lang-switch button {
  padding: 6px 10px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.lang-switch button + button {
  border-left: 1px solid var(--line);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--navy);
}

.nav-toggle-bar {
  position: relative;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after  { top: 6px; }

/* ---------- Naslovni dio ---------- */

.hero {
  background:
    linear-gradient(90deg, rgba(19, 30, 42, 0.82) 0%, rgba(19, 30, 42, 0.55) 45%, rgba(19, 30, 42, 0.2) 100%),
    url("images/hero.jpg?v=1") center right / cover no-repeat,
    var(--navy);
  color: #fff;
  padding: 140px 0 130px;
  border-bottom: 4px solid var(--accent);
}

.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 4.5vw, 3rem);
  max-width: 760px;
}

.hero-phone {
  margin: 20px 0 0;
  font-size: 1.15rem;
  color: #c9d1d9;
}

.hero-phone a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.hero-phone a:hover {
  border-bottom-color: #fff;
}

/* ---------- Sekcije ---------- */

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 32px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

#o-nama p {
  margin: 0;
  text-align: justify;
  hyphens: auto;
}

/* ---------- Oblasti rada ---------- */

.areas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.area {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  padding: 28px 28px 24px;
}

.area h3 {
  font-size: 1.25rem;
  margin-bottom: 14px;
}

.area ul {
  margin: 0;
  padding-left: 18px;
}

.area li {
  margin-bottom: 6px;
  color: var(--text);
}

.area li::marker {
  color: var(--accent);
}

.area:target {
  border-color: var(--accent);
}

/* ---------- Kontakt ---------- */

.contact {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 40px;
  align-items: start;
}

.contact-list {
  margin: 0;
}

.contact-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.contact-item:first-child {
  padding-top: 0;
}

.contact-item dt {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.contact-item dd {
  margin: 0;
  font-size: 1.1rem;
}

.contact-item a {
  text-decoration: none;
}

.map {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background: var(--bg-alt);
}

.map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Podnožje ---------- */

.site-footer {
  background: var(--navy-dark);
  color: #aab4be;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.footer-inner p {
  margin: 0;
}

.site-footer a {
  color: #d5dbe1;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

/* ---------- Responzivnost ---------- */

@media (max-width: 960px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 12px 24px 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-list a {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .sub-nav {
    position: static;
    visibility: visible;
    opacity: 1;
    border: 0;
    padding: 0 0 0 16px;
  }

  .has-sub > a::after {
    display: none;
  }

  .lang-switch {
    align-self: flex-start;
  }

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

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 88px 0 80px;
    background:
      linear-gradient(rgba(19, 30, 42, 0.68), rgba(19, 30, 42, 0.68)),
      url("images/hero.jpg?v=1") 70% center / cover no-repeat,
      var(--navy);
  }

  .section {
    padding: 56px 0;
  }

  .areas {
    grid-template-columns: 1fr;
  }

  .area {
    padding: 22px 20px 18px;
  }

  #o-nama p {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-header,
  .map,
  .skip-link {
    display: none;
  }

  .hero {
    background: none;
    color: #000;
    padding: 0 0 24px;
  }

  .hero h1,
  .hero-phone,
  .hero-phone a {
    color: #000;
  }
}

/* Čitljivost teksta preko svjetlijeg dijela fotografije */
.hero h1,
.hero-phone {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

