/* Modern UI Enhancements for Zenvera Fluent CMS */

html, body {
    min-width: 320px;
}

.content-management-card,
.settings-card {
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

/* ============================================
   Content Alignment with Subheader
   ============================================ */
/* Ensure main content aligns with subheader text (24px from left) */
.cms-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.cms-body-content {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.cms-nav-link svg {
    color: inherit;
    fill: currentColor;
}

/* ============================================
   Design Tokens & Variables
   ============================================ */
:root {
    --card-border-radius: 8px;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

/* ============================================
   Modern Card Components
   ============================================ */
.modern-card {
    background: var(--colorNeutralBackground1, #fff);
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    padding: var(--spacing-lg);
    transition: var(--transition-smooth);
    border: none;
}

.modern-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.modern-card-header {
    background: linear-gradient(135deg, var(--colorBrandBackground, #0078d4) 0%, var(--colorBrandBackgroundHover, #106ebe) 100%);
    color: var(--colorNeutralForegroundOnBrand, #fff);
    padding: var(--spacing-md);
    border-radius: var(--card-border-radius) var(--card-border-radius) 0 0;
    margin: calc(var(--spacing-lg) * -1) calc(var(--spacing-lg) * -1) var(--spacing-md) calc(var(--spacing-lg) * -1);
    font-weight: 600;
}

/* ============================================
   Widget Styling
   ============================================ */
.modern-widget {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin-bottom: 1.5rem;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.modern-widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-bottom: 1px solid #e0e0e0;
}

.widget-header > svg {
    color: #0078d4;
}

.widget-title {
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.widget-content {
    padding: 1rem 1.25rem;
}

.modern-widget.category-tag-widget {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: none;
    transition: none;
}

.modern-widget.category-tag-widget:hover {
    transform: none;
}

.category-tag-widget .widget-header {
    padding: 0.75rem 1rem;
    border-bottom-color: #e2e8f0;
    background: #f5f8fc;
}

.category-tag-widget .widget-title {
    color: #17243c;
}

.category-tag-widget .widget-content {
    padding: 0.75rem 1rem 1rem;
}

.widget-categories,
.widget-tags {
    display: flex;
    gap: 0.5rem;
}

.widget-categories {
    flex-direction: column;
}

.widget-tags {
    flex-wrap: wrap;
}

.category-tag-widget :is(.widget-link, .widget-tag) {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-sizing: border-box;
    min-width: 0;
    min-height: 2rem;
    max-width: 100%;
    padding: 0.3rem 0.625rem;
    border: 1px solid;
    font-size: 0.85rem;
    line-height: 1.3;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.category-tag-widget .widget-link {
    border-color: #d1dfeb;
    border-radius: 8px;
    background: #edf4fa;
    color: #17476b;
}

.category-tag-widget .widget-tag {
    border-color: #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #42566b;
}

.category-tag-widget .widget-link:hover {
    background: #e1edf7;
}

.category-tag-widget .widget-tag:hover {
    background: #f3f6f9;
}

.category-tag-widget :is(.widget-link, .widget-tag):is(:hover, :focus-visible) {
    text-decoration: underline;
}

.category-tag-widget :is(.widget-link, .widget-tag):focus-visible {
    outline: 2px solid #2459a9;
    outline-offset: 2px;
}

.category-tag-widget svg {
    color: inherit;
    flex-shrink: 0;
}

.widget-count {
    margin-inline-start: auto;
    color: #42566b;
    font-variant-numeric: tabular-nums;
}

.widget-description {
    color: #333;
    line-height: 1.6;
    font-size: 0.95rem;
}

.widget-description p {
    margin: 0 0 0.75rem 0;
}

.widget-description p:last-child {
    margin-bottom: 0;
}

.modern-widget-header {
    background: linear-gradient(135deg, var(--colorNeutralBackground2, #fafafa) 0%, var(--colorNeutralBackground3, #f5f5f5) 100%);
    color: var(--colorNeutralForeground1, #242424);
    padding: var(--spacing-md);
    border-radius: var(--card-border-radius) var(--card-border-radius) 0 0;
    margin: calc(var(--spacing-lg) * -1) calc(var(--spacing-lg) * -1) var(--spacing-md) calc(var(--spacing-lg) * -1);
    font-weight: 600;
    font-size: var(--fontSizeBase400, 16px);
}

/* ============================================
   Post Navigation
   ============================================ */
.post-navigation-prev,
.post-navigation-next {
    flex: 1;
    padding: var(--spacing-sm);
    transition: var(--transition-smooth);
    border-radius: 4px;
}

.post-navigation-prev:hover,
.post-navigation-next:hover {
    background: var(--colorNeutralBackground3, #f5f5f5);
}

.post-navigation-prev {
    text-align: left;
}

.post-navigation-next {
    text-align: right;
}

/* ============================================
   Post Meta Information
   ============================================ */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: center;
    margin: var(--spacing-md) 0;
    color: var(--colorNeutralForeground3, #616161);
    font-size: var(--fontSizeBase200, 12px);
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* ============================================
   Tags & Categories
   ============================================ */
.tags-container {
    background: var(--colorNeutralBackground2, #fafafa);
    padding: var(--spacing-md);
    border-radius: var(--card-border-radius);
    margin: var(--spacing-lg) 0;
}

.tag-list,
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.tag-item,
.category-item {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--colorBrandBackground, #0078d4);
    color: var(--colorNeutralForegroundOnBrand, #fff);
    border-radius: 20px;
    font-size: var(--fontSizeBase200, 12px);
    transition: var(--transition-smooth);
    text-decoration: none;
}

.tag-item:hover,
.category-item:hover {
    background: var(--colorBrandBackgroundHover, #106ebe);
    transform: scale(1.05);
    text-decoration: none;
}

/* ============================================
   Content Sections
   ============================================ */
.content-section {
    padding: var(--spacing-lg);
    line-height: 1.8;
}

.content-section h1,
.content-section h2,
.content-section h3,
.content-section h4 {
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    color: var(--colorNeutralForeground1, #242424);
}

.content-section p {
    margin-bottom: var(--spacing-md);
}

.content-section a {
    color: var(--colorBrandForegroundLink, #005a9e);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.content-section a:hover {
    text-decoration: underline;
    color: var(--colorBrandForegroundLinkHover, #004578);
}

/* ============================================
   Header Enhancements
   ============================================ */
.modern-header {
    background: linear-gradient(135deg, var(--colorBrandBackground, #0078d4) 0%, var(--colorBrandBackgroundHover, #106ebe) 100%);
    padding: var(--spacing-lg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modern-header h3 a {
    color: var(--colorNeutralForegroundOnBrand, #fff);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.modern-header h3 a:hover {
    opacity: 0.9;
    text-decoration: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* ============================================
   Blog Post Cards (Scroll View)
   ============================================ */
.blog-post-card {
    background: var(--colorNeutralBackground1, #fff);
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    padding: var(--spacing-lg);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    border: none;
}

.blog-post-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
}

.blog-post-card-title {
    margin-bottom: var(--spacing-md);
    color: var(--colorNeutralForeground1, #242424);
}

.blog-post-card-meta {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    font-size: var(--fontSizeBase200, 12px);
    color: var(--colorNeutralForeground3, #616161);
}

.blog-post-card-description {
    flex: 1;
    color: var(--colorNeutralForeground1, #242424);
    margin-bottom: var(--spacing-md);
}

.blog-post-card-link {
    margin-top: auto;
    align-self: flex-start;
}

/* ============================================
   Footer Enhancements
   ============================================ */
.cms-layout > .cms-footer {
    display: block;
    text-align: center;
    overflow-wrap: anywhere;
}

.modern-footer {
    background: var(--colorNeutralBackground4, #f0f0f0);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    border-top: 1px solid var(--colorNeutralStroke2, #e0e0e0);
}

.modern-footer-content {
    text-align: center;
    color: var(--colorNeutralForeground3, #616161);
    font-size: var(--fontSizeBase200, 12px);
}

.modern-footer a {
    color: var(--colorBrandForegroundLink, #005a9e);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.modern-footer a:hover {
    color: var(--colorBrandForegroundLinkHover, #004578);
    text-decoration: underline;
}

/* ============================================
   Loading States
   ============================================ */
.modern-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl);
    min-height: 200px;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .post-navigation-prev,
    .post-navigation-next {
        width: 100%;
        text-align: center;
    }

    .tag-list,
    .category-list {
        justify-content: center;
    }

    .content-section {
        padding: var(--spacing-md);
    }

    .modern-card,
    .modern-widget {
        padding: var(--spacing-md);
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-gradient {
    background: linear-gradient(135deg, var(--colorBrandForegroundLink, #005a9e) 0%, var(--colorBrandForegroundLinkHover, #004578) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   Remove Old Border Styles
   ============================================ */
.no-border {
    border: none !important;
}

/* ============================================
   Spacing Utilities
   ============================================ */
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

/* Ensure body-section and side-section maintain flex layout */
.content-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

.content-wrapper .body-section {
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 0 !important;
    margin-left: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
}

.content-wrapper .side-section {
    flex: 0 0 22%;
    min-width: 200px;
    margin-left: 1rem;
    margin-right: 0;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Widget spacing in sidebar */
.side-section .modern-widget {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* ============================================
   Layout Modes
   ============================================ */

/* Landing Mode - Full-width, minimal chrome */
.layout-landing .content-wrapper {
    max-width: 100%;
    padding: 0 1.5rem;
    margin: 0;
    box-sizing: border-box;
}

.layout-landing .body-section {
    width: 100%;
    padding: 1rem;
}

.layout-landing .main {
    padding: 0;
    margin: 0;
}

/* Reading Mode - Narrow content, optimized for reading */
.layout-reading .content-wrapper {
    max-width: 90ch;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.layout-reading .body-section {
    font-size: 1.125rem;
    line-height: 1.75;
    max-width: 100%;
    color: #333;
}

.layout-reading .side-section {
    display: none !important; /* Hide sidebar widgets in reading mode */
}

.layout-reading .main {
    justify-content: center;
}

/* Standard Mode - Default layout (uses existing styles) */
.layout-standard .content-wrapper {
    padding: 0 1.5rem;
    box-sizing: border-box;
}

/* On small screens, stack sidebar below content */
@media (max-width: 900px) {
    .content-wrapper {
        flex-direction: column;
    }

    .content-wrapper .body-section {
        width: 100%;
    }

    .content-wrapper .side-section {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }
}

.cms-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 24px;
    max-width: 100%;
    vertical-align: middle;
}

.cms-checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: none;
    accent-color: #1766aa;
}

.cms-checkbox:has(input:disabled) {
    opacity: 0.65;
}

/* Blog Settings */
.admin-tabs > fluent-tablist {
    display: flex;
    flex-wrap: wrap;
}

.settings-language {
    display: grid;
    gap: 0.25rem;
    width: min(100%, 250px);
    margin-block: 0.35rem;
}

.settings-language select {
    min-height: 32px;
    padding-inline: 0.5rem;
    font: inherit;
    color: var(--colorNeutralForeground1, #242424);
    background: var(--colorNeutralBackground1, #fff);
    border: 1px solid var(--colorNeutralStrokeAccessible, #616161);
    border-radius: 4px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.settings-title {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.3;
}

.settings-form label {
    font-weight: 700;
}

.settings-form fluent-field {
    min-width: 0;
    max-width: 100%;
    margin-block: 0 !important;
    vertical-align: middle;
}

.settings-section > fluent-field {
    display: grid;
    margin-block: 0.5rem !important;
}

.settings-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 23.5rem));
    gap: 0.65rem 1rem;
    align-items: end;
}

.settings-fields-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-fields-compact {
    grid-template-columns: repeat(2, minmax(0, 14rem));
}

.settings-options,
.settings-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.settings-options {
    margin-block: 0.6rem;
}

.settings-actions {
    padding-block-start: 0.85rem;
    border-block-start: 1px solid #e0e6ed;
}

.settings-help {
    margin-block: 0.5rem;
    color: #526174;
}

.settings-route-selector {
    flex: 1 1 13rem;
    max-width: 24rem;
    min-width: 0;
}

.settings-route-add {
    flex-wrap: wrap;
}

.settings-route-add fluent-field {
    flex: 1 1 14rem;
    max-width: 26rem;
}

.settings-route-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #dbe2ea;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
}

.settings-json-preview {
    padding: 0.7rem 0.85rem;
    border: 1px solid #dbe2ea;
    border-radius: 6px;
}

.settings-json-preview summary {
    font-weight: 600;
    cursor: pointer;
}

.settings-json-preview pre {
    max-height: 24rem;
    overflow: auto;
    padding: 0.6rem;
    background: #f3f6fa;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.settings-form fluent-field:has(> fluent-textarea) {
    width: 100%;
}

.settings-form fluent-textarea::part(control) {
    width: 100%;
}

.settings-card {
    box-sizing: border-box;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-field-with-help {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.settings-field-with-help .settings-info-icon {
    flex: none;
    margin: 0 0 0.85rem;
}

.settings-field-with-help fluent-field {
    max-width: calc(100% - 1.5rem);
}

.settings-form input[type="file"] {
    max-width: 100%;
}

.settings-section {
    min-width: 0;
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.7rem;
    padding: 0.65rem 0.75rem;
    background: #eef4fa;
    color: #25466c;
    border-radius: 6px;
}

.settings-section-header svg {
    flex: none;
}

.settings-section-header h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
}

.settings-subsection {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

/* Color Picker Styling */
.color-picker-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.color-picker-input {
    width: 60px;
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin-bottom: 0.35rem;
}

.color-picker-text-field {
    flex: 1;
}

/* Route Override Cards */
.route-override-card {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.route-override-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.route-override-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Info Icon with Tooltip */
.settings-info-icon {
    cursor: help;
    color: #666;
    margin-left: 0.25rem;
}

.settings-info-icon:hover {
    color: #0078d4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .settings-card {
        padding: 1rem;
    }
    
    .settings-form {
        gap: 1rem;
    }

    .settings-fields {
        grid-template-columns: minmax(0, 1fr);
    }
    
    .color-picker-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .color-picker-input {
        width: 100%;
        max-width: 200px;
    }
}

/* ============================================
   Hero Section
   ============================================ */
/* Hero block: no border, no background. Spacing via margin only so title/description stay typography-only. */
.hero-content-provided {
    width: 100%;
    padding: 0;
    margin-bottom: 2rem;
    text-align: center;
    border: none;
    background: none;
}

.hero-content-provided .hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #1a1a1a;
    line-height: 1.2;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0;
}

.hero-content-provided .hero-description {
    font-size: 1.25rem;
    color: #666;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto 0 auto;
}

/* Responsive adjustments for hero */
@media (max-width: 768px) {
    .hero-content-provided {
        padding: 2rem 1rem;
    }
    
    .hero-content-provided .hero-title {
        font-size: 2rem;
    }
    
    .hero-content-provided .hero-description {
        font-size: 1.125rem;
    }
}

/* Landing mode hero adjustments */
.layout-landing .hero-content-provided {
    padding: 3rem 1rem;
    margin-bottom: 0;
}

/* Reading mode hero adjustments */
.layout-reading .hero-content-provided {
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
    padding: 3rem 1rem;
}

/* ============================================
   Modern Login & Reset Password Pages
   ============================================ */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

/* Break out of content-wrapper and body-section padding to center properly */
.body-section .login-container,
.content-wrapper .login-container {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    width: calc(100% + 3rem);
    max-width: none;
}

.login-card {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 0 auto;
}

.login-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.login-header h3 {
    font-weight: 600;
    color: #1a1a1a;
}

.login-header p {
    font-size: 0.95rem;
}

.login-form {
    width: 100%;
}

.login-form :is(fluent-field, fluent-text-input) {
    width: 100%;
}

.oidc-identity-value {
    margin: 0;
    padding: 0.75rem;
    background: #f5f7fa;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-all;
    user-select: all;
}

.login-form fluent-button {
    height: 44px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.login-form fluent-button:hover {
    transform: translateY(-1px);
}

.login-form fluent-message-bar {
    border-radius: 6px;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    color: #666;
    font-size: 0.85rem;
    text-align: center;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #e1e1e1;
}

.login-wait-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none !important;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
}

.login-wait-overlay.is-visible {
    display: flex !important;
}

.login-wait-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #d0d0d0;
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: login-wait-spin 0.8s linear infinite;
}

@keyframes login-wait-spin {
    to {
        transform: rotate(360deg);
    }
}

.login-wait {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    min-width: 220px;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Responsive Design for Login */
@media (max-width: 768px) {
    .login-container {
        min-height: calc(100vh - 100px);
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }
    
    .login-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .login-header > svg {
        width: 40px !important;
        height: 40px !important;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem 1rem;
    }
    
    .login-header h3 {
        font-size: 1.5rem;
    }
}

/* ============================================
   Modern Page Styling
   ============================================ */
/* Page Title: typography only. No border, background, box, card, or panel. */
.page-title {
    font-weight: 600;
    color: #1a1a1a;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
    line-height: 1.3;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0;
}

/* Page Description: optional content block. May use container, border, or background separately from title. */
.page-description-block {
    margin-top: 0;
    margin-bottom: 1rem;
}

.page-description {
    color: #666;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 0;
}

/* Legacy page-header: no border/background. Margin-only for grouping where still used. */
.page-header {
    margin-top: 0;
    margin-bottom: 1rem;
    padding: 0;
    border: none;
    background: none;
}

.page-content {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    max-width: 100%;
    line-height: 1.8;
    color: #333;
}

/* If a duplicate page title is the first child of Fluent CMS content, render as typography only */
.page-content > h1:first-child {
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0;
}

/* If the first block in Fluent CMS content is a div containing only an h1 (title block), strip its box */
.page-content > div:first-child:has(> h1:only-child) {
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.page-content > div:first-child:has(> h1:only-child) > h1 {
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0;
}

/* Blog Posts Page */
.blog-posts-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.blog-posts-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
    padding: 0;
    border: none;
    background: none;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blog-posts-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.blog-posts-title-section {
    overflow-wrap: anywhere;
    flex: 1;
    min-width: min(100%, 200px);
}

.display-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.horizontal-scroll-container {
    margin: 0;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
}

.post-card-scroll,
.post-card-classic {
    --post-card-surface: #eef4ff;
    --post-card-border: #cbd9f8;
    --post-card-accent: #3867cb;
    --post-card-link: #244986;
    padding: 1rem 1.25rem;
    min-height: 0 !important;
    max-height: none !important;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--post-card-border);
    border-block-start: 4px solid var(--post-card-accent);
    border-radius: 12px;
    background: var(--post-card-surface);
    box-shadow: none;
    align-items: stretch;
}

.posts-grid tbody tr:nth-child(3n + 2) .post-card-classic,
.post-card-scroll:nth-of-type(3n + 2) {
    --post-card-surface: #eaf7f4;
    --post-card-border: #b9dfd8;
    --post-card-accent: #16857a;
    --post-card-link: #165649;
}

.posts-grid tbody tr:nth-child(3n + 3) .post-card-classic,
.post-card-scroll:nth-of-type(3n + 3) {
    --post-card-surface: #fff4e3;
    --post-card-border: #f1d7ac;
    --post-card-accent: #be751b;
    --post-card-link: #754710;
}

.post-card-scroll {
    align-self: flex-start;
    height: auto;
    width: 330px;
    min-width: 330px;
}

.post-card-scroll:hover,
.post-card-classic:hover {
    box-shadow: 0 4px 14px #142b4314;
}

.post-card-classic:hover {
    transform: translateY(-4px);
}

.post-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: block;
    line-height: 1.4;
}

:is(.post-card-title, .post-card-read-more) {
    color: var(--post-card-link, #244986);
}

.post-card-title {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.post-card-title:hover {
    text-decoration: underline;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.post-card-meta > svg {
    color: #666;
}

.post-card-divider {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--post-card-border, #e0e0e0);
}

.post-card-description {
    flex: 0 0 auto;
    color: #555;
    line-height: 1.6;
    overflow: visible;
    margin-bottom: 0;
}

.post-card-read-more {
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: 500;
    text-decoration: none;
}

.post-card-read-more:hover {
    text-decoration: underline;
}

.blog-posts-classic {
    margin: 0 auto 2rem;
    max-width: 100%;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.posts-grid {
    width: 100%;
}

.post-card-classic {
    max-width: 100%;
    height: fit-content !important;
}

.pagination-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination-label {
    font-weight: 600;
    color: #333;
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-button {
    min-width: 40px;
    min-height: 36px;
    border: 1px solid var(--colorNeutralStroke2, #d1d1d1);
    border-radius: 6px;
    background: var(--colorNeutralBackground1, #fff);
    color: var(--colorNeutralForeground1, #242424);
}

.pagination-button[aria-current="page"] {
    border-color: transparent;
    background: var(--colorBrandBackground, #0078d4);
    color: var(--colorNeutralForegroundOnBrand, #fff);
}

.top-navigation-row {
    box-sizing: border-box;
}

.top-navigation-links {
    display: flex;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.top-navigation-links > nav {
    min-width: max-content;
}

.top-navigation-links .cms-nav-link {
    padding-inline: 0.3rem;
}

.responsive-top-menu {
    display: none;
}

body:has(.hamburger-menu:not(.responsive-top-menu) .hamburger-backdrop) {
    overflow: hidden;
}

@media (max-width: 900px) {
    .top-navigation-row .top-navigation-links {
        display: none;
    }

    .responsive-top-menu {
        display: block;
    }

    body:has(.responsive-top-menu .hamburger-backdrop) {
        overflow: hidden;
    }

    .top-navigation-row .top-navigation-brand {
        max-width: calc(100% - 2.5rem);
        margin-inline-end: 0 !important;
    }

    .top-navigation-brand :is(a, h3) {
        max-width: 100%;
        min-width: 0;
    }

    .top-navigation-brand h3 a {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .top-navigation-brand img {
        max-width: 100% !important;
    }
}

.site-search {
    width: min(100%, 48rem);
    min-width: 0;
}

.site-search-form,
.search-results li,
.search-empty,
.blog-posts-empty {
    padding: clamp(0.875rem, 3vw, 1.25rem);
    border: 1px solid #dce5f0;
    border-radius: 12px;
    background: #f5f8fc;
}

.site-search-form {
    margin-block: 1rem;
}

.site-search-form label {
    display: block;
    margin-block-end: 0.5rem;
    font-weight: 600;
    color: #17243c;
}

.site-search-controls {
    display: flex;
    gap: 0.5rem;
}

.site-search-controls input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.75rem;
    border: 1px solid #99b0ca;
    border-radius: 8px;
    background: #fff;
    color: #17243c;
    font: inherit;
}

.site-search-controls button {
    flex-shrink: 0;
    padding: 0.55rem 0.9rem;
    border: 1px solid #214b79;
    border-radius: 8px;
    background: #214b79;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.site-search-controls button:hover {
    background: #173b63;
}

.search-summary,
.search-results p,
.search-empty p {
    color: #42566b;
    overflow-wrap: anywhere;
}

.search-results {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.search-results li {
    background: #fff;
}

.search-results h2,
.search-empty h2 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.search-results h2 a,
.blog-filter-back {
    color: #214b79;
}

.search-results p,
.search-empty p {
    margin: 0.35rem 0 0;
}

.search-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-block: 1rem;
}

.search-pagination a {
    display: grid;
    min-width: 2.25rem;
    min-height: 2.25rem;
    place-items: center;
    border: 1px solid #d1dfeb;
    border-radius: 8px;
    color: #214b79;
    text-decoration: none;
}

.search-pagination a:is(:hover, [aria-current="page"]) {
    background: #edf4fa;
    border-color: #99b0ca;
}

.site-search :is(input, button, a):focus-visible,
.blog-filter-back:focus-visible {
    outline: 2px solid #2459a9;
    outline-offset: 3px;
}

.blog-filter-type {
    margin: 0;
    color: #42566b;
    font-size: 0.85rem;
    font-weight: 600;
}

.blog-filter-back {
    display: inline-block;
    margin-block-start: 0.55rem;
}

.site-search,
.contact-page,
.archive-page {
    padding-block-start: clamp(1rem, 2.4vw, 1.75rem);
}

/* Contact Page */
.contact-page {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
}

.contact-card {
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    padding: 1.25rem;
    margin-top: 1.15rem;
    border: 1px solid #cbd9f8;
    border-block-start: 4px solid #3867cb;
    border-radius: 12px;
    background: #f5f8fc;
    box-shadow: none;
}

.contact-form {
    width: 100%;
}

.contact-form fluent-field {
    width: 100%;
    min-width: 0;
}

.contact-form :is(fluent-text-input, fluent-textarea)::part(control) {
    box-sizing: border-box;
    width: 100%;
    background-color: #fff;
}

.contact-form-actions {
    margin-top: 1rem;
}

.contact-form-actions fluent-button[disabled] {
    background: #a9cde6;
    color: #fff;
}

.page-editor-form,
.post-comment-form-card > form {
    width: 100%;
    min-width: 0;
}

.contact-message {
    margin-bottom: 1.5rem;
}

.captcha-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #cbd9f8;
}

/* Archive Page */
.archive-page {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
}

.archive-content {
    width: 100%;
    max-width: 1200px;
    min-width: 0;
    margin-top: 1.15rem;
}

.archive-categories {
    margin-bottom: 1.35rem;
    padding: clamp(1rem, 3vw, 1.25rem);
    background: #eef4ff;
    border: 1px solid #cbd9f8;
    border-radius: 12px;
}

.archive-section-label {
    display: block;
    margin-bottom: 0.875rem;
    color: #244986;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.archive-page .category-link {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border: 1px solid #cbd9f8;
    border-radius: 999px;
    background: #fff;
    color: #244986;
    font-weight: 500;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.archive-page .category-link:hover {
    background: #eaf2ff;
    border-color: #9ab8e5;
}

.archive-page .category-link:focus-visible,
.archive-page .archive-post-link:focus-visible,
.archive-page .archive-grid-card:focus-visible {
    outline: 2px solid #2459a9;
    outline-offset: 3px;
}

.archive-category-section {
    --archive-accent-surface: #eaf7f4;
    --archive-accent-border: #b9dfd8;
    --archive-accent-text: #165649;
    margin-bottom: 1.35rem;
    scroll-margin-top: 6rem;
    border: 1px solid var(--archive-accent-border);
    border-radius: 12px;
    background: #fff;
}

.archive-category-section:nth-of-type(3n + 2) {
    --archive-accent-surface: #fff4e3;
    --archive-accent-border: #f1d7ac;
    --archive-accent-text: #754710;
}

.archive-category-section:nth-of-type(3n + 3) {
    --archive-accent-surface: #eef4ff;
    --archive-accent-border: #cbd9f8;
    --archive-accent-text: #244986;
}

.archive-category-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.85rem clamp(0.85rem, 3vw, 1.25rem);
    border-bottom: 1px solid var(--archive-accent-border);
    border-radius: 11px 11px 0 0;
    background: var(--archive-accent-surface);
}

.archive-page .category-title {
    margin: 0;
    color: var(--archive-accent-text);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.archive-page .post-count {
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--archive-accent-border);
    background: #fff;
    color: var(--archive-accent-text);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.archive-page .archive-grid-card {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.5rem clamp(0.375rem, 2vw, 1rem) 0.75rem;
    border: 0;
    border-radius: 0 0 11px 11px;
    box-shadow: none;
    overflow-x: auto;
}

.archive-grid {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    --colorSubtleBackgroundHover: #f5f8fc;
}

.archive-grid-rated {
    min-width: 28rem;
}

.archive-grid tr,
.archive-grid [role="row"] {
    min-height: 36px;
}

.archive-grid td,
.archive-grid th,
.archive-grid [role="gridcell"],
.archive-grid [role="columnheader"] {
    padding: 0.375rem clamp(0.375rem, 2vw, 0.75rem);
    line-height: 1.4;
    border-bottom: 1px solid #edf1f6;
}

.archive-grid th,
.archive-grid [role="columnheader"] {
    color: #526077;
    font-size: 0.8rem;
    font-weight: 600;
}

.archive-grid tbody tr:hover,
.archive-grid [role="rowgroup"] [role="row"]:hover {
    background: #f5f8fc;
}

.archive-page .archive-post-link {
    color: #2459a9;
    text-decoration: none;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.archive-page .archive-post-link:hover {
    text-decoration: underline;
}

.archive-footer {
    margin-top: 1rem;
    padding: 1rem 0;
    border-top: 1px solid #e2e8f0;
    color: #526077;
    text-align: left;
}

.archive-page .total-count {
    color: #2459a9;
    font-weight: 600;
}

/* Post Page */
.post-header-section {
    margin-bottom: 0.5rem;
    margin-top: 0;
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    box-sizing: border-box;
}

.post-title {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    font-size: 1.75rem;
}

.post-description {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.post-metadata {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
}

.metadata-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    color: #42566b;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.post-metadata :is(.category-badge-inline, .tag-badge-header) {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2rem;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.25rem 0.625rem;
    border: 1px solid #d1dfeb;
    border-radius: 999px;
    background: #edf4fa;
    color: #17476b;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.post-metadata :is(.category-badge-inline, .tag-badge-header):is(:hover, :focus-visible) {
    border-color: #8eabc2;
    background: #e1edf7;
    color: #143957;
    text-decoration: underline;
}

.post-metadata svg {
    flex-shrink: 0;
    color: inherit;
}

/* Keep old class for backward compatibility if used elsewhere */
.post-categories {
    margin-bottom: 0.5rem;
}

.category-badge {
    padding: 0.4rem 0.8rem;
    background-color: #f0f0f0;
    border-radius: 4px;
    text-decoration: none;
    color: #0078d4;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.category-badge:hover {
    background-color: #e8f4f8;
    color: #005a9e;
    border: 1px solid #0078d4;
}

.post-divider {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

.post-navigation {
    margin: 1.25rem 0;
    width: 100%;
}

.post-nav-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 0.75rem;
}

.post-nav-item {
    display: flex;
    min-width: 0;
    --post-nav-background: #eef4ff;
    --post-nav-border: #cbd9f8;
    --post-nav-foreground: #244986;
}

.post-nav-next {
    --post-nav-background: #eaf7f4;
    --post-nav-border: #b9dfd8;
    --post-nav-foreground: #165649;
}

nav.post-navigation .post-nav-item > a.post-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
    min-height: 3.65rem;
    padding: 0.7rem 0.85rem;
    box-sizing: border-box;
    border: 1px solid var(--post-nav-border);
    border-radius: 12px;
    background: var(--post-nav-background);
    color: var(--post-nav-foreground);
    text-decoration: none;
}

.post-nav-link svg {
    flex: 0 0 auto;
    color: inherit;
}

.post-nav-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    text-align: start;
}

.post-nav-next .post-nav-content {
    text-align: end;
}

.post-nav-label {
    color: #46596c;
    font-size: 0.78rem;
}

.post-nav-title {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

.post-nav-link:is(:hover, :focus-within) .post-nav-title {
    text-decoration: underline;
}

.post-content {
    line-height: 1.8;
    color: #333;
    margin: 0 0 1rem 0;
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    box-sizing: border-box;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

.post-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem auto;
    max-width: 100%;
    width: 100%;
    padding: 1rem 2rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-sizing: border-box;
}

/* Post Footer Section - Side by Side Layout */
.post-footer-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 100%;
    width: 100%;
    margin: 2rem auto 1rem auto;
    padding: 0;
    box-sizing: border-box;
    align-items: start;
}

/* When only one column exists, make it span full width or use single column */
.post-footer-section:has(.post-footer-column:only-child) {
    grid-template-columns: 1fr;
}

.post-footer-column {
    min-width: 0; /* Prevents overflow */
    display: flex;
    flex-direction: column;
    width: 100%;
}

.post-footer-column > * {
    width: 100%;
}

/* Related Posts Card */
.related-posts-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.related-posts-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-bottom: 1px solid #e0e0e0;
}

.related-posts-header > svg {
    color: #0078d4;
}

.related-posts-title {
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.related-posts-content {
    padding: 1rem 1.25rem;
    flex: 1;
    text-align: left !important;
}

.related-posts-card .related-posts-content {
    text-align: left !important;
}

.related-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left !important;
    width: 100%;
}

.related-posts-list li {
    margin-bottom: 0.75rem;
    padding-left: 0;
    text-align: left !important;
    width: 100%;
}

.related-posts-list li:last-child {
    margin-bottom: 0;
}

.related-post-link {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    color: #0078d4;
    text-decoration: none;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
    border-radius: 4px;
    justify-content: flex-start !important;
    text-align: left !important;
    width: 100%;
    margin: 0;
}

.related-post-link:hover {
    color: #106ebe;
    text-decoration: none;
    background-color: #f5f5f5;
    padding-left: 0.5rem;
}

.related-post-link > svg {
    color: #0078d4;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.related-post-link:hover > svg {
    transform: translateX(2px);
    color: #106ebe;
}

/* Post Comments Card */
.post-comments-card {
    height: 100%;
    display: flex !important;
    flex-direction: column;
    padding: 0;
    overflow: visible;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

.post-comments-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-bottom: 1px solid #e0e0e0;
}

.post-comments-header > svg {
    color: #0078d4;
}

.post-comments-title {
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.post-comments-content {
    padding: 1rem 1.25rem;
    flex: 1;
    overflow-y: visible;
    min-height: 150px;
}

.post-comments-content p {
    margin: 0;
}

.post-comment-list {
    display: grid;
    gap: 0.75rem;
}

.post-comment-entry {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.875rem;
    border: 1px solid #d8e0e8;
    border-radius: 0.5rem;
    background: #fff;
}

.post-comment-byline {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.post-comment-byline fluent-avatar {
    flex-shrink: 0;
}

.post-comment-author-details {
    display: grid;
    min-width: 0;
    overflow-wrap: anywhere;
}

.post-comment-author-details time {
    color: #5c6470;
    font-size: 0.875rem;
}

.post-comment-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.post-comment-moderation,
.post-comment-contact,
.post-comment-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.post-comment-moderation {
    justify-content: space-between;
    padding-top: 0.625rem;
    border-top: 1px solid #e2e8f0;
}

.post-comment-contact {
    color: #5c6470;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.post-comments-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
}

/* Backward compatibility - keep old classes */
.related-posts-container,
.post-comments-container {
    max-width: 100%;
    width: 100%;
    margin: 1rem auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

.tag-badge {
    padding: 0.4rem 0.8rem;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-decoration: none;
    color: #0078d4;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tag-badge:hover {
    background-color: #0078d4;
    color: #ffffff;
    border-color: #0078d4;
}

/* Responsive Design for Pages */
@media (max-width: 1400px) {
    .blog-posts-container {
        max-width: 100%;
        padding: 0;
    }
    
    .post-header-section,
    .post-content,
    .post-navigation,
    .post-tags,
    .post-footer-section {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
    
    .blog-posts-classic {
        max-width: 100%;
        padding: 0;
    }
}

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

@media (max-width: 768px) {
    .blog-posts-container {
        padding: 0;
    }
    
    .blog-posts-header {
        flex-direction: column;
    }
    
    .post-card-scroll {
        width: 280px;
        min-width: 280px;
    }
    
    .post-header-section,
    .post-content,
    .post-navigation,
    .post-tags,
    .post-footer-section {
        padding-left: 0;
        padding-right: 0;
    }
    
    .blog-posts-classic {
        padding: 0;
    }
    
    .post-footer-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
}

/* Admin dashboard */
.admin-page-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    line-height: 1.25;
}

.dashboard-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 1400px;
    margin-inline: auto;
    padding-block: 1rem;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-stat-card {
    min-width: 0;
    background: #fff;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    overflow: hidden;
}

.stat-card-header,
.stat-header-content,
.stat-badge,
.quick-action-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-card-header {
    justify-content: space-between;
    min-height: 56px;
    padding: 0.75rem 1rem;
    color: #fff;
    background: #244986;
}

.stat-header-pages { background: #5a398d; }
.stat-header-comments { background: #155a52; }
.stat-header-actions { background: #34465d; }

.stat-header-content svg,
.stat-badge svg,
.quick-action-link svg {
    flex: none;
}

.stat-header-content h2 {
    margin: 0;
    color: inherit;
    font-size: 1rem;
    font-weight: 600;
}

.stat-header-total {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stat-card-content {
    display: grid;
    gap: 0.4rem;
    padding: 0.75rem;
}

.stat-badge,
.quick-action-link {
    min-height: 44px;
    padding: 0.4rem 0.65rem;
    color: #254363;
    background: #f1f5f9;
    border-radius: 6px;
    text-decoration: none;
}

.stat-badge-success { color: #276143; background: #eaf6ee; }
.stat-badge-warning { color: #82521b; background: #fff4e3; }
.stat-badge-danger { color: #962c3b; background: #fff0f1; }

.stat-badge:hover,
.quick-action-link:hover {
    text-decoration: underline;
}

.stat-badge:focus-visible,
.quick-action-link:focus-visible {
    outline: 2px solid #2459a9;
    outline-offset: 2px;
}

.stat-badge-value {
    margin-inline-start: auto;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

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

@media (max-width: 600px) {
    .dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ============================================
   Account Page Styling
   ============================================ */
.account-card {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e5e5;
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e5e5e5;
}

.account-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    border-radius: 12px;
    color: #ffffff;
}

.account-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.account-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #0891b2;
    border-radius: 6px;
}

.account-section-header > svg {
    color: #0891b2;
    flex-shrink: 0;
}

.account-section-header h5 {
    color: #0c4a6e;
    font-weight: 600;
}

.account-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e5e5;
}

/* Responsive Account Page */
@media (max-width: 768px) {
    .account-card {
        padding: 1.5rem;
    }
    
    .account-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .account-header-icon {
        width: 40px;
        height: 40px;
    }
    
    .account-section-header {
        padding: 0.75rem 1rem;
    }
}

/* ============================================
   Content Management Styling
   ============================================ */
.content-management-card {
    --content-row-stripe: #f4f7fa;
    box-sizing: border-box;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #dbe2ea;
    padding: clamp(0.75rem, 2vw, 1.25rem);
    margin-bottom: 1rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e5e5;
}

.content-filters {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    min-width: 0;
}

.content-search {
    flex: 1 1 22rem;
    justify-content: flex-end;
}

.content-search fluent-field {
    flex: 1 1 12rem;
    max-width: 23.5rem;
    min-width: 0;
    margin-block: 0 !important;
}

.filter-button {
    min-width: 4.25rem;
}

.filter-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-button-primary {
    display: flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
}

.action-button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.content-grid-scroll {
    min-width: 0;
    overflow-x: auto;
}

.content-grid-scroll:focus-visible {
    outline: 2px solid #2459a9;
    outline-offset: 2px;
}

.content-grid-scroll > table {
    width: 100%;
}

.content-grid-scroll > .content-data-grid {
    --fluent-data-grid-stripe-background-color: var(--content-row-stripe);
}

.content-grid-scroll > .content-data-grid th {
    background: #f3f6fa;
}

.content-grid-scroll > .content-data-grid :is(th, td:not([col-select=true])) {
    padding-inline: 0.75rem;
}

.content-grid-scroll > .content-data-grid th > div {
    padding-inline: 0 !important;
}

.content-grid-scroll > .content-data-grid :is([col-title], th[col-justify=start] [col-sort-button]) {
    padding-inline: 0;
}

.content-grid-scroll > .content-data-grid .comment-badge {
    justify-content: center;
}

.comments-cell {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.comments-preview,
.comments-post-inline,
.comments-post-column > .content-link {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.comments-preview {
    flex: 1;
}

.comments-post-column > .content-link {
    display: block;
}

.comments-post-inline {
    display: none;
}

@media (max-width: 1100px) {
    .comments-grid {
        --comments-post-width: 0px;
    }

    .comments-grid :is(th, td).comments-post-column {
        display: none;
    }

    .comments-post-inline {
        display: block;
        max-width: 45%;
        font-size: 0.875rem;
    }
}

.content-link {
    overflow-wrap: anywhere;
    color: #0078d4;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.content-link:hover {
    color: #106ebe;
    text-decoration: underline;
}

.comment-badge {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.comment-approved {
    color: #107c10;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: #e8f5e9;
    border-radius: 4px;
}

.comment-pending {
    color: #d13438;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: #ffebee;
    border-radius: 4px;
}

.status-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge-published {
    background: #e8f5e9;
    color: #107c10;
}

.status-badge-draft {
    background: #fff3e0;
    color: #ff8c00;
}

.status-badge-success {
    background: #e8f5e9;
    color: #107c10;
}

.status-badge-warning {
    background: #fff3e0;
    color: #ff8c00;
}

.status-badge-info {
    background: #e3f2fd;
    color: #0078d4;
}

.status-badge-danger {
    background: #ffebee;
    color: #d13438;
}

.status-badge-neutral {
    background: #f5f5f5;
    color: #666;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.action-buttons fluent-button {
    transition: all 0.2s ease;
}

.action-buttons fluent-button:hover {
    transform: translateY(-1px);
}

.content-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e5e5;
}

/* Responsive Content Management */
@media (max-width: 768px) {
    .content-management-card {
        padding: 1rem;
    }
    
    .content-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .content-search {
        flex-basis: auto;
        justify-content: flex-start;
    }

    .content-header > .action-button-primary {
        align-self: flex-start;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

.cms-nav-link,
.cms-nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
}

.cms-nav-link:is(:hover, :focus-visible, .active) {
    background: color-mix(in srgb, currentColor 9%, transparent);
}

.cms-sidebar-links {
    display: flex;
    flex-direction: column;
    width: 150px;
}

.cms-sidebar-links-collapsed {
    width: max-content;
}

.cms-sidebar-links-collapsed .cms-nav-link-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.cms-nav-toggle {
    border: 0;
    background: transparent;
}

.post-settings-option {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-block: 0.5rem;
}

.cms-dialog-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
}

.post-scroll-track {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.25rem 0.25rem 0.75rem;
    scroll-snap-type: x proximity;
}

.post-scroll-track .post-card-scroll {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    scroll-snap-align: start;
    overflow-wrap: anywhere;
}

.post-scroll-actions {
    display: flex;
    flex-shrink: 0;
    gap: 0.5rem;
}

.post-scroll-actions button {
    display: grid;
    place-items: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #244986;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.post-scroll-actions button:hover {
    background: #edf4ff;
}

.post-scroll-actions button:focus-visible {
    outline: 2px solid #2459a9;
    outline-offset: 2px;
}

.post-editor-card {
    align-self: stretch;
}

.post-editor-taxonomy-panel h2 {
    line-height: 1.4;
}

.post-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem);
    align-items: start;
    gap: clamp(1rem, 3vw, 2rem);
    width: 100%;
}

.post-editor-layout > form {
    min-width: 0;
}

.post-editor-taxonomy {
    display: grid;
    gap: 1.25rem;
    color: #17243c;
}

.post-editor-taxonomy-panel {
    min-width: 0;
    margin: 0;
    padding: 1rem;
    border: 1px solid #d8e2ef;
    border-radius: 12px;
    background: #f8faff;
}

.post-editor-taxonomy-panel :is(legend, h2) {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 650;
}

.post-editor-taxonomy-panel legend {
    padding-inline: 0.35rem;
}

.post-editor-category-list {
    display: grid;
    gap: 0.35rem;
    max-height: 18rem;
    overflow-y: auto;
}

.post-editor-category {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.5rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.post-editor-category:is(:hover, :has(:checked)) {
    border-color: #cbd9f8;
    background: #edf3ff;
}

.post-editor-category input {
    margin: 0;
    accent-color: #244986;
}

.post-editor-tag-form {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.post-editor-tag-form label,
.post-editor-taxonomy-hint {
    color: #435574;
    font-size: 0.875rem;
}

.post-editor-taxonomy-hint {
    margin-block: 0.65rem 0.35rem;
}

.post-editor-taxonomy-hint:empty {
    display: none;
}

.post-editor-tag-entry {
    display: flex;
    gap: 0.4rem;
}

.post-editor-tag-entry input {
    min-width: 0;
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 1px solid #a9bad2;
    border-radius: 7px;
    background: #fff;
    color: #17243c;
}

.post-editor-tag-entry button {
    padding-inline: 0.75rem;
    border: 0;
    border-radius: 7px;
    background: #244986;
    color: #fff;
}

.post-editor-tag-entry button:disabled {
    opacity: 0.55;
}

.post-editor-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-height: 12rem;
    overflow-y: auto;
    margin: 0.55rem 0 0;
    padding: 0;
    list-style: none;
}

.post-editor-tag-list li {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
    padding-inline: 0.55rem 0.25rem;
    border: 1px solid #cbd9f8;
    border-radius: 999px;
    background: #e9f1ff;
    color: #244986;
    overflow-wrap: anywhere;
}

.post-editor-tag-list button {
    padding: 0.25rem 0.45rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
}

.post-editor-tag-list button:hover {
    background: #d7e5ff;
}

.post-editor-tag-suggestions li {
    padding: 0;
    background: #fff;
}

@media (max-width: 760px) {
    .post-editor-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Error pages */
.error-layout { min-height: 100svh; display: grid; align-content: center; padding: clamp(24px, 6vw, 72px) 20px; box-sizing: border-box; background: var(--colorNeutralBackground2, #f5f7fb); color: var(--colorNeutralForeground1, #18283f); font-family: var(--body-font, 'Segoe UI', sans-serif); }
.status-card { width: min(100%, 640px); margin: 0 auto; padding: clamp(28px, 6vw, 64px); box-sizing: border-box; border: 1px solid var(--colorNeutralStroke2, #dfe5ef); border-radius: 24px; background: var(--colorNeutralBackground1, #fff); box-shadow: 0 20px 64px rgb(25 46 80 / 8%); }
.status-code { display: block; margin-bottom: 20px; color: var(--colorBrandForeground1, #0078d4); font-size: clamp(64px, 14vw, 112px); font-weight: 700; line-height: 1; letter-spacing: -.06em; }
.status-card h1 { margin: 0 0 16px; color: var(--colorNeutralForeground1, #18283f); font-size: clamp(26px, 5vw, 36px); line-height: 1.2; letter-spacing: -.025em; }
.status-card p { margin: 0; color: var(--colorNeutralForeground3, #526175); font-size: 16px; line-height: 1.75; }
.status-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 24px; }
.status-actions a { display: inline-flex; align-items: center; justify-content: center; gap: 18px; padding: 12px 20px; border: 1px solid var(--colorNeutralStroke2, #dfe5ef); border-radius: 8px; color: var(--colorBrandForeground1, #0078d4); font-weight: 600; text-decoration: none; }
.status-actions .status-primary { background: var(--colorBrandBackground, #0078d4); border-color: transparent; color: var(--colorNeutralForegroundOnBrand, #fff); }
.status-actions a:hover { background: var(--colorSubtleBackgroundHover, #edf3fa); }
.status-actions .status-primary:hover { background: var(--colorBrandBackgroundHover, #106ebe); }
.status-home { color: var(--colorBrandForeground1, #0078d4); text-underline-offset: 4px; }
.status-card a:focus-visible { outline: 3px solid var(--colorBrandForeground1, #0078d4); outline-offset: 4px; }
@media (max-width: 480px) { .status-actions { flex-direction: column; } }
