@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&display=swap');

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

[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    color: #fff;
    background: #000;
}

/* ── Header ── */

header {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 3rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-brand .social-links {
    margin-top: 0;
}

.header-brand .social-icon {
    width: 40px;
    height: 40px;
}

.site-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.8rem;
    color: #fff;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 3rem;
}

nav a {
    font-family: 'Dancing Script', cursive;
    font-size: 2.1rem;
    color: #7ecece;
    text-decoration: none;
}

nav a:hover,
nav a.active {
    color: #fff;
}

nav a.nav-owner {
    color: #9b7aae;
}

nav a.nav-owner:hover {
    color: #c4a0d8;
}

/* ── Page banner ── */

.page-banner {
    background: #9b7aae;
    padding: 2.5rem 3rem;
    text-align: center;
}

.page-banner h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 2.8rem;
    font-weight: 400;
    color: #fff;
    margin: 0;
}

/* ── About page ── */

.about-main {
    max-width: 680px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.about-main h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    font-weight: 400;
    margin: 2rem 0 0.25rem;
}

.about-main h3:first-child {
    margin-top: 0;
}

.about-main p {
    margin: 0 0 0.75rem;
    line-height: 1.7;
}

.about-main a {
    color: inherit;
}

.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: #3a3a3a;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.2s;
}

.social-icon:hover {
    background: #555;
}

.social-icon img {
    filter: brightness(0) invert(1);
}

/* ── Owner pages ── */

.owner-main {
    max-width: 480px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: #ccc;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
    font-size: 1rem;
}

.form-group input[type="file"] {
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn {
    padding: 0.6rem 1.5rem;
    background: #9b7aae;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

.btn:hover {
    background: #b090c8;
}

.btn-secondary {
    background: #333;
}

.btn-secondary:hover {
    background: #444;
}

.manage-delete {
    background: none;
    border: none;
    color: #555;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
    flex-shrink: 0;
}

.manage-delete:hover {
    color: #c04040;
}

.form-error {
    color: #e07070;
    margin: 0 0 0.5rem;
}

.form-success {
    color: #70c070;
    margin: 0 0 0.5rem;
}

.upload-result {
    margin-bottom: 1.5rem;
}

/* ── Manage section ── */

.manage-section {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.manage-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #1a1a1a;
}

.manage-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.manage-visible {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #aaa;
    white-space: nowrap;
    flex-shrink: 0;
}

.manage-input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
    font-size: 0.9rem;
    min-width: 0;
}

/* ── Gallery ── */

.gallery {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    max-width: 1159px;
    margin: 0 auto;
}

.gallery-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-flow: dense;
    gap: 4px;
}

.gallery-item {
    aspect-ratio: 1;
    overflow: hidden;
    background: #111;
    position: relative;
}

.admin-btns {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;
    flex-direction: column;
    gap: 3px;
    z-index: 2;
}

.gallery-item:hover .admin-btns {
    display: flex;
}

.admin-btn {
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

.admin-btn-hide:hover {
    background: rgba(160, 30, 30, 0.85);
}

.admin-btn-move.selected {
    background: #9b7aae;
}

.admin-btn-insert {
    background: rgba(0, 100, 100, 0.7);
}

.admin-btn-insert:hover {
    background: rgba(0, 140, 140, 0.9);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

/* ── Lightbox ── */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-content {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    pointer-events: none;
}

.lightbox-content img {
    max-width: 65vw;
    max-height: 88vh;
    object-fit: contain;
}

.lightbox-info {
    width: 25vw;
    flex-shrink: 0;
    padding-top: 0.25rem;
    pointer-events: auto;
}

.lightbox-title {
    /*font-family: 'Dancing Script', cursive;*/
    font-size: 2.3rem;
    font-weight: 400;
    margin: 0 0 0.75rem;
}

.lightbox-description {
    font-size: 1.35rem;
    line-height: 1.7;
    color: #ccc;
    margin: 0;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.gallery-group .gallery-item:first-child {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.gallery-group .gallery-item:nth-child(10) {
    grid-column: 3 / 5;
    grid-row: 3 / 5;
}

@media (max-width: 1280px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.9rem 1.25rem;
        gap: 0.4rem;
    }

    nav {
        gap: 1.25rem;
    }

    nav a {
        font-size: 1.4rem;
    }

    .lightbox-content {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        max-height: 90vh;
        overflow-y: auto;
        text-align: center;
    }

    .lightbox-info {
        order: -1;
        width: 90vw;
        padding-top: 0;
    }

    .lightbox-content img {
        max-width: 90vw;
        max-height: 65vh;
    }

    .lightbox-title {
        font-size: 1.6rem;
    }

    .lightbox-description {
        font-size: 1.1rem;
    }
}
