/* ?? Light Theme (Default) */
:root {
    --bg: #f8f8f8;
    --card: #ffffff;
    --text: #1a1a1a;
    --muted: #555555;
    --accent: #b68d40;
    --link: #0056cc;
}

/* ?? Dark Theme */
body.dark {
    --bg: #0b0b0b;
    --card: #141414;
    --text: #f6f6f6;
    --muted: #b6b6b6;
    --accent: #d3b36c;
    --link: #a9d2ff;
}

* { box-sizing: border-box }

body {
    margin: 0;
    font-family: Montserrat, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
}

.container { max-width: 1100px; margin: 0 auto; padding: 16px }

/* Header */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
}

.logo {
    max-width: 380px;
    width: 100%;
}
body.dark .logo {
    content: url('../../assets/images/Traboulsi-Palace-Dark.png');
}

body:not(.dark) .logo {
    content: url('../../assets/images/Traboulsi-Palace-Light.png');
}

nav ul, nav {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

nav a {
    display: inline-block;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text);
    background: var(--card);
    border: 1px solid #222;
    border-radius: 8px;
    font-weight: 600;
    transition: border-color 0.3s, color 0.3s;
}

nav a.active, nav a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Typography */
h1, h2, h3 {
    font-family: "Playfair Display", serif;
    margin: 18px 0 12px;
}

/* Main content */
main {
    background: var(--card);
    border: 1px solid #222;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    transition: background 0.3s;
}

/* Gallery Section */
.gallery-section {
    margin: 20px 0;
}

.gallery-section .featured-image {
    width: 100%;
    border-radius: 14px;
    margin-bottom: 24px;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.gallery-section .featured-image:hover {
    transform: scale(1.01);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

/* Gallery Item */
.gallery-item {
    background: var(--card);
    border: 1px solid var(--muted);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    border-color: var(--accent);
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* Gallery Caption */
.gallery-caption {
    padding: 12px;
    text-align: center;
}

.gallery-caption strong {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    font-size: 14px;
}

.gallery-caption .gallery-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

.modal-caption {
    padding: 16px;
    text-align: center;
}

.modal-caption h3 {
    color: var(--accent);
    margin: 0 0 8px 0;
    font-size: 18px;
}

.modal-caption p {
    color: var(--text);
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    background: rgba(0,0,0,0.5);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .gallery-item img {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .gallery-item img {
        height: 120px;
    }

    .gallery-caption {
        padding: 8px;
    }

    .gallery-caption strong {
        font-size: 12px;
    }

    .gallery-caption .gallery-desc {
        font-size: 11px;
    }
}



/* Videos */
.video-grid {
    display: grid;
    gap: 8px;
}

.video-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 10px;
}

.video-left { display: flex; flex-direction: column; gap: 6px }
.video-date { font-weight: 700; color: var(--accent) }
.video-desc { font-size: 12px; color: var(--muted) }
.hashtag {
    background: #1e1e1e;
    border: 1px solid #333;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.video-link {
    color: var(--link);
    text-decoration: none;
    font-weight: 700;
}

/* Comments */
.comment-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

input[type="text"], textarea {
    width: 100%;
    padding: 10px;
    background: #0f0f0f;
    border: 1px solid #222;
    color: var(--text);
    border-radius: 10px;
}

button, .btn {
    padding: 10px 14px;
    border-radius: 10px;
    background: #1b1b1b;
    border: 1px solid #333;
    color: var(--text);
    cursor: pointer;
}

button:hover, .btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.list-comments .comment {
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 10px;
    margin: 8px 0;
}

.comment strong { color: var(--accent) }
.comment .time { color: var(--muted); font-size: 12px; margin-left: 6px }

/* Footer */
footer { color: var(--muted); text-align: center; margin: 18px 0 8px }
.small { font-size: 12px; color: var(--muted) }
.admin-note { margin-top: 14px; font-size: 12px; color: var(--muted) }

 .theme-toggle {
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
}

.theme-toggle:hover {
    color: var(--accent);
}

input[type="text"], textarea {
    width: 100%;
    padding: 10px;
    background: #f6f6f6;  /* light background */
    border: 1px solid #ccc; /* light border */
    color: #111;            /* dark text */
    border-radius: 10px;
}

/* Dark mode */
body.dark input[type="text"],
body.dark textarea {
    background: #0f0f0f;   /* dark background */
    border: 1px solid #222; /* dark border */
    color: var(--text);      /* your dark mode text color */
}

/* Light mode (default) */
.list-comments .comment {
    background: #f6f6f6;   /* light background */
    border: 1px solid #ccc; /* light border */
    border-radius: 12px;
    padding: 10px;
    margin: 8px 0;
    color: #111;            /* dark text for light background */
}

/* Dark mode */
body.dark .list-comments .comment {
    background: #111;       /* dark background */
    border: 1px solid #222; /* dark border */
    color: var(--text);      /* your dark mode text color */
}
/* Light mode (default) */
button, .btn {
    padding: 10px 14px;
    border-radius: 10px;
    background: #f0f0f0;   /* light background */
    border: 1px solid #ccc; /* light border */
    color: #111;            /* dark text */
    cursor: pointer;
}

/* Dark mode */
body.dark button,
body.dark .btn {
    background: #1b1b1b;   /* dark background */
    border: 1px solid #333; /* dark border */
    color: var(--text);      /* your dark mode text color */
}
/* Light mode (default) */
.gallery-item {
    background: #f6f6f6;    /* light background */
    border: 1px solid #ccc;  /* light border */
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .15s ease;
    color: #111;             /* text color if any inside */
}

/* Dark mode */
body.dark .gallery-item {
    background: #111;       /* dark background */
    border: 1px solid #222; /* dark border */
    color: var(--text);      /* text color for dark mode */
}
/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 items per row */
    gap: 12px; /* spacing between thumbnails */
}

/* Gallery Item */
.gallery-item {
    width: 100%;
    aspect-ratio: 1 / 1; /* square thumbnails */
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Hover effect */
.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Image styling */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* crop and fill */
    display: block;
}

/* Caption below image */
.gallery-caption {
    font-size: 12px;
    color: var(--muted, #aaa);
    text-align: center;
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 per row on tablets */
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr; /* 1 per row on mobile */
    }
}
