/**
 * AltVeil — Dark Gothic Template for Alternative Culture Directory
 * =================================================================
 * Color Palette:
 *   --av-bg:          #0d0d0d   (near-black)
 *   --av-surface:     #1a1a1a   (cards / panels)
 *   --av-surface-hover:#242424
 *   --av-border:      #2a2a2a
 *   --av-crimson:     #8b0000   (primary accent)
 *   --av-purple:      #4a0e4e   (secondary accent)
 *   --av-forest:      #1a3a1a   (approved / success)
 *   --av-text:        #e0e0e0
 *   --av-text-sec:    #999
 *   --av-text-muted:  #666
 *   --av-link:        #c41e3a
 *   --av-link-hover:  #ff2d55
 */

/* ================================================================
   0. CUSTOM PROPERTIES
   ================================================================ */
:root {
    --av-bg: #0d0d0d;
    --av-surface: #1a1a1a;
    --av-surface-hover: #242424;
    --av-border: #2a2a2a;
    --av-crimson: #8b0000;
    --av-crimson-light: #c41e3a;
    --av-crimson-glow: rgba(139, 0, 0, .45);
    --av-purple: #4a0e4e;
    --av-purple-light: #6b1d6e;
    --av-forest: #1a3a1a;
    --av-forest-light: #2d5a2d;
    --av-text: #e0e0e0;
    --av-text-sec: #999;
    --av-text-muted: #666;
    --av-link: #c41e3a;
    --av-link-hover: #ff2d55;
    --av-amber: #b8860b;
    --av-amber-bg: rgba(184, 134, 11, .15);
    --av-green-bg: rgba(26, 58, 26, .35);
    --av-red-bg: rgba(139, 0, 0, .15);

    --ff-display: 'Cinzel Decorative', 'Cinzel', serif;
    --ff-heading: 'Cinzel', serif;
    --ff-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --header-h: 64px;
    --radius: 6px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,.5);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.6);
    --shadow-glow: 0 0 20px var(--av-crimson-glow);
    --transition: .25s ease;
}

/* ================================================================
   1. RESET & BASE
   ================================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--ff-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--av-text);
    background-color: var(--av-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--av-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--av-border);
    border-radius: 5px;
    border: 2px solid var(--av-bg);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--av-text-muted);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--av-border) var(--av-bg);
}

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

a {
    color: var(--av-link);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover,
a:focus-visible {
    color: var(--av-link-hover);
}

::selection {
    background: var(--av-crimson);
    color: #fff;
}

/* ================================================================
   2. TYPOGRAPHY
   ================================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--ff-heading);
    font-weight: 600;
    line-height: 1.25;
    color: var(--av-text);
    margin-bottom: .5em;
}

h1 { font-size: 2.5rem; font-family: var(--ff-display); font-weight: 700; }
h2 { font-size: 2rem;   font-family: var(--ff-display); font-weight: 700; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; color: var(--av-text-sec); }

p {
    margin-bottom: 1em;
}

blockquote {
    border-left: 3px solid var(--av-crimson);
    padding: 1rem 1.5rem;
    margin: 1.5em 0;
    background: var(--av-surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--av-text-sec);
}

pre, code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: .9em;
}
code {
    background: #111;
    padding: .15em .4em;
    border-radius: 3px;
    color: var(--av-crimson-light);
}
pre {
    background: #0a0a0a;
    border: 1px solid var(--av-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5em 0;
}
pre code {
    background: none;
    padding: 0;
    color: var(--av-text);
}

hr {
    border: none;
    height: 1px;
    background: var(--av-border);
    margin: 2rem 0;
}

ul, ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}
li + li {
    margin-top: .35em;
}

/* Gothic ornamental divider */
.av-gothic-divider,
.gothic-divider {
    text-align: center;
    margin: 2rem 0;
    color: var(--av-text-muted);
    font-size: 1.25rem;
    position: relative;
}
.av-gothic-divider::before,
.av-gothic-divider::after,
.gothic-divider::before,
.gothic-divider::after {
    content: '';
    display: inline-block;
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--av-border), transparent);
    vertical-align: middle;
    margin: 0 1rem;
}

/* ================================================================
   3. LAYOUT
   ================================================================ */
.av-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.av-main {
    padding: 2rem 0;
}
.av-main--fullwidth {
    padding: 0;
    max-width: 100%;
}

.av-main__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.av-main__grid--sidebar {
    grid-template-columns: 280px 1fr;
}

.av-main__top,
.av-main__bottom {
    padding: 1.5rem 0;
}

/* ================================================================
   4. HEADER
   ================================================================ */
.av-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-h);
    background: var(--av-bg);
    border-bottom: 1px solid var(--av-border);
    transition: box-shadow var(--transition), background var(--transition);
}
.av-header.is-scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, .6);
    background: rgba(13, 13, 13, .97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.av-header__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Logo */
.av-header__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}
.av-header__logo-text {
    font-family: var(--ff-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--av-crimson-light);
    text-shadow: 0 0 20px var(--av-crimson-glow), 0 0 40px rgba(139, 0, 0, .2);
    letter-spacing: .05em;
    transition: text-shadow var(--transition);
}
.av-header__logo:hover .av-header__logo-text {
    text-shadow: 0 0 25px var(--av-crimson-glow), 0 0 50px rgba(139, 0, 0, .35);
}

/* Nav */
.av-header__nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.av-header__nav ul {
    display: flex;
    list-style: none;
    gap: .25rem;
    padding: 0;
    margin: 0;
}
.av-header__nav li {
    margin: 0;
}
.av-header__nav a {
    display: block;
    padding: .5rem .85rem;
    font-size: .8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--av-text-sec);
    border-radius: var(--radius);
    position: relative;
    transition: color var(--transition);
}
.av-header__nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--av-crimson-light);
    transition: width var(--transition), left var(--transition);
}
.av-header__nav a:hover,
.av-header__nav a:focus-visible,
.av-header__nav .active > a,
.av-header__nav .current > a {
    color: var(--av-text);
}
.av-header__nav a:hover::after,
.av-header__nav .active > a::after,
.av-header__nav .current > a::after {
    width: 60%;
    left: 20%;
}

/* Header Actions */
.av-header__actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}
.av-header__logout {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

/* Hamburger */
.av-header__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid var(--av-border);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 6px;
    z-index: 1001;
}
.av-hamburger__line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--av-text);
    border-radius: 1px;
    transition: transform var(--transition), opacity var(--transition);
}
.av-header__hamburger.is-active .av-hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.av-header__hamburger.is-active .av-hamburger__line:nth-child(2) {
    opacity: 0;
}
.av-header__hamburger.is-active .av-hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ================================================================
   5. HERO SECTION
   ================================================================ */
.av-hero {
    position: relative;
    min-height: calc(100svh - var(--header-h));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: visible;
    background: var(--av-bg);
}

.av-hero__overlay {
    position: absolute;
    inset: 0;
    background:
        /* Subtle radial glow */
        radial-gradient(ellipse at 50% 30%, rgba(139, 0, 0, .08) 0%, transparent 60%),
        /* Subtle noise-like pattern using repeating gradients */
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, .003) 2px,
            rgba(255, 255, 255, .003) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, .003) 2px,
            rgba(255, 255, 255, .003) 4px
        ),
        /* Dark vignette */
        radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, .5) 100%);
    pointer-events: none;
    z-index: 1;
}

.av-hero__content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    padding: 2rem 1.5rem;
}

.av-hero__title {
    font-family: var(--ff-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    color: var(--av-text);
    letter-spacing: .08em;
    margin-bottom: .25em;
    text-shadow: 0 0 40px var(--av-crimson-glow), 0 2px 4px rgba(0, 0, 0, .5);
}

.av-hero__tagline {
    font-family: var(--ff-heading);
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: var(--av-text-sec);
    letter-spacing: .05em;
    margin-bottom: 2rem;
}

/* Search form in hero */
.av-hero__search {
    margin-bottom: 2rem;
}

.av-search-form__group {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    border: 1px solid var(--av-border);
    border-radius: 50px;
    overflow: hidden;
    background: var(--av-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.av-search-form__group:focus-within {
    border-color: var(--av-crimson);
    box-shadow: var(--shadow-glow);
}

.av-search-form__input {
    flex: 1;
    appearance: none;
    border: none;
    background: transparent;
    color: var(--av-text);
    font-family: var(--ff-body);
    font-size: 1rem;
    padding: 1rem 1.5rem;
    outline: none;
}
.av-search-form__input::placeholder {
    color: var(--av-text-muted);
}

.av-search-form__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    background: var(--av-crimson);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
}
.av-search-form__btn:hover {
    background: var(--av-crimson-light);
}

/* Hero ornament */
.av-hero__ornament {
    font-size: 1.5rem;
    color: var(--av-text-muted);
    opacity: .5;
    margin-top: 1rem;
}

/* ================================================================
   6. BUTTONS
   ================================================================ */
.av-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1.35rem;
    font-family: var(--ff-body);
    font-size: .85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}
.av-btn--primary {
    background: var(--av-crimson);
    color: #fff;
    border-color: var(--av-crimson);
}
.av-btn--primary:hover,
.av-btn--primary:focus-visible {
    background: #6d0000;
    border-color: #6d0000;
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.av-btn--secondary {
    background: var(--av-purple);
    color: #fff;
    border-color: var(--av-purple);
}
.av-btn--secondary:hover,
.av-btn--secondary:focus-visible {
    background: var(--av-purple-light);
    border-color: var(--av-purple-light);
    color: #fff;
}
.av-btn--ghost {
    background: transparent;
    color: var(--av-text-sec);
    border-color: var(--av-border);
}
.av-btn--ghost:hover,
.av-btn--ghost:focus-visible {
    color: var(--av-text);
    border-color: var(--av-text-muted);
    background: var(--av-surface);
}
.av-btn--sm {
    padding: .45rem 1rem;
    font-size: .75rem;
}
.av-btn--lg {
    padding: .85rem 2rem;
    font-size: 1rem;
}

.av-icon {
    flex-shrink: 0;
}

/* ================================================================
   7. CARDS
   ================================================================ */
.av-card,
.card {
    background: var(--av-surface);
    border: 1px solid var(--av-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.av-card:hover,
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #333;
}
.av-card__image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}
.av-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.av-card:hover .av-card__image img {
    transform: scale(1.03);
}
.av-card__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.5) 0%, transparent 50%);
    pointer-events: none;
}
.av-card__body {
    padding: 1.25rem;
}
.av-card__title {
    font-family: var(--ff-heading);
    font-size: 1.1rem;
    margin-bottom: .35em;
}
.av-card__title a {
    color: var(--av-text);
}
.av-card__title a:hover {
    color: var(--av-link-hover);
}
.av-card__meta {
    font-size: .8rem;
    color: var(--av-text-muted);
    margin-bottom: .75em;
}
.av-card__excerpt {
    font-size: .9rem;
    color: var(--av-text-sec);
    margin-bottom: 1em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.av-card__footer {
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--av-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--av-text-muted);
}

/* Card grid */
.av-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* ================================================================
   8. FORMS
   ================================================================ */
.av-form-group {
    margin-bottom: 1.25rem;
}
.av-form-group label,
.av-label,
label.required,
.control-label {
    display: block;
    margin-bottom: .4rem;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--av-text-sec);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select,
.form-control,
.inputbox {
    width: 100%;
    padding: .7rem 1rem;
    font-family: var(--ff-body);
    font-size: .95rem;
    color: var(--av-text);
    background: var(--av-surface);
    border: 1px solid var(--av-border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}
input:focus,
textarea:focus,
select:focus,
.form-control:focus,
.inputbox:focus {
    border-color: var(--av-crimson);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, .2);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Submit / generic Joomla buttons */
button[type="submit"],
input[type="submit"],
.btn-primary,
.button-primary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.5rem;
    font-family: var(--ff-body);
    font-size: .85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--av-crimson);
    color: #fff;
    border: 1px solid var(--av-crimson);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
button[type="submit"]:hover,
input[type="submit"]:hover,
.btn-primary:hover {
    background: #6d0000;
    border-color: #6d0000;
    box-shadow: var(--shadow-glow);
}

/* ================================================================
   9. BADGES
   ================================================================ */
.av-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-radius: 50px;
    line-height: 1.5;
}
.av-badge--category {
    background: var(--av-surface);
    color: var(--av-text-sec);
    border: 1px solid var(--av-border);
}
.av-badge--category .av-badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--av-crimson-light);
}
.av-badge--tag {
    background: rgba(196, 30, 58, .1);
    color: var(--av-crimson-light);
    border: 1px solid rgba(196, 30, 58, .2);
}

/* Status badges */
.badge-status-pending,
.av-badge--pending {
    background: var(--av-amber-bg);
    color: var(--av-amber);
    border: 1px solid rgba(184, 134, 11, .3);
}
.badge-status-approved,
.av-badge--approved {
    background: var(--av-green-bg);
    color: var(--av-forest-light);
    border: 1px solid rgba(26, 58, 26, .4);
}
.badge-status-rejected,
.av-badge--rejected {
    background: var(--av-red-bg);
    color: var(--av-crimson-light);
    border: 1px solid rgba(139, 0, 0, .3);
}

/* Metallic user badges */
.av-badge--metallic {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 50%, #2a2a2a 100%);
    color: #ccc;
    border: 1px solid #444;
    text-shadow: 0 1px 1px rgba(0,0,0,.5);
}
.av-badge--gold {
    background: linear-gradient(135deg, #3d2e0a 0%, #7a5c1f 50%, #3d2e0a 100%);
    color: #d4a937;
    border: 1px solid #7a5c1f;
}
.av-badge--silver {
    background: linear-gradient(135deg, #2a2a2e 0%, #50505a 50%, #2a2a2e 100%);
    color: #b0b0b8;
    border: 1px solid #50505a;
}

/* ================================================================
   10. MAP VIEW LAYOUT (com_altveil)
   ================================================================ */
.altveil-map-container {
    display: flex;
    width: 100%;
    height: calc(100vh - var(--header-h));
    overflow: hidden;
}

.altveil-sidebar {
    width: 380px;
    flex-shrink: 0;
    background: var(--av-surface);
    border-right: 1px solid var(--av-border);
    overflow-y: auto;
    z-index: 10;
}

.altveil-map-area {
    flex: 1;
    position: relative;
}

.altveil-detail-panel {
    position: fixed;
    top: var(--header-h);
    right: 0;
    width: 420px;
    height: calc(100vh - var(--header-h));
    background: var(--av-surface);
    border-left: 1px solid var(--av-border);
    box-shadow: -4px 0 20px rgba(0, 0, 0, .4);
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    overflow-y: auto;
    z-index: 20;
}
.altveil-detail-panel.is-open {
    transform: translateX(0);
}

/* ================================================================
   11. ARTICLE / BLOG OVERRIDES
   ================================================================ */
.av-article {
    background: var(--av-surface);
    border: 1px solid var(--av-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}
.av-article__image {
    position: relative;
    overflow: hidden;
    max-height: 450px;
}
.av-article__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.av-article__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(13, 13, 13, .6) 0%, transparent 40%);
}
.av-article__body {
    padding: 2rem;
}
.av-article__title {
    font-family: var(--ff-display);
    font-size: 2rem;
    margin-bottom: .5em;
}
.av-article__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .8rem;
    color: var(--av-text-muted);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--av-border);
}
.av-article__meta a {
    color: var(--av-text-sec);
}
.av-article__meta a:hover {
    color: var(--av-link-hover);
}
.av-article__content {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--av-text);
}
.av-article__content img {
    border-radius: var(--radius);
    margin: 1.5em 0;
}
.av-article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--av-border);
}

/* Blog grid */
.av-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}
.av-blog-grid .av-card {
    display: flex;
    flex-direction: column;
}
.av-blog-grid .av-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.av-blog-grid .av-card__excerpt {
    flex: 1;
}

/* Read more link */
.av-readmore {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--av-crimson-light);
    transition: gap var(--transition), color var(--transition);
}
.av-readmore:hover {
    gap: .6rem;
    color: var(--av-link-hover);
}
.av-readmore::after {
    content: '\2192';
}

/* Pagination */
.pagination,
.av-pagination {
    display: flex;
    justify-content: center;
    gap: .35rem;
    margin: 2.5rem 0 1rem;
    padding: 0;
    list-style: none;
}
.pagination li,
.av-pagination li {
    margin: 0;
}
.pagination a,
.pagination span,
.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 .6rem;
    font-size: .85rem;
    color: var(--av-text-sec);
    background: var(--av-surface);
    border: 1px solid var(--av-border);
    border-radius: var(--radius);
    transition: all var(--transition);
}
.pagination a:hover,
.page-link:hover {
    color: var(--av-text);
    border-color: var(--av-crimson);
    background: rgba(139, 0, 0, .1);
}
.pagination .active span,
.pagination .active .page-link,
.page-item.active .page-link {
    background: var(--av-crimson);
    border-color: var(--av-crimson);
    color: #fff;
}

/* ================================================================
   12. SIDEBAR
   ================================================================ */
.av-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Module chrome: card style */
.av-sidebar .card,
.av-mod-card {
    background: var(--av-surface);
    border: 1px solid var(--av-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.av-mod-card__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--av-border);
    font-family: var(--ff-heading);
    font-size: .9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--av-text);
}
.av-mod-card__body {
    padding: 1.25rem;
}

/* ================================================================
   13. FOOTER
   ================================================================ */
.av-footer {
    background: var(--av-bg);
    border-top: 1px solid var(--av-border);
    padding: 2rem 0 1.5rem;
}

/* Ornamental divider — hidden by default */
.av-footer__ornament {
    display: none;
}

.av-footer__grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.av-footer__logo {
    font-family: var(--ff-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--av-crimson-light);
    text-shadow: 0 0 15px var(--av-crimson-glow);
    display: block;
    margin-bottom: .5rem;
}
.av-footer__desc {
    font-size: .85rem;
    color: var(--av-text-muted);
}

.av-footer__modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 2rem;
}
.av-footer__modules h3,
.av-footer__modules .card-header {
    font-family: var(--ff-heading);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--av-text-sec);
    margin-bottom: .75rem;
}
.av-footer__modules ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.av-footer__modules li {
    margin: 0;
}
.av-footer__modules a {
    display: block;
    padding: .3rem 0;
    font-size: .85rem;
    color: var(--av-text-muted);
    transition: color var(--transition), padding-left var(--transition);
}
.av-footer__modules a:hover {
    color: var(--av-link-hover);
    padding-left: .35rem;
}

.av-footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--av-border);
    font-size: .8rem;
    color: var(--av-text-muted);
}
.av-footer__bottom a {
    color: var(--av-text-muted);
}
.av-footer__bottom a:hover {
    color: var(--av-link-hover);
}

/* ================================================================
   14. LOGIN / REGISTRATION FORMS
   ================================================================ */
.av-auth-form {
    max-width: 440px;
    margin: 3rem auto;
    background: var(--av-surface);
    border: 1px solid var(--av-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}
.av-auth-form fieldset {
    border: none;
    padding: 0;
    margin: 0;
    outline: none;
}
.av-auth-form legend {
    border: none;
    padding: 0;
    outline: none;
}
.av-auth-form form {
    border: none;
    outline: none;
}
.av-auth-form__header {
    text-align: center;
    margin-bottom: 2rem;
}
.av-auth-form__title {
    font-family: var(--ff-display);
    font-size: 1.75rem;
    margin-bottom: .35em;
}
.av-auth-form__subtitle {
    color: var(--av-text-muted);
    font-size: .9rem;
}
.av-auth-form .control-group,
.av-auth-form .av-form-group {
    margin-bottom: 1.25rem;
}
.av-auth-form .btn-primary,
.av-auth-form button[type="submit"] {
    width: 100%;
    justify-content: center;
    padding: .85rem;
    margin-top: .5rem;
}
.av-auth-form__footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--av-border);
    font-size: .85rem;
    color: var(--av-text-muted);
}

/* --- System messages (floating toast) --- */
#system-message-container {
    position: fixed;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    width: auto;
    min-width: 320px;
    max-width: 560px;
    padding: 0;
    pointer-events: none;
}
#system-message-container > * {
    pointer-events: auto;
}
.alert {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    font-size: .9rem;
    border: 1px solid var(--av-border);
    background: var(--av-surface);
    color: var(--av-text);
    margin-bottom: .5rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .6);
    animation: av-toast-in .35s ease-out;
}
@keyframes av-toast-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alert-success {
    background: rgba(46, 125, 50, .2);
    border-color: rgba(46, 125, 50, .5);
    color: #a5d6a7;
}
.alert-error,
.alert-danger {
    background: rgba(198, 40, 40, .2);
    border-color: rgba(198, 40, 40, .5);
    color: #ef9a9a;
}
.alert-warning {
    background: rgba(255, 160, 0, .2);
    border-color: rgba(255, 160, 0, .5);
    color: #ffe082;
}
.alert-info {
    background: rgba(66, 165, 245, .2);
    border-color: rgba(66, 165, 245, .5);
    color: #90caf9;
}
.alert .btn-close,
.alert button.close {
    float: right;
    background: none;
    border: none;
    color: inherit;
    opacity: .6;
    cursor: pointer;
    font-size: 1.1rem;
}

/* --- Profile view / edit --- */
.av-profile-details {
    margin: 0;
    padding: 0;
}
.av-profile-row {
    display: flex;
    justify-content: space-between;
    padding: .75rem 0;
    border-bottom: 1px solid var(--av-border);
}
.av-profile-row:first-child {
    border-top: 1px solid var(--av-border);
}
.av-profile-row dt {
    color: var(--av-text-muted);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.av-profile-row dd {
    margin: 0;
    color: var(--av-text);
    font-size: .9rem;
}
.av-profile-edit fieldset {
    border: none;
    padding: 0;
    margin: 0;
}
.av-profile-edit .control-label label {
    display: block;
    margin-bottom: .35rem;
}
.av-profile-edit .controls input,
.av-profile-edit .controls select {
    width: 100%;
    background: var(--av-surface);
    border: 1px solid var(--av-border);
    color: var(--av-text);
    padding: .6rem .85rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
}
.av-profile-edit .controls input:focus,
.av-profile-edit .controls select:focus {
    border-color: var(--av-crimson);
    outline: none;
}

/* ================================================================
   15. ERROR PAGE
   ================================================================ */
.av-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding: 2rem;
}
.av-error__code {
    font-family: var(--ff-display);
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 900;
    color: var(--av-crimson);
    line-height: 1;
    text-shadow: 0 0 40px var(--av-crimson-glow), 0 0 80px rgba(139, 0, 0, .15);
    margin-bottom: .1em;
}
.av-error__title {
    font-family: var(--ff-heading);
    font-size: 1.5rem;
    color: var(--av-text);
    margin-bottom: .5em;
}
.av-error__message {
    color: var(--av-text-muted);
    max-width: 480px;
    margin-bottom: 2rem;
}

/* ================================================================
   16. OFFLINE PAGE
   ================================================================ */
.av-offline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
    background: var(--av-bg);
}
.av-offline__icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--av-crimson);
}
.av-offline__title {
    font-family: var(--ff-display);
    font-size: 2rem;
    margin-bottom: .5em;
}
.av-offline__message {
    color: var(--av-text-muted);
    max-width: 420px;
    margin-bottom: 2rem;
}

/* ================================================================
   17. UTILITIES
   ================================================================ */
.text-crimson  { color: var(--av-crimson-light) !important; }
.text-purple   { color: var(--av-purple-light) !important; }
.text-muted    { color: var(--av-text-muted) !important; }
.text-sec      { color: var(--av-text-sec) !important; }
.bg-surface    { background-color: var(--av-surface) !important; }
.bg-dark       { background-color: var(--av-bg) !important; }

.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;
}

/* Fade-in animation */
.av-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s ease, transform .6s ease;
}
.av-fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================================
   18. JOOMLA MODULE CHROME — "card" style
   ================================================================ */
/* Wraps module output in card chrome when using style="card" */
div[class*="moduletable"],
.moduletable {
    margin-bottom: 1.5rem;
}

/* ================================================================
   19. RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
    .av-main__grid--sidebar {
        grid-template-columns: 240px 1fr;
    }
    .altveil-sidebar {
        width: 320px;
    }
    .altveil-detail-panel {
        width: 360px;
    }
    .av-footer__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-h: 56px;
    }

    .av-hero {
        min-height: calc(100svh - var(--header-h));
    }

    .av-header__hamburger {
        display: flex;
    }

    .av-header__nav {
        position: fixed;
        inset: 0;
        top: var(--header-h);
        background: rgba(13, 13, 13, .98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 1.5rem;
        transform: translateX(100%);
        transition: transform .35s cubic-bezier(.4, 0, .2, 1);
        z-index: 999;
    }
    .av-header__nav.is-open {
        transform: translateX(0);
    }
    .av-header__nav ul {
        flex-direction: column;
        gap: 0;
    }
    .av-header__nav a {
        padding: .85rem .5rem;
        font-size: .9rem;
        border-bottom: 1px solid var(--av-border);
    }
    .av-header__nav a::after {
        display: none;
    }

    .av-header__actions {
        display: none;
    }
    .av-header__nav.is-open ~ .av-header__actions {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem 1.5rem;
        background: var(--av-surface);
        border-top: 1px solid var(--av-border);
        z-index: 1000;
        justify-content: center;
    }

    .av-main__grid--sidebar {
        grid-template-columns: 1fr;
    }
    .av-sidebar {
        order: 2;
    }

    .altveil-map-container {
        flex-direction: column;
    }
    .altveil-sidebar {
        width: 100%;
        height: 45vh;
        border-right: none;
        border-bottom: 1px solid var(--av-border);
        order: 2;
    }
    .altveil-map-area {
        height: 55vh;
        order: 1;
    }
    .altveil-detail-panel {
        width: 100%;
        left: 0;
        transform: translateY(100%);
    }
    .altveil-detail-panel.is-open {
        transform: translateY(0);
    }

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

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .av-hero__title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .av-footer__bottom {
        flex-direction: column;
        gap: .5rem;
        text-align: center;
    }
    .av-footer__modules {
        grid-template-columns: repeat(2, 1fr);
    }

    .av-article__body {
        padding: 1.25rem;
    }
    .av-article__title {
        font-size: 1.5rem;
    }

    .av-auth-form {
        margin: 1.5rem auto;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .av-container {
        padding: 0 1rem;
    }
    .av-footer__modules {
        grid-template-columns: 1fr;
    }
    .av-search-form__input {
        font-size: .9rem;
        padding: .85rem 1rem;
    }
}
