/* /home-editor.css - @version 15.0.0 - Homepage editing tools (edit outlines, undo/redo, text and image
   pop-ups, the community photo gallery). Moved unchanged from the inline <style> in index.html. */
/* --- Events list --- */
.events-list {
    margin: .75rem auto 0;
    max-width: 980px
}

.event-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(0,0,0,.45);
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    padding: .6rem .8rem;
    margin: .4rem 0
}

    .event-row .date {
        font-weight: 700;
        white-space: nowrap;
        opacity: .95
    }

    .event-row .title a {
        color: #dbeafe;
        text-decoration: none
    }

        .event-row .title a:hover {
            text-decoration: underline
        }

    .event-row .at {
        opacity: .8
    }

.glass-box.hero-content {
    width: min(1100px,90vw);
    margin: 2rem auto 4rem
}

/* Editable content hover states */
.can-edit .editable-content {
    position: relative;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .can-edit .editable-content:hover {
        background: rgba(59, 130, 246, 0.08);
        outline: 2px solid rgba(59, 130, 246, 0.3);
        outline-offset: 2px;
    }

    .can-edit .editable-content::before {
        content: '✎ Edit';
        position: absolute;
        top: 8px;
        left: 8px;
        font-size: 0.75rem;
        color: #3b82f6;
        background: rgba(255, 255, 255, 0.95);
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        font-weight: 700;
        z-index: 10;
    }

    .can-edit .editable-content:hover::before {
        opacity: 1;
    }

/* Image editing hover states */
.can-edit .editable-image-block {
    position: relative;
    cursor: pointer;
}

    .can-edit .editable-image-block .image-preview {
        transition: all 0.2s ease;
    }

    .can-edit .editable-image-block:hover .image-preview {
        opacity: 0.7;
        outline: 2px solid rgba(59, 130, 246, 0.5);
        outline-offset: 4px;
    }

    .can-edit .editable-image-block::before {
        content: '📷 Change Image';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 1rem;
        color: #fff;
        background: rgba(59, 130, 246, 0.9);
        padding: 0.75rem 1.5rem;
        border-radius: 8px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        font-weight: 700;
        z-index: 10;
    }

    .can-edit .editable-image-block:hover::before {
        opacity: 1;
    }

.image-preview {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    background: rgba(0,0,0,.15)
}

.editable-image-block {
    position: relative;
    display: block;
}

/* Full-screen modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

    .modal-overlay.active {
        display: flex;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal container */
.modal-container {
    width: min(1200px, 95vw);
    max-height: 90vh;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.15s ease;
}

    .modal-close:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-1px);
    }

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Quill editor in modal */
.modal-quill-editor {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    min-height: 400px;
}

    .modal-quill-editor .ql-toolbar {
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px 12px 0 0;
        background: rgba(30, 41, 59, 0.8);
        padding: 1rem;
    }

    .modal-quill-editor .ql-container {
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-top: none;
        border-radius: 0 0 12px 12px;
        font-size: 1rem;
    }

    .modal-quill-editor .ql-editor {
        min-height: 350px;
        color: #fff !important;
        font-size: 1rem;
        line-height: 1.6;
    }

        .modal-quill-editor .ql-editor * {
            color: #fff !important;
        }

        .modal-quill-editor .ql-editor.ql-blank::before {
            color: rgba(255, 255, 255, 0.5) !important;
        }

        .modal-quill-editor .ql-editor p,
        .modal-quill-editor .ql-editor h1,
        .modal-quill-editor .ql-editor h2,
        .modal-quill-editor .ql-editor h3,
        .modal-quill-editor .ql-editor h4,
        .modal-quill-editor .ql-editor h5,
        .modal-quill-editor .ql-editor h6,
        .modal-quill-editor .ql-editor div,
        .modal-quill-editor .ql-editor span,
        .modal-quill-editor .ql-editor strong,
        .modal-quill-editor .ql-editor em,
        .modal-quill-editor .ql-editor ul,
        .modal-quill-editor .ql-editor ol,
        .modal-quill-editor .ql-editor li {
            color: #fff !important;
        }

    .modal-quill-editor .ql-toolbar button,
    .modal-quill-editor .ql-toolbar .ql-picker-label {
        color: #fff !important;
    }

    .modal-quill-editor .ql-toolbar .ql-stroke {
        stroke: #fff !important;
    }

    .modal-quill-editor .ql-toolbar .ql-fill {
        fill: #fff !important;
    }

/* Image upload modal */
.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.image-preview-large {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
}

.image-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.file-input-wrapper {
    position: relative;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.2);
    border: 2px dashed rgba(59, 130, 246, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #93c5fd;
    font-weight: 700;
}

    .file-input-label:hover {
        background: rgba(59, 130, 246, 0.3);
        border-color: rgba(59, 130, 246, 0.7);
    }

    .file-input-label input[type="file"] {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

.file-info {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.15s ease;
}

    .btn:hover {
        background: rgba(255, 255, 255, 0.12);
        transform: translateY(-1px);
    }

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
}

    .btn-primary:hover {
        background: #1d4ed8;
    }

.btn-success {
    background: #16a34a;
    border-color: #16a34a;
}

    .btn-success:hover {
        background: #15803d;
    }

.btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.22);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Preview modal */
.cms-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.cms-preview-modal {
    width: min(1100px,92vw);
    max-height: 88vh;
    overflow: auto;
    border-radius: 14px;
    background: rgba(8,14,25,.95);
    border: 1px solid rgba(255,255,255,.12);
    padding: 20px;
    color: #fff;
}

.cms-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cms-preview-close {
    border: 0;
    border-radius: 10px;
    padding: 0.4rem 0.8rem;
    background: #374151;
    color: #fff;
    cursor: pointer;
}

.page-preview-bar {
    position: sticky;
    top: 64px;
    z-index: 20;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin: 0.25rem 0 1rem;
}

/* Undo/redo buttons */
.content-version-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: none;
    gap: 0.35rem;
    z-index: 11;
    background: rgba(8, 14, 25, 0.7);
    backdrop-filter: blur(8px);
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.can-edit .editable-content:hover .content-version-controls,
.can-edit .editable-image-block:hover .content-version-controls {
    display: flex;
}

.has-modifications .content-version-controls {
    display: flex;
}

.version-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    color: #3b82f6;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    .version-btn:hover:not(:disabled) {
        background: #3b82f6;
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    }

    .version-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        border-color: rgba(156, 163, 175, 0.4);
        color: #9ca3af;
    }

        .version-btn:disabled:hover {
            background: rgba(255, 255, 255, 0.95);
            color: #9ca3af;
            transform: none;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

.loading-placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.lightbox-img {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,.6);
    display: block;
}

[hidden] {
    display: none !important;
}

/* Gallery styles */
.home-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
    gap: .9rem;
    justify-items: center
}

.gal-card {
    position: relative;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
    padding: .6rem;
    width: 100%;
    max-width: 520px;
    margin: 0 auto
}

.gal-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.12);
    border-radius: 10px;
    overflow: hidden
}

.gal-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    margin: auto;
    cursor: zoom-in
}

.gal-meta {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-top: .5rem
}

.gal-row {
    display: flex;
    gap: .5rem
}

    .gal-row input[type="text"] {
        flex: 1;
        min-width: 0;
        border-radius: 10px;
        border: 1px solid rgba(255,255,255,.22);
        background: rgba(255,255,255,.08);
        color: #fff;
        padding: .45rem .6rem;
        outline: none
    }

        .gal-row input[type="text"]:focus {
            border-color: #60a5fa;
            box-shadow: 0 0 0 3px rgba(96,165,250,.35)
        }

.gal-actions {
    display: flex;
    gap: .5rem;
    margin-top: .35rem
}

.gal-handle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    cursor: grab;
    user-select: none;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.22);
    padding: .2rem .45rem;
    border-radius: 8px;
    font-weight: 800
}

    .gal-handle:active {
        cursor: grabbing
    }

.home-gallery-toolbar {
    display: flex;
    gap: .5rem;
    align-items: center;
    margin: .5rem 0 0
}

.file-trigger {
    position: relative;
    overflow: hidden
}

    .file-trigger input[type=file] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer
    }

.file-hint {
    font-size: .85rem;
    opacity: .7
}

.editor-border {
    outline: 2px dashed #2ecc71;
    border-radius: 8px;
    padding: .35rem
}

@media (max-width: 768px) {
    .modal-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-quill-editor .ql-editor {
        min-height: 250px;
    }
}

/* Print styles - hide all editor UI */
@media print {
    .editor-border,
    .editable-content,
    .editable-image-block,
    .editable-gallery-block {
        outline: none !important;
        border: none !important;
        padding: 0 !important;
    }

    .content-version-controls,
    .version-btn,
    .page-preview-bar,
    .home-gallery-toolbar,
    .gal-actions,
    .gal-handle,
    .gal-row,
    .modal-overlay,
    .cms-preview-overlay,
    #gal-add,
    .file-hint,
    .btn,
    .file-trigger {
        display: none !important;
        visibility: hidden !important;
    }

    .can-edit .editable-content::before,
    .can-edit .editable-image-block::before,
    .editable-content::before,
    .editable-image-block::before {
        display: none !important;
        content: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .can-edit .editable-content,
    .can-edit .editable-image-block,
    .can-edit .editable-gallery-block,
    .can-edit .editable-content:hover,
    .can-edit .editable-image-block:hover,
    .can-edit .editable-image-block:hover .image-preview {
        background: transparent !important;
        outline: none !important;
        opacity: 1 !important;
        cursor: default !important;
    }

    .image-preview,
    .gal-img {
        opacity: 1 !important;
        outline: none !important;
    }

    .gal-card {
        border: 1px solid #ccc !important;
        background: #fff !important;
    }

    .gal-meta p {
        display: block !important;
        color: #000 !important;
    }
}
