/* ==========================================================================
   Russhaupten Gästebuch – Glassmorphism Design
   Scoped under .rh-guestbook to avoid theme collisions.
   ========================================================================== */

/* ── Page background: injected inline by shortcode render ─── */

/* ── Variables ─────────────────────────────────────────────── */
.rh-guestbook {
    --rh-gb-glass-bg: rgba(255, 255, 255, 0.55);
    --rh-gb-glass-border: rgba(255, 255, 255, 0.35);
    --rh-gb-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
    --rh-gb-blur: 12px;
    --rh-gb-radius: 16px;
    --rh-gb-radius-sm: 10px;
    --rh-gb-text: #1a1a2e;
    --rh-gb-text-muted: #555;
    --rh-gb-accent: #0077b6;
    --rh-gb-accent-hover: #005f8a;
    --rh-gb-success: #2d6a4f;
    --rh-gb-success-bg: rgba(45, 106, 79, 0.12);
    --rh-gb-error: #9b2226;
    --rh-gb-error-bg: rgba(155, 34, 38, 0.10);
    --rh-gb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;

    font-family: var(--rh-gb-font);
    color: var(--rh-gb-text);
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

/* ── Dark mode ─────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .rh-guestbook {
        --rh-gb-glass-bg: rgba(30, 30, 50, 0.60);
        --rh-gb-glass-border: rgba(255, 255, 255, 0.12);
        --rh-gb-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.30);
        --rh-gb-text: #e0e0e0;
        --rh-gb-text-muted: #aaa;
        --rh-gb-accent: #48cae4;
        --rh-gb-accent-hover: #90e0ef;
        --rh-gb-success-bg: rgba(45, 106, 79, 0.25);
        --rh-gb-error-bg: rgba(155, 34, 38, 0.25);
    }
}

/* ── Notices ───────────────────────────────────────────────── */
.rh-gb-notice {
    padding: 14px 20px;
    border-radius: var(--rh-gb-radius-sm);
    margin-bottom: 24px;
    font-weight: 500;
    line-height: 1.5;
}

.rh-gb-notice--success {
    background: var(--rh-gb-success-bg);
    color: var(--rh-gb-success);
    border: 1px solid rgba(45, 106, 79, 0.25);
}

.rh-gb-notice--error {
    background: var(--rh-gb-error-bg);
    color: var(--rh-gb-error);
    border: 1px solid rgba(155, 34, 38, 0.20);
}

/* ── Glass card mixin (shared) ─────────────────────────────── */
.rh-gb-form-wrap,
.rh-gb-entry {
    background: var(--rh-gb-glass-bg);
    backdrop-filter: blur(var(--rh-gb-blur));
    -webkit-backdrop-filter: blur(var(--rh-gb-blur));
    border: 1px solid var(--rh-gb-glass-border);
    border-radius: var(--rh-gb-radius);
    box-shadow: var(--rh-gb-glass-shadow);
    padding: 28px;
    margin-bottom: 24px;
}

/* ── Form ──────────────────────────────────────────────────── */
.rh-gb-form-title,
.rh-gb-entries-title {
    margin: 0 0 20px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--rh-gb-text);
}

.rh-gb-field {
    margin-bottom: 18px;
}

.rh-gb-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--rh-gb-text);
}

.rh-gb-req {
    color: var(--rh-gb-error);
}

.rh-gb-field input[type="text"],
.rh-gb-field input[type="file"] {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--rh-gb-glass-border);
    border-radius: var(--rh-gb-radius-sm);
    background: rgba(255, 255, 255, 0.45);
    color: var(--rh-gb-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.rh-gb-field input[type="text"]:focus {
    outline: none;
    border-color: var(--rh-gb-accent);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.18);
}

.rh-gb-field input[type="file"] {
    padding: 8px;
    cursor: pointer;
}

/* TinyMCE wrapper – fit into glass design */
.rh-gb-field .wp-editor-wrap {
    border-radius: var(--rh-gb-radius-sm);
    overflow: hidden;
    border: 1px solid var(--rh-gb-glass-border);
}

.rh-gb-field .wp-editor-wrap .mce-toolbar-grp {
    background: rgba(255, 255, 255, 0.3) !important;
    border-bottom: 1px solid var(--rh-gb-glass-border) !important;
}

/* Checkbox field */
.rh-gb-field--checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    font-size: 0.88rem;
    line-height: 1.5;
    cursor: pointer;
}

.rh-gb-field--checkbox input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--rh-gb-accent);
}

/* Submit button */
.rh-gb-btn {
    display: inline-block;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--rh-gb-accent);
    border: none;
    border-radius: var(--rh-gb-radius-sm);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.rh-gb-btn:hover,
.rh-gb-btn:focus-visible {
    background: var(--rh-gb-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.rh-gb-btn:focus-visible {
    outline: 3px solid var(--rh-gb-accent);
    outline-offset: 2px;
}

.rh-gb-btn:active {
    transform: translateY(0);
}

/* ── Entries ───────────────────────────────────────────────── */
.rh-gb-entries-title {
    margin-top: 40px;
}

.rh-gb-empty {
    text-align: center;
    color: var(--rh-gb-text-muted);
    font-style: italic;
    padding: 40px 0;
}

.rh-gb-entry__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.rh-gb-entry__name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--rh-gb-text);
}

.rh-gb-entry__date {
    font-size: 0.82rem;
    color: var(--rh-gb-text-muted);
    white-space: nowrap;
}

.rh-gb-entry__content {
    line-height: 1.65;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.rh-gb-entry__content p:first-child {
    margin-top: 0;
}

.rh-gb-entry__content p:last-child {
    margin-bottom: 0;
}

.rh-gb-entry__content a {
    color: var(--rh-gb-accent);
    text-decoration: underline;
}

/* Entry image thumbnail */
.rh-gb-entry__image {
    margin-top: 14px;
}

.rh-gb-entry__image img {
    max-width: 220px;
    max-height: 180px;
    object-fit: cover;
    border-radius: var(--rh-gb-radius-sm);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--rh-gb-glass-border);
}

.rh-gb-entry__image img:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ── Lightbox ──────────────────────────────────────────────── */
.rh-gb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.80);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.rh-gb-lightbox--open {
    opacity: 1;
    visibility: visible;
}

.rh-gb-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 10px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    object-fit: contain;
}

.rh-gb-lightbox__close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.rh-gb-lightbox__close:hover,
.rh-gb-lightbox__close:focus-visible {
    background: rgba(255, 255, 255, 0.30);
}

/* ── Pagination ────────────────────────────────────────────── */
.rh-gb-pagination {
    text-align: center;
    margin-top: 32px;
    padding: 16px 0;
}

.rh-gb-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    color: var(--rh-gb-text);
    background: var(--rh-gb-glass-bg);
    border: 1px solid var(--rh-gb-glass-border);
    transition: background 0.2s, color 0.2s;
}

.rh-gb-pagination .page-numbers:hover {
    background: var(--rh-gb-accent);
    color: #fff;
}

.rh-gb-pagination .page-numbers.current {
    background: var(--rh-gb-accent);
    color: #fff;
    pointer-events: none;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
    .rh-gb-form-wrap,
    .rh-gb-entry {
        padding: 18px 16px;
        border-radius: 12px;
    }

    .rh-gb-entry__image img {
        max-width: 100%;
        max-height: 200px;
    }

    .rh-gb-btn {
        width: 100%;
        text-align: center;
    }
}
