*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 13pt;
    background: linear-gradient(180deg, #faf6ee, #f0e8d0);
    min-height: 100vh;
    color: #2a2a2a;
}

#header {
    background: linear-gradient(180deg, #1a7a3a, #2e9e50, #3aad5c);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.header-brand { text-align: left; }
.header-logo {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
}
.header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.15);
    padding: 5px 12px;
    margin: 10px -12px -8px;
    font-size: 11pt;
}
.header-nav a { color: #f0e8d0; text-decoration: none; }
.header-nav a:hover { text-decoration: underline; color: #ffd740; }
.nav-links { display: flex; gap: 14px; }
.nav-account { display: flex; gap: 10px; }
.nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(0,0,0,0.18);
    color: #f0e8d0;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10pt;
    cursor: pointer;
}
.nav-toggle-icon {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-top: 2px solid #f0e8d0;
    border-bottom: 2px solid #f0e8d0;
    position: relative;
}
.nav-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 2px;
    border-top: 2px solid #f0e8d0;
}

.page-wrapper { display: flex; gap: 20px; padding: 10px 8px; }
.main-content { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }
@media (max-width: 900px) { .sidebar { display: none; } }

@media (max-width: 900px) {
    .header-logo { max-width: 100%; }
    .nav-toggle { display: inline-flex; }
    .header-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin: 8px -12px -8px;
        padding: 8px 12px;
    }
    #header.nav-open .header-nav { display: flex; }
    .nav-links,
    .nav-account {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .nav-search { display: flex; width: 100%; }
    .nav-search input { width: 100%; }
}

.post-list { list-style: none; }
.top-stories-art {
    margin: 10px 0 12px;
    border: 1px solid #ddd4c4;
    background: #efe7d2;
    overflow: hidden;
}
.top-stories-art img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 430px;
    object-fit: contain;
}

@media (max-width: 900px) {
    .top-stories-art img {
        max-height: 66vh;
    }
}

.post-item {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    gap: 4px;
}
.post-rank {
    color: #8a7a6a;
    min-width: 28px;
    text-align: right;
    font-size: 10pt;
    padding-top: 2px;
}
.vote-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 8px;
    line-height: 1;
    min-width: 16px;
    padding-top: 1px;
}
.vote-btn {
    cursor: pointer;
    color: #8a7a6a;
    background: none;
    border: none;
    font-size: 10px;
    padding: 0;
    line-height: 1;
}
.vote-btn:hover { color: #d4a830; }
.vote-btn.active { color: #d4a830; }
.post-content { flex: 1; }
.post-title { font-size: 12pt; }
.post-title a { color: #1a6b6e; text-decoration: none; }
.post-title a:visited { color: #8a7a6a; }
.post-link { color: #2a2a2a; font-size: 9pt; }
.post-link:visited { color: #2a2a2a; }
.post-title a:hover { text-decoration: underline; }
.post-meta { font-size: 9pt; color: #8a7a6a; margin-top: 2px; }
.post-meta a { color: #8a7a6a; text-decoration: none; }
.post-meta a:hover { text-decoration: underline; color: #1a6b6e; }
.post-location { color: #1a7a3a; }

.form-group select {
    padding: 4px 6px;
    border: 1px solid #ccc4b4;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10pt;
    max-width: 400px;
    width: 100%;
}

.post-detail { margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #ddd4c4; }
.post-detail .post-title { font-size: 15pt; margin-bottom: 4px; color: #2a2a2a; }
.post-detail .post-url { font-size: 10pt; margin-top: 2px; }
.post-detail .post-url a { color: #1a6b6e; }
.post-detail .post-body { margin: 10px 0; line-height: 1.5; }
.post-detail .post-body img { max-width: 100%; display: block; margin: 10px auto; }

.comment-section { margin-top: 15px; }
.comment {
    border-left: 2px solid #ddd4c4;
    padding: 6px 0 6px 10px;
    margin: 8px 0;
}
.comment-meta { font-size: 9pt; color: #8a7a6a; margin-bottom: 4px; }
.comment-meta a { color: #8a7a6a; text-decoration: none; }
.comment-meta a:hover { text-decoration: underline; color: #1a6b6e; }
.comment-body { font-size: 12pt; line-height: 1.4; }
.comment-body img { max-width: 100%; display: block; margin: 10px auto; }

.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 10pt; margin-bottom: 3px; color: #8a7a6a; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    max-width: 400px;
    padding: 4px 6px;
    border: 1px solid #ccc4b4;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10pt;
}
textarea {
    width: 100%;
    max-width: 600px;
    padding: 4px 6px;
    border: 1px solid #ccc4b4;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10pt;
    min-height: 100px;
}
.btn {
    padding: 4px 12px;
    background: #f0e8d0;
    border: 1px solid #ccc4b4;
    cursor: pointer;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10pt;
    margin-top: 5px;
    color: #2a2a2a;
}
.btn:hover { background: #e0d8c0; }

/* Nav search */
.nav-search { display: inline-flex; }
.nav-search input {
    padding: 2px 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: #f0e8d0;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10pt;
    width: 140px;
    outline: none;
}
.nav-search input::placeholder { color: rgba(240,232,208,0.6); }
.nav-search input:focus { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); }

/* Search page */
.search-form { margin-bottom: 15px; display: flex; gap: 6px; }
.search-input {
    flex: 1;
    max-width: 400px;
    padding: 4px 6px;
    border: 1px solid #ccc4b4;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10pt;
}

.browse-location-title {
    margin: 4px 0 10px;
    color: #1a6b6e;
    font-size: 12pt;
}
.location-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
}
.location-table th,
.location-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #ddd4c4;
    text-align: left;
}
.location-table th {
    background: #f0e8d0;
    color: #8a7a6a;
    font-size: 9pt;
}
.location-story-count {
    text-align: right;
    white-space: nowrap;
}

.flash { padding: 6px 10px; margin-bottom: 10px; font-size: 10pt; border: 1px solid; }
.flash-error { background: #fde0e0; border-color: #d06070; color: #c04050; }
.flash-success { background: #e0f0e0; border-color: #4a9b4a; color: #3a7a3a; }

.profile-header { margin-bottom: 15px; }
.profile-header h2 { font-size: 13pt; color: #1a6b6e; }
.profile-header .join-date { font-size: 9pt; color: #8a7a6a; }
.tab-nav { margin-bottom: 10px; font-size: 10pt; }
.tab-nav a { color: #8a7a6a; text-decoration: none; margin-right: 10px; }
.tab-nav a:hover { text-decoration: underline; color: #1a6b6e; }
.tab-nav a.active { color: #1a6b6e; font-weight: bold; }

.ql-toolbar.ql-snow { border-color: #ccc4b4 !important; background: #fff; }
.ql-container.ql-snow { border-color: #ccc4b4 !important; min-height: 120px; font-family: Verdana, Geneva, sans-serif; font-size: 10pt; }

.pagination { margin: 15px 0; font-size: 10pt; }
.pagination a { color: #1a6b6e; text-decoration: none; }
.pagination a:hover { text-decoration: underline; }

.error-msg { color: #c04050; font-size: 10pt; margin-bottom: 10px; }

a { color: #1a6b6e; }
hr { border: none; border-top: 1px solid #ddd4c4; margin: 10px 0; }
.empty-state { color: #8a7a6a; font-size: 10pt; font-style: italic; }
.meta { font-size: 9pt; color: #8a7a6a; }

h3 { font-size: 14pt; margin-bottom: 10px; color: #1a6b6e; }

/* Ad slots */
.ad-slot { margin-bottom: 15px; }
.ad-placeholder {
    background: #f0e8d0;
    border: 2px dashed #ccc4b4;
    color: #8a7a6a;
    text-align: center;
    padding: 40px 10px;
    font-size: 11pt;
}
.ad-slot-banner .ad-placeholder { height: 90px; padding: 0 10px; display: flex; align-items: center; justify-content: center; }
.sidebar .ad-placeholder { min-height: 250px; display: flex; align-items: center; justify-content: center; }

/* Admin */
.admin-stats { font-size: 11pt; border-collapse: collapse; }
.admin-stats td { padding: 4px 15px 4px 0; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 10pt; }
.admin-table th, .admin-table td { padding: 5px 8px; border-bottom: 1px solid #ddd4c4; text-align: left; }
.admin-table th { background: #f0e8d0; font-size: 9pt; color: #8a7a6a; }
.row-blocked { background: #fde0e0; }
.status-blocked { color: #c04050; font-weight: bold; font-size: 9pt; }
.status-active { color: #3a7a3a; font-size: 9pt; }
.admin-image-preview {
    width: 96px;
    height: 54px;
    object-fit: cover;
    border: 1px solid #ccc4b4;
    background: #fff;
}
.btn-small { font-size: 9pt; padding: 2px 8px; }
.btn-danger { color: #c04050; border-color: #c04050; }
.btn-danger:hover { background: #fde0e0; }

/* Static pages */
.static-page h2 { font-size: 15pt; margin-bottom: 10px; color: #1a6b6e; }
.static-page-body { line-height: 1.5; }
.static-page-body img { max-width: 100%; display: block; margin: 10px auto; }

/* Post thumbnail */
.post-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 1px solid #ddd4c4;
    flex-shrink: 0;
}
