:root {
    --primary-color: #1a472a;
    /* Deep Golf Green */
    --accent-color: #d4af37;
    /* Gold */
    --text-color: #333;
    --bg-color: #f9f9f9;
    --card-bg: #ffffff;
    --header-height: 70px;
}

* {
    box_sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Typography */
h1,
h2,
h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
header {
    background-color: var(--primary-color);
    color: white;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    text-decoration: none !important;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: white;
    font-weight: 500;
}

nav a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    min-height: calc(100vh - var(--header-height) - 100px);
}

footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* Components */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.mobile-menu-toggle {
    display: none;
}

.btn:hover {
    background-color: #143620;
    text-decoration: none;
}

.btn-accent {
    background-color: var(--accent-color);
    color: #000;
}

.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    background-color: #e0f2f1;
    border-left: 4px solid var(--primary-color);
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

textarea {
    min-height: 150px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.table th {
    background-color: #f1f1f1;
}

.pinned-badge {
    background-color: var(--accent-color);
    color: black;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Admin Dashboard */
.dashboard-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.admin-section {
    margin-bottom: 3rem;
}

/* Image Constraints */
.post-content img,
.card img,
.ql-editor img {
    max-width: 100%;
    max-height: 600px;
    /* Reasonable height ensuring it fits most screens */
    width: auto;
    height: auto;
    display: block;
    margin: 1rem auto;
    object-fit: contain;
    border-radius: 4px;
}

/* Tables */
.post-content table,
.card table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.post-content table td,
.post-content table th,
.card table td,
.card table th {
    border: 1px solid #ddd;
    padding: 8px;
}

.post-content table tr:nth-child(even),
.card table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.post-content table th,
.card table th {
    padding-top: 12px;
    padding-bottom: 12px;
    text-align: left;
    background-color: var(--primary-color);
    color: white;
}

/* Indent Support */
.ql-indent-1 {
    padding-left: 3em;
}

.ql-indent-2 {
    padding-left: 6em;
}

.ql-indent-3 {
    padding-left: 9em;
}

.ql-indent-4 {
    padding-left: 12em;
}

.ql-indent-5 {
    padding-left: 15em;
}

.ql-indent-6 {
    padding-left: 18em;
}

.ql-indent-7 {
    padding-left: 21em;
}

.ql-indent-8 {
    padding-left: 24em;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    :root {
        --header-height: auto;
    }

    /* Layout Adjustments */
    header {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .logo {
        font-size: 1.2rem;
        max-width: 80%;
    }


    /* Mobile Menu */
    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        margin-left: auto;
    }

    nav {
        width: 100%;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 1rem;
        background-color: #143620;
        /* Slightly darker green for menu */
        border-radius: 4px;
        overflow: hidden;
    }

    nav ul.show {
        display: flex;
    }

    nav li a {
        display: block;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav li:last-child a {
        border-bottom: none;
    }

    /* Content Adjustments */
    main {
        padding: 0 0.5rem;
        margin: 1rem auto;
    }

    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Typography */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Tables */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }

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

    /* Specific table adjustment for content */
    .post-content table,
    .card table {
        display: block;
        overflow-x: auto;
    }

    /* Indentation Reduction */
    .ql-indent-1 {
        padding-left: 1.5em;
    }

    .ql-indent-2 {
        padding-left: 3em;
    }

    .ql-indent-3 {
        padding-left: 4.5em;
    }

    .ql-indent-4 {
        padding-left: 6em;
    }

    .ql-indent-5 {
        padding-left: 7.5em;
    }

    .ql-indent-6 {
        padding-left: 9em;
    }

    .ql-indent-7 {
        padding-left: 10.5em;
    }

    .ql-indent-8 {
        padding-left: 12em;
    }
}