/*
Theme Name: FL Scientific Publishing Hub
Theme URI: https://sphub.org/
Author: Faculty of Logistics, University of Maribor
Description: Accessible, responsive academic publishing theme for the Scientific Publishing Hub.
Version: 1.1.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: fl-sphub
*/

:root {
  --ink: #173645;
  --ink-soft: #526773;
  --brand: #006a8e;
  --brand-dark: #004f6c;
  --accent: #2b9a70;
  --paper: #ffffff;
  --surface: #f3f7f9;
  --line: #dce7eb;
  --shadow: 0 14px 45px rgba(23, 54, 69, 0.1);
  --radius: 16px;
  --content: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #f7fafb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-underline-offset: 0.18em; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  width: auto;
  height: auto;
  clip: auto;
  z-index: 100000;
  top: 10px;
  left: 10px;
  padding: 12px 16px;
  color: #fff;
  background: var(--brand-dark);
  border-radius: 6px;
}
:focus-visible { outline: 3px solid #f4b942; outline-offset: 3px; }

.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }
.container { width: min(calc(100% - 40px), var(--content)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(220, 231, 235, 0.9);
  backdrop-filter: blur(12px);
}
.header-inner { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 13px; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 20px rgba(0, 106, 142, 0.22);
}
.brand-copy { display: grid; line-height: 1.18; }
.brand-title { font-size: 1.05rem; font-weight: 800; }
.brand-subtitle { color: var(--ink-soft); font-size: 0.78rem; }
.primary-menu { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.primary-menu a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink); font-size: 0.92rem; font-weight: 650; text-decoration: none; }
.primary-menu a:hover, .primary-menu .current-menu-item > a, .primary-menu .current_page_item > a { color: var(--brand); background: #eaf4f7; }

.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(125deg, #004f6c 0%, #006a8e 58%, #1385a6 100%); }
.hero::after { content: ""; position: absolute; inset: -35% -10% auto auto; width: 560px; height: 560px; border: 90px solid rgba(255, 255, 255, 0.06); border-radius: 50%; }
.hero-inner { position: relative; z-index: 1; min-height: 500px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); align-items: center; gap: 70px; padding-block: 72px; }
.eyebrow { margin: 0 0 14px; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.hero .eyebrow { color: #bfeaf6; }
.hero h1 { max-width: 780px; margin: 0; font-size: clamp(2.5rem, 5vw, 4.8rem); line-height: 1.04; letter-spacing: -0.045em; }
.hero-copy { max-width: 710px; margin: 24px 0 0; color: #e1f3f7; font-size: clamp(1.04rem, 2vw, 1.24rem); line-height: 1.7; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 11px 20px; border: 1px solid transparent; border-radius: 9px; font-weight: 750; text-decoration: none; transition: transform 160ms ease, background 160ms ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: var(--brand-dark); background: #fff; }
.button-primary:hover { color: var(--brand-dark); background: #eaf4f7; }
.button-secondary { color: #fff; border-color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.08); }
.button-secondary:hover { color: #fff; background: rgba(255, 255, 255, 0.16); }
.hero-panel { padding: 30px; border: 1px solid rgba(255, 255, 255, 0.26); border-radius: 22px; background: rgba(255, 255, 255, 0.1); box-shadow: 0 24px 70px rgba(0, 31, 45, 0.2); backdrop-filter: blur(8px); }
.hero-panel strong { display: block; font-size: 2.6rem; line-height: 1; }
.hero-panel span { display: block; margin-top: 9px; color: #d8f0f5; }
.hero-stat + .hero-stat { margin-top: 24px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.22); }

.section { padding-block: 78px; }
.section-compact { padding-block: 54px; }
.section-surface { background: var(--surface); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 30px; }
.section-heading h2 { margin: 0; font-size: clamp(1.9rem, 3vw, 2.7rem); line-height: 1.15; letter-spacing: -0.035em; }
.section-heading p { max-width: 650px; margin: 10px 0 0; color: var(--ink-soft); }
.section-link { flex: 0 0 auto; font-weight: 750; }

.publication-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.publication-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 3px 18px rgba(23, 54, 69, 0.05); transition: transform 180ms ease, box-shadow 180ms ease; }
.publication-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.publication-cover { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #eaf4f7, #dcebee); }
.publication-cover img { width: 100%; height: 100%; object-fit: contain; padding: 18px; transition: transform 220ms ease; }
.publication-card:hover .publication-cover img { transform: scale(1.025); }
.publication-placeholder { width: 88px; height: 112px; display: grid; place-items: center; color: var(--brand); border: 2px solid currentColor; border-radius: 5px; background: rgba(255, 255, 255, 0.65); font-size: 2rem; }
.publication-year { position: absolute; top: 14px; right: 14px; padding: 5px 9px; color: var(--brand-dark); background: rgba(255, 255, 255, 0.94); border-radius: 999px; font-size: 0.75rem; font-weight: 800; box-shadow: 0 3px 12px rgba(23, 54, 69, 0.1); }
.publication-body { display: flex; flex: 1; flex-direction: column; padding: 22px; }
.publication-kicker { margin: 0 0 7px; color: var(--brand); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.publication-card h3 { margin: 0; font-size: 1.18rem; line-height: 1.35; letter-spacing: -0.015em; }
.publication-card h3 a { color: var(--ink); text-decoration: none; }
.publication-card h3 a::after { content: ""; position: absolute; inset: 0; }
.publication-author { margin: 12px 0 0; color: var(--ink-soft); font-size: 0.91rem; }
.publication-more { margin-top: auto; padding-top: 18px; color: var(--brand); font-weight: 750; font-size: 0.9rem; }

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.feature { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.feature-number { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: var(--brand); background: #eaf4f7; font-weight: 850; }
.feature h3 { margin: 20px 0 8px; font-size: 1.15rem; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.94rem; }

.page-hero { padding-block: 62px; color: #fff; background: linear-gradient(125deg, var(--brand-dark), var(--brand)); }
.page-hero .eyebrow { color: #bfeaf6; }
.page-hero h1 { max-width: 900px; margin: 0; font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1.08; letter-spacing: -0.04em; }
.page-hero p { max-width: 720px; margin: 18px 0 0; color: #dff3f7; font-size: 1.08rem; }
.content-card { padding: clamp(26px, 5vw, 58px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 32px rgba(23, 54, 69, 0.06); }
.prose { max-width: 820px; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3 { margin-top: 1.8em; line-height: 1.25; letter-spacing: -0.02em; }
.prose p, .prose li { color: #334f5d; }
.prose img { border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { padding: 12px; border: 1px solid var(--line); text-align: left; }

.book-layout { display: grid; grid-template-columns: minmax(240px, 360px) minmax(0, 1fr); gap: clamp(36px, 7vw, 84px); align-items: start; }
.book-cover-large { position: sticky; top: 118px; overflow: hidden; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.book-cover-large img { width: 100%; max-height: 540px; object-fit: contain; }
.book-details .eyebrow { color: var(--brand); }
.book-details h1 { margin: 0; font-size: clamp(2.2rem, 4.5vw, 4.2rem); line-height: 1.07; letter-spacing: -0.045em; }
.book-byline { margin: 20px 0 0; color: var(--ink-soft); font-size: 1.13rem; }
.book-actions { margin: 28px 0; }
.book-actions .button { color: #fff; background: var(--brand); }
.book-actions .button:hover { color: #fff; background: var(--brand-dark); }
.book-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 30px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.book-meta div { min-width: 0; padding: 16px 18px; background: #fff; }
.book-meta dt { color: var(--ink-soft); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.book-meta dd { margin: 5px 0 0; overflow-wrap: anywhere; font-weight: 700; }

.empty-state { padding: 48px 26px; color: var(--ink-soft); text-align: center; border: 1px dashed #b9ccd4; border-radius: var(--radius); background: #fff; }
.pagination { margin-top: 38px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { min-width: 42px; min-height: 42px; display: grid; place-items: center; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; }
.page-numbers.current { color: #fff; border-color: var(--brand); background: var(--brand); }

.site-footer { margin-top: 70px; color: #cfe2e8; background: #102f3d; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 0.8fr 0.8fr; gap: 50px; padding-block: 54px; }
.site-footer h2, .site-footer h3 { color: #fff; }
.site-footer h2 { margin: 0; font-size: 1.3rem; }
.site-footer h3 { margin: 0 0 12px; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.site-footer p { margin: 12px 0 0; }
.site-footer a { color: #dff5fb; }
.footer-links { margin: 0; padding: 0; list-style: none; }
.footer-links li + li { margin-top: 8px; }
.footer-bottom { padding-block: 18px; border-top: 1px solid rgba(255, 255, 255, 0.13); color: #a9c4cd; font-size: 0.82rem; }

@media (max-width: 980px) {
  .site-header { position: static; }
  .header-inner { min-height: 0; align-items: flex-start; flex-direction: column; padding-block: 17px; gap: 14px; }
  .site-nav { width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .primary-menu { width: max-content; }
  .hero-inner { min-height: auto; grid-template-columns: 1fr; gap: 36px; }
  .hero-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .hero-stat + .hero-stat { margin: 0; padding: 0 0 0 20px; border-top: 0; border-left: 1px solid rgba(255, 255, 255, 0.22); }
  .publication-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: 1fr; }
  .book-layout { grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 42px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .container { width: min(calc(100% - 28px), var(--content)); }
  .brand-subtitle { display: none; }
  .site-nav { overflow: visible; }
  .primary-menu { width: 100%; flex-wrap: wrap; gap: 2px 4px; }
  .primary-menu a { padding: 8px 10px; font-size: 0.86rem; }
  .hero-inner { padding-block: 52px; }
  .hero h1 { font-size: clamp(2.25rem, 12vw, 3.4rem); }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-stat + .hero-stat { padding: 20px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.22); border-left: 0; }
  .section { padding-block: 56px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .publication-grid { grid-template-columns: 1fr; }
  .publication-cover { aspect-ratio: 16 / 11; }
  .page-hero { padding-block: 46px; }
  .book-layout { grid-template-columns: 1fr; }
  .book-cover-large { position: static; max-width: 360px; margin-inline: auto; }
  .book-meta { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
