/*
Theme Name: U Pravu
Theme URI: https://upravu.rs
Author: U Pravu
Description: Pravni blog — Srpski. Custom theme za upravu.rs. Bez page buildera, bez viÅ¡ejeziÄ nosti.
Version: 2.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: upravu
*/

/* ============================================================
   1. TOKENS
   ============================================================ */
:root {
  --navy:      #1a2744;
  --navy-2:    #223060;
  --gold:      #c9a96e;
  --gold-dk:   #b3915a;
  --cream:     #f9f6f1;
  --text:      #2c2c2c;
  --muted:     #6b7280;
  --border:    #e5e0d8;
  --white:     #ffffff;

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --header-h: 64px;
  --wrap: 1160px;
}

/* ============================================================
   2. RESET + OVERFLOW GUARDS  (fixes the sideways sliding)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;   /* nothing can drag the page sideways */
}

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

img, svg, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
  display: block;
}

table { max-width: 100%; border-collapse: collapse; }

h1, h2, h3, h4, h5, h6, p, li, a, blockquote {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

a { color: inherit; }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

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

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--navy); color: #fff; padding: 12px 20px;
}
.skip-link:focus { left: 0; }

/* ============================================================
   3. LAYOUT
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 72px 0; }
.section--cream { background: var(--cream); }
.section--tight { padding: 48px 0; }

.eyebrow {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--navy);
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.2;
  margin-bottom: 32px;
}

/* ============================================================
   4. HEADER + NAVIGATION
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 2px solid var(--navy);
  line-height: 1.1;
  padding-bottom: 1px;
  flex-shrink: 0;
  white-space: nowrap;
}
.brand .dot { color: var(--gold); }

/* Desktop nav — unchanged from the current site */
.nav-desktop ul {
  display: flex;
  align-items: center;
  gap: 34px;
  list-style: none;
}
.nav-desktop a {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.nav-desktop a:hover { border-color: var(--gold); }
.nav-desktop .current-menu-item > a,
.nav-desktop .current_page_item > a,
.nav-desktop .current-menu-parent > a,
.nav-desktop .current-post-ancestor > a { border-color: var(--gold); }

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-right: -10px;
}
.nav-toggle span {
  position: relative;
  display: block;
  width: 24px; height: 2px;
  background: var(--navy);
  transition: background .2s ease;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute; left: 0;
  width: 24px; height: 2px;
  background: var(--navy);
  transition: transform .25s ease, top .2s ease;
}
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after  { top:  7px; }

body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
body.nav-open .nav-toggle span::after  { top: 0; transform: rotate(-45deg); }

/* Mobile slide-in panel */
.nav-mobile {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: min(320px, 86vw);
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  background: var(--white);
  border-left: 1px solid var(--border);
  padding: 12px 24px 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform .28s ease;
  z-index: 190;
  visibility: hidden;
}
body.nav-open .nav-mobile { transform: translateX(0); visibility: visible; }

.nav-mobile ul { list-style: none; }
.nav-mobile a {
  display: block;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.nav-mobile .current-menu-item > a,
.nav-mobile .current_page_item > a { color: var(--gold); }

.nav-overlay {
  position: fixed; inset: 0;
  background: rgba(26,39,68,.45);
  opacity: 0; visibility: hidden;
  transition: opacity .28s ease;
  z-index: 180;
}
body.nav-open .nav-overlay { opacity: 1; visibility: visible; }

/* ============================================================
   5. HERO
   ============================================================ */
.hero {
  background: var(--navy);
  color: var(--white);
  padding: 88px 0 92px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.14;
  margin-bottom: 22px;
  max-width: 15ch;
}
.hero-title .accent { color: var(--gold); }
.hero-lead {
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255,255,255,.78);
  max-width: 56ch;
  margin-bottom: 34px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 17px 30px;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn--gold { background: var(--gold); color: var(--navy); border: 1px solid var(--gold); }
.btn--gold:hover { background: var(--gold-dk); border-color: var(--gold-dk); }
.btn--ghost { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.55); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ============================================================
   6. POST LIST
   ============================================================ */
.post-list { list-style: none; }

.post-card {
  padding: 30px 0;
  border-bottom: 1px solid var(--border);
}
.post-card:first-child { padding-top: 0; }

.post-card__cat {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
}
.post-card__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(21px, 2.6vw, 27px);
  line-height: 1.3;
  color: var(--navy);
  margin-bottom: 14px;
}
.post-card__title a { text-decoration: none; }
.post-card__title a:hover { color: var(--gold-dk); }

.post-card__excerpt {
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
  font-style: italic;
  border-left: 2px solid var(--gold);
  padding-left: 18px;
  margin-bottom: 18px;
}
.post-card__meta {
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 10px;
}
.post-card__more {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 4px;
}
.post-card__more:hover { color: var(--gold-dk); }

.empty-note {
  font-size: 15px;
  color: var(--muted);
  padding: 24px 0;
}

/* ============================================================
   7. OBLASTI (practice areas)
   ============================================================ */
.oblasti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}
.oblast-card {
  background: transparent;
  border-left: 2px solid var(--border);
  padding: 6px 0 6px 22px;
  text-decoration: none;
  display: block;
  transition: border-color .2s ease;
}
.oblast-card:hover { border-left-color: var(--gold); }
.oblast-card__icon { margin-bottom: 16px; color: var(--muted); }
.oblast-card__icon svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.3; }
.oblast-card__title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}
.oblast-card__desc {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--muted);
}

/* ============================================================
   8. FILTER BAR (Članci) — scrolls, never breaks the layout
   ============================================================ */
.filter-bar {
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
}
.filter-bar__scroll {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-bar__scroll::-webkit-scrollbar { display: none; }

.filter-bar a {
  flex: 0 0 auto;
  padding: 20px 26px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  border-right: 1px solid rgba(255,255,255,.12);
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}
.filter-bar a:hover { color: var(--white); }
.filter-bar a.is-active {
  color: var(--white);
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 -3px 0 var(--gold);
}

/* ============================================================
   9. PAGE BANNER (O nama, Konsultacija, arhive)
   ============================================================ */
.page-banner {
  background: var(--navy);
  color: var(--white);
  padding: 54px 0;
}
.page-banner h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.2;
}
.page-banner p {
  margin-top: 12px;
  color: rgba(255,255,255,.72);
  font-size: 15.5px;
  max-width: 62ch;
}

/* ============================================================
   10. ARTICLE / PAGE CONTENT
   ============================================================ */
.content-wrap { padding: 56px 0 80px; }
.content-narrow { max-width: 760px; margin: 0 auto; }

.breadcrumb {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}
.breadcrumb a { text-decoration: none; color: var(--muted); }
.breadcrumb a:hover { color: var(--gold-dk); }

.entry-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.22;
  color: var(--navy);
  margin-bottom: 16px;
}
.entry-meta {
  font-size: 12.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.entry-content { font-size: 17px; line-height: 1.85; }
.entry-content > * + * { margin-top: 22px; }
.entry-content h2 {
  font-family: var(--serif);
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-top: 44px;
}
.entry-content h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 34px;
}
.entry-content a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.entry-content a:hover { color: var(--gold-dk); }
.entry-content ul, .entry-content ol { padding-left: 22px; }
.entry-content li + li { margin-top: 8px; }
.entry-content blockquote {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 22px;
  font-style: italic;
  color: var(--muted);
}
.entry-content img { margin: 8px 0; }
.entry-content table th, .entry-content table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 15px;
  text-align: left;
}
.entry-content table th { background: var(--cream); color: var(--navy); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.entry-footer {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.cta-box {
  background: var(--cream);
  border-left: 3px solid var(--gold);
  padding: 28px 26px;
  margin-top: 44px;
}
.cta-box h3 {
  font-family: var(--serif);
  font-size: 21px;
  color: var(--navy);
  margin-bottom: 10px;
}
.cta-box p { font-size: 15px; color: var(--muted); margin-bottom: 18px; }

/* Pagination */
.pagination {
  margin-top: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pagination .page-numbers {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 14px;
  color: var(--navy);
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ============================================================
   11. FORMS (Contact Form 7 or plain HTML)
   ============================================================ */
.form-shell { max-width: 640px; }
.form-shell label,
.wpcf7 label {
  display: block;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-dk);
  font-weight: 600;
  margin-bottom: 10px;
}
input[type=text], input[type=email], input[type=tel], input[type=url],
select, textarea {
  width: 100%;
  max-width: 100%;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  padding: 14px 16px;
  margin-bottom: 22px;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 44px;
}
textarea { min-height: 160px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }

input[type=submit], .wpcf7-submit, .form-submit {
  width: auto;
  background: var(--gold);
  color: var(--navy);
  border: 1px solid var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  padding: 17px 34px;
  cursor: pointer;
}
input[type=submit]:hover, .wpcf7-submit:hover { background: var(--gold-dk); }

/* ============================================================
   12. FOOTER
   ============================================================ */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.72);
  padding: 44px 0 36px;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.footer-brand {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}
.footer-brand .dot { color: var(--gold); }
.footer-tag { font-size: 14px; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 22px; margin-top: 22px; }
.footer-nav a { font-size: 13.5px; text-decoration: none; color: rgba(255,255,255,.72); }
.footer-nav a:hover { color: var(--gold); }
.footer-legal {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 13px;
  color: rgba(255,255,255,.55);
}


/* ============================================================
   13. HERO SLIDER
   ============================================================ */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 60px;
  align-items: center;
}

.slider { min-width: 0; }
.slider .eyebrow { margin-bottom: 14px; }

.slides {
  display: grid;               /* every slide shares one cell = no height jump */
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.04);
}

.slide {
  grid-area: 1 / 1;
  padding: 30px 30px 28px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s ease;
  min-width: 0;
}
.slide.is-active { opacity: 1; visibility: visible; }

.slide__cat {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 12px;
}
.slide__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(21px, 2.1vw, 27px);
  line-height: 1.28;
  margin-bottom: 14px;
}
.slide__title a { color: var(--white); text-decoration: none; }
.slide__title a:hover { color: var(--gold); }

.slide__excerpt {
  font-size: 14.5px;
  line-height: 1.75;
  color: rgba(255,255,255,.72);
  margin-bottom: 16px;
}
.slide__meta {
  font-size: 12px;
  letter-spacing: .09em;
  color: rgba(255,255,255,.5);
  margin-bottom: 18px;
}
.slide__more {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(201,169,110,.5);
  padding-bottom: 4px;
}
.slide__more:hover { border-bottom-color: var(--gold); }

.slider-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}
.slider-dots { display: flex; gap: 9px; }
.slider-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  padding: 0;
  transition: background .2s ease, transform .2s ease;
}
.slider-dot:hover { background: rgba(255,255,255,.55); }
.slider-dot.is-active { background: var(--gold); transform: scale(1.25); }

.slider-arrows { display: flex; gap: 6px; }
.arrow {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.22);
  transition: border-color .2s ease, background .2s ease;
}
.arrow:hover { border-color: var(--gold); background: rgba(201,169,110,.12); }
.arrow svg {
  width: 17px; height: 17px;
  stroke: rgba(255,255,255,.8);
  fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.arrow:hover svg { stroke: var(--gold); }

.section-more { margin-top: 36px; }

/* ============================================================
   15. MOBILE  (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  .nav-desktop { display: none; }
  .nav-toggle  { display: flex; }

  .wrap { padding: 0 20px; }

  .section { padding: 48px 0; }
  .section--tight { padding: 36px 0; }

  .hero { padding: 52px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-title { max-width: none; }
  .hero-lead { font-size: 15.5px; margin-bottom: 28px; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .btn { text-align: center; padding: 16px 24px; }

  /* Slider on phone */
  .slide { padding: 26px 22px 24px; }
  .slider-nav { margin-top: 16px; }
  .arrow { width: 42px; height: 42px; }

  /* Filter bar scrolls sideways within its own strip */
  .filter-bar a { padding: 16px 20px; }

  .page-banner { padding: 40px 0; }
  .content-wrap { padding: 40px 0 60px; }

  .oblasti-grid { grid-template-columns: 1fr; gap: 26px; }

  .entry-content { font-size: 16.5px; }

  .footer-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-nav ul { gap: 16px 20px; }
}

@media (max-width: 480px) {
  .brand { font-size: 20px; }
  .post-card { padding: 26px 0; }
  .post-card__excerpt { padding-left: 14px; }
  .slide__title { font-size: 20px; }
}

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

/* Print */
@media print {
  .site-header, .site-footer, .nav-mobile, .nav-overlay, .cat-filter, .cta-box, .slider-nav { display: none !important; }
  .slide { opacity: 1 !important; visibility: visible !important; position: static; }
  body { color: #000; }
}
