/* ==========================================================================
   NOTT Template — Nothing Off The Table
   Lightweight, SEO-focused Joomla template
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* Brand Colors — NOTT (Nothing Off The Table) */
    --nott-teal: #3D8080;
    --nott-teal-hover: #2E6A6A;
    --nott-teal-light: #E4F2F2;
    --nott-gold: #C49A2A;
    --nott-gold-hover: #A88320;
    --nott-gold-light: #FBF2E0;
    --nott-gray: #9B9B9B;
    --nott-gray-dark: #5A5A5A;
    --nott-charcoal: #3A5568;

    /* Light Mode (default) */
    --color-bg: #F5F4F0;
    --color-bg-alt: #EFEDE8;
    --color-bg-card: #FFFFFF;
    --color-text: #2D3748;
    --color-text-muted: #6B7280;
    --color-text-light: #9B9B9B;
    --color-heading: #1A2A35;
    --color-primary: var(--nott-teal);
    --color-primary-hover: var(--nott-teal-hover);
    --color-primary-light: var(--nott-teal-light);
    --color-accent: var(--nott-gold);
    --color-accent-hover: var(--nott-gold-hover);
    --color-accent-light: var(--nott-gold-light);
    --color-border: #E2DED8;
    --color-border-light: #EAE7E2;
    --color-shadow: rgba(58, 85, 104, 0.08);
    --color-shadow-hover: rgba(58, 85, 104, 0.18);
    --color-overlay: rgba(26, 42, 53, 0.55);
    --color-code-bg: #F0EEE8;
    --color-success: #16A34A;
    --color-warning: #F59E0B;
    --color-error: #DC2626;

    /* Typography */
    --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    --line-height: 1.6;
    --line-height-tight: 1.25;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Layout */
    --container-max: 1200px;
    --container-padding: var(--space-6);
    --sidebar-width: 280px;
    --header-height: 100px;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;
    --border-radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   Dark Mode
   -------------------------------------------------------------------------- */
[data-color-scheme="dark"] {
    --color-bg: #0F1820;
    --color-bg-alt: #16212B;
    --color-bg-card: #1C2832;
    --color-text: #E2E8F0;
    --color-text-muted: #94A3B8;
    --color-text-light: #64748B;
    --color-heading: #F0F4F8;
    --color-primary-light: #0D2626;
    --color-accent-light: #261C08;
    --color-border: #243040;
    --color-border-light: #1C2830;
    --color-shadow: rgba(0, 0, 0, 0.35);
    --color-shadow-hover: rgba(0, 0, 0, 0.55);
    --color-overlay: rgba(0, 0, 0, 0.7);
    --color-code-bg: #1C2832;
}

/* Auto mode — follows system preference */
@media (prefers-color-scheme: dark) {
    [data-color-scheme="auto"] {
        --color-bg: #0F1820;
        --color-bg-alt: #16212B;
        --color-bg-card: #1C2832;
        --color-text: #E2E8F0;
        --color-text-muted: #94A3B8;
        --color-text-light: #64748B;
        --color-heading: #F0F4F8;
        --color-primary-light: #0D2626;
        --color-accent-light: #261C08;
        --color-border: #243040;
        --color-border-light: #1C2830;
        --color-shadow: rgba(0, 0, 0, 0.35);
        --color-shadow-hover: rgba(0, 0, 0, 0.55);
        --color-overlay: rgba(0, 0, 0, 0.7);
        --color-code-bg: #1C2832;
    }
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--color-heading);
    line-height: var(--line-height-tight);
    font-weight: var(--font-weight-bold);
}

h1 { font-size: var(--font-size-4xl); margin-bottom: var(--space-6); }
h2 { font-size: var(--font-size-3xl); margin-bottom: var(--space-5); }
h3 { font-size: var(--font-size-2xl); margin-bottom: var(--space-4); }
h4 { font-size: var(--font-size-xl); margin-bottom: var(--space-3); }
h5 { font-size: var(--font-size-lg); margin-bottom: var(--space-3); }
h6 { font-size: var(--font-size-base); margin-bottom: var(--space-2); }

p {
    margin-bottom: var(--space-4);
}

ul, ol {
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
}

code, pre {
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
    font-size: var(--font-size-sm);
}

code {
    background: var(--color-code-bg);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--border-radius-sm);
}

pre {
    background: var(--color-code-bg);
    padding: var(--space-4);
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin-bottom: var(--space-4);
}

pre code {
    background: none;
    padding: 0;
}

blockquote {
    border-left: 4px solid var(--color-primary);
    padding: var(--space-4) var(--space-6);
    margin: var(--space-6) 0;
    background: var(--color-bg-alt);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-6);
}

th, td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    font-weight: var(--font-weight-semibold);
    color: var(--color-heading);
    background: var(--color-bg-alt);
}

/* --------------------------------------------------------------------------
   Skip Link (Accessibility)
   -------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: 1000;
    padding: var(--space-3) var(--space-6);
    background: var(--color-primary);
    color: #fff;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    font-weight: var(--font-weight-semibold);
}

.skip-link:focus {
    top: 0;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */
.topbar {
    background: var(--nott-charcoal);
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-sm);
    padding: var(--space-2) 0;
}

.topbar a {
    color: rgba(255, 255, 255, 0.8);
}

.topbar a:hover {
    color: #fff;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
    transition: box-shadow var(--transition-base);
}

.site-header.sticky {
    position: sticky;
    top: 0;
}

.site-header.scrolled {
    box-shadow: 0 2px 20px var(--color-shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    height: var(--header-height);
}

.site-brand a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-heading);
}

.site-logo {
    height: 80px;
    width: auto;
}

.site-name {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-heading);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    z-index: 110;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-heading);
    transition: transform var(--transition-base), opacity var(--transition-fast);
}

.hamburger {
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

.nav-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Top-level menu list — always horizontal */
.nav-collapse ul {
    display: flex;
    align-items: center;
    list-style: none;
    gap: var(--space-1);
    padding: 0;
    margin: 0;
    flex-direction: row;
    flex-wrap: wrap;
    background: none;
    border: none;
    box-shadow: none;
    float: none;
    position: static;
    width: auto;
}

/* All nav links, spans, and separator elements — uniform size */
.nav-collapse a,
.nav-collapse span,
.nav-collapse .nav-header,
.nav-collapse .separator > *,
.nav-collapse .dropdown-toggle {
    display: block;
    padding: var(--space-2) var(--space-3) !important;
    color: var(--color-text) !important;
    font-weight: var(--font-weight-semibold) !important;
    font-size: var(--font-size-sm) !important;
    border-radius: var(--border-radius);
    transition: color var(--transition-fast), background-color var(--transition-fast);
    text-decoration: none !important;
    line-height: var(--line-height) !important;
    cursor: pointer;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin: 0 !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
}

/* Caret/arrow indicators on parent items */
.nav-collapse .caret,
.nav-collapse .dropdown-toggle::after {
    display: none !important;
}

/* Top-level nav links: position for underline */
.nav-collapse > ul > li > a {
    position: relative;
}

/* Top-level nav: underline on hover/active via pseudo-element */
.nav-collapse > ul > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: var(--space-3, 0.75rem);
    right: var(--space-3, 0.75rem);
    height: 2px;
    background: var(--color-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.nav-collapse > ul > li > a:hover::after,
.nav-collapse > ul > .active > a::after,
.nav-collapse > ul > .current > a::after {
    opacity: 1;
}

.nav-collapse > ul > li > a:hover,
.nav-collapse > ul > .active > a,
.nav-collapse > ul > .current > a {
    color: var(--color-primary) !important;
    background: none !important;
}

/* Dropdown items: background highlight on hover/active */
.nav-collapse ul ul a:hover,
.nav-collapse .nav-child a:hover,
.nav-collapse ul ul .active > a,
.nav-collapse .nav-child .active > a {
    color: var(--color-primary) !important;
    background: var(--color-primary-light) !important;
}

/* Dropdown submenus */
.nav-collapse li {
    position: relative;
}

.nav-collapse ul ul,
.nav-collapse .nav-child {
    display: none !important;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 160px;
    flex-direction: column !important;
    background: var(--color-bg-card, #FFFFFF);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px var(--color-shadow);
    padding: var(--space-1) 0;
    z-index: 120;
    gap: 0;
}

.nav-collapse li:hover > ul,
.nav-collapse li:hover > .nav-child,
.nav-collapse li:focus-within > ul,
.nav-collapse li:focus-within > .nav-child {
    display: flex !important;
}

.nav-collapse ul ul a,
.nav-collapse .nav-child a {
    padding: var(--space-1) var(--space-2) !important;
    border-bottom: none !important;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    border-radius: 0;
}

.nav-collapse ul ul ul,
.nav-collapse .nav-child .nav-child {
    top: 0;
    left: 100%;
}

.header-search {
    margin-left: var(--space-4);
}

/* Color scheme toggle */
.color-scheme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-full);
    padding: var(--space-2);
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.color-scheme-toggle:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.icon-moon { display: none; }

[data-color-scheme="dark"] .icon-sun { display: none; }
[data-color-scheme="dark"] .icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
    [data-color-scheme="auto"] .icon-sun { display: none; }
    [data-color-scheme="auto"] .icon-moon { display: block; }
}

/* --------------------------------------------------------------------------
   Banner
   -------------------------------------------------------------------------- */
.site-banner {
    background: var(--color-bg-alt);
    padding: var(--space-4) 0;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.site-hero {
    background: linear-gradient(135deg, var(--nott-charcoal) 0%, #1A2835 100%);
    color: #fff;
    padding: var(--space-16) 0;
    text-align: center;
}

.site-hero h1,
.site-hero h2,
.site-hero h3 {
    color: #fff;
}

.site-hero p {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--font-size-lg);
    max-width: 640px;
    margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumbs {
    padding: var(--space-4) 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border-light);
}

.nott-breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    list-style: none;
    padding: 0;
    margin: 0;
}

.nott-breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--color-text-muted);
}

.nott-breadcrumbs__item:not(:last-child)::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid var(--color-text-light);
    border-top: 1.5px solid var(--color-text-light);
    transform: rotate(45deg);
    margin-left: var(--space-2);
    margin-right: var(--space-1);
}

.nott-breadcrumbs__item a {
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.nott-breadcrumbs__item a:hover {
    color: var(--color-primary);
}

.nott-breadcrumbs__item--active {
    color: var(--color-heading);
    font-weight: var(--font-weight-semibold);
}

/* --------------------------------------------------------------------------
   Main Layout Grid
   -------------------------------------------------------------------------- */
.site-main {
    flex: 1;
    padding: var(--space-10) 0;
}

/* Remove top padding when the main content area contains an article with a hero image,
   so the hero sits flush against the header bar.
   :has() is supported in all modern browsers (Chrome 105+, Safari 15.4+, Firefox 121+). */
.site-main:has(.article-hero) {
    padding-top: 0;
}

.main-grid {
    display: grid;
    gap: var(--space-10);
}

.content-full .main-grid {
    grid-template-columns: 1fr;
}

.content-sidebar-right .main-grid {
    grid-template-columns: 1fr var(--sidebar-width);
}

.content-sidebar-left .main-grid {
    grid-template-columns: var(--sidebar-width) 1fr;
}

.content-both-sidebars .main-grid {
    grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
    font-size: var(--font-size-sm);
}

.sidebar .moduletable {
    margin-bottom: var(--space-8);
}

/* --------------------------------------------------------------------------
   Above / Below Content
   -------------------------------------------------------------------------- */
.above-content,
.below-content {
    padding: var(--space-6) 0 0;
}

.above-content {
    background: var(--color-bg-alt);
}

/* --------------------------------------------------------------------------
   Bottom Modules
   -------------------------------------------------------------------------- */
.site-bottom {
    background: var(--color-bg-alt);
    padding: var(--space-6) 0 var(--space-12);
}

.bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background: #2B3C6B;
    color: rgba(255, 255, 255, 0.8);
    padding: var(--space-12) 0 var(--space-6);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.site-footer a {
    color: rgba(255, 255, 255, 0.8);
}

.site-footer a:hover {
    color: var(--color-primary);
}

.footer-copyright {
    padding-top: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.5);
}

.footer-copyright p {
    margin: 0;
}

/* --------------------------------------------------------------------------
   Module Chrome (nott style)
   -------------------------------------------------------------------------- */
.mod-nott {
    margin-bottom: var(--space-6);
}

.mod-nott:last-child {
    margin-bottom: 0;
}

.mod-nott__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-heading);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-primary);
}

/* --------------------------------------------------------------------------
   Cards (for extension listings, etc.)
   -------------------------------------------------------------------------- */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    position: relative;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px var(--color-shadow-hover);
}

.card__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.card:hover .card__image img {
    transform: scale(1.05);
}

.card__body {
    padding: var(--space-6);
}

.card__title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
}

.card__title a::after {
    content: '';
    position: absolute;
    inset: 0;
}

.card__text {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-4);
}

.card__footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-size-sm);
}

/* Card grid layout */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-ghost:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-base);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-xs);
}

/* --------------------------------------------------------------------------
   Badges / Tags
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--border-radius-full);
    background: var(--color-primary-light);
    color: var(--color-primary);
    border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.badge--success {
    background: #DCFCE7;
    color: var(--color-success);
    border-color: color-mix(in srgb, var(--color-success) 20%, transparent);
}

.badge--warning {
    background: #FEF3C7;
    color: #92400E;
    border-color: color-mix(in srgb, #92400E 20%, transparent);
}

.badge--muted {
    background: var(--color-bg-subtle, #F3F4F6);
    color: var(--color-text-muted, #6B7280);
    border-color: var(--color-border, #E5E7EB);
}

/* --------------------------------------------------------------------------
   Alerts / System Messages (Joomla 5/6 <joomla-alert> web component)
   -------------------------------------------------------------------------- */
/* Only apply spacing when there are actual messages — an empty container
   still gets margin-bottom applied and creates a phantom gap */
#system-message-container:not(:empty) {
    margin-bottom: var(--space-4);
}

joomla-alert {
    display: block;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-4);
    border: 1px solid;
    font-size: var(--font-size-sm);
    position: relative;
}

/* Hide Joomla's raw alert type heading (e.g. "success", "info") */
joomla-alert .alert-heading {
    display: none;
}

/* Reset inner wrapper backgrounds */
joomla-alert .alert-wrapper,
joomla-alert .alert-message {
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
    color: inherit;
}

/* Close button */
joomla-alert .joomla-alert--close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-4);
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    line-height: 1;
    padding: 0;
}

joomla-alert .joomla-alert--close:hover {
    opacity: 1;
}

/* Type colours — light mode */
joomla-alert[type="info"],
joomla-alert[type="notice"] {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

joomla-alert[type="success"],
joomla-alert[type="message"] {
    background: #F0FDF4;
    border-color: var(--color-success);
    color: var(--color-success);
}

joomla-alert[type="warning"] {
    background: #FFFBEB;
    border-color: var(--color-warning);
    color: #92400E;
}

joomla-alert[type="error"],
joomla-alert[type="danger"] {
    background: #FEF2F2;
    border-color: var(--color-error);
    color: var(--color-error);
}

/* Type colours — dark mode */
[data-color-scheme="dark"] joomla-alert[type="info"],
[data-color-scheme="dark"] joomla-alert[type="notice"] {
    background: #0D2626;
    border-color: var(--color-primary);
    color: #5EC9C9;
}

[data-color-scheme="dark"] joomla-alert[type="success"],
[data-color-scheme="dark"] joomla-alert[type="message"] {
    background: #052E16;
    border-color: var(--color-success);
    color: #4ADE80;
}

[data-color-scheme="dark"] joomla-alert[type="warning"] {
    background: #1C1105;
    border-color: var(--color-warning);
    color: #FBBF24;
}

[data-color-scheme="dark"] joomla-alert[type="error"],
[data-color-scheme="dark"] joomla-alert[type="danger"] {
    background: #2A0A0A;
    border-color: var(--color-error);
    color: #F87171;
}

@media (prefers-color-scheme: dark) {
    [data-color-scheme="auto"] joomla-alert[type="info"],
    [data-color-scheme="auto"] joomla-alert[type="notice"] {
        background: #2A1512;
        border-color: var(--color-primary);
        color: #F87171;
    }

    [data-color-scheme="auto"] joomla-alert[type="success"],
    [data-color-scheme="auto"] joomla-alert[type="message"] {
        background: #052E16;
        border-color: var(--color-success);
        color: #4ADE80;
    }

    [data-color-scheme="auto"] joomla-alert[type="warning"] {
        background: #1C1105;
        border-color: var(--color-warning);
        color: #FBBF24;
    }

    [data-color-scheme="auto"] joomla-alert[type="error"],
    [data-color-scheme="auto"] joomla-alert[type="danger"] {
        background: #2A0A0A;
        border-color: var(--color-error);
        color: #F87171;
    }
}

/* --------------------------------------------------------------------------
   Login Form (com_users override)
   -------------------------------------------------------------------------- */
.nott-login {
    display: flex;
    justify-content: center;
    padding: var(--space-8) 0;
}

.nott-login__card {
    width: 100%;
    max-width: 440px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-10);
}

.nott-login__card h2 {
    margin-bottom: var(--space-2);
}

.nott-login__intro {
    color: var(--color-text-muted);
    margin-bottom: var(--space-8);
}

.nott-login__field {
    margin-bottom: var(--space-5);
}

.nott-login__field label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
}

.nott-login__remember {
    margin-bottom: var(--space-4);
    font-size: var(--font-size-sm);
}

.nott-login__remember label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.nott-login__extra {
    margin-bottom: var(--space-4);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.nott-login__submit {
    width: 100%;
}

.nott-login__links {
    text-align: center;
    margin-top: var(--space-6);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.nott-login__divider {
    margin: 0 var(--space-2);
}

.nott-login__register {
    text-align: center;
    margin-top: var(--space-6);
    margin-bottom: 0;
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   User Profile (com_users/profile override)
   -------------------------------------------------------------------------- */
.nott-profile,
.nott-profile-edit {
    max-width: 680px;
    margin: 0 auto;
    padding: var(--space-6) 0;
}

.nott-profile__heading h1,
.nott-profile-edit__heading h1 {
    margin-bottom: var(--space-6);
}

.nott-profile__card,
.nott-profile-edit__card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
    margin-bottom: var(--space-6);
}

/* Profile header with avatar */
.nott-profile__header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.nott-profile__avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-full);
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    flex-shrink: 0;
}

.nott-profile__identity {
    flex: 1;
    min-width: 0;
}

.nott-profile__name {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-1);
}

.nott-profile__username {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin: 0;
}

.nott-profile__edit-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
    transition: background-color var(--transition-fast);
}

.nott-profile__edit-btn:hover {
    background: var(--color-primary-hover);
    color: #fff;
}

/* Profile detail rows */
.nott-profile__details {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nott-profile__detail {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.nott-profile__detail:last-child {
    border-bottom: none;
}

.nott-profile__label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-semibold);
}

.nott-profile__value {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    text-align: right;
}

.nott-profile__section-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.nott-profile__section-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

/* Edit profile form */
.nott-profile-edit__section-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.nott-profile-edit__section-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

/* Style Joomla's rendered form fields */
.nott-profile-edit__fields .control-group {
    margin-bottom: var(--space-5);
}

.nott-profile-edit__fields .control-label label,
.nott-profile-edit__fields .control-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: var(--space-1);
}

.nott-profile-edit__fields .controls input[type="text"],
.nott-profile-edit__fields .controls input[type="email"],
.nott-profile-edit__fields .controls input[type="password"],
.nott-profile-edit__fields .controls input[type="url"],
.nott-profile-edit__fields .controls input[type="tel"],
.nott-profile-edit__fields .controls select,
.nott-profile-edit__fields .controls textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.nott-profile-edit__fields .controls input:focus,
.nott-profile-edit__fields .controls select:focus,
.nott-profile-edit__fields .controls textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(61, 128, 128, 0.15);
}

.nott-profile-edit__fields .controls .form-text,
.nott-profile-edit__fields .controls .help-block,
.nott-profile-edit__fields .controls small {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* Password field with show/hide toggle */
.nott-profile-edit__fields .controls .input-group {
    display: flex;
    gap: 0;
}

.nott-profile-edit__fields .controls .input-group input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1;
}

.nott-profile-edit__fields .controls .input-group .btn,
.nott-profile-edit__fields .controls .input-group button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-left: none;
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    cursor: pointer;
    white-space: nowrap;
}

/* Passkey / MFA sections */
.nott-profile-edit__card fieldset {
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.nott-profile-edit__card fieldset legend {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    padding: 0 var(--space-2);
}

.nott-profile-edit__card table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.nott-profile-edit__card table th {
    text-align: left;
    padding: var(--space-2) var(--space-3);
    border-bottom: 2px solid var(--color-border);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
}

.nott-profile-edit__card table td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text);
}

/* MFA section — method list container */
#com-users-methods-list {
    font-size: var(--font-size-sm);
}

#com-users-methods-reset-container {
    border-color: var(--color-border) !important;
    background: var(--color-bg-alt) !important;
    border-radius: var(--border-radius) !important;
    padding: var(--space-3) var(--space-4) !important;
    margin-bottom: var(--space-4);
}

/* Method cards grid */
#com-users-methods-list-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

/* Individual method card */
.com-users-methods-list-method {
    border: 1px solid var(--color-border-light) !important;
    border-radius: var(--border-radius) !important;
    padding: var(--space-5) !important;
    margin: 0 !important;
    background: var(--color-bg) !important;
    overflow: hidden;
}

/* Method card header */
.com-users-methods-list-method .com-users-methods-list-method-header {
    gap: var(--space-3) !important;
    margin-bottom: var(--space-3);
}

/* Method image */
.com-users-methods-list-method .com-users-methods-list-method-image {
    background: none !important;
    padding: 0 !important;
}

.com-users-methods-list-method .com-users-methods-list-method-image img {
    max-width: 40px;
    max-height: 40px;
}

/* Method title */
.com-users-methods-list-method .com-users-methods-list-method-title h2,
.com-users-methods-list-method .com-users-methods-list-method-title h3,
.com-users-methods-list-method .com-users-methods-list-method-title h4 {
    font-size: var(--font-size-base) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Method records / body */
.com-users-methods-list-method .com-users-methods-list-method-records-container {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.com-users-methods-list-method .com-users-methods-list-method-records-container p {
    margin-bottom: var(--space-2);
}

.com-users-methods-list-method .com-users-methods-list-method-records-container a {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
    padding: 0 !important;
}

@media (max-width: 600px) {
    #com-users-methods-list-container {
        grid-template-columns: 1fr;
    }
}

/* Action buttons */
.nott-profile-edit__actions {
    display: flex;
    gap: var(--space-3);
    padding-top: var(--space-4);
    margin-bottom: var(--space-8, 2rem);
}

.nott-profile-edit__actions .btn-primary {
    padding: var(--space-3) var(--space-6);
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.nott-profile-edit__actions .btn-primary:hover {
    background: var(--color-primary-hover);
}

.nott-profile-edit__actions .btn-secondary {
    padding: var(--space-3) var(--space-6);
    background: var(--color-bg-alt);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.nott-profile-edit__actions .btn-secondary:hover {
    background: var(--color-border-light);
    border-color: var(--color-text-muted);
}

.nott-profile-edit__actions .btn-danger {
    display: none;
}

/* Newsletter preference label in profile edit */
.nott-newsletter-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    cursor: pointer;
    line-height: 1.5;
}

.nott-newsletter-label input[type="checkbox"] {
    margin-top: 0.2em;
    flex-shrink: 0;
}

/* Profile responsive */
@media (max-width: 600px) {
    .nott-profile__header {
        flex-direction: column;
        text-align: center;
    }

    .nott-profile__detail {
        flex-direction: column;
        gap: var(--space-1);
    }

    .nott-profile__value {
        text-align: left;
    }

    .nott-profile__card,
    .nott-profile-edit__card {
        padding: var(--space-5);
    }
}

/* --------------------------------------------------------------------------
   Login Module (mod_login override)
   -------------------------------------------------------------------------- */
.nott-mod-login {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.nott-mod-login__field input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
}

.nott-mod-login__submit {
    width: 100%;
}

.nott-mod-login__loggedin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.nott-mod-login__loggedin p {
    margin: 0;
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Back to Top
   -------------------------------------------------------------------------- */
.back-to-top {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #2B3C6B;
    color: var(--nott-gold);
    border: none;
    border-radius: var(--border-radius-full);
    cursor: pointer;
    box-shadow: 0 4px 12px var(--color-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base), background-color var(--transition-fast);
}

.back-to-top:hover {
    background: #1e2d52;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Scroll Animations
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(24px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity var(--transition-slow), transform var(--transition-spring);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children animations */
.stagger > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.stagger.revealed > *:nth-child(1) { transition-delay: 0ms; }
.stagger.revealed > *:nth-child(2) { transition-delay: 80ms; }
.stagger.revealed > *:nth-child(3) { transition-delay: 160ms; }
.stagger.revealed > *:nth-child(4) { transition-delay: 240ms; }
.stagger.revealed > *:nth-child(5) { transition-delay: 320ms; }
.stagger.revealed > *:nth-child(6) { transition-delay: 400ms; }
.stagger.revealed > *:nth-child(7) { transition-delay: 480ms; }
.stagger.revealed > *:nth-child(8) { transition-delay: 560ms; }

.stagger.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .stagger > * {
        opacity: 1;
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-1);
    list-style: none;
    padding: 0;
    margin: var(--space-8) 0;
}

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.pagination li a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pagination .active span {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-sm { font-size: var(--font-size-sm); }
.text-lg { font-size: var(--font-size-lg); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --container-padding: var(--space-4);
        --sidebar-width: 220px;
    }

    h1 { font-size: var(--font-size-3xl); }
    h2 { font-size: var(--font-size-2xl); }

    .content-both-sidebars .main-grid {
        grid-template-columns: 1fr;
    }

    .content-both-sidebars .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

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

/* Mobile */
@media (max-width: 768px) {
    :root {
        --header-height: 80px;
    }

    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }
    h3 { font-size: var(--font-size-lg); }

    .nav-toggle {
        display: block;
    }

    .nav-collapse {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 85vw);
        height: 100vh;
        background: var(--color-bg);
        padding: calc(var(--header-height) + var(--space-6)) var(--space-6) var(--space-6);
        box-shadow: -4px 0 20px var(--color-shadow);
        transition: right var(--transition-base);
        overflow-y: auto;
        z-index: 105;
    }

    .nav-collapse.open {
        right: 0;
    }

    .nav-collapse ul {
        flex-direction: column;
        gap: var(--space-1);
    }

    .nav-collapse a {
        padding: var(--space-3) var(--space-4);
        font-size: var(--font-size-base);
    }

    /* Mobile dropdowns: indented, always visible */
    .nav-collapse ul ul,
    .nav-collapse .nav-child {
        position: static !important;
        display: flex !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        min-width: 0 !important;
        padding-left: var(--space-4) !important;
    }

    .nav-collapse ul ul a,
    .nav-collapse .nav-child a {
        font-size: var(--font-size-sm);
        padding: var(--space-2) var(--space-4);
        white-space: normal;
    }

    /* Reset flex-direction on mobile nav */
    .nav-collapse > div > ul,
    .nav-collapse > ul {
        flex-direction: column;
    }

    .header-search {
        margin-left: 0;
        margin-top: var(--space-4);
    }

    /* Sidebar stacks below content on mobile */
    .content-sidebar-right .main-grid,
    .content-sidebar-left .main-grid,
    .content-both-sidebars .main-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 10;
    }

    .site-hero {
        padding: var(--space-10) 0;
    }

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

    .site-main {
        padding: var(--space-6) 0;
    }
}

/* --------------------------------------------------------------------------
   Blog Listing
   -------------------------------------------------------------------------- */
.blog-header {
    padding-block: var(--space-8);
    margin-bottom: var(--space-8);
    border-bottom: 1px solid var(--color-border);
}

.blog-header__title {
    margin-bottom: var(--space-3);
}

.blog-header__desc {
    color: var(--color-text-muted);
    font-size: var(--font-size-lg);
    max-width: 640px;
}

.blog-empty {
    color: var(--color-text-muted);
    text-align: center;
    padding: var(--space-16) 0;
}

.blog-pagination {
    margin-top: var(--space-12);
    display: flex;
    justify-content: center;
}

/* Card extras for blog */
.card__category {
    margin-bottom: var(--space-3);
}

.card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    margin-bottom: var(--space-3);
}

.card__meta-author {
    font-weight: var(--font-weight-semibold);
}

.card__meta-sep {
    color: var(--color-text-light);
}

/* --------------------------------------------------------------------------
   Article Hero — full-bleed image with overlay
   -------------------------------------------------------------------------- */

/*
 * Full-bleed: the article renders inside .container > .content-area.
 * We use the 50% / 50vw trick to break out to viewport edges.
 * Works best on full-width (no sidebar) article pages.
 */
.article-hero {
    /*
     * Full-bleed: break out of container padding (--container-padding each side)
     * plus any auto-centering gap when the viewport is wider than --container-max.
     * Using explicit values avoids percentage-calculation ambiguity in nested grids.
     */
    width: 100vw;
    margin-left: calc(
        (var(--container-padding) * -1) -
        max(0px, (100vw - var(--container-max)) / 2)
    );
    position: relative;
    min-height: 480px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    margin-bottom: 0;
}

.article-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.article-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.80) 0%,
        rgba(0, 0, 0, 0.45) 45%,
        rgba(0, 0, 0, 0.10) 100%
    );
    display: flex;
    align-items: flex-end;
    width: 100%;
}

.article-hero__content {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    /* top padding ensures content clears the breadcrumbs overlay at the top of the image */
    padding: calc(var(--space-12) + 3rem) var(--container-padding) var(--space-12);
}

.article-hero__title {
    font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-5xl));
    color: #fff;
    margin-bottom: var(--space-4);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    line-height: var(--line-height-tight);
    overflow-wrap: break-word;
    max-width: 100%;
}

.article-hero__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-6);
}

.article-hero__sep {
    color: rgba(255, 255, 255, 0.5);
}

.article-hero__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* White outline button — for use on dark hero backgrounds */
.btn-white-outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.65);
}

.btn-white-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Article Header — no-image fallback
   -------------------------------------------------------------------------- */
.article-header {
    padding-block: var(--space-8) var(--space-6);
    margin-top: var(--space-10);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-8);
}

.article-header__title {
    margin-bottom: var(--space-3);
}

.article-header__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Article Body
   -------------------------------------------------------------------------- */
.article-body {
    padding-block: var(--space-10);
}

/* When the article body contains a full-bleed hero, remove all top/bottom spacing */
.nott-article:has(.tp-home) .article-body {
    padding-block-start: 0;
    padding-top: 0;
    margin-top: 0;
    padding-block-end: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

.article-content {
    max-width: 740px;
    margin-inline: auto;
}

/* When the article contains a full-page layout (e.g. home page), let it fill the width */
.article-content:has(.tp-home) {
    max-width: none;
}

/* Links repeated at bottom of article */
.article-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding-top: var(--space-8);
    margin-top: var(--space-8);
    border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
    .topbar,
    .site-header,
    .site-hero,
    .breadcrumbs,
    .sidebar,
    .site-bottom,
    .site-footer,
    .back-to-top,
    .nav-toggle {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
        font-size: 12pt;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .site-main {
        padding: 0;
    }
}

/* --------------------------------------------------------------------------
   Truth Project — Home Page Hero
   -------------------------------------------------------------------------- */
.tp-home {
    --tp-navy: #2B3C6B;
    --tp-gold: #D9952A;
    --tp-gold-hover: #B87D1E;

    /* Full-width breakout — mirrors the .article-hero calculation:
       pull back by the container padding + any auto-centering gap */
    width: 100vw;
    margin-left: calc(
        (var(--container-padding) * -1) -
        max(0px, (100vw - var(--container-max)) / 2)
    );
    margin-right: 0;

    position: relative;
    min-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    background-color: var(--tp-navy);        /* fallback while image loads */
    background-size: cover;
    background-position: center 50%;
    background-repeat: no-repeat;
    background-attachment: fixed;           /* CSS parallax — image stays pinned to viewport */
    overflow: hidden;
}

/* fixed attachment doesn't work on iOS/touch — fall back to scroll */
@media (hover: none) {
    .tp-home {
        background-attachment: scroll;
    }
}

/* Strip any margin Joomla's article wrapper may add above the hero */
.article-content:has(.tp-home) > *:first-child {
    margin-top: 0;
    padding-top: 0;
}

/* Dark gradient overlay — light at top to show the photo, darker at bottom for CTA legibility */
.tp-home::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(20, 28, 50, 0.15) 0%,
        rgba(20, 28, 50, 0.25) 45%,
        rgba(20, 28, 50, 0.70) 100%
    );
    z-index: 1;
}

/* Content sits above the overlay — heading top, CTA bottom */
.tp-home__inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 72vh;
    width: 100%;
    padding: 3.5rem 3rem 3.5rem;
    text-align: center;
}

.tp-home__heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2.75rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;          /* single line on desktop */
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6), 0 1px 6px rgba(0, 0, 0, 0.4);
}

/* Each sentence stays on its own line on mobile */
.tp-home__line {
    display: inline;
}

/* Upper block — heading + byline grouped at the top */
.tp-home__upper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

/* Lower block — button anchored to the bottom */
.tp-home__lower {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tp-home__sub {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: rgba(255, 255, 255, 0.90);
    line-height: 1.7;
    margin: 0;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}

.tp-home__cta {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--border-radius-full);
    padding: 0.9rem 2.5rem;
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base),
                border-color var(--transition-base), box-shadow var(--transition-base),
                transform var(--transition-fast);
    backdrop-filter: blur(4px);
}

.tp-home__cta:hover,
.tp-home__cta:focus-visible {
    background: var(--tp-gold);
    border-color: var(--tp-gold);
    color: #fff;
    box-shadow: 0 4px 22px rgba(217, 149, 42, 0.5);
    transform: translateY(-2px);
    text-decoration: none;
}

.tp-home__cta:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(217, 149, 42, 0.3);
}

@media (max-width: 768px) {
    .tp-home__heading {
        white-space: normal;
        font-size: clamp(1.6rem, 6.5vw, 2.4rem);
    }
    .tp-home__line {
        display: block;   /* each sentence on its own line */
    }
    .tp-home__inner {
        min-height: 65vh;
        padding: 2.5rem 1.25rem;
    }
}

/* Flush hero to top of page (removes site-main top padding) */
.site-main:has(.tp-home) {
    padding-top: 0;
}

/* Remove article content width cap for the hero */
.article-content:has(.tp-home) {
    max-width: none;
    margin-inline: 0;
}

/* --------------------------------------------------------------------------
   Truth Project — Our Story page
   -------------------------------------------------------------------------- */
.tp-story {
    --tp-navy: #2B3C6B;
    --tp-gold: #D9952A;
    --tp-gold-light: #FBF3E4;
    --tp-rule: rgba(43, 60, 107, 0.15);

    font-family: var(--font-family);
    color: var(--color-text);
    max-width: 760px;
    margin-inline: auto;
    padding: 1rem 0 3rem;
}

/* Opening "What if…" pull-quote */
.tp-story__pullquote {
    position: relative;
    text-align: center;
    padding: 2.5rem 2rem 2rem;
    margin: 0 0 3rem;
    border-top: 2px solid var(--tp-gold);
    border-bottom: 2px solid var(--tp-gold);
}

.tp-story__pullquote::before {
    content: '\201C';
    position: absolute;
    top: -0.6em;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 5rem;
    line-height: 1;
    color: var(--tp-gold);
    background: var(--color-bg);
    padding-inline: 0.5rem;
}

.tp-story__pullquote p {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.15rem, 2.5vw, 1.45rem);
    font-style: italic;
    color: var(--tp-navy);
    line-height: 1.7;
    margin: 0;
}

/* Lead paragraph */
.tp-story__lead {
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--color-text);
    margin: 0 0 2.5rem;
    border-left: 3px solid var(--tp-gold);
    padding-left: 1.25rem;
}

/* Body prose */
.tp-story__body {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--color-text);
    margin: 0 0 1.75rem;
}

/* Rob & Lyn intro card */
.tp-story__authors {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    background: var(--tp-gold-light);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem 2rem;
    margin: 0 0 2.5rem;
}

.tp-story__authors-avatar {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--tp-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.tp-story__authors-text {
    flex: 1;
}

.tp-story__authors-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tp-navy);
    margin: 0 0 0.5rem;
}

.tp-story__authors-bio {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--color-text);
    margin: 0;
}

/* Questions list */
.tp-story__questions {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.tp-story__questions li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--color-text);
}

.tp-story__questions li::before {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tp-gold);
    margin-top: 0.55em;
}

/* Section heading */
.tp-story__heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: var(--tp-navy);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--tp-rule);
}

/* Closing call-to-action block */
.tp-story__closing {
    background: var(--tp-navy);
    border-radius: var(--border-radius-lg);
    padding: 2.25rem 2rem;
    text-align: center;
    margin-top: 3rem;
}

.tp-story__closing p {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    font-style: italic;
    color: #fff;
    line-height: 1.75;
    margin: 0 0 1.25rem;
}

.tp-story__closing p:last-of-type {
    margin-bottom: 1.5rem;
}

.tp-story__closing-cta {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--tp-gold);
    border: 2px solid var(--tp-gold);
    border-radius: var(--border-radius-full);
    padding: 0.75rem 2rem;
    transition: background var(--transition-base), color var(--transition-base),
                transform var(--transition-fast), box-shadow var(--transition-base);
}

.tp-story__closing-cta:hover,
.tp-story__closing-cta:focus-visible {
    background: var(--tp-gold);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(217, 149, 42, 0.4);
    text-decoration: none;
}

/* Remove article-content width cap for story page */
.article-content:has(.tp-story) {
    max-width: none;
}

/* --------------------------------------------------------------------------
   ResearchLab module overrides — reduce built-in padding to match
   the template's surrounding section spacing
   -------------------------------------------------------------------------- */
.researchlab-insights-module {
    padding-top: var(--space-4) !important;
}

.researchlab-search-module {
    padding-bottom: var(--space-4) !important;
}
