/*
Theme Name: Lični Oglasi
Theme URI: https://licnioglasi.rs
Author: licnioglasi.rs
Description: Moderna tema za sajt ličnih oglasa. 20 oglasa po strani sa numerisanim stranama, meni kategorija na vrhu, pretraga po gradu koja prepoznaje padeže (Beograd, Beograda, Beogradu...), kartice sa kratkim tekstom i dugmetom Pogledaj.
Version: 1.3.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: licnioglasi
*/

:root {
  --paper: #f8f5fb;
  --surface: #ffffff;
  --ink: #2b1733;
  --muted: #6e5f76;
  --line: #e9e1ef;
  --rose: #c2185b;
  --rose-dark: #9c1249;
  --rose-soft: #fbe4ee;
  --plum: #3b1f4a;
  --focus: 0 0 0 3px rgba(194, 24, 91, .35);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17111b;
    --surface: #211a26;
    --ink: #f3ecf6;
    --muted: #b3a6bb;
    --line: #362c3d;
    --rose: #f0628f;
    --rose-dark: #ff86ab;
    --rose-soft: #3a1c2b;
    --plum: #120c15;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rose); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: none; box-shadow: var(--focus); }
.container { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.container-narrow { width: min(760px, 100% - 2rem); margin-inline: auto; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0 .5rem; }
.brand {
  display: inline-flex; align-items: baseline; gap: .1rem;
  font-family: var(--serif); font-weight: 700; font-size: 1.55rem; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none;
}
.brand-heart { color: var(--rose); font-size: 1.1rem; margin-left: .25rem; }
.custom-logo { max-height: 48px; width: auto; }

/* Meni kategorija – uvek vidljiv, na telefonu se pomera prstom levo-desno */
.cat-nav ul {
  list-style: none; margin: 0; padding: .35rem 0 .8rem;
  display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-nav ul::-webkit-scrollbar { display: none; }
.cat-nav li { flex: 0 0 auto; }
.cat-nav .sub-menu { display: none; }
.cat-nav a {
  display: inline-block; padding: .4rem .95rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .93rem; white-space: nowrap;
}
.cat-nav a:hover { border-color: var(--rose); color: var(--rose); }
.cat-nav .current-menu-item > a,
.cat-nav .current-cat > a { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- Hero + pretraga po gradu ---------- */
.hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); }
.hero h1 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  line-height: 1.05; letter-spacing: -.02em; margin: 0 0 .9rem; max-width: 16ch;
}
.hero-lead { color: var(--muted); margin: 0 0 1.75rem; max-width: 52ch; font-size: 1.08rem; }
.hero--compact { padding: 1.25rem 0 .25rem; }

.lo-search { max-width: 640px; }
.kat-select { display: block; margin-bottom: .75rem; }
.kat-label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; }
.kat-select select {
  width: 100%; appearance: none; -webkit-appearance: none; cursor: pointer;
  font: inherit; font-size: 1.02rem; color: var(--ink);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23c2185b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
  border: 1.5px solid var(--line); border-radius: 14px; padding: .8rem 2.8rem .8rem 1rem;
}
.kat-select select:hover, .kat-select select:focus { border-color: var(--rose); outline: none; }
.grad-search {
  display: flex; align-items: center; gap: .5rem; max-width: 640px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: .4rem;
}
.grad-search:focus-within { border-color: var(--rose); }
.grad-search .field { flex: 1; display: flex; align-items: center; gap: .55rem; padding-left: .8rem; min-width: 0; color: var(--muted); }
.grad-search .field svg { flex: 0 0 auto; }
.grad-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1.05rem; color: var(--ink); padding: .65rem 0;
}
.grad-search input:focus-visible { box-shadow: none; }
.grad-search input::-webkit-search-cancel-button { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer; font: inherit; font-weight: 600; text-decoration: none;
  border-radius: 12px; padding: .7rem 1.35rem; transition: background-color .15s;
}
.btn-primary { background: var(--rose); color: #fff; }
.btn-primary:hover { background: var(--rose-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }

/* ---------- Lista oglasa ---------- */
.site-main { padding-bottom: 3rem; }
.results-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .5rem 1rem; margin: 1.75rem 0 1.25rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line);
}
.results-head h2 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; margin: 0; }
.results-head .count { color: var(--muted); }
.results-head a { font-weight: 600; text-decoration: none; }

.ads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.25rem; }

.ad-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  transition: border-color .15s;
}
.ad-card:hover { border-color: var(--rose); }
.ad-media {
  display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: hsl(var(--h, 340) 70% 92%);
}
@media (prefers-color-scheme: dark) { .ad-media { background: hsl(var(--h, 340) 35% 24%); } }
.ad-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.ad-card:hover .ad-media img { transform: scale(1.03); }
.ad-initial {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-size: 4rem; font-weight: 600; line-height: 1;
  color: hsl(var(--h, 340) 55% 32%);
}
@media (prefers-color-scheme: dark) { .ad-initial { color: hsl(var(--h, 340) 80% 82%); } }
.ad-body { flex: 1; display: flex; flex-direction: column; padding: 1.1rem 1.2rem 1.25rem; }
.ad-title { font-family: var(--serif); font-weight: 600; font-size: 1.22rem; line-height: 1.25; margin: 0 0 .45rem; }
.ad-title a { color: var(--ink); text-decoration: none; }
.ad-title a:hover { color: var(--rose); }
.ad-excerpt { color: var(--muted); margin: 0 0 1.1rem; font-size: .97rem; }
.ad-body .btn { margin-top: auto; align-self: flex-start; padding: .55rem 1.2rem; }

.empty-state { text-align: center; padding: 3.5rem 1rem; border: 1px dashed var(--line); border-radius: 14px; background: var(--surface); }
.empty-state h2 { font-family: var(--serif); margin: 0 0 .5rem; }
.empty-state p { color: var(--muted); margin: 0 0 1.25rem; }

/* ---------- Numeracija strana ---------- */
.lo-pagination { margin-top: 2.5rem; }
.lo-pagination ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: 0; padding: 0; }
.lo-pagination li > .page-numbers {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 .85rem;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.lo-pagination li > a.page-numbers:hover { border-color: var(--rose); color: var(--rose); }
.lo-pagination li > .current { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.lo-pagination li > .dots { border: 0; background: none; min-width: auto; }

/* ---------- Jedan oglas ---------- */
.back-link { display: inline-block; margin-top: 1.5rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.back-link:hover { color: var(--rose); }
.single-ad {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: clamp(1.25rem, 4vw, 2.75rem); margin-top: 1rem;
}
.single-ad .ad-cats { display: flex; flex-wrap: wrap; gap: .4rem; }
.single-ad .ad-cats a {
  font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--rose);
  background: var(--rose-soft); padding: .25rem .7rem; border-radius: 999px;
}
.single-ad h1 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15; letter-spacing: -.015em; margin: .8rem 0 .5rem;
}
.entry-meta { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; color: var(--muted); font-size: .92rem; }
.single-thumb { margin: 1.5rem 0 0; }
.single-thumb img { width: 100%; border-radius: 14px; }
.entry-content { margin-top: 1.75rem; font-size: 1.08rem; line-height: 1.75; overflow-wrap: break-word; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content p { margin: 0 0 1.1em; }
.entry-content h2, .entry-content h3 { font-family: var(--serif); line-height: 1.25; margin: 1.6em 0 .5em; }
.entry-content img { border-radius: 12px; }
.entry-content blockquote { margin: 1.5em 0; padding: .25em 0 .25em 1.1em; border-left: 3px solid var(--rose); color: var(--muted); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.25rem; }
.post-nav a {
  display: block; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink); text-decoration: none;
}
.post-nav a:hover { border-color: var(--rose); }
.post-nav small { display: block; color: var(--muted); font-size: .82rem; }
.post-nav strong { font-family: var(--serif); font-weight: 600; }
.post-nav .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { grid-column: 1; } }

/* Komentari (ako ih uključiš) */
.comments-area { margin-top: 2rem; }
.comments-area h2, .comment-reply-title { font-family: var(--serif); }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { border-top: 1px solid var(--line); padding: 1rem 0; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit;
}
.comment-form .submit { background: var(--rose); color: #fff; border: 0; border-radius: 12px; padding: .7rem 1.35rem; font: inherit; font-weight: 600; cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 3rem; background: var(--plum); color: #d8cbe0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: 2.25rem 0; }
.footer-brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: #fff; text-decoration: none; }
.footer-menu ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0; padding: 0; }
.footer-menu a { color: #fff; text-decoration: none; font-weight: 500; }
.footer-menu a:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 1.1rem 0 1.4rem; font-size: .9rem; color: #b9a9c3; }
.footer-bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }

@media (max-width: 600px) {
  .grad-search { flex-wrap: wrap; border-radius: 14px; }
  .grad-search .field { flex-basis: 100%; padding: 0 .5rem; }
  .grad-search .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
