/* =============================================================
   LexKiran — Public Site Theme
   Palette: Deep navy (authority) + warm gold (insight) + cream paper
   Headings: Playfair Display (serif, judicial)   Body: Inter (clean, readable)
   ============================================================= */

:root {
  --navy-950: #0a1628;
  --navy-900: #0f1f38;
  --navy-800: #16294a;
  --navy-700: #1e3a63;
  --navy-600: #2b4d7f;
  --gold-500: #c9a256;
  --gold-400: #d9b872;
  --gold-100: #f5ecd7;
  --paper-50: #fbf9f4;
  --paper-100: #f4f0e6;
  --ink-900: #1a1d24;
  --ink-700: #3d4250;
  --ink-500: #6b7080;
  --ink-300: #a8adba;
  --line: #e4dfd2;
  --success: #1f7a4d;
  --success-bg: #e7f5ee;
  --danger: #b3372c;
  --danger-bg: #fbeae8;
  --warning: #9a6b13;
  --warning-bg: #fdf1dc;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(10, 22, 40, 0.06), 0 1px 1px rgba(10,22,40,.04);
  --shadow-md: 0 6px 20px rgba(10, 22, 40, 0.10);
  --shadow-lg: 0 16px 40px rgba(10, 22, 40, 0.16);
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink-900);
  background: var(--paper-50);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .brand-mark, .serif {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--navy-950);
  line-height: 1.25;
  margin: 0 0 .5em;
}
p { margin: 0 0 1em; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold-500); }
img { max-width: 100%; display: block; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.accent { color: var(--gold-500); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border-radius: 6px; font-weight: 600; font-size: 0.95rem;
  border: 1.5px solid transparent; cursor: pointer; transition: all .15s ease;
}
.btn-primary { background: var(--navy-900); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-gold { background: var(--gold-500); color: var(--navy-950); }
.btn-gold:hover { background: var(--gold-400); color: var(--navy-950); }
.btn-outline { background: transparent; border-color: var(--navy-900); color: var(--navy-900); }
.btn-outline:hover { background: var(--navy-900); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 8px; margin: 16px 0; font-size: 0.95rem; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error, .alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info { background: var(--navy-800); color: #fff; }

/* Header */
.site-header { background: var(--navy-950); border-bottom: 3px solid var(--gold-500); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 28px; padding: 14px 24px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; margin-right: auto; }
.brand .brand-mark { color: #fff; margin: 0; font-size: 1.6rem; }
.brand-tag { color: var(--gold-400); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a { color: #e7e9ee; font-weight: 500; font-size: 0.95rem; padding: 6px 2px; }
.main-nav a:hover { color: var(--gold-400); }
.nav-dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; background: #fff; min-width: 220px;
  box-shadow: var(--shadow-lg); border-radius: 8px; padding: 8px; margin-top: 10px; z-index: 50;
}
/* Invisible hover bridge: keeps .nav-dropdown "hovered" while the cursor crosses
   the visual gap between the nav link and the dropdown panel below it, so the
   menu doesn't disappear on the way down. */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 14px;
  z-index: 49;
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; color: var(--ink-900); padding: 9px 12px; border-radius: 6px; font-size: 0.9rem; }
.dropdown-menu a:hover { background: var(--paper-100); color: var(--navy-900); }
.header-search { display: flex; align-items: center; background: rgba(255,255,255,.08); border-radius: 6px; padding: 4px 4px 4px 12px; }
.header-search input { background: transparent; border: none; color: #fff; outline: none; width: 160px; font-size: 0.88rem; }
.header-search input::placeholder { color: #9aa3b5; }
.header-search button { background: transparent; border: none; color: #fff; cursor: pointer; padding: 6px 10px; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; }
.nav-toggle span { width: 24px; height: 2px; background: #fff; }
.header-actions { display: flex; align-items: center; gap: 10px; }
/* .btn-outline is navy-on-transparent, which disappears against the dark navy
   header — override to a gold outline so "Editor Login" / "Dashboard" is
   clearly visible here, on-brand with the rest of the header. */
.header-actions .btn-outline { border-color: var(--gold-400); color: #fff; background: transparent; }
.header-actions .btn-outline:hover { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-950); }

/* Hero */
.hero { padding: 28px 0 40px; background: var(--paper-50); }
.hero-box {
  background-image:
    linear-gradient(100deg, rgba(8,16,30,.94) 0%, rgba(8,16,30,.82) 32%, rgba(8,16,30,.45) 60%, rgba(8,16,30,.2) 100%),
    url('/assets/images/hero-bg.jpg');
  background-size: cover;
  background-position: center top;
  background-color: var(--navy-950);
  color: #fff; padding: 64px 40px 56px; position: relative; overflow: hidden; border-radius: 16px;
}
.hero-box::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 300px at 85% 20%, rgba(201,162,86,.14), transparent 70%);
}
.hero-inner { position: relative; max-width: 720px; }
.hero .eyebrow { color: var(--gold-400); text-transform: uppercase; letter-spacing: .16em; font-size: 0.78rem; font-weight: 700; margin-bottom: 14px; display: block; }
.hero h1 { color: #fff; font-size: 2.6rem; margin-bottom: 18px; }
.hero p { color: #cbd2e0; font-size: 1.08rem; max-width: 560px; }
.hero-actions { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }

/* Section headings */
.section { padding: 56px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 28px; flex-wrap: wrap; gap: 10px; }
.section-head h2 { font-size: 1.7rem; margin: 0; }
.section-head .view-all { font-weight: 600; font-size: 0.9rem; }
.section-alt { background: var(--paper-100); }

/* Card grids */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card {
  background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-thumb { height: 170px; background: linear-gradient(135deg, var(--navy-800), var(--navy-600)); display: flex; align-items: center; justify-content: center; color: var(--gold-400); font-family: 'Playfair Display', serif; font-size: 1.1rem; text-align: center; padding: 14px; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { display: flex; gap: 10px; align-items: center; font-size: 0.78rem; color: var(--ink-500); flex-wrap: wrap; }
.card h3 { font-size: 1.18rem; margin: 0; }
.card h3 a { color: var(--navy-950); }
.card p.excerpt { color: var(--ink-700); font-size: 0.92rem; margin: 0; }
.card-footer { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; color: var(--ink-500); }

/* Wide (horizontal) cards — used on the blog listing */
.card-wide-list { display: flex; flex-direction: column; gap: 22px; }
.card-wide {
  background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--line); display: flex; transition: transform .15s, box-shadow .15s;
}
.card-wide:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-wide .card-thumb { width: 300px; height: auto; flex-shrink: 0; }
.card-wide .card-body { flex: 1; padding: 24px 28px; justify-content: center; gap: 12px; }
.card-wide h3 { font-size: 1.35rem; }
.card-wide .card-footer { margin-top: 4px; }
@media (max-width: 760px) {
  .card-wide { flex-direction: column; }
  .card-wide .card-thumb { width: 100%; height: 190px; }
}

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge-supreme { background: #eef1fb; color: #33429c; }
.badge-highcourt { background: var(--gold-100); color: #8a6a1c; }
.badge-tribunal { background: #e7f5ee; color: var(--success); }
.badge-other { background: var(--paper-100); color: var(--ink-700); }
.badge-paper { background: var(--navy-900); color: #fff; }
.badge-status-draft { background: #eee; color: #666; }
.badge-status-pending_review { background: var(--warning-bg); color: var(--warning); }
.badge-status-published { background: var(--success-bg); color: var(--success); }
.badge-status-rejected { background: var(--danger-bg); color: var(--danger); }

/* Single article */
.article-header { padding: 48px 0 30px; background: var(--paper-100); border-bottom: 1px solid var(--line); }
.article-header .badge { margin-bottom: 14px; }
.article-header h1 { font-size: 2.1rem; max-width: 820px; }
.article-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-500); font-size: 0.9rem; margin-top: 12px; }
.article-meta a { color: var(--navy-700); font-weight: 600; }

/* Premium masthead (article-header--premium) — left-aligned */
.article-header--premium { padding: 56px 0 40px; text-align: left; }
.article-header--premium .badge { margin: 0 0 20px; }
.article-header--premium h1 {
  max-width: 100%;
  margin: 0;
  font-size: 2.35rem;
  line-height: 1.22;
  letter-spacing: -0.01em;
  font-weight: 800;
}
.article-header--premium .title-rule {
  width: 64px;
  height: 3px;
  margin: 22px 0 20px;
  background: linear-gradient(90deg, var(--gold-500) 0%, var(--gold-500) 80%, transparent);
  border-radius: 2px;
}
.article-header--premium .article-meta {
  justify-content: flex-start;
  margin-top: 4px;
  font-size: 0.88rem;
  letter-spacing: .01em;
}
@media (max-width: 640px) {
  .article-header--premium h1 { font-size: 1.6rem; }
}
.article-body { max-width: 760px; margin: 0 auto; padding: 40px 24px; font-size: 1.06rem; color: var(--ink-900); }
.article-body h2 { font-size: 1.4rem; margin-top: 1.6em; }
.article-body h3 { font-size: 1.15rem; margin-top: 1.4em; }
.article-body blockquote { border-left: 4px solid var(--gold-500); margin: 1.6em 0; padding: 4px 22px; background: var(--paper-100); font-style: italic; color: var(--ink-700); }
.article-body img { border-radius: 8px; margin: 1.4em 0; }
.article-body pre, .article-body code { background: var(--navy-950); color: #eaeef7; border-radius: 6px; padding: 2px 6px; font-size: 0.9em; }
.citation-box { max-width: 760px; margin: 0 auto 30px; padding: 18px 22px; background: var(--gold-100); border-radius: 8px; border: 1px solid var(--gold-400); font-size: 0.92rem; }
.tags-row { max-width: 760px; margin: 0 auto; padding: 0 24px 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag-pill { background: var(--paper-100); border: 1px solid var(--line); padding: 5px 13px; border-radius: 999px; font-size: 0.8rem; color: var(--ink-700); }

/* Paper single */
.paper-download { max-width: 760px; margin: 0 auto 30px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.paper-download .meta { color: var(--ink-500); font-size: 0.85rem; }

/* Comments */
.comments-section { max-width: 760px; margin: 40px auto; padding: 0 24px; }
.comment { border-bottom: 1px solid var(--line); padding: 18px 0; }
.comment-author { font-weight: 700; color: var(--navy-950); }
.comment-date { color: var(--ink-500); font-size: 0.8rem; margin-left: 8px; }
.comment-form textarea, .comment-form input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 0.95rem; margin-bottom: 12px; }
.comment-form textarea { min-height: 110px; }

/* Sidebar / filters */
.layout-with-sidebar { display: grid; grid-template-columns: 2.2fr 1fr; gap: 40px; }
.sidebar-widget { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 24px; }
.sidebar-widget h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; color: var(--navy-900); border-bottom: 2px solid var(--gold-500); padding-bottom: 8px; margin-bottom: 14px; }
.sidebar-widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar-widget li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 0.9rem; }
.sidebar-widget li:last-child { border-bottom: none; }
.sidebar-widget li a { display: flex; justify-content: space-between; }

/* Forms (public: login, contact, subscribe) */
.form-page { max-width: 460px; margin: 60px auto; padding: 40px 36px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md); }
.form-page h1 { font-size: 1.6rem; text-align: center; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 7px; font-size: 0.95rem; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--navy-700); }
.form-hint { font-size: 0.8rem; color: var(--ink-500); margin-top: 6px; }
.contact-page { max-width: 640px; margin: 50px auto; padding: 0 24px; }

/* Newsletter form (footer) */
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input { flex: 1; padding: 10px 12px; border-radius: 6px; border: none; }
.form-note { font-size: 0.8rem; color: var(--gold-400); min-height: 1em; }

/* Pagination */
.pagination { display: flex; justify-content: space-between; align-items: center; margin: 34px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.page-link { font-weight: 600; }
.page-info { color: var(--ink-500); font-size: 0.9rem; }

/* Footer */
.site-footer { background: var(--navy-950); color: #cbd2e0; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr 1.3fr; gap: 30px; padding: 56px 24px 36px; }
.footer-col ul.scroll-links { max-height: 220px; overflow-y: auto; padding-right: 6px; }
.footer-brand { color: #fff; }
.footer-tagline { color: var(--gold-400); font-size: 0.85rem; text-transform: uppercase; letter-spacing: .1em; }
.footer-about { font-size: 0.88rem; color: #9aa3b5; }
.footer-col h4 { color: #fff; font-size: 0.9rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; font-family: 'Inter', sans-serif; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #b7bfd0; font-size: 0.9rem; }
.footer-col a:hover { color: var(--gold-400); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; }
.footer-bottom-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 0.8rem; color: #8590a6; }

/* Author box */
.author-box { max-width: 760px; margin: 20px auto; padding: 20px 24px; background: var(--paper-100); border-radius: var(--radius); display: flex; gap: 16px; align-items: flex-start; }
.author-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--navy-800); color: var(--gold-400); display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', serif; font-weight: 700; flex-shrink: 0; }
.author-avatar.has-photo { padding: 0; overflow: hidden; }
.author-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-500); }

/* Responsive */
@media (max-width: 960px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav { display: none; flex-direction: column; width: 100%; align-items: flex-start; background: var(--navy-900); padding: 16px; border-radius: 0 0 8px 8px; }
  .main-nav.open { display: flex; }
  .header-search { display: none; }
  .header-inner { gap: 12px; }
  .header-actions .btn { padding: 6px 12px; font-size: 0.8rem; white-space: nowrap; }
  .card-grid { grid-template-columns: 1fr; }
  .hero { padding: 16px 0 28px; }
  .hero-box { padding: 40px 22px 34px; border-radius: 12px; }
  .hero h1 { font-size: 2rem; }
  .footer-grid { grid-template-columns: 1fr; padding: 40px 24px; }
  .article-header h1 { font-size: 1.6rem; }
  .paper-download { flex-direction: column; align-items: flex-start; }
}
