/*
Theme Name: LawWorks MV Dhivehi
Theme URI: https://lawworksmv.com
Author: LawWorks MV
Description: A clean Dhivehi RTL legal knowledge-base theme inspired by modern public legal databases. Designed for editable WordPress records, categories, search, and downloadable resources.
Version: 1.0.1
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: lawworks-mv
*/

:root {
  --lw-navy-950: #071a25;
  --lw-navy-900: #0b2634;
  --lw-navy-800: #12394b;
  --lw-teal-700: #0d6d66;
  --lw-teal-600: #10877c;
  --lw-teal-100: #dff3ef;
  --lw-gold-500: #b88b3d;
  --lw-gold-100: #f4ead7;
  --lw-ink: #15242d;
  --lw-muted: #64747d;
  --lw-line: #dce5e8;
  --lw-surface: #ffffff;
  --lw-bg: #f5f8f8;
  --lw-radius: 16px;
  --lw-shadow: 0 12px 32px rgba(7, 26, 37, .08);
  --lw-content: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--lw-bg);
  color: var(--lw-ink);
  font-family: "Noto Sans Thaana", "MV Waheed", Faruma, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.9;
  direction: rtl;
  text-align: right;
}
a { color: var(--lw-teal-700); text-decoration: none; }
a:hover { color: var(--lw-navy-900); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }

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

/* Header */
.lw-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--lw-line);
}
.lw-header-row { min-height: 76px; display: flex; align-items: center; gap: 22px; }
.lw-brand { display: flex; align-items: center; gap: 12px; color: var(--lw-navy-950); margin-left: auto; }
.lw-brand-mark {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--lw-navy-900), var(--lw-teal-600));
  color: #fff; font-weight: 800; box-shadow: 0 7px 18px rgba(13,109,102,.22);
}
.lw-brand-copy { display: flex; flex-direction: column; line-height: 1.35; }
.lw-brand-title { font-size: 19px; font-weight: 800; color: var(--lw-navy-950); }
.lw-brand-tagline { font-size: 12px; color: var(--lw-muted); }
.lw-nav ul { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; gap: 6px; }
.lw-nav a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--lw-ink); font-size: 14px; font-weight: 650; }
.lw-nav a:hover, .lw-nav .current-menu-item > a { background: var(--lw-teal-100); color: var(--lw-teal-700); }
.lw-header-search { display: flex; align-items: center; width: min(320px, 30vw); position: relative; }
.lw-header-search input { width: 100%; padding: 10px 42px 10px 14px; border: 1px solid var(--lw-line); border-radius: 12px; background: var(--lw-bg); outline: none; }
.lw-header-search input:focus { border-color: var(--lw-teal-600); box-shadow: 0 0 0 3px rgba(16,135,124,.12); }
.lw-header-search button { position: absolute; right: 7px; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; color: var(--lw-muted); }
.lw-menu-toggle { display: none; border: 1px solid var(--lw-line); background: #fff; border-radius: 10px; width: 42px; height: 42px; cursor: pointer; }

/* Hero */
.lw-hero { background: linear-gradient(135deg, var(--lw-navy-950), var(--lw-navy-800)); color: #fff; padding: 74px 0 66px; overflow: hidden; position: relative; }
.lw-hero::before, .lw-hero::after { content: ""; position: absolute; border-radius: 999px; pointer-events: none; }
.lw-hero::before { width: 440px; height: 440px; left: -120px; top: -240px; background: rgba(16,135,124,.20); }
.lw-hero::after { width: 280px; height: 280px; right: -100px; bottom: -180px; border: 54px solid rgba(184,139,61,.12); }
.lw-hero-inner { position: relative; z-index: 2; max-width: 820px; margin-inline: auto; text-align: center; }
.lw-eyebrow { display: inline-flex; padding: 6px 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #b8ded8; font-size: 13px; margin-bottom: 16px; background: rgba(255,255,255,.05); }
.lw-hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.4; margin: 0 0 12px; letter-spacing: -.4px; }
.lw-hero p { color: rgba(255,255,255,.75); max-width: 680px; margin: 0 auto 28px; font-size: 17px; }
.lw-search-large { display: flex; max-width: 720px; margin: auto; background: #fff; border-radius: 15px; padding: 7px; box-shadow: 0 18px 40px rgba(0,0,0,.22); }
.lw-search-large input { flex: 1; border: 0; outline: none; padding: 10px 14px; min-width: 0; color: var(--lw-ink); background: transparent; }
.lw-search-large button { border: 0; border-radius: 11px; padding: 10px 24px; background: var(--lw-teal-600); color: #fff; font-weight: 750; cursor: pointer; }
.lw-search-large button:hover { background: var(--lw-teal-700); }

/* Sections */
.lw-section { padding: 64px 0; }
.lw-section + .lw-section { padding-top: 0; }
.lw-section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.lw-section-head h2 { margin: 0; font-size: clamp(24px, 3vw, 34px); color: var(--lw-navy-950); }
.lw-section-head p { margin: 6px 0 0; color: var(--lw-muted); font-size: 14px; }
.lw-link-more { font-size: 14px; font-weight: 700; white-space: nowrap; }

.lw-category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.lw-category-card { background: var(--lw-surface); border: 1px solid var(--lw-line); border-radius: var(--lw-radius); padding: 24px; min-height: 185px; display: flex; flex-direction: column; transition: .2s ease; color: var(--lw-ink); }
.lw-category-card:hover { transform: translateY(-4px); border-color: rgba(16,135,124,.45); box-shadow: var(--lw-shadow); }
.lw-category-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--lw-teal-100); color: var(--lw-teal-700); margin-bottom: 18px; font-weight: 900; }
.lw-category-card h3 { margin: 0 0 7px; font-size: 20px; color: var(--lw-navy-950); }
.lw-category-card p { margin: 0; color: var(--lw-muted); font-size: 14px; line-height: 1.75; }
.lw-category-count { margin-top: auto; padding-top: 16px; font-size: 12px; color: var(--lw-teal-700); font-weight: 750; }

.lw-record-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.lw-record-card { background: var(--lw-surface); border: 1px solid var(--lw-line); border-radius: var(--lw-radius); overflow: hidden; display: flex; flex-direction: column; min-height: 270px; transition: .2s ease; }
.lw-record-card:hover { transform: translateY(-3px); box-shadow: var(--lw-shadow); border-color: rgba(16,135,124,.35); }
.lw-record-card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.lw-record-type { display: inline-flex; align-self: flex-start; border-radius: 999px; background: var(--lw-gold-100); color: #735418; padding: 3px 10px; font-size: 11px; font-weight: 750; margin-bottom: 13px; }
.lw-record-card h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.65; color: var(--lw-navy-950); }
.lw-record-card p { margin: 0; color: var(--lw-muted); font-size: 14px; line-height: 1.75; }
.lw-record-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; border-top: 1px solid var(--lw-line); margin-top: auto; padding-top: 16px; font-size: 12px; color: var(--lw-muted); }

/* Archive */
.lw-page-hero { padding: 46px 0; background: #fff; border-bottom: 1px solid var(--lw-line); }
.lw-page-hero h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); color: var(--lw-navy-950); }
.lw-page-hero p { margin: 9px 0 0; color: var(--lw-muted); max-width: 760px; }
.lw-toolbar { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; }
.lw-filter-list { display: flex; gap: 8px; flex-wrap: wrap; }
.lw-filter-list a { padding: 7px 12px; background: #fff; border: 1px solid var(--lw-line); border-radius: 999px; color: var(--lw-ink); font-size: 13px; }
.lw-filter-list a:hover, .lw-filter-list a.is-active { background: var(--lw-navy-900); color: #fff; border-color: var(--lw-navy-900); }
.lw-result-count { color: var(--lw-muted); font-size: 13px; }

/* Single */
.lw-single-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
.lw-article { background: #fff; border: 1px solid var(--lw-line); border-radius: var(--lw-radius); padding: clamp(24px, 4vw, 48px); }
.lw-article h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.55; color: var(--lw-navy-950); margin: 0 0 18px; }
.lw-article-meta { display: flex; gap: 10px 20px; flex-wrap: wrap; color: var(--lw-muted); font-size: 13px; padding-bottom: 22px; border-bottom: 1px solid var(--lw-line); margin-bottom: 28px; }
.lw-article-content { line-height: 2.05; }
.lw-article-content h2, .lw-article-content h3 { color: var(--lw-navy-950); margin-top: 1.8em; line-height: 1.6; }
.lw-article-content a { text-decoration: underline; text-underline-offset: 3px; }
.lw-article-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.lw-article-content th, .lw-article-content td { border: 1px solid var(--lw-line); padding: 10px 12px; }
.lw-side-card { background: #fff; border: 1px solid var(--lw-line); border-radius: var(--lw-radius); padding: 20px; position: sticky; top: 100px; }
.lw-side-card h2 { font-size: 16px; margin: 0 0 14px; color: var(--lw-navy-950); }
.lw-fact { padding: 12px 0; border-top: 1px solid var(--lw-line); }
.lw-fact:first-of-type { border-top: 0; padding-top: 0; }
.lw-fact-label { display: block; font-size: 11px; color: var(--lw-muted); margin-bottom: 3px; }
.lw-fact-value { font-size: 14px; color: var(--lw-ink); word-break: break-word; }
.lw-download { display: block; text-align: center; margin-top: 16px; padding: 11px 14px; border-radius: 10px; background: var(--lw-teal-600); color: #fff; font-weight: 750; }
.lw-download:hover { color: #fff; background: var(--lw-teal-700); }

/* Generic */
.lw-notice { padding: 16px 18px; border: 1px solid #ead6a9; background: #fff8e9; border-radius: 12px; color: #6f571f; margin-bottom: 24px; font-size: 14px; }
.lw-empty { text-align: center; background: #fff; border: 1px dashed var(--lw-line); border-radius: var(--lw-radius); padding: 56px 20px; }
.lw-empty h2 { margin: 0 0 6px; color: var(--lw-navy-950); }
.lw-pagination { margin-top: 30px; }
.lw-pagination .nav-links { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.lw-pagination .page-numbers { min-width: 39px; height: 39px; padding: 4px 11px; border: 1px solid var(--lw-line); background: #fff; border-radius: 9px; display: grid; place-items: center; color: var(--lw-ink); }
.lw-pagination .current { background: var(--lw-navy-900); color: #fff; border-color: var(--lw-navy-900); }

/* Footer */
.lw-footer { margin-top: 68px; background: var(--lw-navy-950); color: rgba(255,255,255,.7); }
.lw-footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 46px 0; }
.lw-footer h2, .lw-footer h3 { color: #fff; margin: 0 0 12px; }
.lw-footer p { margin: 0; font-size: 14px; }
.lw-footer ul { list-style: none; margin: 0; padding: 0; }
.lw-footer li + li { margin-top: 7px; }
.lw-footer a { color: rgba(255,255,255,.72); font-size: 14px; }
.lw-footer a:hover { color: #fff; }
.lw-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 0; font-size: 12px; }

/* WordPress */
.alignwide { width: min(1120px, 100%); margin-inline: auto; }
.alignfull { width: 100%; }
.wp-caption, .gallery-caption { color: var(--lw-muted); }
.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: 980px) {
  .lw-menu-toggle { display: inline-grid; place-items: center; }
  .lw-nav { display: none; position: absolute; top: 76px; right: 16px; left: 16px; background: #fff; border: 1px solid var(--lw-line); box-shadow: var(--lw-shadow); border-radius: 14px; padding: 10px; }
  .lw-nav.is-open { display: block; }
  .lw-nav ul { display: block; }
  .lw-header-search { width: min(300px, 36vw); }
  .lw-category-grid, .lw-record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lw-single-wrap { grid-template-columns: 1fr; }
  .lw-side-card { position: static; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .lw-container { width: min(calc(100% - 22px), var(--lw-content)); }
  .lw-header-row { min-height: 68px; }
  .lw-brand-tagline { display: none; }
  .lw-header-search { display: none; }
  .lw-nav { top: 68px; }
  .lw-hero { padding: 54px 0 48px; }
  .lw-search-large { display: grid; gap: 7px; }
  .lw-search-large input { width: 100%; }
  .lw-search-large button { width: 100%; }
  .lw-section { padding: 48px 0; }
  .lw-category-grid, .lw-record-grid { grid-template-columns: 1fr; }
  .lw-section-head { align-items: start; }
  .lw-footer-top { grid-template-columns: 1fr; gap: 26px; }
  .lw-article { padding: 22px; }
}

@media print {
  .lw-header, .lw-footer, .lw-side-card, .lw-page-hero, .lw-pagination { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .lw-section { padding: 0; }
  .lw-article { border: 0; padding: 0; }
  .lw-single-wrap { display: block; }
  a { color: #000; text-decoration: none; }
}
