/*
Theme Name: Znanost.hr
Theme URI: https://znanost.hr/
Author: Znanost.hr
Description: Lagani custom WordPress theme za znanstveni news/magazine portal.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: znanosthr
*/

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --text: #17202b;
  --muted: #667382;
  --line: #dce4ec;
  --accent: #1266d6;
  --accent-dark: #0b4fae;
  --max: 1180px;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(22, 40, 66, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

.container {
  width: min(calc(100% - 32px), var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
}

.site-title {
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.4px;
}

.site-title span { color: var(--accent); }

.main-nav { margin-left: auto; }

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

.main-nav a {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.main-nav a:hover { color: var(--accent); }

.header-search {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
}

.hero {
  padding: 48px 0 30px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr);
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.featured-card {
  position: relative;
  min-height: 470px;
  display: flex;
  align-items: flex-end;
  background: #dfe7ef;
}

.featured-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,20,36,.08) 25%, rgba(5,20,36,.88) 100%);
}

.featured-content {
  position: relative;
  z-index: 2;
  padding: 32px;
  color: #fff;
}

.kicker,
.category-link {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.featured-content .kicker { color: #bcd8ff; }

.featured-content h1 {
  max-width: 780px;
  margin: 8px 0 12px;
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.08;
  letter-spacing: -1.3px;
}

.featured-content h1 a { color: #fff; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.featured-content .meta { color: #d7e0e8; }

.side-stack {
  display: grid;
  gap: 18px;
}

.side-story {
  display: grid;
  grid-template-columns: 122px 1fr;
  min-height: 136px;
}

.side-story .thumb {
  background: var(--surface-2);
}

.side-story .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-story .body {
  padding: 17px;
}

.side-story h3 {
  font-size: 17px;
  line-height: 1.28;
  margin: 5px 0 8px;
}

.side-story h3 a { color: var(--text); }

.section {
  padding: 26px 0 44px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -.5px;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 24px;
  margin-right: 10px;
  border-radius: 99px;
  background: var(--accent);
  vertical-align: -3px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.post-card .thumb {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}

.post-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.post-card:hover .thumb img { transform: scale(1.025); }

.post-card .body { padding: 20px; }

.post-card h2,
.post-card h3 {
  margin: 6px 0 8px;
  line-height: 1.28;
  letter-spacing: -.25px;
}

.post-card h2 { font-size: 22px; }
.post-card h3 { font-size: 19px; }

.post-card h2 a,
.post-card h3 a { color: var(--text); }

.excerpt {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  align-items: start;
}

.article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 50px);
}

.article-header {
  margin-bottom: 30px;
}

.article-title {
  margin: 8px 0 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.06;
  letter-spacing: -1.4px;
}

.article .featured-image {
  margin: 0 0 30px;
  border-radius: 12px;
  overflow: hidden;
}

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

.entry-content > * {
  max-width: 760px;
}

.entry-content h2,
.entry-content h3 {
  margin-top: 1.8em;
  line-height: 1.2;
}

.entry-content blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--accent);
  color: #3a4654;
  font-size: 20px;
}

.entry-content figure,
.entry-content .wp-block-image {
  max-width: 100%;
}

.sidebar {
  display: grid;
  gap: 20px;
}

.widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.widget-title {
  margin: 0 0 14px;
  font-size: 18px;
}

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

.archive-header {
  padding: 46px 0 20px;
}

.archive-title {
  margin: 0 0 8px;
  font-size: 40px;
  line-height: 1.1;
}

.pagination {
  margin-top: 28px;
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination .page-numbers {
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.site-footer {
  margin-top: 40px;
  background: #111b27;
  color: #c4ced9;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  padding: 46px 0;
}

.site-footer h3 {
  margin-top: 0;
  color: #fff;
}

.site-footer a { color: #d7e7ff; }

.footer-menu {
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer-menu li + li { margin-top: 8px; }

.copyright {
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 13px;
  color: #96a5b5;
}

.no-results,
.error404-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
}

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

@media (max-width: 940px) {
  .hero-grid,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .main-nav { display: none; }

  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .container { width: min(calc(100% - 22px), var(--max)); }

  .header-inner { min-height: 64px; }

  .hero { padding-top: 22px; }

  .featured-card { min-height: 390px; }
  .featured-content { padding: 22px; }

  .side-story { grid-template-columns: 104px 1fr; }

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

  .section-title { font-size: 24px; }

  .article { padding: 23px 19px; }
  .entry-content { font-size: 17px; }

  .footer-inner { grid-template-columns: 1fr; }
}
