@font-face {
    font-family: 'Outfit';
    src: url('../assets/fonts/outfit.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --primary: #FF6601;
    --primary-hover: #e65c00;
    --secondary: #6366f1;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text: #0f172a;
    --text-muted: #475569;
    --glass: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(0, 0, 0, 0.08);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: 0.3s ease;
}

.dark-mode {
    --background: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Glassmorphism Navigation */
.main-nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    background: var(--surface);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: inline-block;
    padding: 0.5rem 0;
}

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

.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    min-width: 200px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 0.5rem 0;
}

.nav-item:hover .sub-menu {
    display: block;
}

.sub-menu li {
    list-style: none;
}

.sub-menu a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
}

.sub-menu a:hover {
    background: var(--surface-hover);
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background: var(--text);
    border-radius: 10px;
    transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Hero Section */
.hero {
    height: 40vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 10% 0;
    margin-top: 70px;
    /* Top padding to clear fixed nav */
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(circle at bottom left, rgba(236, 72, 153, 0.15), transparent);
}

.hero h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);

}

/* Post Grid */
.container {
    padding: 4rem 5%;
    max-width: 76.25rem;
    margin: 0 auto;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Enforce 2 columns as requested */
    gap: 2.5rem;
}

/* Home Page specific grid override if needed, but the user asked for 2 columns */
@media (max-width: 900px) {
    .post-grid {
        grid-template-columns: 1fr;
    }
}

.post-card {
    background: var(--surface);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
    background: var(--surface-hover);
}

.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 2px solid var(--primary);
}

.post-content {
    padding: 1rem;
}

.post-content h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.post-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.post-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.read-more {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

/* Single Post Page */
.single-post {
    padding-top: 100px !important;
    /* Account for fixed nav */
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 4rem;
    padding-left: 5%;
    padding-right: 5%;
    background-color: white;
}

.single-post h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.single-post-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: 24px;
    margin-bottom: 3rem;
    border: 1px solid var(--glass-border);
}

.post-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text);
}

/* Post Content & Quill Overrides */
.post-body img,
.ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.post-body iframe,
.ql-video {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 16px;
    margin: 2rem 0;
}

/* Enhanced Table Styles */
.post-body table,
.ql-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.5rem 0;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
}

.post-body th,
.ql-editor th {
    background: var(--surface-hover);
    padding: 1.2rem;
    text-align: left;
    font-weight: 700;
    color: var(--primary);
}

.post-body td,
.ql-editor td {
    padding: 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-muted);
}

/* Breadcrumb Styling */
.breadcrumb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 5% 0;
}

.breadcrumb-nav {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    background: var(--surface-hover);
    border-radius: 12px;
    display: inline-flex;
    flex-wrap: wrap;
    /* Prevent overflow */
    align-items: center;
    border: 1px solid var(--glass-border);
}

.breadcrumb-nav a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

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

.breadcrumb-nav span {
    margin: 0 0.6rem;
    opacity: 0.4;
}

.breadcrumb-nav .current {
    color: var(--primary);
    font-weight: 600;
    opacity: 1 !important;
}

/* Admin Sidebar Layout */
.admin-container .main-fields {
    background: rgba(255, 255, 255, 0.02);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

/* Fix for Quill Table Selection UI */
.ql-table-select {
    background: var(--surface) !important;
    border: 1px solid var(--glass-border) !important;
}

/* Footer Styling */
footer {
    padding: 1rem 0;
    background: var(--surface);
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

/* Responsiveness & Mobile Optimization */
@media (max-width: 1024px) {

    .container,
    .admin-container {
        width: 95%;
        padding: 0 1rem;
    }

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

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--surface);
        flex-direction: column;
        align-items: center;
        padding: 4rem 2rem;
        gap: 3rem;
        transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        z-index: 1000;
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.2rem;
    }

    .breadcrumb-container,
    .single-post {
        padding-top: 100px;
        /* Nav is now single line with burger */
    }

    .hero {
        height: auto;
        padding: 6rem 1rem 4rem;
    }

    .hero h1,
    .single-post h1 {
        font-size: 2rem;
    }

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

    .single-post-image {
        height: 250px;
        margin-bottom: 2rem;
        border-radius: 16px;
    }

    .post-body {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    .post-body table {
        display: block;
        overflow-x: auto;
    }

    /* Admin Navbar Mobile */
    .admin-nav-bar .admin-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .admin-nav-logo {
        width: 100%;
    }

    .admin-nav-links {
        display: none !important;
        flex-direction: column;
        width: 100%;
        gap: 1.5rem;
        padding-top: 1.5rem;
    }

    .admin-nav-links.active {
        display: flex !important;
    }

    .admin-links-left,
    .admin-links-right {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {

    .hero h1,
    .single-post h1 {
        font-size: 1.8rem;
    }

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

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

/* Admin Dashboard UI */
.admin-container {
    padding: 0rem 1% 0rem;
    max-width: 1200px;
    margin: 0 auto;
}

.btn {
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    border: none;
    transition: 0.3s;
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.admin-actions {
    display: flex;
    gap: 1rem;
}

.btn-delete {
    background: #ef4444;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Admin Media Queries */
@media (max-width: 768px) {

    /* Admin Forms */
    form {
        padding: 2rem !important;
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .admin-container div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .branding-section,
    .seo-global-section {
        grid-column: 1 / -1 !important;
    }

    .main-fields,
    .sidebar-fields,
    .media-fields,
    .seo-fields {
        grid-column: 1 / -1 !important;
    }

    .admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Shortcodes Frontend Styling */
.sc-posts-list,
.sc-pages-list {
    list-style: none;
    padding: 1.5rem;
    background: var(--surface-hover);
    border-radius: 16px;
    margin: 2rem 0;
    border: 1px solid var(--glass-border);
}

.sc-posts-list li,
.sc-pages-list li {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--glass-border);
}

.sc-posts-list li:last-child,
.sc-pages-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sc-posts-list a,
.sc-pages-list a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.sc-posts-list small {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.sc-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--primary);
    color: white !important;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.2rem;
    transition: var(--transition);
}

.sc-badge:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.sc-tag {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-right: 1rem;
}

.sc-tag:hover {
    color: var(--primary);
}

.sc-category-posts {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 16px;
    margin: 2rem 0;
}

.sc-category-posts h4 {
    margin-bottom: 1rem;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}