:root {
    --primary-hover: #07470c;
    /* Calculated relative to primary usually, or hardcoded for now */
    --text-color: #333;
    --light-grey: #f4f4f4;
    --white: #ffffff;
    --main-font: 'Roboto', sans-serif;
}

body {
    font-family: var(--main-font);
    margin: 0;
    padding: 0;
    color: var(--text-color);
}

.top-bar {
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-links a {
    color: var(--white);
    text-decoration: none;
    margin-left: 15px;
    font-weight: 500;
}

.top-links a i {
    margin-right: 5px;
}

/* Header */
.main-header {
    background-color: var(--white);
    padding: 1.5rem 0;
    border-bottom: 1px solid #ddd;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section img {
    max-height: var(--logo-max-height, 60px);
    width: auto;
}

.journal-title h1 {
    font-family: 'Playfair Display', serif;
    /* Keep serif for title specifically unless overridden? For now let's keep it distinctive */
    color: var(--heading-color);
    margin: 0;
    font-size: var(--title-size, 1.5rem);
    font-weight: 700;
    line-height: 1.2;
}

.journal-title p {
    margin: 0;
    color: #666;
    font-size: var(--subtitle-size, 1rem);
    letter-spacing: 0.5px;
}

.search-section {
    display: flex;
}

.search-section input {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    outline: none;
    width: 150px;
}

.search-section button {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Nav */
.main-nav {
    position: relative;
    background-color: var(--primary-color);
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.main-nav.sticky {
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background-color: var(--primary-color);
    /* Ensure opacity */
}

/* Ensure container allows flex items to spread when sticky for search icon positioning */
.main-nav.sticky .container .nav-list {
    justify-content: space-between;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list li {
    margin: 0;
    position: relative;
}

.nav-list a {
    display: block;
    padding: 1rem 1.5rem;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.nav-list a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    padding: 0;
    list-style: none;
    border-radius: 0 0 4px 4px;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    border-bottom: 1px solid #eee;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background-color: var(--light-grey);
    color: var(--primary-color);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* User Top Bar Dropdown */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--primary-color);
    min-width: 160px;
    z-index: 2000;
    border-radius: 3px;
    padding: 8px 0;
    margin-top: 0px;
    list-style: none;
    animation: fadeInDown 0.2s ease-out;
}

.user-dropdown-menu li a {
    color: var(--white) !important;
    padding: 10px 16px !important;
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0 !important;
    text-decoration: none;
    transition: all 0.2s;
}

.user-dropdown-menu li a:hover {
    background-color: #f8f9fa2c;
    color: var(--white) !important;
}

.user-dropdown-menu li a i {
    width: 16px;
    text-align: center;
    color: var(--white);
}

.user-dropdown-menu li a:hover i {
    color: var(--white);
}

.user-dropdown:hover .user-dropdown-menu {
    display: block;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

footer h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

footer p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

footer p:last-child {
    margin-bottom: 0;
}

/* NEW Footer Links Styling */
.footer-link {
    color: #aaa;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    /* Ensure transition works well */
    margin-bottom: 4px;
    /* Spacing between links */
    font-size: 0.9rem;
}

.footer-link:hover {
    color: #ffffff;
    padding-left: 5px;
    /* Sliding animation */
}

.copyright {
    text-align: center;
    border-top: 1px solid #444;
    margin-top: 1rem;
    padding-top: 0.75rem;
    font-size: 0.85rem;
    color: #aaa;
}

.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
}

@media (max-width: 1024px) {
    .main-content-grid {
        grid-template-columns: 1fr 280px;
        gap: 1.5rem;
    }
}

@media (max-width: 900px) {
    .main-content-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   QUILL CONTENT RESET - Public Page
   ============================================ */

.policy-body.ql-editor {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    white-space: normal !important;
    overflow: visible !important;
}

/* Reset spacing - NOT li padding */
.policy-body.ql-editor p,
.policy-body.ql-editor h1,
.policy-body.ql-editor h2,
.policy-body.ql-editor h3,
.policy-body.ql-editor h4,
.policy-body.ql-editor h5,
.policy-body.ql-editor h6,
.policy-body.ql-editor blockquote,
.policy-body.ql-editor pre {
    margin: 0 !important;
    padding: 0 !important;
}

/* ul/ol reset */
.policy-body.ql-editor ul,
.policy-body.ql-editor ol {
    margin: 0 !important;
    padding-left: 1.5em !important;
}

/* li margin only */
.policy-body.ql-editor li {
    margin: 0 !important;
}

/* Strip ql-snow wrapper */
.ql-snow {
    border: none !important;
    background: transparent !important;
}

/* Reset float/vertical only */
.policy-body.ql-editor,
.policy-body.ql-editor p,
.policy-body.ql-editor h1,
.policy-body.ql-editor h2,
.policy-body.ql-editor h3,
.policy-body.ql-editor h4,
.policy-body.ql-editor h5,
.policy-body.ql-editor h6,
.policy-body.ql-editor ul,
.policy-body.ql-editor ol,
.policy-body.ql-editor li,
.policy-body.ql-editor span,
.policy-body.ql-editor div {
    vertical-align: unset !important;
    float: unset !important;
}

/* ============================================
   QUILL ALIGNMENT - Restore on Public Page
   ============================================ */

.policy-body p.ql-align-center,
.policy-body li.ql-align-center,
.policy-body div.ql-align-center,
.ql-align-center {
    text-align: center !important;
}

.policy-body p.ql-align-right,
.policy-body li.ql-align-right,
.policy-body div.ql-align-right {
    text-align: right !important;
}

.policy-body p.ql-align-justify,
.policy-body li.ql-align-justify,
.policy-body div.ql-align-justify {
    text-align: justify !important;
}

.policy-body p.ql-align-left,
.policy-body li.ql-align-left,
.policy-body div.ql-align-left {
    text-align: left !important;
}

/* ============================================
   QUILL INDENT - Restore on Public Page
   ============================================ */

.policy-body .ql-indent-1 {
    padding-left: 3em !important;
}

.policy-body .ql-indent-2 {
    padding-left: 6em !important;
}

.policy-body .ql-indent-3 {
    padding-left: 9em !important;
}

.policy-body .ql-indent-4 {
    padding-left: 12em !important;
}

.policy-body .ql-indent-5 {
    padding-left: 15em !important;
}

.policy-body .ql-indent-6 {
    padding-left: 18em !important;
}

.policy-body .ql-indent-7 {
    padding-left: 21em !important;
}

.policy-body .ql-indent-8 {
    padding-left: 24em !important;
}

/* List item indents */
.policy-body li.ql-indent-1 {
    padding-left: 4.5em !important;
}

.policy-body li.ql-indent-2 {
    padding-left: 7.5em !important;
}

.policy-body li.ql-indent-3 {
    padding-left: 10.5em !important;
}

.policy-body li.ql-indent-4 {
    padding-left: 13.5em !important;
}

.policy-body li.ql-indent-5 {
    padding-left: 16.5em !important;
}

.policy-body li.ql-indent-6 {
    padding-left: 19.5em !important;
}

.policy-body li.ql-indent-7 {
    padding-left: 22.5em !important;
}

.policy-body li.ql-indent-8 {
    padding-left: 25.5em !important;
}

/* ============================================
   SIDEBAR CARD SPACING FIX
   ============================================ */
.sidebar-card {
    padding: 1.5rem !important; /* Top and Bottom gap standard */
    display: flex;
    flex-direction: column;
}

.card-details {
    margin: 0 !important;
    padding: 0 !important;
    text-align: justify;
}

/* Remove margins from all children to have full control */
.card-details > * {
    margin-top: 0 !important;
    margin-bottom: 1rem;
}

/* Specifically target the last child to remove its bottom margin */
.card-details > *:last-child {
    margin-bottom: 0 !important;
}

/* Hide empty paragraphs or paragraphs with only a break which Quill sometimes adds */
.card-details p:empty,
.card-details p br:only-child {
    display: none;
}

/* For browsers that don't support :has yet, this covers some cases */
.card-details p:last-child {
    margin-bottom: 0 !important;
}

/* ============================================
   GLOBAL QUILL EMPTY PARAGRAPH COLLAPSE
   Removes the large blank gap boxes Quill
   inserts as empty <p><br></p> spacers.
   ============================================ */
.ql-editor p:empty,
.ql-editor p > br:only-child,
.policy-body p:empty,
.policy-body p > br:only-child {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    height: 0 !important;
}