/*
Theme Name: ZRS
Theme URI: https://zrs.com.hr
Author: Katal
Description: Tema Zagrebačkog rukometnog saveza.
Version: 1.0.1
Requires PHP: 7.4
Text Domain: zrs
*/

:root {
  --navy: #1b3a78;
  --navy-d: #10264f;
  --red: #d91f26;
  --ink: #14181f;
  --muted: #5d6675;
  --line: #e4e7ec;
  --bg: #f4f6f9;
  --white: #fff;
  --radius: 10px;
  --wrap: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--red); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

/* ---------- Header ---------- */
.topbar { background: var(--navy-d); color: #c9d3e6; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 16px; }
.topbar a { color: #fff; }
.topbar .social { display: flex; gap: 14px; }
.site-header { background: var(--white); border-bottom: 4px solid var(--red); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(16,38,79,.06); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 78px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.brand img { max-height: 54px; width: auto; }
.brand-text { font-weight: 800; text-transform: uppercase; line-height: 1.05; font-size: 18px; }
.brand-text small { display: block; font-weight: 600; font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: 10px 11px; font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--ink); text-transform: uppercase; letter-spacing: .02em; border-radius: 6px; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-menu-ancestor > a { color: var(--red); }
.main-nav ul ul { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--white); box-shadow: 0 10px 30px rgba(0,0,0,.12); border-radius: 8px; padding: 8px; flex-direction: column; }
.main-nav li:hover > ul, .main-nav li:focus-within > ul { display: flex; }
.main-nav ul ul a { text-transform: none; font-weight: 600; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 3px; background: var(--navy); margin: 5px 0; border-radius: 2px; }
.header-search { margin-left: 8px; }
.header-search input { border: 1px solid var(--line); border-radius: 20px; padding: 8px 14px; font: inherit; font-size: 14px; width: 170px; }

@media (max-width: 1240px) { .header-search { display: none; } }
@media (max-width: 1100px) {
  .nav-toggle { display: block; }
  .header-search { display: none; }
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--white); display: none; border-bottom: 4px solid var(--red); }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 10px 20px 20px; }
  .main-nav ul ul { display: flex; position: static; box-shadow: none; padding: 0 0 0 14px; }
  .brand-text { font-size: 15px; }
  .brand img { max-height: 44px; }
}

/* ---------- Layout ---------- */
.site-main { padding: 32px 0 56px; }
.grid-main { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 32px; }
@media (max-width: 980px) { .grid-main { grid-template-columns: 1fr; } }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 18px; }
.section-title h2 { font-size: 22px; text-transform: uppercase; margin: 0; padding-left: 12px; border-left: 5px solid var(--red); }
.section-title a { font-size: 14px; font-weight: 700; }
.section { margin-bottom: 44px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; margin-bottom: 44px; }
.hero .card-over:first-child { grid-row: 1 / 3; }
.card-over { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--navy); min-height: 220px; display: block; color: #fff; }
.card-over img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card-over:hover img { transform: scale(1.04); }
.card-over::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16,38,79,0) 35%, rgba(16,38,79,.92)); }
.card-over .txt { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px; z-index: 2; }
.card-over h3 { font-size: 19px; margin: 6px 0 0; color: #fff; }
.hero .card-over:first-child h3 { font-size: 30px; }
.card-over:hover h3 { text-decoration: underline; }
@media (max-width: 980px) { .hero { grid-template-columns: 1fr 1fr; grid-template-rows: auto; } .hero .card-over:first-child { grid-column: 1 / 3; grid-row: auto; min-height: 340px; } }
@media (max-width: 760px) {
  .hero .card-over:first-child { grid-column: auto; }
  .hero { grid-template-columns: 1fr; grid-template-rows: auto; }
  .hero .card-over:first-child { grid-row: auto; min-height: 300px; }
  .hero .card-over:first-child h3 { font-size: 23px; }
}

.badge { display: inline-block; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 4px; }
.badge.hrs { background: #fff; color: var(--navy); }
.meta { font-size: 13px; color: var(--muted); }
.card-over .meta { color: #d3dbea; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.card { background: var(--white); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(16,38,79,.06); transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 10px 28px rgba(16,38,79,.12); transform: translateY(-2px); }
.card .thumb { aspect-ratio: 3 / 2; background: linear-gradient(135deg, var(--navy), var(--navy-d)); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb.noimg { display: flex; align-items: center; justify-content: center; }
.card .thumb.noimg img { width: 70%; height: auto; object-fit: contain; filter: brightness(0) invert(1); opacity: .8; }
.card .body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 18px; margin: 0; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--red); }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.list-compact { list-style: none; margin: 0; padding: 0; background: var(--white); border-radius: var(--radius); }
.list-compact li { display: flex; gap: 14px; padding: 14px; border-bottom: 1px solid var(--line); }
.list-compact li:last-child { border: 0; }
.list-compact img { width: 92px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
.list-compact a { color: var(--ink); font-weight: 700; font-size: 15px; line-height: 1.35; }
.list-compact a:hover { color: var(--red); }

/* ---------- Sidebar ---------- */
.sidebar .box { background: var(--white); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.sidebar .box h3, .widget-title { font-size: 16px; text-transform: uppercase; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--line); }
.quick { display: grid; gap: 10px; }
.quick a { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 8px; background: var(--bg); font-weight: 700; color: var(--navy); }
.quick a::after { content: "→"; color: var(--red); }
.quick a:hover { background: var(--navy); color: #fff; }
.video { position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.widget { margin-bottom: 24px; background: var(--white); border-radius: var(--radius); padding: 20px; }
.widget ul { margin: 0; padding-left: 18px; }

/* ---------- Single ---------- */
.entry { background: var(--white); border-radius: var(--radius); overflow: hidden; }
.entry-hero img { width: 100%; max-height: 560px; object-fit: cover; }
.entry-inner { padding: 28px 36px 40px; }
@media (max-width: 600px) { .entry-inner { padding: 20px; } }
.entry h1 { font-size: 34px; margin: 10px 0 8px; }
@media (max-width: 600px) { .entry h1 { font-size: 26px; } }
.entry-content { font-size: 18px; }
.entry-content p { margin: 0 0 1.1em; }
.entry-content img { border-radius: 8px; margin: 1em 0; }
.entry-content a { text-decoration: underline; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1em 0; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.entry-content th { background: var(--bg); }
.entry-content blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--red); color: var(--muted); font-style: italic; }
.wp-caption, .wp-block-image figcaption { font-size: 14px; color: var(--muted); }
.alignleft { float: left; margin: .3em 1.2em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.2em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.share { display: flex; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.share a { padding: 8px 14px; border-radius: 6px; background: var(--bg); font-size: 14px; font-weight: 700; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.post-nav a { display: block; background: var(--white); border-radius: var(--radius); padding: 16px; font-weight: 700; }
.post-nav .next { text-align: right; }

/* ---------- Archive ---------- */
.page-head { background: var(--navy); color: #fff; padding: 36px 0; margin-bottom: 0; background-image: linear-gradient(120deg, var(--navy-d), var(--navy) 60%, #2b56a8); }
.page-head h1 { margin: 0; font-size: 32px; text-transform: uppercase; }
.page-head p { margin: 6px 0 0; color: #c9d3e6; }
.pagination { margin-top: 32px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers { padding: 8px 14px; background: var(--white); border-radius: 6px; font-weight: 700; }
.pagination .current { background: var(--navy); color: #fff; }

/* ---------- Sponsors & footer ---------- */
.sponsors { background: var(--white); padding: 28px 0; border-top: 1px solid var(--line); }
.sponsors .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 36px; }
.sponsors img { max-height: 56px; width: auto; filter: grayscale(1); opacity: .75; transition: .2s; }
.sponsors a:hover img, .sponsors img:hover { filter: none; opacity: 1; }
.site-footer { background: var(--navy-d); color: #c9d3e6; padding: 48px 0 24px; font-size: 15px; }
.site-footer a { color: #fff; }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 800px) { .footer-cols { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; text-transform: uppercase; font-size: 14px; letter-spacing: .06em; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 18px; font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.search-form { display: flex; gap: 8px; }
.search-form input[type=search] { flex: 1; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.btn, .search-form button { background: var(--red); color: #fff; border: 0; padding: 10px 18px; border-radius: 8px; font-weight: 700; cursor: pointer; font: inherit; }
.btn:hover { background: var(--navy); color: #fff; }

/* Dokumenti (lista datoteka) */
.docs { list-style: none; margin: 0; padding: 0; }
.docs li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.docs .ext { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--red); }