:root {
    --bg: #f8f6ff;
    --surface: #ffffff;
    --surface-soft: #ede8ff;
    --accent: #6f5fa8;
    --accent-light: #b7aed9;
    --text: #2f2a44;
    --muted: #6d6780;
    --success: #4f9273;
    --info: #5f7eb5;
    --warning: #b57b4f;
    --danger: #b55464;
    --border: #d8d3ed;
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Work Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

.site-header {
    background: linear-gradient(135deg, rgba(233, 242, 237, 0.95), rgba(255, 249, 242, 0.95));
    border-bottom: 1px solid rgba(92, 136, 124, 0.18);
    box-shadow: 0 18px 38px -30px rgba(36, 58, 52, 0.35);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-family: "Playfair Display", serif;
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #2f4a43;
}

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

.nav-link,
.dropdown-trigger,
.dropdown-item {
    color: #4f7068;
    font-weight: 500;
    letter-spacing: 0.04em;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link {
    padding: 0.4rem 0.6rem;
}

.nav-link:hover,
.nav-link:focus {
    color: #d97a4a;
    background: rgba(217, 122, 74, 0.12);
}

.nav-dropdown {
    position: relative;
}

.dropdown-trigger {
    background: transparent;
    border: 1px solid rgba(92, 136, 124, 0.25);
    padding: 0.4rem 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.dropdown-trigger:hover,
.dropdown-trigger:focus {
    color: #d97a4a;
    border-color: rgba(217, 122, 74, 0.45);
    background: rgba(217, 122, 74, 0.12);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    min-width: 13rem;
    background: #ffffff;
    border-radius: 18px;
    padding: 0.75rem;
    box-shadow: 0 18px 36px -22px rgba(32, 52, 46, 0.35);
    border: 1px solid rgba(92, 136, 124, 0.18);
    display: none;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 200;
}

.dropdown-item {
    display: block;
    padding: 0.45rem 0.75rem;
    color: #3d5b52;
    border-radius: 12px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: #d97a4a;
    background: rgba(217, 122, 74, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: rgba(92, 136, 124, 0.18);
    margin: 0.35rem 0;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
    display: flex;
}

.content {
    flex: 1;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3.5rem;
}

.hero {
    background: linear-gradient(135deg, rgba(111, 95, 168, 0.08), rgba(183, 174, 217, 0.35));
    border-radius: 18px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.hero h1 {
    font-family: "Playfair Display", serif;
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.hero p {
    color: var(--muted);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.6;
}

.featured-grid,
.posts-grid {
    display: grid;
    gap: 1.5rem;
}

.featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 2.5rem;
}

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

.card {
    background: var(--surface);
    border: 1px solid rgba(215, 209, 237, 0.6);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 12px 24px -18px rgba(47, 42, 68, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 32px -20px rgba(47, 42, 68, 0.35);
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.1rem;
    box-shadow: inset 0 0 0 1px rgba(111, 95, 168, 0.08);
}

.featured .card-image {
    height: 220px;
}

.card h2,
.card h3 {
    font-family: "Playfair Display", serif;
    margin-top: 0;
    color: var(--accent);
}

.card p {
    color: var(--muted);
    line-height: 1.6;
}

.card-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: rgba(111, 95, 168, 0.12);
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

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

.tag-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 0;
}

.tag-list li {
    font-size: 0.75rem;
    background: var(--surface-soft);
    color: var(--accent);
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
}

.pagination {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--surface-soft);
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border 0.2s ease;
}

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

.button.secondary {
    background: transparent;
    border-color: var(--accent-light);
    color: var(--accent);
}

.button.danger {
    background: transparent;
    border-color: rgba(181, 84, 100, 0.3);
    color: var(--danger);
}

.button.small {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
}

.button:hover {
    background: rgba(111, 95, 168, 0.12);
}

.post-detail header h1 {
    font-family: "Playfair Display", serif;
    font-size: 2.25rem;
    margin-bottom: 0.4rem;
}

.post-detail .lead {
    font-size: 1.1rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.post-body {
    margin-top: 2rem;
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--text);
}

.post-hero {
    margin: 2rem 0;
}

.post-hero img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 40px -28px rgba(47, 42, 68, 0.45);
}

.post-body p {
    margin-bottom: 1.25rem;
}

.related {
    margin-top: 3rem;
}

.related h2 {
    font-family: "Playfair Display", serif;
    margin-bottom: 1rem;
}

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

.editor,
.auth-card,
.dashboard {
    background: var(--surface);
    border-radius: 18px;
    padding: 2rem;
    border: 1px solid rgba(215, 209, 237, 0.7);
    box-shadow: 0 18px 36px -24px rgba(47, 42, 68, 0.35);
}

.editor h1,
.auth-card h1,
.dashboard h1 {
    font-family: "Playfair Display", serif;
    margin-top: 0;
    color: var(--accent);
}

.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.form-group.inline {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.input,
.textarea,
.table input,
.table textarea {
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    font: inherit;
    background: var(--surface-soft);
    color: var(--text);
    transition: border 0.2s ease;
}

.textarea {
    resize: vertical;
    min-height: 180px;
}

.input:focus,
.textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(111, 95, 168, 0.15);
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.input-file {
    padding: 0.65rem;
    border: 1px dashed var(--accent-light);
    border-radius: 12px;
    background: rgba(111, 95, 168, 0.04);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.quill-editor {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    min-height: 260px;
}

.ql-toolbar.ql-snow {
    border-radius: 14px 14px 0 0;
    border-color: var(--border);
}

.ql-container.ql-snow {
    border-radius: 0 0 14px 14px;
    border-color: var(--border);
}

.current-hero {
    margin-bottom: 1rem;
}

.current-hero-image {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 18px 36px -28px rgba(47, 42, 68, 0.4);
}

.error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.description {
    font-size: 0.8rem;
    color: var(--muted);
}

.auth-card {
    max-width: 420px;
    margin: 0 auto;
    text-align: left;
}

.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--muted);
}

.auth-switch a {
    color: var(--accent);
}

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

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

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

.table td.actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.hero-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(111, 95, 168, 0.15);
}

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

.table form {
    display: inline;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    margin: 2rem 0;
}

.flash-container {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.flash-success {
    background: rgba(79, 146, 115, 0.12);
    color: var(--success);
}

.flash-info {
    background: rgba(95, 126, 181, 0.12);
    color: var(--info);
}

.flash-warning {
    background: rgba(181, 123, 79, 0.12);
    color: var(--warning);
}

.flash-danger {
    background: rgba(181, 84, 100, 0.12);
    color: var(--danger);
}

.site-footer {
    margin-top: auto;
    background: var(--surface);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 720px) {
    .nav {
        flex-direction: column;
        gap: 0.75rem;
    }

    .nav-links {
        justify-content: center;
        gap: 0.75rem;
        width: 100%;
    }

    .nav-link {
        margin: 0;
    }

    .dropdown-trigger {
        width: 100%;
        justify-content: space-between;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        margin-top: 0.5rem;
        box-shadow: none;
    }

    .nav-dropdown {
        width: 100%;
    }

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

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .table td.actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
