/* === RESET & BASIS === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:   #1a4a8a;
    --primary-d: #0f2e5a;
    --gold:      #c8a822;
    --gold-d:    #a08015;
    --bg:        #f5f5f0;
    --white:     #ffffff;
    --text:      #1a1a1a;
    --text-m:    #444444;
    --border:    #cccccc;
    --shadow:    0 2px 8px rgba(0,0,0,0.12);
    --radius:    6px;
}

html { font-size: 18px; scroll-behavior: smooth; }

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: underline; }
a:hover { color: var(--gold-d); }

img { max-width: 100%; height: auto; display: block; }

/* === HEADER === */
.site-header {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header-logo img {
    width: auto;
    height: 80px;
    border-radius: 10%;
    border: 2px solid var(--gold);
}

.header-title h1 {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--white);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    line-height: 1.3;
}

/* === NAVIGATION === */
.main-nav {
    background: var(--primary-d);
    border-top: 3px solid var(--gold);
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-nav li a {
    display: block;
    padding: 0.75rem 1.2rem;
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0.02em;
    transition: background 0.2s, color 0.2s;
}

.main-nav li a:hover,
.main-nav li.active a {
    background: var(--gold);
    color: var(--primary-d);
}

/* === MAIN CONTENT === */
.site-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* === FLASH MESSAGES === */
.flash {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    font-weight: bold;
    font-size: 1rem;
}
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.flash-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* === PAGE TITLE === */
.page-title {
    font-size: 1.8rem;
    color: var(--primary);
    border-bottom: 3px solid var(--gold);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

/* === POST CARDS === */
.post-list { display: flex; flex-direction: column; gap: 2rem; }

.post-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.post-card-header {
    padding: 1rem 1.5rem 0.5rem;
    border-bottom: 2px solid var(--gold);
}

.post-card-title {
    font-size: 1.35rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.post-card-date {
    font-size: 0.9rem;
    color: var(--text-m);
    font-family: Arial, sans-serif;
}

.post-card-body {
    padding: 1.2rem 1.5rem;
    line-height: 1.8;
}

.post-card-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 0.5rem 0;
}

.post-card-attachments {
    padding: 0.75rem 1.5rem 1rem;
    border-top: 1px solid var(--border);
    background: #fafafa;
}

.post-card-attachments h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-m);
    font-family: Arial, sans-serif;
}

.attachment-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.attachment-list li a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.9rem;
    font-family: Arial, sans-serif;
}

.attachment-list li a:hover { background: var(--primary-d); color: var(--white); }

.post-thumb-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem 1rem;
    border-top: 1px solid var(--border);
}

.post-thumb-grid a img {
    width: 150px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    transition: transform 0.2s;
}
.post-thumb-grid a:hover img { transform: scale(1.05); border-color: var(--gold); }

/* === PAGINATION === */
.pagination { margin-top: 2rem; text-align: center; }
.pagination ul { list-style: none; display: inline-flex; gap: 0.5rem; }
.pagination li a {
    display: block;
    padding: 0.6rem 1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    text-decoration: none;
    font-family: Arial, sans-serif;
    min-width: 44px;
    text-align: center;
}
.pagination li.active a,
.pagination li a:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* === GUESTBOOK === */
.guestbook-form {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.guestbook-form h2 { font-size: 1.35rem; color: var(--primary); margin-bottom: 1rem; }

.form-group { margin-bottom: 1.2rem; }
.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.4rem;
    font-size: 1rem;
    font-family: Arial, sans-serif;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 1.05rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    background: var(--white);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.btn {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    font-size: 1.05rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-weight: bold;
    transition: background 0.2s;
}
.btn-primary   { background: var(--primary);  color: var(--white); }
.btn-primary:hover { background: var(--primary-d); color: var(--white); }
.btn-gold      { background: var(--gold);    color: var(--primary-d); }
.btn-gold:hover    { background: var(--gold-d); color: var(--primary-d); }
.btn-danger    { background: #c0392b; color: var(--white); }
.btn-danger:hover  { background: #962d22; color: var(--white); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.9rem; }

.guestbook-entries { display: flex; flex-direction: column; gap: 1.5rem; }

.guestbook-entry {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    box-shadow: var(--shadow);
}

.guestbook-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.guestbook-entry-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary);
}

.guestbook-entry-date {
    font-size: 0.9rem;
    color: var(--text-m);
    font-family: Arial, sans-serif;
}

.guestbook-entry-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.8;
}

/* === BILDERGALERIE === */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.gallery-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.gallery-card:hover { transform: translateY(-4px); }

.gallery-card-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gallery-card-cover-placeholder {
    width: 100%;
    height: 200px;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #aaa;
}

.gallery-card-body { padding: 1rem; }

.gallery-card-title {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.gallery-card-desc {
    font-size: 0.95rem;
    color: var(--text-m);
    margin-bottom: 0.75rem;
}

.gallery-card-count {
    font-size: 0.9rem;
    color: var(--text-m);
    font-family: Arial, sans-serif;
}

/* Gallery detail */
.gallery-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
}

.gallery-image-item { text-align: center; }

.gallery-image-item a img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    transition: border-color 0.2s, transform 0.2s;
}

.gallery-image-item a:hover img {
    border-color: var(--gold);
    transform: scale(1.03);
}

.gallery-image-subtext {
    font-size: 0.9rem;
    color: var(--text-m);
    margin-top: 0.4rem;
    font-style: italic;
    font-family: Arial, sans-serif;
}

/* === FOOTER === */
.site-footer {
    background: var(--primary-d);
    color: #ccc;
    text-align: center;
    padding: 1.2rem;
    margin-top: auto;
    font-size: 0.9rem;
    font-family: Arial, sans-serif;
}

.site-footer a { color: var(--gold); text-decoration: none; }
.site-footer a:hover { color: var(--white); }

/* === IMPRESSUM === */
.impressum-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    line-height: 1.9;
}

.impressum-content h2 {
    color: var(--primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

/* === UTILITY === */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-m); font-size: 0.9rem; font-family: Arial, sans-serif; }
.text-center { text-align: center; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    html { font-size: 17px; }
    .header-inner { flex-direction: column; text-align: center; padding: 1rem; }
    .header-title h1 { font-size: 1.3rem; }
    .header-logo img { width: 70px; }
    .main-nav ul { justify-content: center; }
    .main-nav li a { padding: 0.6rem 0.8rem; font-size: 0.9rem; }
    .site-main { padding: 1rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 480px) {
    .main-nav li a { padding: 0.5rem 0.6rem; font-size: 0.85rem; }
    .gallery-images { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* === ADMIN STYLES === */
.admin-body { font-family: Arial, sans-serif; font-size: 16px; }

.admin-header {
    background: var(--primary-d);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 { font-size: 1.2rem; }
.admin-header a { color: var(--gold); text-decoration: none; font-size: 0.95rem; }
.admin-header a:hover { color: var(--white); }

.admin-nav {
    background: var(--primary);
    padding: 0 1.5rem;
}

.admin-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.admin-nav li a {
    display: block;
    padding: 0.65rem 1rem;
    color: var(--white);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
}

.admin-nav li.active a,
.admin-nav li a:hover {
    border-bottom-color: var(--gold);
    color: var(--gold);
}

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.admin-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.admin-card h2 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 0.5rem;
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.admin-table th, .admin-table td {
    padding: 0.65rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table th { background: #f0f0f0; font-weight: bold; }
.admin-table tr:hover td { background: #fafafa; }

.admin-table .actions { white-space: nowrap; }
.admin-table .actions a,
.admin-table .actions button { margin-right: 0.4rem; }

.form-row { margin-bottom: 1.2rem; }
.form-row label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="email"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    font-family: inherit;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-hint { font-size: 0.85rem; color: var(--text-m); margin-top: 0.3rem; }

/* TinyMCE inside admin */
.tox-tinymce { border-radius: var(--radius) !important; }

.admin-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.upload-item {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: center;
    background: #fafafa;
}

.upload-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.upload-item-name {
    font-size: 0.8rem;
    padding: 0.3rem;
    word-break: break-all;
    color: var(--text-m);
}

.upload-item-actions {
    padding: 0.4rem;
    display: flex;
    gap: 0.3rem;
    justify-content: center;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: bold;
}
.badge-info    { background: #d1ecf1; color: #0c5460; }
.badge-success { background: #d4edda; color: #155724; }
