/*
Theme Name: Kodeks
Theme URI: https://example.com
Author: Kodeks
Description: Custom theme for the Kodeks legal blog. Bilingual (Serbian/English via Polylang), article + FAQ publishing, editable practice areas (categories), and a styled consultation form. Reproduces the original Kodeks design exactly.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: kodeks
*/

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Sans:wght@300;400;500;600&subset=latin,latin-ext&display=swap');

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root { --navy:#1a2744; --gold:#c9a96e; --cream:#f9f6f1; --text:#2c2c2c; --muted:#6b7280; --border:#e5e0d8; }
  html { scroll-behavior: smooth; }
  body { font-family: 'DM Sans', sans-serif; background: #fff; color: var(--text); }

  /* NAV */
  nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: #fff; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 5%; height: 64px; gap: 1.5rem;
  }
  .logo { font-family: 'Lora', serif; font-size: 1.55rem; font-weight: 700; color: var(--navy); cursor: pointer; flex-shrink: 0; }
  .logo span { color: var(--gold); }
  .nav-center { display: flex; align-items: center; gap: 2rem; flex: 1; justify-content: center; }
  .nav-center a {
    font-size: 0.8rem; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--navy); text-decoration: none; padding-bottom: 2px;
    border-bottom: 2px solid transparent; transition: border-color 0.2s; cursor: pointer; white-space: nowrap;
  }
  .nav-center a:hover, .nav-center a.active { border-color: var(--gold); }
  .nav-lang { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; padding-left: 1.2rem; border-left: 1px solid var(--border); }
  .lang-btn {
    display: flex; align-items: center; gap: 0.3rem; font-size: 0.74rem; font-weight: 500;
    color: var(--muted); cursor: pointer; background: none; border: none;
    font-family: 'DM Sans', sans-serif; padding: 0.2rem 0.4rem; transition: color 0.2s; text-transform: uppercase;
  }
  .lang-btn:hover { color: var(--navy); }
  .lang-btn.active { color: var(--navy); font-weight: 600; }
  .lang-divider { width: 1px; height: 14px; background: var(--border); }

  .kodeks-page { display: none; padding-top: 64px; min-height: 100vh; }
  .kodeks-page.active { display: block; }

  /* ===== HOME ===== */
  .hero { background: var(--navy); padding: 80px 5% 72px; color: #fff; display: flex; align-items: center; justify-content: center; gap: 4%; }
  .hero-text { flex: 0 0 40%; }
  .hero-text h1 { font-family: 'Lora', serif; font-size: clamp(2rem, 3.4vw, 2.85rem); line-height: 1.2; font-weight: 700; margin-bottom: 1.1rem; }
  .hero-text h1 em { color: var(--gold); font-style: normal; }
  .hero-text p { font-size: 0.93rem; line-height: 1.82; color: rgba(255,255,255,0.68); margin-bottom: 1.9rem; font-weight: 300; }
  .hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
  .btn {
    display: inline-block; padding: 0.75rem 1.8rem; background: var(--gold); color: #fff;
    font-size: 0.79rem; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase;
    cursor: pointer; border: 1px solid var(--gold); font-family: 'DM Sans', sans-serif; transition: background 0.2s, transform 0.15s;
  }
  .btn:hover { background: #b8914f; border-color: #b8914f; transform: translateY(-1px); }
  .btn-outline { background: transparent; color: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.28); }
  .btn-outline:hover { background: rgba(255,255,255,0.07); }

  .hero-slide-panel { flex: 0 0 44%; border: 1px solid rgba(201,169,110,0.25); background: rgba(255,255,255,0.04); overflow: hidden; }
  .slide-header { padding: 0.95rem 1.5rem; border-bottom: 1px solid rgba(201,169,110,0.2); display: flex; justify-content: space-between; align-items: center; }
  .slide-header-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); font-weight: 500; }
  .slide-dots { display: flex; gap: 5px; }
  .dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(201,169,110,0.3); transition: background 0.3s, transform 0.3s; cursor: pointer; }
  .dot.active { background: var(--gold); transform: scale(1.3); }
  .slide-img { width: 100%; height: 148px; background: rgba(255,255,255,0.04); border-bottom: 1px solid rgba(201,169,110,0.15); position: relative; }
  .slide-img-inner { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s; display: flex; align-items: center; justify-content: center; }
  .slide-img-inner.active { opacity: 1; }
  .slide-img-inner svg { opacity: 0.14; color: var(--gold); }
  .slides-wrapper { position: relative; height: 118px; }
  .slide { position: absolute; inset: 0; padding: 1.3rem 1.5rem; opacity: 0; transition: opacity 0.6s; display: flex; flex-direction: column; justify-content: space-between; }
  .slide.active { opacity: 1; }
  .slide-tag { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 0.4rem; font-weight: 500; }
  .slide-title { font-family: 'Lora', serif; font-size: 1.05rem; color: #fff; line-height: 1.42; font-weight: 600; }
  .slide-cta { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.32); margin-top: 0.7rem; cursor: pointer; transition: color 0.2s; display: inline-block; }
  .slide-cta:hover { color: var(--gold); }
  .slide-progress { height: 2px; background: rgba(201,169,110,0.12); }
  .slide-progress-bar { height: 100%; background: var(--gold); width: 0%; transition: width linear; }

  .areas { padding: 48px 5% 68px; background: var(--cream); }
  .section-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--gold); margin-bottom: 0.4rem; font-weight: 500; }
  .section-title { font-family: 'Lora', serif; font-size: clamp(1.6rem, 2.5vw, 2.1rem); color: var(--navy); margin-bottom: 2.6rem; font-weight: 700; }
  .area-strip { display: flex; align-items: flex-start; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .area-item { flex: 1; padding: 2.1rem 1.6rem; cursor: pointer; position: relative; transition: background 0.2s; }
  .area-item:hover { background: rgba(26,39,68,0.05); }
  .area-item + .area-item::before { content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 1px; background: var(--border); }
  .area-icon-svg { display: block; margin-bottom: 1rem; color: var(--navy); opacity: 0.5; transition: opacity 0.2s, color 0.2s; }
  .area-item:hover .area-icon-svg { opacity: 1; color: var(--gold); }
  .area-name { font-family: 'Lora', serif; font-size: 1.05rem; color: var(--navy); margin-bottom: 0.45rem; font-weight: 600; }
  .area-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.65; font-weight: 300; }

  /* ===== OBLASTI PAGE ===== */
  .oblasti-toolbar {
    display: flex; background: var(--navy);
    position: sticky; top: 64px; z-index: 50;
    border-bottom: 1px solid rgba(201,169,110,0.2);
  }
  .toolbar-btn {
    flex: 1; padding: 1.15rem 0.5rem; text-align: center;
    font-size: 0.74rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
    color: rgba(255,255,255,0.5); background: none; border: none;
    border-right: 1px solid rgba(255,255,255,0.08);
    cursor: pointer; font-family: 'DM Sans', sans-serif; position: relative;
    transition: color 0.2s, font-size 0.2s, background 0.2s;
  }
  .toolbar-btn:last-child { border-right: none; }
  .toolbar-btn::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--gold); transform: scaleX(0); transition: transform 0.22s; }
  .toolbar-btn:hover { color: #fff; font-size: 0.8rem; background: rgba(255,255,255,0.06); }
  .toolbar-btn:hover::after, .toolbar-btn.active::after { transform: scaleX(1); }
  .toolbar-btn.active { color: #fff; font-weight: 600; }

  .oblasti-list { padding: 0 5%; }
  .oblasti-post { display: grid; grid-template-columns: 42% 1fr; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
  .oblasti-post:hover { background: #fafafa; }
  .post-img-wrap { position: relative; overflow: hidden; }
  .post-img-placeholder { background: var(--cream); display: flex; align-items: center; justify-content: center; min-height: 210px; width: 100%; height: 100%; }
  .post-img-placeholder svg { opacity: 0.18; color: var(--navy); }
  .post-date-badge { position: absolute; bottom: 12px; left: 12px; background: rgba(26,39,68,0.52); backdrop-filter: blur(4px); color: rgba(255,255,255,0.88); font-size: 0.68rem; padding: 0.28rem 0.52rem; letter-spacing: 0.04em; }
  .post-body { padding: 2rem 2.2rem; display: flex; flex-direction: column; justify-content: center; }
  .post-body-tag { font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 0.65rem; font-weight: 500; }
  .post-body-title { font-family: 'Lora', serif; font-size: 1.1rem; color: var(--navy); line-height: 1.42; margin-bottom: 1rem; font-weight: 600; transition: color 0.2s; }
  .oblasti-post:hover .post-body-title { color: var(--gold); }
  .post-body-teaser { font-size: 0.84rem; color: var(--muted); line-height: 1.78; font-weight: 300; font-style: italic; border-left: 2px solid var(--gold); padding-left: 0.9rem; }
  .post-body-cta { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--navy); font-weight: 500; margin-top: 1.2rem; display: inline-block; border-bottom: 1px solid var(--gold); padding-bottom: 1px; }

  /* ===== ARTICLE ===== */
  .article-hero { width: 100%; height: 52vh; min-height: 320px; max-height: 440px; position: relative; overflow: hidden; display: flex; align-items: flex-end; }
  .article-hero-placeholder { position: absolute; inset: 0; background: linear-gradient(135deg, #1a2744 0%, #2a3f6e 60%, #1a2744 100%); display: flex; align-items: center; justify-content: center; }
  .article-hero-placeholder svg { opacity: 0.08; color: #fff; }
  .article-hero-gradient { position: absolute; inset: 0; background: linear-gradient(to top, rgba(26,39,68,0.82) 0%, rgba(26,39,68,0.1) 55%, transparent 100%); }
  .article-hero-meta { position: relative; z-index: 2; padding: 0 5% 2.4rem; width: 100%; }
  .article-hero-tag { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); font-weight: 500; margin-bottom: 0.6rem; }
  .article-hero-title { font-family: 'Lora', serif; font-size: clamp(1.5rem, 3vw, 2.2rem); color: #fff; font-weight: 700; line-height: 1.25; max-width: 780px; margin-bottom: 0.6rem; }
  .article-hero-date { font-size: 0.72rem; color: rgba(255,255,255,0.5); }
  .article-body { display: grid; grid-template-columns: 73% 1fr; gap: 0; padding: 0 5%; }
  .article-main { padding: 3.2rem 3.5rem 4rem 0; border-right: 1px solid var(--border); }
  .article-main p { font-size: 0.96rem; line-height: 1.92; color: var(--text); margin-bottom: 1.5rem; font-weight: 300; }
  .article-main p:first-child { font-size: 1.06rem; color: var(--navy); font-weight: 400; }
  .article-main h2 { font-family: 'Lora', serif; font-size: 1.25rem; color: var(--navy); font-weight: 700; margin: 2.4rem 0 1rem; }
  .article-main h3 { font-family: 'Lora', serif; font-size: 1.05rem; color: var(--navy); font-weight: 600; margin: 2rem 0 0.8rem; }
  .article-main ul { margin: 0 0 1.5rem 1.2rem; }
  .article-main ul li { font-size: 0.95rem; line-height: 1.85; color: var(--text); font-weight: 300; margin-bottom: 0.3rem; }
  .article-highlight { background: var(--cream); border-left: 3px solid var(--gold); padding: 1.1rem 1.4rem; margin: 1.8rem 0; font-size: 0.88rem; line-height: 1.78; color: var(--text); font-style: italic; }
  .article-sidebar { padding: 3.2rem 0 4rem 2.4rem; }
  .sidebar-faq-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); font-weight: 500; margin-bottom: 1.4rem; }
  .faq-item { border-bottom: 1px solid var(--border); padding: 1rem 0; }
  .faq-q { font-family: 'Lora', serif; font-size: 0.88rem; color: var(--navy); font-weight: 600; line-height: 1.45; cursor: pointer; display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; user-select: none; }
  .faq-q:hover { color: var(--gold); }
  .faq-chevron { flex-shrink: 0; margin-top: 2px; transition: transform 0.22s; font-style: normal; font-size: 0.7rem; color: var(--gold); }
  .faq-item.open .faq-chevron { transform: rotate(180deg); }
  .faq-a { font-size: 0.82rem; color: var(--muted); line-height: 1.75; font-weight: 300; max-height: 0; overflow: hidden; transition: max-height 0.28s ease, padding 0.2s; }
  .faq-item.open .faq-a { max-height: 300px; padding-top: 0.7rem; }

  /* ===== CONSULT ===== */
  .consult-wrap {
    display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 64px);
  }
  .consult-form-side {
    padding: 72px 6% 72px 10%;
    display: flex; flex-direction: column; justify-content: center;
    background: #fff;
  }
  .consult-info-side {
    padding: 72px 10% 72px 6%;
    background: var(--navy); color: #fff;
    display: flex; flex-direction: column; justify-content: center;
  }
  .consult-big-title { font-family: 'Lora', serif; font-size: clamp(2rem, 3vw, 2.7rem); color: #fff; font-weight: 700; line-height: 1.18; margin-bottom: 2.4rem; }
  .consult-info h3 { font-family: 'Lora', serif; font-size: 1.05rem; color: rgba(255,255,255,0.9); margin-bottom: 0.9rem; font-weight: 600; }
  .consult-info p { font-size: 0.87rem; color: rgba(255,255,255,0.58); line-height: 1.85; margin-bottom: 1.2rem; font-weight: 300; }
  .consult-note { border-left: 3px solid var(--gold); padding: 1rem 1.3rem; font-size: 0.8rem; color: rgba(255,255,255,0.55); line-height: 1.75; margin-top: 1.6rem; }
  .form-group { margin-bottom: 1.25rem; }
  .form-group label { display: block; font-size: 0.71rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--navy); margin-bottom: 0.42rem; font-weight: 600; }
  .form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 0.72rem 1rem; border: 1px solid var(--border);
    background: #fff; font-family: 'DM Sans', sans-serif; font-size: 0.87rem;
    color: var(--text); outline: none; transition: border-color 0.2s; appearance: none;
  }
  .form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--navy); }
  .form-group textarea { height: 110px; resize: vertical; }
  .form-note { font-size: 0.71rem; color: var(--muted); margin-top: 0.75rem; line-height: 1.7; font-weight: 300; }

  /* ===== ABOUT ===== */
  .about-header { background: var(--navy); padding: 64px 5% 56px; color: #fff; }
  .about-header-inner { max-width: 80%; margin: 0 auto; text-align: left; }
  .about-header h1 { font-family: 'Lora', serif; font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 700; }

  .about-body { padding: 72px 5%; display: flex; gap: 0; }
  .about-margin { flex: 0 0 10%; display: flex; align-items: flex-start; justify-content: center; padding-top: 0.5rem; }
  .about-margin-visual { display: flex; flex-direction: column; align-items: center; gap: 18px; opacity: 0.2; }
  .about-margin-visual span { width: 1px; height: 32px; background: var(--navy); display: block; }
  .about-margin-visual svg { color: var(--gold); }
  .about-content { flex: 1; }
  .about-content p { font-size: 0.95rem; line-height: 1.92; color: var(--text); font-weight: 300; margin-bottom: 1.5rem; }
  .about-content p.lead { font-size: 1.05rem; color: var(--navy); font-weight: 500; margin-bottom: 1.8rem; }

  /* FOOTER */
  footer { background: var(--navy); color: rgba(255,255,255,0.42); padding: 2.2rem 5%; font-size: 0.75rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
  footer .footer-logo { font-family: 'Lora', serif; font-size: 1.1rem; color: #fff; font-weight: 700; }
  footer .footer-logo span { color: var(--gold); }

  @media (max-width: 860px) {
    .hero { flex-direction: column; }
    .hero-slide-panel { display: none; }
    .area-strip, .oblasti-post, .article-body, .consult-wrap { flex-direction: column; grid-template-columns: 1fr; }
    .consult-form-side, .consult-info-side { padding: 48px 5%; }
    .toolbar-btn { flex: 0 0 50%; }
    .about-margin { display: none; }
  }
/* ============================================================
   WORDPRESS-SPECIFIC ADDITIONS (do not affect the original look)
   ============================================================ */

/* Accessibility helper */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; word-wrap: normal !important;
}

/* WordPress core alignment & caption classes for images inside articles */
.article-main img { max-width: 100%; height: auto; }
.article-main .aligncenter { display: block; margin: 1.6rem auto; }
.article-main .alignleft { float: left; margin: 0.4rem 1.6rem 1rem 0; }
.article-main .alignright { float: right; margin: 0.4rem 0 1rem 1.6rem; }
.article-main .wp-caption,
.article-main figure { margin: 1.6rem 0; }
.article-main figcaption,
.article-main .wp-caption-text {
  font-size: 0.78rem; color: var(--muted); font-style: italic; margin-top: 0.5rem; text-align: center;
}
.article-main a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); }
.article-main a:hover { color: var(--gold); }
.article-main blockquote { border-left: 3px solid var(--gold); background: var(--cream); padding: 1.1rem 1.4rem; margin: 1.8rem 0; font-style: italic; }
.article-main ol { margin: 0 0 1.5rem 1.2rem; }
.article-main ol li { font-size: 0.95rem; line-height: 1.85; color: var(--text); font-weight: 300; margin-bottom: 0.3rem; }

/* Polylang language switcher — match the original .lang-btn look */
.nav-lang .pll-parent-menu-item,
.nav-lang ul { list-style: none; display: flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0; }
.nav-lang li { display: flex; align-items: center; }
.nav-lang a {
  display: flex; align-items: center; gap: 0.3rem; font-size: 0.74rem; font-weight: 500;
  color: var(--muted); text-decoration: none; text-transform: uppercase; padding: 0.2rem 0.4rem; transition: color 0.2s;
}
.nav-lang a:hover { color: var(--navy); }
.nav-lang .current-lang a, .nav-lang .current-lang > a { color: var(--navy); font-weight: 600; }

/* Empty-state message for category pages with no posts yet */
.oblasti-empty { padding: 4rem 5%; text-align: center; color: var(--muted); font-size: 0.95rem; }

/* Contact Form 7 — styled to match the original consultation form exactly */
.consult-form-side .wpcf7 .form-group { margin-bottom: 1.25rem; }
.consult-form-side .wpcf7 label { display: block; font-size: 0.71rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--navy); margin-bottom: 0.42rem; font-weight: 600; }
.consult-form-side .wpcf7 input[type=text],
.consult-form-side .wpcf7 input[type=email],
.consult-form-side .wpcf7 textarea,
.consult-form-side .wpcf7 select {
  width: 100%; padding: 0.72rem 1rem; border: 1px solid var(--border);
  background: #fff; font-family: 'DM Sans', sans-serif; font-size: 0.87rem;
  color: var(--text); outline: none; transition: border-color 0.2s; appearance: none;
}
.consult-form-side .wpcf7 input:focus,
.consult-form-side .wpcf7 textarea:focus,
.consult-form-side .wpcf7 select:focus { border-color: var(--navy); }
.consult-form-side .wpcf7 textarea { height: 110px; resize: vertical; }
.consult-form-side .wpcf7 input[type=submit] {
  width: 100%; text-align: center; padding: 0.9rem 1.8rem; background: var(--gold); color: #fff;
  font-size: 0.79rem; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase;
  cursor: pointer; border: 1px solid var(--gold); font-family: 'DM Sans', sans-serif; transition: background 0.2s, transform 0.15s;
}
.consult-form-side .wpcf7 input[type=submit]:hover { background: #b8914f; border-color: #b8914f; transform: translateY(-1px); }
.consult-form-side .wpcf7-response-output { font-size: 0.8rem; margin: 1rem 0 0; padding: 0.7rem 1rem; line-height: 1.6; }
.consult-form-side .wpcf7-not-valid-tip { color: #c0392b; font-size: 0.72rem; }
.consult-form-side .wpcf7 .form-note { font-size: 0.71rem; color: var(--muted); margin-top: 0.75rem; line-height: 1.7; font-weight: 300; }

/* Admin-side FAQ box readability is handled inline in functions.php */

/* Linked cards/areas (the originals used divs; as links they must not underline) */
a.area-item { text-decoration: none; color: inherit; display: block; }
a.oblasti-post { text-decoration: none; color: inherit; }
a.toolbar-btn { text-decoration: none; display: block; }
.about-content p:first-of-type { font-size: 1.05rem; color: var(--navy); font-weight: 500; margin-bottom: 1.8rem; }
.page-oblasti-wrap { min-height: 60vh; }

/* Custom logo image in the nav bar */
.logo img,
.logo .custom-logo { height: 44px; width: auto; display: block; }
.logo .custom-logo-link { display: flex; align-items: center; }

/* Fix: prevent WordPress body.page class from hiding content */
body.page { display: block !important; }

