/*
Theme Name: Lawsuit Results Theme
Theme URI: https://lawsuit-results.com
Author: Tim Brocklehurst
Description: Authoritative legal documentation theme. GOV.UK-inspired clarity and trust.
Version: 2.1.0
License: GNU General Public License v2 or later
Text Domain: lawsuit-results-theme
*/

/* =============================================================================
   TOKENS
   --header-h tracks the measured fixed header height so every offset
   that depends on it stays in sync automatically.
   ============================================================================= */

:root {
    /* Palette */
    --navy:          #1a2332;
    --blue:          #005ea2;
    --blue-dark:     #003d7a;
    --green:         #00703c;
    --green-dark:    #004e2a;
    --amber:         #a66500;
    --red:           #c0392b;
    --red-dark:      #922b21;
    --bg:            #f3f2f1;
    --surface:       #ffffff;
    --surface-alt:   #f8f8f7;
    --border:        #d8d8d8;
    --border-strong: #b1b4b6;
    --text:          #0b0c0c;
    --text-sec:      #505a5f;
    --text-muted:    #767676;

    /* Fonts */
    --font-head: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "Courier New", Courier, monospace;

    /* Spacing */
    --s1:  4px;
    --s2:  8px;
    --s3:  16px;
    --s4:  24px;
    --s5:  32px;
    --s6:  48px;

    /* Layout */
    --content-max:  820px;
    --site-max:    1200px;
    --content-pad:  24px;

    /* Fixed header — update if header markup changes */
    --header-h:     88px;   /* branding(~52px) + nav(~36px) */
    --admin-bar-h:  32px;
}

@media screen and (max-width: 782px) {
    :root { --admin-bar-h: 46px; }
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}


/* =============================================================================
   1. RESET
   ============================================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
}

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

a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); text-decoration-thickness: 2px; }

ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.25em; line-height: 1.6; }

/* Prevent overflow globally */
* { max-width: 100%; overflow-wrap: break-word; word-break: break-word; }

/* Exempt elements that handle their own overflow */
table, iframe, .embedded-document iframe, img, .document-link {
    overflow-wrap: normal;
    word-break: normal;
}


/* =============================================================================
   2. TYPOGRAPHY
   ============================================================================= */

h1, h2, h3, h4 {
    font-family: var(--font-head);
    line-height: 1.25;
    color: var(--navy);
}

h1 { font-size: clamp(1.35rem, 3.5vw, 2.1rem); font-weight: 700; margin-bottom: var(--s3); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.05rem, 2.5vw, 1.45rem); font-weight: 600; margin: var(--s5) 0 var(--s3); padding-bottom: var(--s2); border-bottom: 2px solid var(--border); letter-spacing: -0.01em; }
h3 { font-size: 1.025rem; font-weight: 700; margin: var(--s4) 0 var(--s2); }
h4 { font-size: 0.95rem; font-weight: 700; margin: var(--s3) 0 var(--s1); }

p { margin-bottom: var(--s3); color: var(--text); line-height: 1.75; }
p:last-child { margin-bottom: 0; }

p.subtitle {
    font-size: 1rem;
    color: var(--text-sec);
    border-left: 4px solid var(--border-strong);
    padding: var(--s2) 0 var(--s2) var(--s3);
    margin: 0 0 var(--s4);
    line-height: 1.6;
    font-style: italic;
}

strong { font-weight: 700; }

cite {
    display: block;
    font-style: normal;
    font-weight: 600;
    font-size: 0.825rem;
    color: var(--text-sec);
    margin-top: var(--s3);
    padding-top: var(--s2);
    border-top: 1px solid var(--border);
}


/* =============================================================================
   3. PAGE LAYOUT
   entry-header and entry-content share identical max-width and auto
   side margins so the H1 and body text are symmetrically centred.
   ============================================================================= */

.site { max-width: var(--site-max); margin: 0 auto; }

.site-content {
    margin-top: var(--header-h);
    padding: var(--s4) var(--content-pad) var(--s6);
    overflow: visible;
}

.admin-bar .site-content {
    margin-top: calc(var(--header-h) + var(--admin-bar-h));
}

article.type-page { background: var(--bg); }

/* H1 header and content share max-width and centering */
.entry-header,
.entry-content {
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.entry-header {
    background: transparent;
    padding: var(--s4) 0 var(--s3);
}

.entry-content {
    background: var(--surface);
    padding: var(--s5) var(--s5);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    overflow: visible;
}

/* Inner sections get no background/shadow — avoid double-boxing */
.entry-content section,
.entry-content article {
    background: transparent;
    padding: 0;
    box-shadow: none;
    margin-bottom: var(--s5);
}

.entry-content section h2:first-child,
.entry-content article h2:first-child { margin-top: 0; }

/* Outer article/section cards */
article, section {
    background: var(--surface);
    padding: var(--s5);
    margin-bottom: var(--s3);
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.background-section {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    padding: var(--s4);
    margin: var(--s4) 0;
}

.home_intro_header { width: 100%; }

.container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--content-pad);
}

/* Breadcrumbs match content width */
.breadcrumbs-wrapper {
    max-width: var(--content-max);
    margin: 0 auto;
}

/* Spacers */
.twenty-spacer { height: 20px; }
.thirty-spacer { height: 30px; }
.forty-spacer  { height: 40px; }


/* =============================================================================
   4. FIXED HEADER & NAVIGATION
   ============================================================================= */

.site-header,
header#masthead.site-header {
    background: var(--navy);
    color: #fff;
    padding: 0 var(--content-pad);
    position: fixed;
    z-index: 1000;
    left: 0; right: 0; top: 0;
}

.admin-bar .site-header,
.admin-bar header#masthead.site-header {
    top: var(--admin-bar-h);
}

.site-header .site-branding {
    max-width: var(--site-max);
    margin: 0 auto;
    padding: 14px 0 0;
}

.site-title, p.site-title {
    font-family: var(--font-head);
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.site-title a { color: #fff; text-decoration: none; }
.site-title a:hover { text-decoration: underline; color: #fff; }

.main-site-intro {
    display: none;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    margin-top: 3px;
}

.main-navigation {
    max-width: var(--site-max);
    margin: 0 auto;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 6px 0 0;
    margin: 0;
}

.main-navigation a {
    display: block;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s;
    white-space: nowrap;
}

.main-navigation li a:hover { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }
.main-navigation li.current-menu-item a { background: rgba(255,255,255,0.16); color: #fff; font-weight: 700; text-decoration: none; }

.hamburger { display: none; background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; padding: 10px 0; line-height: 1; }

header nav.mobile-menu { display: none; padding-bottom: var(--s3); }
.mobile-menu-items { list-style: none; padding: 0; margin: 0; }
.mobile-menu-items li { border-top: 1px solid rgba(255,255,255,0.1); margin: 0; }
.mobile-menu-items li a { display: block; color: rgba(255,255,255,0.88); text-decoration: none; padding: 10px 0; font-size: 0.9rem; }
.mobile-menu-items li a:hover { color: #fff; text-decoration: underline; }


/* =============================================================================
   5. BREADCRUMBS
   ============================================================================= */

.breadcrumbs {
    font-size: 0.8rem;
    padding: var(--s2) 0 var(--s3);
    color: var(--text-sec);
    line-height: 1.5;
}

.breadcrumb-home { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb-home:hover { color: var(--blue-dark); }
.breadcrumb-separator { color: var(--text-muted); margin: 0 6px; font-size: 0.7rem; }
.breadcrumb-current { color: var(--text-sec); font-weight: 500; }


/* =============================================================================
   6. STATUS BADGES
   ============================================================================= */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--green);
    color: #fff;
    padding: 5px 14px;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    max-width: none;
}

.status-badge.case-dismissed, .status-badge.case-closed { background: var(--green); }
.status-badge.retraction { background: var(--blue); }
.status-badge.warning { background: var(--amber); }


/* =============================================================================
   7. CASE STATUS / VERDICT BOX
   Badges are vertically and horizontally centred.
   ============================================================================= */

.case-status {
    background: #f0fbf4;
    border: 2px solid var(--green);
    padding: var(--s3) var(--s4);
    margin: var(--s4) 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    min-height: 52px;
    text-align: center;
}

.case-status h2 {
    font-size: 0.975rem;
    font-weight: 700;
    color: #00542e;
    margin: 0;
    padding: 0;
    border: none;
    width: 100%;
    text-align: center;
}

.case-status .status-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #00542e;
    margin: 0;
    width: 100%;
    text-align: center;
}

.case-status-box {
    background: #f0fbf4;
    border: 2px solid var(--green);
    padding: var(--s4);
    margin: var(--s4) 0;
    text-align: center;
}


/* =============================================================================
   8. LAWSUIT OUTCOME BOX
   ============================================================================= */

.lawsuit-outcome {
    background: #edf4fb;
    border-left: 5px solid var(--blue);
    padding: var(--s3) var(--s4);
    margin: var(--s4) 0;
}

.lawsuit-outcome h2, .lawsuit-outcome h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 var(--s2);
    padding: 0;
    border: none;
}


/* =============================================================================
   9. ALERT BOXES
   ============================================================================= */

.alert-box {
    padding: var(--s3) var(--s4);
    margin: var(--s4) 0;
    border-left: 5px solid;
    line-height: 1.6;
}

.alert-box h2, .alert-box h3 { font-size: 1rem; font-weight: 700; margin: 0 0 var(--s2); padding: 0; border: none; line-height: 1.3; }
.alert-box p:last-child { margin-bottom: 0; }

.alert-box.info    { background: #edf4fb; border-color: var(--blue);  color: #1a3a5c; }
.alert-box.success { background: #f0fbf4; border-color: var(--green); color: #004225; }
.alert-box.warning { background: #fef8ec; border-color: var(--amber); color: #5c3900; }
.alert-box.info    h2, .alert-box.info    h3 { color: #0d2a45; }
.alert-box.success h2, .alert-box.success h3 { color: #003319; }
.alert-box.warning h2, .alert-box.warning h3 { color: #3d2600; }
.alert-box.key-facts ul { margin-left: var(--s4); }


/* =============================================================================
   10. KEY FACTS & SUMMARY BOX
   ============================================================================= */

.key-facts {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-left: 5px solid var(--border-strong);
    padding: var(--s3) var(--s4);
    margin: var(--s4) 0;
}

.key-facts h3, .key-points h3 { margin: 0 0 var(--s2); font-size: 1rem; color: var(--navy); padding: 0; border: none; }

.key-facts ul, .key-points ul { list-style: none; padding: 0; margin: 0; }

.key-facts li { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; line-height: 1.5; color: var(--text); margin: 0; }
.key-facts li:last-child { border-bottom: none; }

.summary-box, .key-points { background: var(--surface-alt); border: 1px solid var(--border); padding: var(--s4); margin: var(--s4) 0; }
.summary-box h2, .summary-box h3 { margin: 0 0 var(--s2); border: none; padding: 0; font-size: 1rem; }


/* =============================================================================
   11. BLOCKQUOTES
   ============================================================================= */

blockquote {
    border-left: 5px solid var(--blue);
    margin: var(--s4) 0;
    padding: var(--s3) var(--s4);
    background: var(--surface-alt);
    font-size: 0.975rem;
    line-height: 1.75;
    color: var(--text);
}

blockquote p { color: inherit; margin-bottom: var(--s2); }

blockquote.official {
    background: #f6f4f0;
    border-left: 5px solid var(--navy);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--navy);
}

blockquote.official p { color: var(--navy); }
.timeline-item.final blockquote { border-left-color: var(--green); background: #f0fbf4; }


/* =============================================================================
   12. TABLES
   th has fixed width ~36% with no wrapping to keep rows even-height.
   ============================================================================= */

table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--s4) 0;
    font-size: 0.9rem;
    background: var(--surface);
    table-layout: fixed;
}

thead tr { background: #e8edf4; }

th {
    text-align: left !important;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--navy);
    background: #e8edf4;
    border-right: 3px solid #c5d0e0;
    white-space: nowrap;
    vertical-align: middle;
    width: 36%;
}

td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text); line-height: 1.5; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: var(--surface-alt); }

.key-facts table { border: none; margin: var(--s2) 0 0; table-layout: auto; }
.key-facts table th { width: auto; white-space: normal; }


/* =============================================================================
   13. TIMELINE
   ============================================================================= */

.timeline-container {
    position: relative;
    padding-left: 40px;
    margin: var(--s5) 0;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 6px;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--blue) 0%, var(--blue) 62%, var(--green) 100%);
    z-index: 0;
}

.timeline-item { position: relative; padding-bottom: var(--s5); margin: 0; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
    position: absolute;
    left: -27px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--surface);
    border: 3px solid var(--blue);
    box-shadow: 0 0 0 2px var(--surface);
    z-index: 2;
    flex-shrink: 0;
}

.timeline-marker.final { border-color: var(--green); background: var(--green); }

.timeline-date { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--blue); margin-bottom: 4px; }
.timeline-date.final { color: var(--green); }
.timeline-title { font-size: 1rem; font-weight: 700; color: var(--navy); margin: 0 0 var(--s2); line-height: 1.3; }
.timeline-item.final .timeline-title { color: var(--green-dark); }
.timeline-content { font-size: 0.9rem; color: var(--text-sec); line-height: 1.7; }
.timeline-content p, .timeline-content ul { font-size: 0.9rem; color: var(--text-sec); }


/* =============================================================================
   14. DOCUMENT LINK BUTTONS
   ============================================================================= */

.document-links { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s4) 0; align-items: center; }

.document-link {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    background: var(--blue);
    color: #fff;
    padding: 9px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 2px;
    transition: background 0.15s;
    box-shadow: 0 2px 0 var(--blue-dark);
    white-space: nowrap;
    max-width: none;
}

.document-link:hover { background: var(--blue-dark); color: #fff; text-decoration: none; }
.document-link.primary { background: var(--red); box-shadow: 0 2px 0 var(--red-dark); }
.document-link.primary:hover { background: var(--red-dark); color: #fff; }
.doc-icon { font-size: 1em; line-height: 1; flex-shrink: 0; }


/* =============================================================================
   15. FAQ ITEMS
   ============================================================================= */

.faq-item { padding: var(--s3) 0 var(--s4); border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-question, p.faq-question { font-size: 0.975rem; font-weight: 700; color: var(--navy); margin: 0 0 var(--s2); line-height: 1.4; }
.faq-answer, p.faq-answer { font-size: 0.9rem; color: var(--text-sec); line-height: 1.75; margin: 0; }


/* =============================================================================
   16. EMBEDDED DOCUMENTS
   ============================================================================= */

.embedded-document { margin: var(--s4) 0; border: 1px solid var(--border-strong); overflow: hidden; }

.embedded-document .document-description,
p.document-description {
    display: block;
    padding: 10px 16px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    color: var(--text-sec);
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    font-style: normal;
    overflow-wrap: normal;
    word-break: normal;
}

.embedded-document iframe { display: block; width: 100%; border: none !important; }


/* =============================================================================
   17. HOMEPAGE CASE GRID
   ============================================================================= */

.cases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); margin-top: var(--s5); }

.case-card { background: var(--surface); padding: var(--s4); border-top: 4px solid var(--blue); box-shadow: 0 1px 4px rgba(0,0,0,0.08); transition: box-shadow 0.2s; display: flex; flex-direction: column; gap: var(--s2); }
.case-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.case-card h3 { color: var(--navy); font-size: 0.975rem; margin: 0; line-height: 1.35; }
.case-date { color: var(--text-muted); font-size: 0.8rem; font-style: italic; margin: 0; }
.case-link { display: inline-block; background: var(--navy); color: #fff; padding: 7px 16px; text-decoration: none; font-size: 0.875rem; font-weight: 600; border-radius: 2px; transition: background 0.15s; align-self: flex-start; margin-top: auto; }
.case-link:hover { background: var(--blue-dark); color: #fff; text-decoration: none; }


/* =============================================================================
   18. FOOTER
   ============================================================================= */

.site-footer, footer { background: var(--navy); color: rgba(255,255,255,0.7); text-align: center; padding: var(--s5) var(--content-pad); margin-top: var(--s6); }
.site-footer .site-info p, footer p { color: rgba(255,255,255,0.65); font-size: 0.875rem; margin: 0; }


/* =============================================================================
   19. EDIT LINK / ADMIN
   ============================================================================= */

.edit-link { margin-top: var(--s4); display: inline-block; }
.edit-link a { background: var(--blue); color: #fff; padding: 6px 14px; font-size: 0.85rem; text-decoration: none; border-radius: 2px; }
.edit-link a:hover { background: var(--blue-dark); text-decoration: none; color: #fff; }


/* =============================================================================
   20. MAIN NETWORK SITE OVERRIDES
   ============================================================================= */

body.main-network-site .site-title { text-align: center; }
body.main-network-site .main-site-intro { display: block; text-align: center; }
body.main-network-site .entry-header { text-align: center; }
body.main-network-site #site-navigation,
body.main-network-site .hamburger,
body.main-network-site .mobile-menu { display: none; }


/* =============================================================================
   21. RESPONSIVE
   ============================================================================= */

/* Tablet landscape */
@media (max-width: 1024px) {
    :root { --content-pad: 20px; }
    .entry-content { padding: var(--s4); }
}

/* Tablet portrait / large phone */
@media (max-width: 768px) {
    :root { --header-h: 56px; --content-pad: 16px; }

    .main-navigation { display: none; }
    .hamburger { display: block; }
    .mobile-menu { display: none; }
    header nav.mobile-menu.is-open { display: block; }

    .site-content { padding: var(--s3) var(--content-pad) var(--s5); }
    .entry-header { padding: var(--s3) 0 var(--s2); }
    .entry-content { padding: var(--s4) var(--s3); }
    .breadcrumbs { padding: var(--s2) 0 var(--s2); }

    h1 { font-size: 1.3rem; }
    h2 { font-size: 1.05rem; }

    /* Tables: horizontal scroll rather than cell wrapping */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 0.85rem; table-layout: auto; }
    th { white-space: normal; width: auto; }

    .document-links { flex-direction: column; align-items: stretch; }
    .document-link { width: 100%; justify-content: center; max-width: 100%; }

    .timeline-container { padding-left: 32px; }
    .timeline-container::before { left: 16px; }
    .timeline-marker { left: -23px; }

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

    /* Ali Shihabi two-column grids stack */
    .entry-content > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* Phone */
@media (max-width: 480px) {
    :root { --header-h: 52px; }

    .entry-content { padding: var(--s3) var(--s2); }
    .site-content { padding: var(--s2) var(--s2) var(--s5); }

    h1 { font-size: 1.15rem; }

    .site-title, p.site-title { font-size: 0.825rem; }

    blockquote, blockquote.official { padding: var(--s2) var(--s3); }
    .alert-box, .key-facts, .summary-box { padding: var(--s2) var(--s3); }
    .case-status { padding: var(--s2) var(--s2); }
    .document-link { font-size: 0.8rem; padding: 8px 14px; }
}


/* =============================================================================
   22. PRINT
   ============================================================================= */

@media print {
    .site-header, .main-navigation, .hamburger, .mobile-menu, .edit-link, .document-links, .breadcrumbs, #wpadminbar { display: none !important; }
    body { background: #fff; font-size: 11pt; color: #000; }
    .entry-content { max-width: 100%; padding: 0; box-shadow: none; margin-top: 0; }
    h1, h2, h3 { page-break-after: avoid; color: #000; }
    blockquote, .key-facts, .alert-box, .lawsuit-outcome { page-break-inside: avoid; }
    a { color: #000; text-decoration: underline; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
    table { display: table; overflow: visible; }
}


/* =============================================================================
   23. LEGACY COMPATIBILITY (Ali Shihabi original pages)
   ============================================================================= */

.lawsuit-login-wrapper { border-radius: 4px; }

div[style*="background: #f9f9f9"],
div[style*="background:#f9f9f9"] {
    background: var(--surface-alt) !important;
    border: 1px solid var(--border) !important;
    padding: var(--s3) var(--s4) !important;
    font-size: 0.9rem;
    line-height: 1.8;
}

.entry-content > div[style*="grid-template-columns"] { margin: var(--s4) 0 !important; }