/*
Theme Name: LAWHUB Unified Theme
Theme URI: https://lawhub.ge/
Author: LawHub
Author URI: https://lawhub.ge/
Description: LAWHUB-ის ერთიანი იერსახე — მუქი ლურჯი სამართლებრივი იდენტობა, საერთო დიზაინ-სისტემა და საჯარო გვერდების შაბლონები. მუშაობს LawHub Exams-თან და LAWHUB Core-თან ერთად.
Version: 1.2.2
Requires at least: 6.0
Tested up to: 6.7
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: lawhub-unified
Tags: education, blue, custom-colors, custom-logo, custom-menu, translation-ready
*/

/* ==========================================================================
   LAWHUB DESIGN SYSTEM
   One set of tokens. Every component below, and every component the Core
   plugin renders in wp-admin, resolves to these — which is what makes the
   exam pages, the duel and the public site look like one product instead of
   three that happen to share a logo.

   Every token is named --lhu-*. That prefix is deliberate: the LawHub Exams
   plugin owns a --lh-* set of its own (--lh-card, --lh-line, --lh-ease among
   them) and this stylesheet is served alongside it, so a shared name would
   mean the theme silently repainting the application.

   The --lh-theme-* trio is the one exception, and is deliberately kept: it is
   the contract the previous theme established for the plugin's guest pages,
   so switching to this theme changes how the site looks without changing
   what the plugin expects.
   ========================================================================== */
:root {
  /* surfaces, darkest to lightest */
  --lhu-navy-900: #0b1626;
  --lhu-navy-800: #0d1726;
  --lhu-navy-700: #122238;
  --lhu-navy-600: #183b63;
  --lhu-navy-500: #1f4a79;

  /* blues */
  --lhu-blue-500: #3578bd;
  --lhu-blue-400: #4f93d6;
  --lhu-blue-300: #8fb5d8;
  --lhu-blue-200: #cfe2f6;

  /* neutrals */
  --lhu-paper: #f4f7fb;
  --lhu-card: #ffffff;
  --lhu-ink: #16263c;
  --lhu-ink-soft: #4a5f79;
  --lhu-ink-faint: #7c8ca1;
  --lhu-line: #dde6f0;

  /* state */
  --lhu-ok: #2f8f63;
  --lhu-warn: #b07d2a;
  --lhu-bad: #c05252;

  /* type */
  --lhu-font: 'Noto Sans Georgian', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --lhu-serif: 'Noto Serif Georgian', Georgia, serif;

  /* rhythm — a 4px grid, so nothing lands on a half pixel */
  --lhu-s1: 4px;  --lhu-s2: 8px;  --lhu-s3: 12px; --lhu-s4: 16px;
  --lhu-s5: 24px; --lhu-s6: 32px; --lhu-s7: 48px; --lhu-s8: 64px;

  --lhu-r1: 8px; --lhu-r2: 12px; --lhu-r3: 18px; --lhu-r4: 26px;
  --lhu-shadow-1: 0 1px 2px rgba(16, 38, 64, .06), 0 2px 8px rgba(16, 38, 64, .05);
  --lhu-shadow-2: 0 2px 6px rgba(16, 38, 64, .08), 0 12px 32px rgba(16, 38, 64, .09);
  --lhu-ease: cubic-bezier(.22, .72, .2, 1);

  /* the contract with the LawHub Exams plugin — do not rename */
  --lh-theme-header: var(--lhu-navy-600);
  --lh-theme-button: var(--lhu-blue-500);
  --lh-theme-accent: var(--lhu-blue-400);

  color-scheme: light;
}

/* --------------------------------------------------------------------------
   Everything below is scoped to .lhu-body — the class this theme's own
   header.php puts on <body>.

   This matters more than it looks. The LawHub Exams plugin renders its own
   complete documents and ends their <head> with do_action('wp_head'), which
   is the hook WordPress uses to print enqueued styles — so this stylesheet
   is served on the application's pages too, whether or not the theme drew
   them. An unscoped `h1` or `a` rule here would quietly restyle every exam,
   duel and profile page. Scoping keeps the theme's typography on the theme's
   pages, and leaves the application looking exactly as it does today.
   -------------------------------------------------------------------------- */
.lhu-body, .lhu-body *, .lhu-body *::before, .lhu-body *::after { box-sizing: border-box; }

body.lhu-body {
  margin: 0;
  background: var(--lhu-paper);
  color: var(--lhu-ink);
  font-family: var(--lhu-font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.lhu-body h1, .lhu-body h2, .lhu-body h3 { font-family: var(--lhu-serif); font-weight: 600; line-height: 1.25; color: var(--lhu-navy-800); margin: 0 0 var(--lhu-s3); }
.lhu-body h1 { font-size: clamp(26px, 4vw, 40px); letter-spacing: -.015em; }
.lhu-body h2 { font-size: clamp(20px, 2.6vw, 28px); }
.lhu-body h3 { font-size: clamp(17px, 2vw, 21px); }
.lhu-body p  { margin: 0 0 var(--lhu-s4); }
.lhu-body a  { color: var(--lhu-blue-500); text-decoration: none; }
.lhu-body a:hover { color: var(--lhu-navy-600); text-decoration: underline; }

/* A focus ring that is always visible on a dark header and on paper alike. */
.lhu-body :where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--lhu-blue-400);
  outline-offset: 2px;
  border-radius: var(--lhu-r1);
}

.lhu-skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: var(--lhu-s3) var(--lhu-s4); background: var(--lhu-navy-800); color: #fff;
  border-radius: 0 0 var(--lhu-r2) 0;
}
.lhu-skip:focus { left: 0; }

.lhu-wrap { width: min(100%, 1160px); margin-inline: auto; padding-inline: var(--lhu-s4); }

/* ----------------------------------------------------------------- header */
.lhu-header {
  background: var(--lh-theme-header);
  color: #eaf2fb;
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 24px rgba(8, 18, 32, .18);
}
.lhu-header-inner { display: flex; align-items: center; gap: var(--lhu-s4); min-height: 64px; }
.lhu-brand { display: inline-flex; align-items: center; gap: var(--lhu-s3); color: #fff; }
.lhu-brand:hover { text-decoration: none; }
.lhu-brand img { max-height: 40px; width: auto; display: block; }
.lhu-brand strong { font-size: 17px; letter-spacing: .16em; font-weight: 800; }
.lhu-brand small { display: block; font-size: 10.5px; color: var(--lhu-blue-300); letter-spacing: .04em; }

.lhu-nav { margin-inline-start: auto; }
.lhu-nav ul { display: flex; align-items: center; gap: var(--lhu-s2); list-style: none; margin: 0; padding: 0; }
.lhu-nav a {
  display: block; padding: var(--lhu-s2) var(--lhu-s3); border-radius: var(--lhu-r1);
  color: #d6e4f4; font-size: 13.5px; font-weight: 600;
  transition: background .18s var(--lhu-ease), color .18s var(--lhu-ease);
}
.lhu-nav a:hover, .lhu-nav .current-menu-item > a { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }

.lhu-burger {
  display: none; margin-inline-start: auto;
  width: 40px; height: 40px; border-radius: var(--lhu-r1);
  border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06);
  color: #fff; cursor: pointer;
}

/* --------------------------------------------------------------- components */
.lhu-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--lhu-s2);
  min-height: 44px;                      /* a touch target, not a link */
  padding: var(--lhu-s3) var(--lhu-s5);
  border: 1px solid transparent; border-radius: var(--lhu-r2);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .16s var(--lhu-ease), background .18s var(--lhu-ease), border-color .18s var(--lhu-ease);
}
.lhu-btn:hover { text-decoration: none; transform: translateY(-1px); }
.lhu-btn:active { transform: none; }
.lhu-btn-primary { background: var(--lh-theme-button); color: #fff; }
.lhu-btn-primary:hover { background: var(--lhu-navy-600); color: #fff; }
.lhu-btn-ghost { background: transparent; border-color: var(--lhu-line); color: var(--lhu-navy-700); }
.lhu-btn-ghost:hover { border-color: var(--lhu-blue-400); color: var(--lhu-navy-800); }

.lhu-card {
  background: var(--lhu-card); border: 1px solid var(--lhu-line);
  border-radius: var(--lhu-r3); padding: var(--lhu-s5);
  box-shadow: var(--lhu-shadow-1);
}
.lhu-card h3 { margin-top: 0; }
.lhu-card p:last-child { margin-bottom: 0; }

.lhu-grid { display: grid; gap: var(--lhu-s4); }
.lhu-grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

.lhu-field { display: grid; gap: var(--lhu-s2); margin-bottom: var(--lhu-s4); }
.lhu-field > span { font-size: 12.5px; font-weight: 600; color: var(--lhu-ink-soft); }
.lhu-field input, .lhu-field textarea, .lhu-field select {
  width: 100%; min-height: 44px; padding: var(--lhu-s3);
  font: inherit; font-size: 14px; color: var(--lhu-ink);
  background: #fff; border: 1px solid var(--lhu-line); border-radius: var(--lhu-r2);
}
.lhu-field input:focus, .lhu-field textarea:focus { border-color: var(--lhu-blue-400); }

.lhu-note {
  display: flex; gap: var(--lhu-s3); padding: var(--lhu-s4);
  border-radius: var(--lhu-r2); border: 1px solid var(--lhu-line);
  background: #fff; font-size: 13.5px;
}
.lhu-note.is-ok   { border-color: #bfe0cd; background: #f1faf5; }
.lhu-note.is-warn { border-color: #ecd9b0; background: #fdf8ec; }
.lhu-note.is-bad  { border-color: #e9c3c3; background: #fdf3f3; }

.lhu-empty { padding: var(--lhu-s7) var(--lhu-s4); text-align: center; color: var(--lhu-ink-faint); }

/* ------------------------------------------------------------------- hero */
.lhu-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(170deg, var(--lhu-navy-700) 0%, var(--lhu-navy-800) 62%, var(--lhu-navy-900) 100%);
  color: #eef4fb; padding: clamp(48px, 8vw, 96px) 0;
}
/* The same restrained colonnade the duel uses, so the two read as one place. */
.lhu-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(143, 181, 216, .05) 0 1px, transparent 1px 12.5%),
    radial-gradient(60% 50% at 50% 0%, rgba(53, 120, 189, .28), transparent 70%);
}
.lhu-hero > * { position: relative; }
.lhu-hero h1 { color: #fff; }
.lhu-hero p { color: #c3d6ea; font-size: clamp(15px, 1.6vw, 17px); max-width: 60ch; }
.lhu-hero-actions { display: flex; flex-wrap: wrap; gap: var(--lhu-s3); margin-top: var(--lhu-s5); }

.lhu-main { padding: clamp(32px, 5vw, 64px) 0; }

/* ----------------------------------------------------------------- footer */
.lhu-footer { background: var(--lhu-navy-800); color: #9fb6ce; padding: var(--lhu-s7) 0 var(--lhu-s5); margin-top: var(--lhu-s8); }
.lhu-footer a { color: #cfe2f6; }
.lhu-footer-grid { display: grid; gap: var(--lhu-s5); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.lhu-footer h4 { color: #fff; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 var(--lhu-s3); }
.lhu-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--lhu-s2); font-size: 13.5px; }
.lhu-footer-base {
  margin-top: var(--lhu-s5); padding-top: var(--lhu-s4);
  border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex; flex-wrap: wrap; gap: var(--lhu-s3); justify-content: space-between;
  font-size: 12.5px;
}

/* -------------------------------------------------------- post / page body */
.lhu-article { background: var(--lhu-card); border: 1px solid var(--lhu-line); border-radius: var(--lhu-r3); padding: clamp(20px, 4vw, 44px); box-shadow: var(--lhu-shadow-1); }
.lhu-article img { max-width: 100%; height: auto; border-radius: var(--lhu-r2); }
.lhu-article blockquote { margin: var(--lhu-s5) 0; padding: var(--lhu-s4) var(--lhu-s5); border-inline-start: 3px solid var(--lhu-blue-400); background: #f7fafd; border-radius: 0 var(--lhu-r2) var(--lhu-r2) 0; }
.lhu-meta { color: var(--lhu-ink-faint); font-size: 12.5px; margin-bottom: var(--lhu-s4); }
.lhu-list { display: grid; gap: var(--lhu-s4); }

/* ------------------------------------------------------------------ phone */
@media (max-width: 860px) {
  .lhu-burger { display: block; }
  .lhu-nav {
    position: absolute; inset-inline: 0; top: 100%;
    background: var(--lhu-navy-700); padding: var(--lhu-s3);
    box-shadow: var(--lhu-shadow-2);
  }
  .lhu-nav[hidden] { display: none; }
  .lhu-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .lhu-nav a { padding: var(--lhu-s3); }
  .lhu-header-inner { position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  .lhu-body * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .lhu-btn:hover { transform: none; }
}

/* Native appearance controls and accessible nested navigation. */
.lhu-header{position:relative}
.lhu-header.is-sticky{position:sticky}
.admin-bar .lhu-header.is-sticky{top:32px}
.lhu-brand .lhu-logo-mobile{display:none}
.lhu-brand{max-width:100%;min-width:0}
.lhu-brand img{object-fit:contain;max-width:min(65vw,320px);height:auto}
.lhu-body .lhu-brand{color:#fff}
.lhu-nav li{position:relative}
.lhu-nav .sub-menu{display:none;position:absolute;top:100%;left:0;min-width:210px;max-width:85vw;background:var(--lh-theme-header);padding:8px;box-shadow:var(--lhu-shadow-2);z-index:45}
.lhu-nav .sub-menu .sub-menu{left:0;top:100%;position:static;margin-left:10px;box-shadow:none}
.lhu-nav li:hover>.sub-menu,.lhu-nav li:focus-within>.sub-menu,.lhu-nav li.is-open>.sub-menu{display:block}
.lhu-nav li.menu-item-has-children>a{padding-right:38px}
.lhu-submenu-toggle{position:absolute;right:0;top:3px;background:transparent;border:0;color:#fff;min-width:32px;min-height:32px;cursor:pointer}
.lhu-body .lhu-btn-primary{color:#fff}
.lhu-body a:hover{color:var(--lh-theme-accent)}
.lhu-body .lhu-nav a:hover{color:#fff}
.lhu-featured{padding-block:20px}
.lhu-ticker{display:flex;gap:20px;align-items:center;border-block:1px solid var(--lhu-line);padding:12px 0}
.lhu-ticker ul{display:flex;gap:24px;overflow-x:auto;list-style:none;margin:0;padding:8px;max-width:100%}
.lhu-ticker li{flex:0 0 min(70vw,320px)}
.lhu-slider{margin-top:20px}
.lhu-slides{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:16px}
.lhu-slide{flex:0 0 100%;scroll-snap-align:start;min-width:0}
.lhu-body .lhu-card img{max-width:100%;height:auto;border-radius:12px}
.lhu-slide img{width:100%;max-height:360px;object-fit:cover}
.lhu-slider-controls{display:flex;justify-content:center;gap:16px;align-items:center;margin-top:12px}
.lhu-slider-controls[hidden]{display:none}
.lhu-slider-controls button{min-height:44px;min-width:44px;background:var(--lh-theme-button);color:#fff;border:0;border-radius:8px;cursor:pointer}
.lhu-main{padding-inline:16px}
.lhu-grid-3{grid-template-columns:repeat(auto-fit,minmax(min(270px,100%),1fr))}
@media(max-width:860px){.lhu-nav .sub-menu{position:static;box-shadow:none;min-width:0;margin-left:12px}.lhu-nav{max-height:75vh;overflow:auto}.lhu-header-inner{flex-wrap:wrap}.lhu-ticker{align-items:flex-start;flex-direction:column}.lhu-nav li:hover>.sub-menu{display:none}.lhu-nav li:focus-within>.sub-menu,.lhu-nav li.is-open>.sub-menu{display:block}}
@media(max-width:782px){.admin-bar .lhu-header.is-sticky{top:46px}}
@media(max-width:600px){.admin-bar .lhu-header.is-sticky{top:0}}

.lhu-nav.is-enhanced li>.sub-menu{display:none}.lhu-nav.is-enhanced li.is-open>.sub-menu{display:block}
