:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --text: #1f2937;
    --muted: #4b5563;
    --primary: #1e40af;
    --primary-soft: #dbeafe;
    --border: #e5e7eb;
    --radius: 14px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Poppins", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

img {
    display: block;
    width: 100%;
}

a {
    color: inherit;
}

.container {
    width: min(1140px, 92%);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.nav-wrap {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 2px;
    margin: 4px 0;
    background: var(--primary);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.main-nav a {
    text-decoration: none;
    color: var(--muted);
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 500;
    transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.hero {
    position: relative;
    min-height: 62vh;
    display: flex;
    align-items: center;
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, rgba(15, 23, 42, 0.75), rgba(30, 64, 175, 0.55)), url("/uploads/image1.jpg") center/cover no-repeat;
    z-index: -2;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(243, 246, 251, 0.5), transparent 55%);
    z-index: -1;
}

.hero-content {
    color: #f8fafc;
    max-width: 760px;
    padding: 56px 0;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 8px;
}

.hero h1 {
    font-size: clamp(2rem, 4.4vw, 3.2rem);
    line-height: 1.15;
    margin-bottom: 16px;
}

.lead {
    font-size: clamp(1rem, 2.2vw, 1.17rem);
    max-width: 680px;
    opacity: 0.95;
}

.btn {
    margin-top: 24px;
    display: inline-block;
    background: #fff;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 11px 18px;
    border-radius: 10px;
    transition: 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.section {
    padding: 74px 0;
}

.section-alt {
    background: #eef2f8;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

h2 {
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    margin-bottom: 16px;
}

.section p {
    max-width: 840px;
    color: var(--muted);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
}

.text-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
}

.card-grid {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.card-grid-news {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card img {
    height: 400px;
    object-fit: cover;
}

.card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card h3 {
    margin-bottom: 8px;
    font-size: 1.18rem;
}

.card-title-link {
    color: var(--text);
    text-decoration: none;
}

.card-title-link:hover {
    color: var(--primary);
}

.card p {
    color: var(--muted);
    margin-bottom: 12px;
}

.card-body p:last-child {
    margin-top: auto;
    margin-bottom: 0;
}

.date {
    display: inline-block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
}

.member-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.member-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.member-card h3 {
    margin-bottom: 6px;
    color: var(--primary);
}

.member-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.gallery-grid img {
    border-radius: 12px;
    border: 1px solid var(--border);
    height: 210px;
    object-fit: cover;
    transition: 0.2s ease;
}

.gallery-grid img:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.12);
}

.site-footer {
    background: #0f172a;
    color: #e5e7eb;
    padding: 54px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 24px;
}

.site-footer h2 {
    font-size: 1.18rem;
    color: #fff;
    margin-bottom: 10px;
}

.site-footer p {
    color: #d1d5db;
    margin-bottom: 8px;
}

.site-footer a {
    color: #93c5fd;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.admin-page {
    background: var(--bg);
}

.admin-layout {
    display: grid;
    place-items: center;
}

.admin-card {
    width: min(760px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 34px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-logout {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--primary-soft);
    border: 1px solid rgba(30,64,175,0.12);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.admin-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30,64,175,0.12);
    filter: saturate(1.05);
}

.admin-logout:active {
    transform: translateY(0);
}

.admin-logout:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.18);
}

.admin-form {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.admin-field {
    display: grid;
    gap: 10px;
}

.admin-label {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
}

.admin-hint {
    margin-top: -4px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #64748b;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.admin-form input,
.admin-form textarea,
.admin-form button {
    width: 100%;
    font: inherit;
}

.admin-form input,
.admin-form textarea {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid #bcc9da;
    border-radius: 14px;
    padding: 16px 17px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: var(--text);
    font-size: 1.08rem;
    line-height: 1.6;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.admin-form input::placeholder,
.admin-form textarea::placeholder {
    color: #7f95af;
}

.admin-form textarea {
    min-height: 200px;
    resize: vertical;
}

.admin-form input[type="file"] {
    padding: 12px;
    background: #f3f8ff;
}

.admin-form input[type="file"]::file-selector-button {
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    margin-right: 12px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    cursor: pointer;
}

.admin-form input[type="file"]::file-selector-button:hover {
    background: #1d3c9f;
}

.admin-form input:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: #3f82f0;
    box-shadow: 0 0 0 5px rgba(79, 141, 245, 0.24), 0 8px 18px rgba(30, 64, 175, 0.12);
    background: #f2f7ff;
}

.admin-form button {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    border-radius: 14px;
    padding: 16px 18px;
    font-weight: 700;
    font-size: 1.08rem;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(180deg, #1f52c4 0%, #1e40af 100%);
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(30, 64, 175, 0.26);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.admin-form button:hover {
    background: linear-gradient(180deg, #1e4bb4 0%, #1d3c9f 100%);
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(30, 64, 175, 0.3);
    filter: saturate(1.05);
}

.admin-form button:active {
    transform: translateY(0);
    box-shadow: 0 7px 14px rgba(30, 64, 175, 0.22);
}

.admin-form button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25);
}

.admin-message {
    margin-top: 8px;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 500;
}

.admin-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.admin-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.admin-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.event-detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: clip;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.event-detail-top {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--border);
}

.event-detail-image {
    width: 100%;
    height: 100%;
    min-height: 320px;
    max-height: 460px;
    object-fit: cover;
}

.event-detail-meta {
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-detail-title {
    margin-top: 8px;
    margin-bottom: 10px;
    font-size: clamp(1.8rem, 3vw, 2.3rem);
    line-height: 1.2;
}

.event-detail-body {
    padding: 26px;
}

.event-detail-summary {
    font-size: 1.08rem;
    font-weight: 500;
    color: var(--text);
}

.event-detail-description {
    margin-top: 10px;
    color: var(--muted);
    line-height: 1.75;
}

.event-detail-actions {
    margin-top: 18px;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.manage-events-card {
    width: 100%;
}

.manage-events-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.manage-events-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
}

.manage-events-table th,
.manage-events-table td {
    border: 1px solid var(--border);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.manage-events-table th:nth-child(3),
.manage-events-table td:nth-child(3) {
    min-width: 340px;
}

.manage-events-table th:nth-child(6),
.manage-events-table td:nth-child(6) {
    min-width: 170px;
    max-width: 220px;
    overflow-wrap: anywhere;
}

.manage-events-table th {
    background: #e0ecff;
    color: #12367d;
}

.manage-actions,
.manage-edit-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.manage-btn {
    display: inline-block;
    border-radius: 10px;
    padding: 8px 12px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.manage-btn-save {
    color: #fff;
    background: #1e40af;
}

.manage-btn-cancel {
    color: #1e40af;
    background: #e2e8f0;
}

.manage-btn-edit {
    color: #fff;
    background: #1d4ed8;
}

.manage-btn-delete {
    color: #fff;
    background: #dc2626;
}

.admin-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    gap: 10px;  
}   

.admin-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.admin-gallery-thumb {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    padding: 0;
    cursor: zoom-in;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.admin-gallery-thumb img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.admin-gallery-name {
    display: block;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    word-break: break-word;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 700;
    display: none;
}

.gallery-lightbox.is-open {
    display: block;
}

.gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
}

.gallery-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    padding: 16px;
}

.gallery-lightbox-image {
    width: 100%;
    height: calc(100vh - 32px);
    object-fit: contain;
    background: #0f172a;
    border-radius: 14px;
}

.gallery-lightbox-path {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 2;
    max-width: calc(100vw - 110px);
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    word-break: break-all;
}

.gallery-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.95);
    color: #0f172a;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.gallery-lightbox-close:hover {
    background: #fff;
}

/* Modal styles for confirm-delete */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
/* Support jQuery .show() which sets inline display:block */
.modal[style*="display: block"] {
    display: flex !important;
}
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}
.modal-content {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 96px);
    overflow: auto;
    background: #fff;
    padding: 22px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
    margin: 0 12px;
}
.modal-content h3 {
    margin-bottom: 6px;
    font-size: 1.15rem;
}
.modal-content .admin-hint {
    margin-bottom: 12px;
    color: var(--muted);
}
.modal-content input[type="text"] {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    width: 100%;
    box-sizing: border-box;
}
.modal-content p strong { font-weight: 700; }
.modal-content .manage-edit-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}
.modal-content .manage-btn-cancel {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 10px;
}
.modal-content .manage-btn-delete {
    padding: 10px 14px;
    border-radius: 10px;
    background: #dc2626;
    color: #fff;
}

.footer-author {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    opacity: 0.55;
}

.footer-author a {
    color: inherit;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-author a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

@media (max-width: 680px) {
    .modal-content {
        max-width: calc(100% - 32px);
        max-height: calc(100vh - 40px);
        padding: 16px;
    }
    .modal-content .manage-edit-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .modal-content .manage-edit-actions .manage-btn-delete,
    .modal-content .manage-edit-actions .manage-btn-cancel {
        width: 100%;
    }
}

@media (max-width: 1000px) {
    .card-grid,
    .card-grid-news,
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .event-detail-top {
        grid-template-columns: 1fr;
    }

    .event-detail-image {
        min-height: 260px;
        max-height: 360px;
    }
}

@media (max-width: 680px) {
    .nav-wrap {
        padding: 12px 0;
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        flex-basis: 100%;
        display: flex;
        flex-direction: column;
        gap: 2px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
    }

    .main-nav.is-open {
        max-height: 240px;
        padding-top: 8px;
        opacity: 1;
    }

    .main-nav a {
        width: 100%;
    }

    .main-nav a {
        padding: 8px 11px;
        font-size: 0.92rem;
    }

    .hero {
        min-height: 58vh;
    }

    .section {
        padding: 56px 0;
    }

    .card-grid,
    .card-grid-news,
    .member-grid,
    .gallery-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .admin-gallery-grid {
        grid-template-columns: 1fr;
    }

    .card img,
    .gallery-grid img {
        height: 220px;
    }

    .gallery-lightbox-path {
        top: 16px;
        left: 16px;
        max-width: calc(100vw - 88px);
    }

    .gallery-lightbox-close {
        top: 12px;
        right: 12px;
    }

    .admin-card {
        padding: 24px;
    }

    .admin-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .event-detail-body {
        padding: 20px;
    }
}
