/**
 * STYLE.CSS - Extended Styles
 * This file extends theme.css with page-specific and legacy styles
 * Design tokens are defined in theme.css - loaded first in head-common.php
 */

/* Phase 1 Refactor: Unified layout, spacing, and CSS cleanup */

/* ===========================================
   PHASE 1: PAGE LAYOUT COMPONENTS
   =========================================== */

.page-section {
    padding: var(--space-16) 0;
    background: var(--color-background);
}

.page-section-alt {
    background: var(--color-surface-secondary);
}

.page-section-compact {
    padding: var(--space-12) 0;
}

.page-header {
    padding-top: calc(var(--header-height, 72px) + var(--space-8));
    padding-bottom: var(--space-8);
    text-align: center;
}

.page-header h1 {
    margin-bottom: var(--space-4);
}

.page-header p {
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.page-content {
    max-width: var(--max-width-xl);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* ===========================================
   PHASE 1: EXTENDED CARD SYSTEM
   =========================================== */

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
}

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

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border-light);
}

.card-meta span {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.card-meta i {
    color: var(--color-accent-500);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border-light);
    background: var(--color-surface-secondary);
}

/* ===========================================
   PHASE 1: BADGE & PILL COMPONENTS
   =========================================== */

.badge-hot {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    border-radius: var(--radius-full);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: var(--color-primary-100);
    color: var(--color-primary-800);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    transition: background var(--transition-base);
}

.tag-pill:hover {
    background: var(--color-primary-200);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
}

.status-pill-published {
    background: var(--color-success-100);
    color: var(--color-success-700);
}

.status-pill-draft {
    background: var(--color-gray-200);
    color: var(--color-gray-700);
}

.status-pill-pending {
    background: var(--color-warning-100);
    color: var(--color-warning-700);
}

/* ===========================================
   PHASE 1: GRID UTILITIES
   =========================================== */

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

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-responsive {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-responsive-sm {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   PHASE 1: FORM HELPERS
   =========================================== */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.form-control {
    width: 100%;
    height: var(--input-height, 44px);
    padding: 0 var(--space-4);
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    background-color: var(--color-surface);
    border: 2px solid var(--color-border-medium);
    border-radius: var(--radius-base);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary-500);
    box-shadow: var(--focus-ring);
}

.form-help {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ===========================================
   PHASE 1: SPACING UTILITIES
   =========================================== */

.mt-section {
    margin-top: calc(var(--header-height, 72px) + var(--space-8));
}

.pt-header-clear {
    padding-top: calc(var(--header-height, 72px) + var(--space-4));
}

/* ===========================================
   END PHASE 1 COMPONENTS
   =========================================== */

/* 
   NOTE: Design tokens are defined in theme.css
   This file extends theme.css with page-specific styles
   Font import kept for legacy compatibility
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* Card image base styles */
.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: var(--light);
}

.card-image.placeholder {
    background: linear-gradient(135deg, #F5B544, #FFE6A3);
}

/* Spacing utilities */
.pt-lg {
    padding-top: var(--space-2xl);
}

.pb-lg {
    padding-bottom: var(--space-2xl);
}

.section-gap {
    padding: var(--space-2xl) 0;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.container {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 1100px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
    color: var(--color-primary-dark);
    font-weight: 700;
    line-height: var(--line-height-tight);
}

p {
    color: var(--color-text);
}

.text-muted {
    color: var(--color-text-muted);
}

/* Utilities */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--card-padding);
    box-shadow: var(--shadow-sm);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2xs) var(--space-sm);
    border-radius: 999px;
    background: rgba(15, 44, 70, 0.1);
    color: var(--color-primary);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.badge-pill {
    border-radius: 999px;
    background: rgba(245, 181, 68, 0.18);
    color: #F5B544;
    padding: var(--space-2xs) var(--space-sm);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.section-title {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: var(--color-primary-dark);
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.85rem 1.8rem;
    border-radius: var(--radius-sm);
    border: 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    font-size: var(--font-size-base);
}

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

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

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.btn-public {
    border-radius: 999px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.btn-primary-public {
    background: var(--color-accent-500);
    color: var(--color-primary-800);
    border: 1px solid var(--color-accent-500);
    border-radius: 999px;
    font-weight: 700;
}

.btn-primary-public:hover {
    background: var(--color-accent-600);
    color: var(--color-primary-800);
}

.btn-secondary-public {
    background: transparent;
    color: var(--color-accent-500);
    border: 1px solid var(--color-accent-500);
    border-radius: 999px;
    font-weight: 700;
}

.btn-secondary-public:hover {
    color: var(--color-primary-800);
    background: var(--color-accent-50);
    border-color: var(--color-accent-600);
}

.btn-secondary {
    background: var(--color-accent);
    color: var(--color-primary-800);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--color-accent-dark);
}

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

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

.btn-info {
    background: #17a2b8;
    color: #fff;
}

.btn-info:hover {
    background: #138496;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #b52a38;
}

.btn-outline-danger {
    border: 1px solid #dc3545;
    color: #dc3545;
    background: transparent;
}

.btn-outline-danger:hover {
    border-color: #b52a38;
    color: #b52a38;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Forms */
form {
    width: 100%;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18, 56, 91, 0.1);
    outline: none;
}

.search-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.search-toolbar input,
.search-toolbar select {
    background: var(--surface);
}

label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-row.two-cols {
    grid-template-columns: 2fr 1fr;
}

.choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.choice-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.color-picker-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.color-input {
    width: 80px;
    height: 50px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.color-preview {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
    color: #fff;
    background: var(--picked-color, var(--primary));
}

.preview-panel {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px dashed var(--border);
}

.preview-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.25rem;
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    background: var(--category-color, var(--primary));
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: var(--category-color, var(--primary));
}

.checkbox-label {
    margin: 0;
    font-weight: 500;
    color: var(--text);
}

.button-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Sections & tables */
section,
.table-wrapper {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

section {
    padding: var(--space-2xl) 0;
}

.table-wrapper {
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    color: var(--color-primary-dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Navigation */
.navbar {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    background: var(--primary);
    color: #fff;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-md);
    font-weight: 700;
}

.logo-text .title {
    font-size: 1.15rem;
    color: var(--primary-dark);
}

.logo-text .subtitle {
    font-size: 0.8rem;
    color: var(--muted);
}

.nav-menu .nav-cta .btn {
    border-radius: 999px;
    background: #F5B544;
    color: var(--color-primary-800);
    border: 1px solid #F5B544;
}

.nav-menu .nav-cta .btn:hover {
    background: #dfa03b;
    color: var(--color-primary-800);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    transition: transform 0.2s ease;
}

.nav-menu a {
    color: var(--muted);
    font-weight: 600;
    position: relative;
    padding-bottom: 0.2rem;
}

.nav-menu a.active,
.nav-menu a:hover {
    color: var(--primary);
}

.nav-menu a.active::after,
.nav-menu a:hover::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.nav-menu .nav-cta {
    margin-left: 0.5rem;
}

/* Admin Layout */
.admin-body {
    background: var(--background);
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--background);
}

.admin-sidebar {
    width: 260px;
    background: var(--primary-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.25rem;
    gap: 1.5rem;
}

.sidebar__brand {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.sidebar__logo {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.sidebar__brand h2 {
    margin: 0;
    font-size: 1.2rem;
}

.sidebar__brand p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(0, 0, 0, 0.15);
    padding: 0.85rem;
    border-radius: var(--radius-md);
}

.sidebar__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.sidebar__nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar__section {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.85);
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar__link i {
    width: 20px;
    text-align: center;
}

.sidebar__link:hover,
.sidebar__link.is-active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.sidebar__footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

/* Fallback layout for legacy admin pages without .admin-wrapper */
body>.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    float: left;
}

body>.admin-content {
    margin-left: 260px;
    padding: 2rem;
}

@media (max-width: 992px) {
    body>.admin-sidebar {
        width: 100%;
        float: none;
        min-height: auto;
    }

    body>.admin-content {
        margin-left: 0;
        padding: 1.5rem;
    }
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    gap: var(--space-lg);
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-header__title h1 {
    margin-bottom: 0.25rem;
}

.admin-header__title p {
    margin: 0;
    color: var(--color-text-muted);
}

.admin-header__actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-header__profile {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.9rem;
}

.admin-header__profile .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 44, 70, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-header__profile span {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.profile-menu {
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
}

.admin-content {
    padding: 2rem;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

@media (max-width: 1200px) {
    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-metrics {
        grid-template-columns: 1fr;
    }
}

.metric-card {
    display: flex;
    gap: var(--space-sm);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    align-items: center;
}

.metric-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(15, 44, 70, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--color-primary);
}

.metric-card__label {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.metric-card__value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.metric-card__sub {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.admin-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.admin-list-item__main {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex: 1;
    min-width: 200px;
}

.admin-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(15, 44, 70, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1.1rem;
    overflow: hidden;
}

.admin-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-list-item__meta {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    min-width: 180px;
}

.admin-list-item__actions {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    color: var(--color-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border: 1px solid var(--color-primary);
    box-shadow: 0 4px 6px rgba(15, 44, 70, 0.2);
}

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

.badge-role,
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-role {
    background: rgba(15, 44, 70, 0.08);
    color: var(--color-primary-dark);
}

.badge-role.is-accent {
    background: rgba(245, 176, 66, 0.15);
    color: var(--color-accent-dark);
}

.badge-status {
    background: rgba(34, 197, 94, 0.15);
    color: #166534;
}

.badge-status.is-draft {
    background: rgba(248, 113, 113, 0.15);
    color: #b91c1c;
}

.badge-status.is-suspended {
    background: rgba(251, 191, 36, 0.2);
    color: #92400e;
}

.category-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.category-list-card {
    padding: 0;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.category-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.category-item.active {
    background: rgba(26, 58, 92, 0.08);
}

.category-item:last-child {
    border-bottom: none;
}

.category-item h4 {
    margin: 0;
}

.category-item .item-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.category-item .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(26, 58, 92, 0.08);
    color: var(--primary-dark);
}

.category-detail {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.category-empty {
    text-align: center;
    color: var(--muted);
    padding: 1.5rem;
}

@media (max-width: 992px) {
    .admin-wrapper {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        flex-direction: row;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .admin-sidebar .admin-logo {
        flex: 1 1 220px;
        margin-bottom: 0;
    }

    .admin-menu {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .admin-menu li {
        flex: 1 1 200px;
    }

    .category-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .category-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .category-item .item-actions {
        width: 100%;
    }
}

.admin-nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0;
    margin: 0;
}

.admin-nav-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.admin-nav-user span {
    color: var(--muted);
    font-weight: 500;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--primary-dark);
    display: block;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--color-primary-800) 0%, var(--color-primary-700) 85%);
    color: #fff;
    padding: 4.5rem 0;
}

.hero-news {
    background: linear-gradient(135deg, var(--color-primary-950) 0%, var(--color-primary-800) 100%);
    color: #fff;
}

.hero-news .hero-visual {
    position: relative;
}

.hero-news .hero-visual.hero-news-visual {
    background: linear-gradient(145deg, rgba(11, 35, 64, 0.9), rgba(7, 21, 35, 0.88)), url('/assets/images/home-hero-legal.jpg');
    background-size: cover;
    background-position: center;
    min-height: 260px;
    border-radius: var(--radius-lg);
}

.hero-news .hero-visual img {
    width: 100%;
    display: block;
    border-radius: var(--radius-lg);
    height: 260px;
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.hero-visual-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, rgba(245, 181, 68, 0.18), rgba(255, 255, 255, 0.08));
    color: #fff;
    text-align: center;
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    z-index: 1;
    pointer-events: none;
}

.hero-visual-fallback .placeholder-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(245, 181, 68, 0.22);
    color: #fff;
    margin-bottom: var(--space-xs);
}

.hero-subpage {
    padding: var(--space-2xl) 0;
}

.hero .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    align-items: center;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-xl);
    align-items: center;
}

.hero-subpage .hero-content h1,
.hero-subpage .hero-content p {
    color: #fff;
}

.hero-subpage .hero-buttons .btn-outline {
    color: #F5B544;
    border-color: rgba(245, 181, 68, 0.7);
}

.hero-subpage .hero-buttons .btn-outline:hover {
    color: var(--color-primary-800);
    background: rgba(245, 181, 68, 0.16);
    border-color: #dea045;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hero-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.hero .eyebrow {
    color: #F5B544;
    letter-spacing: 0.18em;
}

.hero .hero-buttons .btn-outline {
    color: #F5B544;
    border-color: rgba(245, 181, 68, 0.75);
    background: transparent;
}

.hero .hero-buttons .btn-outline:hover {
    color: var(--color-primary-800);
    background: rgba(245, 181, 68, 0.16);
    border-color: #dfa03b;
}

.hero-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}



.slider-nav:hover {
    background: #fff;
}

.slider-nav.prev {
    left: 1rem;
}

.slider-nav.next {
    right: 1rem;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    cursor: pointer;
}

.slider-dot.active {
    background: var(--accent);
}

/* Sections */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2rem;
}

.section-header p {
    color: var(--muted);
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-muted-sm {
    color: var(--muted);
    font-size: 0.9rem;
}

.text-sm {
    font-size: 0.9rem;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

.text-info {
    color: #17a2b8;
}

.search-form-simple {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.min-250 { min-width: 250px; }
.min-300 { min-width: 300px; }

.info-box {
    background: var(--light);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.glossary-filters,
.faq-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.faq-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.faq-answer {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text);
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-helpful {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.helpful-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s;
}

.helpful-btn:hover {
    background: var(--light);
}

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

.quote-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quote-title i {
    color: var(--secondary);
}

.quote-icon i {
    font-size: 3rem;
    color: var(--secondary);
}

/* Chat widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: var(--font-body, 'Inter', sans-serif);
}

.chat-widget.left {
    left: 20px;
    right: auto;
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-700), var(--color-primary-500));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.chat-button i {
    font-size: 1.5rem;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-danger-500);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid #fff;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    background: linear-gradient(135deg, var(--color-primary-700), var(--color-primary-500));
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-header-info .chat-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #d1fae5;
    font-size: 0.9rem;
}

.chat-status.online::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success-500);
}

.chat-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    background: var(--color-surface-100);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    gap: 10px;
}

.chat-message .message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.chat-message .message-content {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

.chat-message.bot .message-content {
    background: var(--color-surface-50);
}

.message-time {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: #fff;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}

.chat-operator-btn,
.chat-send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 8px;
    background: var(--color-primary-600);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.chat-operator-btn:hover,
.chat-send-btn:hover {
    background: var(--color-primary-700);
}

.admin-fab {
    position: fixed;
    bottom: var(--space-6, 1.5rem);
    left: var(--space-6, 1.5rem);
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-primary-800, #0f2c46), var(--color-primary-700, #143a5c));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 20px;
    box-shadow: 0 4px 20px rgba(15, 44, 70, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
}

.admin-fab:hover {
    background: linear-gradient(135deg, var(--color-accent-500, #f5b042), var(--color-accent-600, #e4a13b));
    color: var(--color-primary-900, #0a1e31);
    transform: translateY(-4px) rotate(90deg);
    box-shadow: 0 8px 25px rgba(245, 176, 66, 0.4);
}

.main-footer {
    background: var(--color-primary-900);
    color: var(--color-text-inverse);
    padding: var(--space-16) 0 var(--space-8);
    margin-top: auto;
}

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

.footer-brand {
    max-width: 340px;
}

.footer-brand .brand-mark {
    background: linear-gradient(135deg, var(--color-primary-900), var(--color-primary-700));
}

.footer-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.footer-heading {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: #fff;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--color-accent-400);
}

.footer-newsletter {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-newsletter input {
    width: 100%;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
    margin-top: var(--space-4);
}

.footer-socials a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.footer-socials a:hover {
    background: var(--color-accent-500);
    color: var(--color-primary-900);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-links-bottom {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
}

.footer-links-bottom a {
    color: rgba(255, 255, 255, 0.85);
}

.footer-links-bottom a:hover {
    color: var(--color-accent-400);
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
}

.preview-notice {
    background: #ffc107;
    color: #000;
    padding: 1rem;
    text-align: center;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 10000;
}


.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: var(--space-lg) 0;
    justify-content: center;
}

.alphabet-nav a {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    background: #fff;
}

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

.button-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.error-icon {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: var(--color-primary-50);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: var(--space-4);
}

.error-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    background: var(--color-surface-100, #f5f6fa);
}

.error-card {
    max-width: 520px;
    text-align: center;
    background: var(--color-surface, #fff);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
}

.error-card h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-card p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.search-form-simple {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.min-250 { min-width: 250px; }
.min-300 { min-width: 300px; }

.info-box {
    background: var(--light);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.glossary-filters,
.faq-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: var(--space-lg) 0;
    justify-content: center;
}

.alphabet-nav a {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    background: #fff;
}

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

.mt-lg {
    margin-top: 1.5rem;
}

.mb-lg {
    margin-bottom: 1.5rem;
}

.w-100 {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Article Cards */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.article-image {
    background: linear-gradient(135deg, #F5B544, #FFE6A3);
    position: relative;
}

.article-image .card-image {
    border-radius: 0;
    height: 200px;
    object-fit: cover;
}

.article-card .card-content {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(18, 56, 91, 0.1);
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.article-card h3 a {
    color: var(--primary-dark);
}

.article-card p {
    color: var(--muted);
}

.card-content .meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, var(--color-primary-800) 0%, var(--color-primary-700) 85%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 3rem 2.5rem;
    margin: 3rem 0 2rem;
    color: #fefefe;
}

.newsletter-content {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.newsletter h2 {
    color: #fefefe;
    margin-bottom: 0.35rem;
    font-size: clamp(1.6rem, 3vw, 2rem);
}

.newsletter p {
    color: rgba(245, 247, 251, 0.85);
    margin-bottom: 1.25rem;
}

.newsletter form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.85rem;
    width: min(900px, 100%);
    align-items: center;
}

.newsletter input[type="email"] {
    flex: 1;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: var(--radius-md);
    padding: 0.95rem 1.1rem;
    font-size: 1rem;
    min-height: 54px;
}

.newsletter button[type="submit"] {
    background: #F5B544;
    color: var(--color-primary-800);
    border: 1px solid #F5B544;
    border-radius: 999px;
    padding: 0.95rem 1.6rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    min-height: 54px;
}

.newsletter button[type="submit"]:hover {
    background: #dea045;
    border-color: #dea045;
    color: var(--color-primary-800);
}

@media (max-width: 640px) {
    .newsletter form {
        grid-template-columns: 1fr;
    }

    .newsletter button[type="submit"] {
        width: 100%;
    }
}

.card-image.placeholder {
    background: linear-gradient(135deg, #F5B544, #FFE6A3);
}

/* Tools */
.tools-showcase {
    padding: var(--space-2xl) 0;
    background: var(--color-surface-alt);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    height: 100%;
    justify-content: space-between;
}

.tool-card>.btn {
    margin-top: auto;
    align-self: flex-start;
}

.tool-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    background: var(--color-primary);
}

.tool-icon.success {
    background: var(--color-success);
}

.tool-icon.info {
    background: #0ea5e9;
}

.tool-card-body h3 {
    margin-bottom: 0.35rem;
}

.tool-section {
    margin-bottom: var(--space-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.tool-section-header h3 {
    margin-bottom: 0.35rem;
}

.tool-form-row {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    align-items: flex-end;
}

.tool-form-row .form-group {
    flex: 1;
    min-width: 220px;
}

.tool-result {
    margin-top: var(--space-sm);
    font-weight: 600;
    min-height: 1.8rem;
}

.tool-list {
    margin-top: var(--space-sm);
    padding-left: 1.5rem;
    color: var(--color-text);
    line-height: 1.6;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
}

.template-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    height: 100%;
}

.template-card a {
    margin-top: auto;
    align-self: flex-start;
}

.template-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
}

.template-meta i {
    color: var(--color-primary);
    font-size: 1.25rem;
}

/* News feed */
.news-feed {
    padding: var(--space-2xl) 0;
    background: var(--color-background);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.news-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card .article-media {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    min-height: 220px;
    background: linear-gradient(135deg, #F5B544, #FFE6A3);
}

.news-card .article-media .card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.news-card .category-badge {
    position: absolute;
    left: var(--space-sm);
    bottom: var(--space-sm);
}

.news-card .article-body {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    flex: 1;
}

.news-card .article-body h3 {
    margin: 0;
}

.news-card .article-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.news-label.hot {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border-radius: var(--radius-full);
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.quote-section {
    padding: 4rem 0;
    background: linear-gradient(to bottom, var(--background), #fff);
}

.quote-card {
    background: #fff;
    border-radius: 4px;
    padding: 3rem;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(11, 35, 64, 0.08);
    border: 1px solid rgba(11, 35, 64, 0.05);
}

/* Premium Double Border Effect */
.quote-card::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid #F5B544;
    /* Gold border */
    pointer-events: none;
    z-index: 1;
}

.quote-card::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 16px;
    border: 1px solid rgba(11, 35, 64, 0.1);
    /* Inner subtle border */
    pointer-events: none;
    z-index: 1;
}

.quote-card h2 {
    margin-bottom: 2rem;
    font-family: "Playfair Display", serif;
    /* If available, otherwise falls back */
    color: var(--color-primary-800);
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
    padding: 0 1.5rem;
    background: #fff;
    z-index: 2;
}

.quote-icon {
    font-size: 2.5rem;
    color: #F5B544;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.quote-icon img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #F5B544;
    padding: 3px;
    background: #fff;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.quote-body {
    font-size: 1.6rem;
    color: var(--color-primary-800);
    font-style: italic;
    margin-bottom: 2rem;
    line-height: 1.6;
    font-family: "Georgia", serif;
    position: relative;
    z-index: 2;
    padding: 0 2rem;
}

.quote-body::before {
    content: '“';
    font-size: 4rem;
    color: rgba(245, 181, 68, 0.2);
    position: absolute;
    top: -2rem;
    left: 0;
    font-family: serif;
}

.quote-body::after {
    content: '”';
    font-size: 4rem;
    color: rgba(245, 181, 68, 0.2);
    position: absolute;
    bottom: -3rem;
    right: 0;
    font-family: serif;
}

.quote-author {
    font-weight: 700;
    color: var(--color-primary-800);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
}

.quote-source {
    color: #6c757d;
    font-size: 0.95rem;
    margin-top: 0.25rem;
    font-style: italic;
    position: relative;
    z-index: 2;
}

.quote-link {
    margin-top: 2rem;
    position: relative;
    z-index: 2;
}

.quote-link a {
    color: #F5B544;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.quote-link a:hover {
    color: var(--color-primary-800);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-btn {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    background: var(--surface);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--text);
}

.action-btn i {
    font-size: 1.6rem;
    color: var(--primary);
}

.action-btn strong {
    font-size: 1rem;
    color: var(--primary-dark);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card-grid .card {
    text-align: center;
    padding: 2rem;
}

.card-grid .card i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Portal / Admin shared */
.portal-header,
.admin-header {
    background: var(--surface);
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--border);
}

.portal-nav,
.admin-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.portal-back-link {
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-grid.cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-card {
    background: var(--surface);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(18, 56, 91, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Messages / Tables */
.messages-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
}

.messages-sidebar,
.compose-form,
.message-item,
.upload-area {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.message-item {
    border: 1px solid var(--border);
}

.message-item.unread {
    border-color: var(--accent);
    background: rgba(224, 161, 6, 0.08);
}

.message-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.empty-card {
    text-align: center;
    padding: 2.5rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.empty-card i {
    font-size: 3rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.messages-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s ease, border-color 0.2s ease;
    font-weight: 600;
    color: var(--muted);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.file-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.file-upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(18, 56, 91, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.document-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.document-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.file-pdf {
    color: #dc3545;
}

.file-doc {
    color: #0d6efd;
}

.file-img {
    color: #198754;
}

.file-default {
    color: var(--muted);
}

.document-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--primary-dark);
}

.document-card .document-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.info-card {
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-top: 2rem;
}

.info-card ul {
    margin: 0.75rem 0 0 1.5rem;
    color: var(--muted);
    line-height: 1.7;
    font-size: 0.95rem;
}

.portal-footer {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    text-align: center;
    color: var(--muted);
}

.empty-state {
    text-align: center;
    padding: 2.5rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--muted);
}

.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin-bottom: 1rem;
}

.alert-success {
    color: #0f5132;
    background: #d1e7dd;
    border: 1px solid #badbcc;
}

.alert-error {
    color: #842029;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
}

.alert-info {
    color: #055160;
    background: #cff4fc;
    border: 1px solid #b6effb;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(18, 56, 91, 0.1);
    color: var(--primary-dark);
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: var(--accent);
    color: #fff;
}

.tracking-pixel {
    display: none;
}

.badge-open,
.badge-pending {
    background: #ffc107;
    color: #1f1f1f;
}

.badge-closed,
.badge-archived {
    background: #6c757d;
    color: #fff;
}

.is-hidden {
    display: none !important;
}

.status-badge.status-published {
    background: rgba(16, 185, 129, 0.15);
    color: #0f5132;
}

.status-badge.status-draft {
    background: rgba(108, 117, 125, 0.15);
    color: #374151;
}

.status-badge.status-info {
    background: rgba(29, 91, 153, 0.15);
    color: var(--secondary);
}

.auth-wrapper {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--background);
}

.auth-card {
    width: min(520px, 100%);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
}

.auth-card.auth-card-wide {
    width: min(680px, 100%);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--primary);
    margin-bottom: 0.35rem;
}

.auth-header p {
    color: var(--text-light);
}

.remember-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    background: var(--surface);
    padding: 0 0.75rem;
    position: relative;
    color: var(--text-light);
    font-size: 0.9rem;
}

.auth-alt {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--text);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

.terms-checkbox {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.terms-checkbox input {
    margin-top: 0.25rem;
}

.password-strength {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.strength-weak {
    color: #dc3545;
}

.strength-medium {
    color: #f0ad4e;
}

.strength-strong {
    color: #198754;
}

@media (max-width: 640px) {
    .auth-card {
        padding: 1.75rem;
    }
}

.portal-header-accent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-bottom: none;
}

.portal-header-accent h1,
.portal-header-accent p {
    color: #fff;
}

.calendar-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
}

.calendar-wrapper,
.calendar-sidebar .sidebar-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    padding: 0.75rem;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
}

.calendar-day {
    min-height: 90px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    position: relative;
}

.calendar-day.other-month {
    background: var(--light);
    color: var(--text-light);
}

.calendar-day.today {
    border: 2px solid var(--primary);
    background: rgba(18, 56, 91, 0.08);
}

.calendar-day.has-events {
    border-left: 4px solid var(--secondary);
}

.day-number {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.day-events {
    font-size: 0.8rem;
    color: var(--text-light);
}

.event-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--secondary);
    margin-right: 0.25rem;
}

.calendar-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-hero {
    background: linear-gradient(135deg, var(--color-primary-800) 0%, var(--color-primary-700) 85%);
    color: #fff;
    padding: 3rem 0;
    text-align: center;
}

.search-hero h1 {
    margin-bottom: 0.35rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.search-hero p {
    color: rgba(245, 247, 251, 0.85);
    margin-bottom: 1.5rem;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 180px 160px 140px 140px 120px;
    gap: 0.75rem;
    align-items: center;
    background: #fff;
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.search-form input,
.search-form select {
    height: 48px;
    border: 1px solid #d5dbe5;
    border-radius: var(--radius-sm);
    padding: 0 0.75rem;
}

.search-results {
    margin-top: 2rem;
    display: grid;
    gap: 1rem;
}

.search-result-card {
    background: #fff;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.search-result-card h3 {
    margin-bottom: 0.5rem;
    color: var(--color-primary-dark);
}

.search-result-card p {
    color: var(--color-text-muted);
}

.search-result-meta {
    margin-top: 0.65rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.highlight {
    background: #fff59d;
    padding: 0 3px;
    border-radius: 2px;
}

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

.card-image.placeholder {
    background: linear-gradient(135deg, #F5B544, #FFE6A3);
}

@media (max-width: 768px) {
    .search-form {
        grid-template-columns: 1fr;
    }
}

.sidebar-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.reminder-item,
.court-item {
    padding: 0.75rem;
    border-left: 3px solid var(--primary);
    background: var(--light);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.reminder-item .date,
.court-item .date {
    font-size: 0.85rem;
    color: var(--text-light);
}

@media (max-width: 1024px) {
    .calendar-layout {
        grid-template-columns: 1fr;
    }
}

/* Footer */
footer {
    background: var(--color-primary-800);
    color: #f5f7fb;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 3rem;
    padding: 3rem 0 2.5rem;
}

footer .footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

footer h3 {
    margin-bottom: 0.75rem;
    color: #fefefe;
}

footer ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

footer ul a {
    color: rgba(245, 247, 251, 0.85);
}

footer a {
    color: #F5B544;
}

footer a:hover {
    color: #ffd27a;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.footer-socials a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(245, 181, 68, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #F5B544;
    transition: background 0.2s ease, color 0.2s ease;
}

.footer-socials a:hover {
    background: #F5B544;
    color: var(--color-primary-800);
}

footer p,
footer .footer-custom-text {
    color: rgba(245, 247, 251, 0.82);
}

footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: var(--space-sm);
    margin-top: var(--space-sm);
    text-align: center;
    font-size: 0.9rem;
    color: rgba(245, 247, 251, 0.75);
}

.search-hero {
    background: linear-gradient(135deg, var(--color-primary-800) 0%, var(--color-primary-700) 85%);
    color: #fff;
    padding: 3rem 0;
    text-align: center;
}

.search-hero h1 {
    margin-bottom: 0.35rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.search-hero p {
    color: rgba(245, 247, 251, 0.85);
    margin-bottom: 1.5rem;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 200px 180px 140px;
    gap: 0.75rem;
    align-items: center;
    background: #fff;
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.search-form input,
.search-form select {
    height: 48px;
    border: 1px solid #d5dbe5;
    border-radius: var(--radius-sm);
    padding: 0 0.75rem;
}

.search-results {
    margin-top: 2rem;
    display: grid;
    gap: 1rem;
}

.search-result-card {
    background: #fff;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.search-result-card h3 {
    margin-bottom: 0.5rem;
    color: var(--color-primary-dark);
}

.search-result-card p {
    color: var(--color-text-muted);
}

.search-result-meta {
    margin-top: 0.65rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.highlight {
    background: #fff59d;
    padding: 0 3px;
    border-radius: 2px;
}

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

.card-image.placeholder {
    background: linear-gradient(135deg, #F5B544, #FFE6A3);
}

.footer-newsletter {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
}

.footer-newsletter form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    width: 100%;
}

.footer-newsletter input[type="email"] {
    flex: 1;
    min-width: 220px;
    padding: 0.8rem 1rem;
}

.footer-newsletter button[type="submit"] {
    padding: 0.85rem 1.4rem;
    border-radius: 999px;
}

.footer-custom-text {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(245, 247, 251, 0.82);
}

.demo-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent);
    color: #1f1f1f;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 9999;
    max-width: 320px;
    font-size: 0.9rem;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 64px;
        right: 20px;
        left: 20px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 1.25rem;
        flex-direction: column;
        gap: 1rem;
        display: none;
        box-shadow: var(--shadow-md);
    }

    .nav-menu.show {
        display: flex;
    }

    .hero .container {
        grid-template-columns: 1fr;
    }

    .newsletter form {
        flex-direction: column;
    }

    .messages-container {
        grid-template-columns: 1fr;
    }
}

.file-input-hidden {
    display: none;
}

.card-center {
    text-align: center;
    padding: 2rem;
}

.upload-label {
    cursor: pointer;
    display: block;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.upload-icon-sm {
    font-size: 2rem;
    color: var(--primary);
    display: block;
    margin-bottom: 0.5rem;
}

.search-input,
.filter-select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.search-input {
    max-width: 260px;
}

.filter-select {
    min-width: 180px;
}

.form-check-inline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.preview-image {
    max-width: 320px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.toolbar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.sidebar-section {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-title {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-user {
    margin-right: 1rem;
    color: var(--primary);
    font-weight: bold;
}

.upload-success {
    font-size: 0.9rem;
    color: var(--primary);
}

.sidebar-divider {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.sidebar-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-dark);
    font-weight: 600;
}

.sidebar-user-badge span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 400;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.table th {
    color: var(--primary-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table td:last-child {
    text-align: right;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.status-badge.featured {
    background: rgba(253, 183, 26, 0.15);
    color: var(--accent);
}

.featured-icon {
    color: var(--accent);
}

/* ------------------------------------------------------------------/**
 * Custom overrides for hero sections
 *
 * Some front‑end pages (e.g. guides.php, contact.php) use the `.page-hero`
 * pattern for the introductory header. On certain backgrounds the default
 * text colours inherited from the theme variables result in poor
 * contrast, making the headings and subtitles hard to read (for example
 * dark text on a dark gradient). The rules below force the primary
 * heading and supporting copy within `.page-hero` to render in white,
 * while the smaller eyebrow text uses the accent colour defined in the
 * design tokens. These styles ensure consistent contrast across all
 * hero variants without altering the underlying layout or typography.
 *
 * IMPORTANT: Uses !important to override theme.css defaults that have
 * higher specificity due to CSS cascade order.
 */

/* Force white text on all hero variants for maximum contrast */
.page-hero h1,
.page-hero p,
.page-hero.hero-slim h1,
.page-hero.hero-slim p,
.hero-slim h1,
.hero-slim p {
    color: #fff !important;
}

/* Accent color (gold) for eyebrow text - stands out on dark background */
.page-hero .eyebrow,
.page-hero.hero-slim .eyebrow,
.hero-slim .eyebrow {
    color: var(--color-accent-300) !important;
}

/* Ensure container text is also white */
.page-hero .container h1,
.page-hero .container p,
.page-hero .content-container h1,
.page-hero .content-container p {
    color: #fff !important;
}

/* ===========================================
   PHASE 3: RESPONSIVE FOUNDATION
   =========================================== */

/* Fluid Typography with clamp() */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.25;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.875rem);
    line-height: 1.3;
}

.hero-section h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
}

/* Responsive Container */
.content-container,
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (max-width: 768px) {

    .content-container,
    .container {
        padding: 0 1rem;
    }
}

/* Mobile Navigation */
.navbar {
    position: relative;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    color: var(--color-primary-900);
    font-size: 1.5rem;
    z-index: 1001;
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }

    .navbar-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: white;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        padding: 5rem 2rem 2rem;
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    .navbar-menu.is-active {
        right: 0;
    }

    .navbar-menu li {
        margin: 0;
        border-bottom: 1px solid var(--color-gray-200);
    }

    .navbar-menu a {
        display: block;
        padding: 1rem 0;
        font-size: 1.125rem;
    }

    /* Mobile overlay */
    .navbar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }

    .navbar-overlay.is-active {
        opacity: 1;
        visibility: visible;
    }
}

/* Responsive Grid System */
.articles-grid,
.featured-grid,
.resource-grid,
.pillars-grid {
    display: grid;
    gap: 2rem;
}

/* Desktop */
.articles-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.pillars-grid {
    grid-template-columns: repeat(3, 1fr);
}

.resource-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* Tablet */
@media (max-width: 1024px) {

    .pillars-grid,
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .featured-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {

    .articles-grid,
    .featured-grid,
    .pillars-grid,
    .resource-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Hero Section Responsive */
.hero-section {
    padding: 4rem 0;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 1024px) {
    .hero-inner {
        gap: 2rem;
    }

    .hero-section {
        padding: 3rem 0;
    }
}

@media (max-width: 768px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-visual {
        order: -1;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-meta {
        justify-content: center;
    }

    .hero-section {
        padding: 2rem 0 3rem;
    }
}

/* Touch Optimization - Minimum 44px targets */
@media (max-width: 768px) {

    button,
    .btn,
    a.btn,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Larger tap targets for links */
    .navbar-menu a,
    .sidebar__link {
        padding: 0.875rem 1rem;
    }

    /* Form inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        min-height: 48px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }
}

/* Card Responsive */
.article-card,
.featured-card,
.pillar-card,
.resource-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 769px) {

    .article-card:hover,
    .featured-card:hover,
    .pillar-card:hover,
    .resource-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    }
}

/* Image Optimization */
.card-image,
.article-image img,
.featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;
}

.hero-visual img {
    aspect-ratio: 4/3;
    object-fit: cover;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }
}

/* Responsive Spacing */
section {
    padding: 4rem 0;
}

@media (max-width: 1024px) {
    section {
        padding: 3rem 0;
    }
}

@media (max-width: 768px) {
    section {
        padding: 2.5rem 0;
    }
}

/* Newsletter Form Responsive */
.newsletter-form {
    display: flex;
    gap: 1rem;
}

@media (max-width: 768px) {
    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input {
        width: 100%;
    }

    .newsletter-form button {
        width: 100%;
    }
}

/* Category Tabs Responsive */
.category-tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .tab-btn {
        white-space: nowrap;
    }
}

/* Quote Section Responsive */
.quote-card {
    padding: 3rem;
}

@media (max-width: 768px) {
    .quote-card {
        padding: 2rem 1.5rem;
    }
}

/* Footer Responsive */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Utility Classes */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }

    .show-mobile {
        display: block;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

/* ===========================================
   PHASE 4: GOLD ELEGANT THEME
   =========================================== */

/* Premium Color Palette Enhancement */
:root {
    --color-gold-50: #fffbeb;
    --color-gold-100: #fef3c7;
    --color-gold-200: #fde68a;
    --color-gold-300: #fcd34d;
    --color-gold-400: #fbbf24;
    --color-gold-500: #f5b042;
    --color-gold-600: #d49130;
    --color-gold-700: #b87333;
    --color-navy-gradient: linear-gradient(135deg, #0a1e31 0%, #1f4b72 100%);
    --color-gold-gradient: linear-gradient(135deg, #f5b042 0%, #d49130 100%);
    --shadow-gold: 0 8px 24px rgba(245, 176, 66, 0.25);
    --shadow-premium: 0 20px 60px rgba(15, 24, 43, 0.2);
}

/* Enhanced Hero Section */
.hero-section {
    background: linear-gradient(135deg,
            var(--color-primary-800) 0%,
            var(--color-primary-700) 50%,
            var(--color-primary-600) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: radial-gradient(circle at top right, rgba(245, 176, 66, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.hero-eyebrow {
    color: var(--color-gold-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    display: inline-block;
    margin-bottom: 1rem;
}

.hero-section h1 {
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

/* Premium CTA Buttons */
.btn-secondary,
.btn.btn-secondary {
    background: var(--color-gold-gradient);
    color: var(--color-primary-900);
    box-shadow: var(--shadow-gold);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover,
.btn.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(245, 176, 66, 0.35);
}

.btn-hero-white {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    transition: all 0.3s ease;
}

.btn-hero-white:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
}

/* Hero Buttons Layout */
.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Hero Meta */
.hero-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.hero-meta li {
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-meta i {
    color: var(--color-gold-500);
}

/* Premium Article Cards */
.article-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
    border-color: var(--color-gold-500);
}

.article-image {
    position: relative;
    overflow: hidden;
    background: var(--color-gray-100);
}

.article-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 24, 43, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover .article-image::after {
    opacity: 1;
}

.article-image img {
    transition: transform 0.5s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

/* Category Badge */
.category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--color-gold-gradient);
    color: var(--color-primary-900);
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px rgba(245, 176, 66, 0.3);
    z-index: 10;
}

/* Card Content */
.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    margin: 1rem 0 0.75rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

.card-content h3 a {
    color: var(--color-primary-900);
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-content h3 a:hover {
    color: var(--color-gold-600);
}

.card-content p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.meta i {
    color: var(--color-gold-600);
}

/* Featured Cards */
.featured-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: 1fr;
    transition: all 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-premium);
}

.featured-media {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.featured-body {
    padding: 2rem;
}

.featured-body h3 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
}

.featured-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 1rem;
}

.featured-meta i {
    color: var(--color-gold-600);
}

/* Pillar Cards */
.pillar-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border-top: 4px solid transparent;
}

.pillar-card:hover {
    border-top-color: var(--color-gold-500);
    transform: translateY(-4px);
    box-shadow: var(--shadow-premium);
}

.pillar-card i {
    font-size: 2.5rem;
    color: var(--color-gold-600);
    margin-bottom: 1.5rem;
    display: block;
}

.pillar-card h3 {
    color: var(--color-primary-900);
    margin-bottom: 1rem;
    font-size: 1.375rem;
}

.pillar-card p {
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.link-arrow {
    color: var(--color-gold-600);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.link-arrow:hover {
    gap: 0.75rem;
}

.link-arrow i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.link-arrow:hover i {
    transform: translateX(4px);
}

/* Quote Card Enhancement */
.quote-card {
    background: linear-gradient(135deg,
            var(--color-primary-800) 0%,
            var(--color-primary-600) 100%);
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
}

.quote-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 40%;
    height: 200%;
    background: radial-gradient(circle, rgba(245, 176, 66, 0.15) 0%, transparent 70%);
}

.quote-card h2 {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.quote-card h2 i {
    color: var(--color-gold-500);
}

.quote-body {
    font-size: 1.5rem;
    font-style: italic;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.5rem;
}

.quote-author {
    font-weight: 600;
    color: var(--color-gold-500);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.quote-source {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.quote-link a {
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.quote-link a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    color: var(--color-primary-900);
    margin-bottom: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2 i {
    color: var(--color-gold-600);
}

.section-header p {
    color: var(--color-text-muted);
    font-size: 1.125rem;
}

/* Category Tabs */
.tab-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--color-gray-300);
    background: white;
    color: var(--color-text);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    border-color: var(--color-gold-500);
    color: var(--color-gold-600);
}

.tab-btn.active {
    background: var(--color-gold-gradient);
    color: var(--color-primary-900);
    border-color: var(--color-gold-600);
    box-shadow: var(--shadow-gold);
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, var(--color-primary-800) 0%, var(--color-primary-600) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.newsletter-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 40%;
    height: 200%;
    background: radial-gradient(circle, rgba(245, 176, 66, 0.1) 0%, transparent 70%);
}

.newsletter-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h2 {
    color: white;
    margin-bottom: 0.75rem;
}

.newsletter-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.newsletter-form {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.newsletter-form input {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    flex: 1;
}

.newsletter-form button {
    background: var(--color-gold-gradient);
    color: var(--color-primary-900);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-gold);
}

.newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(245, 176, 66, 0.35);
}

/* Resource Cards */
.resource-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.resource-card:hover {
    border-left-color: var(--color-gold-500);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.resource-card i {
    font-size: 2rem;
    color: var(--color-gold-600);
    margin-bottom: 1rem;
    display: block;
}

.resource-card h3 {
    color: var(--color-primary-900);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.resource-card p {
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

/* Premium Dividers */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--color-gold-500) 50%,
            transparent 100%);
    margin: 4rem 0;
}

/* Enhanced Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-gold-500), var(--color-gold-600));
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--color-gold-600), var(--color-gold-700));
}

/* Premium Selection */
::selection {
    background: var(--color-gold-500);
    color: var(--color-primary-900);
}

::-moz-selection {
    background: var(--color-gold-500);
    color: var(--color-primary-900);
}

/* ===========================================
   PHASE 6: MOBILE & TABLET OPTIMIZATION
   =========================================== */

/* Improved Touch Feedback */
@media (max-width: 768px) {

    /* Touch Ripple Effect */
    .btn,
    button,
    a.btn {
        position: relative;
        overflow: hidden;
    }

    .btn::after,
    button::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.5);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .btn:active::after,
    button:active::after {
        width: 300px;
        height: 300px;
    }

    /* Larger Touch Targets */
    .btn,
    button,
    a.btn,
    .navbar-menu a,
    .tab-btn {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
    }

    /* Mobile Forms Enhancement */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    select,
    textarea {
        min-height: 52px;
        font-size: 16px;
        /* Prevents iOS zoom */
        padding: 1rem 1.25rem;
        border-radius: var(--radius-md);
    }

    select {
        appearance: none;
        background-size: 1.5em;
        padding-right: 3rem;
    }

    /* Better Form Labels */
    label {
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        display: block;
    }

    /* Mobile Table Cards */
    .table-responsive {
        display: block;
    }

    .table-responsive .table {
        display: none;
    }

    .mobile-card {
        background: white;
        border-radius: var(--radius-md);
        padding: 1.25rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border-left: 4px solid var(--color-gold-500);
    }

    .mobile-card-header {
        font-weight: 700;
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
        color: var(--color-primary-900);
    }

    .mobile-card-row {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--color-gray-200);
    }

    .mobile-card-row:last-child {
        border-bottom: none;
    }

    .mobile-card-label {
        font-weight: 600;
        color: var(--color-text-muted);
        font-size: 0.875rem;
    }

    .mobile-card-value {
        font-weight: 500;
        color: var(--color-text);
    }
}

/* Sticky Mobile Header */
@media (max-width: 768px) {
    .main-navbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    /* Compact Mobile Header */
    .navbar-inner {
        padding: 0.75rem 0;
    }

    .brand-name {
        font-size: 1.125rem;
    }

    /* Mobile Menu Improvements */
    .navbar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }

    .navbar-menu.show+.navbar-overlay {
        opacity: 1;
        visibility: visible;
    }

    /* Smooth Menu Animation */
    .navbar-menu {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Tablet-Specific Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {

    /* Two-Column Forms */
    .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    /* Optimized Grid Layouts */
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pillars-grid,
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Better Sidebar on Tablet */
    .admin-sidebar {
        width: 220px;
    }

    .admin-main {
        margin-left: 220px;
    }

    /* Larger Touch Targets on Tablet */
    .btn,
    button {
        min-height: 44px;
    }
}

/* Performance Optimizations */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Scroll Performance */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }

    body {
        overflow-x: hidden;
    }

    /* Smoother Scrolling */
    .articles-grid,
    .featured-grid {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent Horizontal Scroll */
    .content-container {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 896px) and (orientation: landscape) {
    .hero-section {
        padding: 2rem 0;
    }

    .hero-inner {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .navbar-menu {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* Image Loading Optimization */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    /* Lazy Load Placeholder */
    img[loading="lazy"] {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: shimmer 1.5s infinite;
    }

    @keyframes shimmer {
        0% {
            background-position: -200% 0;
        }

        100% {
            background-position: 200% 0;
        }
    }
}

/* Touch-Friendly Links */
@media (max-width: 768px) {
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Better Link Spacing in Lists */
    .navbar-menu li {
        margin: 0.5rem 0;
    }

    .footer-grid a {
        padding: 0.75rem 0;
        display: block;
    }
}

/* Mobile Hero Optimization */
@media (max-width: 768px) {
    .hero-section {
        min-height: auto;
        padding: 3rem 0 2rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-meta {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Mobile Card Stacking */
@media (max-width: 768px) {

    .card,
    .article-card,
    .featured-card {
        margin-bottom: 1.25rem;
    }

    /* Compact Card Padding */
    .card-content {
        padding: 1.25rem;
    }

    .featured-body {
        padding: 1.5rem;
    }
}

/* Safe Area Insets (iOS Notch) */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .main-navbar {
            padding-left: max(1rem, env(safe-area-inset-left));
            padding-right: max(1rem, env(safe-area-inset-right));
        }

        .navbar-menu {
            padding-left: max(2rem, env(safe-area-inset-left));
            padding-right: max(2rem, env(safe-area-inset-right));
        }

        .content-container {
            padding-left: max(1rem, env(safe-area-inset-left));
            padding-right: max(1rem, env(safe-area-inset-right));
        }
    }
}

/* Mobile Footer */
@media (max-width: 768px) {
    .footer-grid {
        gap: 2rem;
    }

    footer {
        padding: 2rem 0;
    }

    .footer-grid h4 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }
}

/*
 * Disable theme toggle buttons across the site and admin.
 * Dark mode functionality has been removed, so these controls should be hidden.
 */
.theme-toggle,
#themeToggle {
    display: none !important;
}

/*
 * Desktop Navigation for .main-navbar
 *
 * The previous implementation relied primarily on mobile-specific styles, leaving
 * the main navigation unstyled on larger screens. This results in invisible or
 * misaligned menu items when viewed on desktop. To correct this, we mirror the
 * styling of the older `.navbar` component and apply it to `.main-navbar` only
 * when the viewport is sufficiently wide. This ensures consistent spacing,
 * alignment, and readable text across breakpoints without affecting the mobile
 * navigation behavior.
 */
@media (min-width: 1024px) {
    /* Main navbar container */
    .main-navbar {
        background: var(--color-surface);
        box-shadow: var(--shadow-sm);
        /* Let the nav sit naturally in the document flow on desktop */
        position: static;
        z-index: 100;
    }

    /* Ensure inner wrapper uses flex to distribute space */
    .main-navbar .navbar-inner,
    .main-navbar .content-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 0;
    }

    /* Desktop menu layout */
    .main-navbar .navbar-menu {
        display: flex;
        align-items: center;
        gap: var(--space-6);
        list-style: none;
        margin: 0;
        padding: 0;
        position: static;
        height: auto;
        width: auto;
        background: transparent;
        box-shadow: none;
    }

    .main-navbar .navbar-menu .menu-item {
        margin: 0;
        border-bottom: none;
    }

    .main-navbar .navbar-menu .menu-link {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-size-base);
        font-weight: var(--font-weight-medium);
        color: var(--color-text-primary);
        text-decoration: none;
        border-radius: var(--radius-md);
        transition: background var(--transition-base), color var(--transition-base);
    }

    .main-navbar .navbar-menu .menu-link:hover,
    .main-navbar .navbar-menu .menu-link:focus {
        background: var(--color-surface-secondary);
        color: var(--color-text-primary);
    }

    .main-navbar .navbar-menu .menu-link.active {
        color: var(--primary);
    }

    /* Hide mobile toggle on desktop */
    .main-navbar .mobile-menu-toggle {
        display: none;
    }

    /* Align CTA button properly */
    .main-navbar .navbar-menu .menu-item-cta .btn {
        margin-left: var(--space-4);
    }
}

/* Prevent Text Size Adjust on Rotation */
@media (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

/* Cookie banner & modal */
.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: var(--space-4);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-4) var(--space-5);
    max-width: 960px;
    width: calc(100% - 2rem);
    z-index: 1100;
}

.cookie-banner__content h3 {
    margin: 0 0 var(--space-2);
    font-size: var(--font-size-lg);
}

.cookie-banner__content p {
    margin: 0;
    color: var(--color-text-secondary);
}

.cookie-banner__actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-left: auto;
}

.cookie-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1101;
    padding: var(--space-4);
}

.cookie-modal__dialog {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: min(620px, 100%);
    border: 1px solid var(--color-border);
}

.cookie-modal__header,
.cookie-modal__footer {
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.cookie-modal__body {
    padding: 0 var(--space-5) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.cookie-modal__close {
    border: none;
    background: none;
    font-size: var(--font-size-xl);
    cursor: pointer;
    color: var(--color-text-secondary);
}

.cookie-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-base);
    background: var(--color-surface-alt, #f8f9fb);
}

.cookie-option p {
    margin: 0.25rem 0 0;
    color: var(--color-text-secondary);
}

.cookie-switch.disabled {
    font-weight: 600;
    color: var(--color-text-primary);
}

.cookie-toggle {
    position: relative;
    width: 48px;
    height: 26px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle label {
    position: absolute;
    cursor: pointer;
    background: var(--color-border);
    border-radius: 26px;
    inset: 0;
    transition: background 0.2s ease;
}

.cookie-toggle label::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.cookie-toggle input:checked+label {
    background: var(--color-primary-600);
}

.cookie-toggle input:checked+label::after {
    transform: translateX(22px);
}

@media (max-width: 768px) {
    .cookie-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-banner__actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Language dropdown */
.lang-dropdown {
    position: relative;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-base);
    background: var(--color-surface);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}

.lang-toggle i {
    font-size: 0.75rem;
}

.lang-menu {
    position: absolute;
    top: 110%;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-md);
    list-style: none;
    margin: 0;
    padding: var(--space-2) 0;
    min-width: 160px;
    display: none;
    z-index: 20;
}

.lang-menu a {
    display: block;
    padding: var(--space-2) var(--space-3);
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
}

.lang-menu a:hover,
.lang-menu a.active {
    background: var(--color-primary-50);
    color: var(--color-primary-800);
}

.lang-dropdown:hover .lang-menu {
    display: block;
}

/* ===========================================
   FULL SYSTEM REFACTOR: UTILITY CLASSES
   =========================================== */

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Checkbox label */
.checkbox-label {
    display: flex;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
    cursor: pointer;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    background: var(--color-surface-secondary);
    border-radius: var(--radius-lg);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.empty-state h3 {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.empty-state p {
    color: var(--color-text-muted);
}

/* No results */
.no-results {
    text-align: center;
    padding: var(--space-6);
    color: var(--color-text-muted);
    background: var(--color-surface-secondary);
    border-radius: var(--radius-md);
}

/* Search highlight */
.highlight {
    background: rgba(251, 191, 36, 0.3);
    padding: 0 2px;
    border-radius: 2px;
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-4); }
.gap-lg { gap: var(--space-6); }

/* Width utilities */
.w-100 { width: 100%; }
.w-auto { width: auto; }

/* Margin utilities */
.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-2); }
.mt-md { margin-top: var(--space-4); }
.mt-lg { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-2); }
.mb-md { margin-bottom: var(--space-4); }
.mb-lg { margin-bottom: var(--space-6); }


/* Portal / Content padding */
.page-content-padded {
    padding: var(--space-8) var(--space-4);
}

.section-padded {
    padding: var(--space-8) 0;
}

/* Flex grow */
.flex-1 { flex: 1; }
.flex-grow { flex-grow: 1; }

/* Align self */
.self-end { align-self: flex-end; }

/* Basis */
.basis-full { flex-basis: 100%; }

/* Small text */
.text-small { font-size: var(--font-size-sm); }
.text-xs { font-size: 0.75rem; }


/* Page content shell */
.page-shell {
    max-width: 900px;
    margin: var(--space-lg) auto;
    padding: 0 var(--space-md);
}

.page-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.page-title {
    color: var(--primary);
    margin-bottom: var(--space-lg);
    font-size: 2.5rem;
}

.page-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

.page-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: var(--font-size-sm);
}

/* Quote card styles */
.quote-text-large {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.quote-author-line {
    font-weight: bold;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.quote-source-line {
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

.badge-featured {
    background: #fff3cd;
    color: #856404;
    margin-top: 0.5rem;
    display: inline-block;
}

/* Message / notification pages */
.message-page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
}

.message-card {
    max-width: 500px;
    padding: var(--space-lg);
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.message-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
}

.icon-success { color: var(--success); }
.icon-info { color: var(--info); }
.icon-danger { color: var(--danger); }

/* Background alternatives */
.bg-light { background: var(--light); }

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    background: var(--color-primary-800);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: slideIn 0.3s ease;
    transition: opacity 0.3s ease;
}

.toast-info { background: var(--color-primary-800); }
.toast-success { background: var(--color-success, #2ec27e); }
.toast-error { background: var(--color-danger, #d9534f); }

@keyframes slideIn {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
