/* =========================================================
   Base layout
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f2f4f7;
    color: #1b1b1b;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #d9dee5;
    padding: 24px 0 20px;
    margin-bottom: 28px;
}

.site-header h1 {
    margin: 0 0 8px;
    color: #003b73;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
}

.breadcrumb {
    color: #616975;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

/* =========================================================
   Public event cards
   ========================================================= */

.event-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(300px, 1fr)
    );
    gap: 24px;
    padding-bottom: 48px;
}

.event-card {
    display: block;
    overflow: hidden;
    background: #ffffff;
    color: #1d1d1d;
    border: 1px solid #d4d8de;
    border-radius: 14px;
    text-decoration: none;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.05);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.event-card:hover {
    transform: translateY(-3px);
    border-color: #3976b8;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.event-image-area {
    width: 100%;
    background: #eef0f3;
    border-bottom: 1px solid #dfe3e8;
}

.event-cover {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #ffffff;
    padding: 12px;
}

.event-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    background:
        linear-gradient(
            135deg,
            #e8edf3,
            #f7f8fa
        );
}

.folder-symbol {
    font-size: 4.5rem;
}

.event-card-content {
    padding: 18px 20px 20px;
}

.event-title {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.event-detail {
    display: block;
    margin-top: 8px;
    color: #6b7280;
    font-size: 0.95rem;
}

/* =========================================================
   PDF cards
   ========================================================= */

.pdf-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 104px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #d4d8de;
    border-radius: 12px;
    color: #1d1d1d;
    text-decoration: none;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.pdf-card:hover {
    transform: translateY(-2px);
    border-color: #3976b8;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.pdf-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 72px;
    flex: 0 0 62px;
    border-radius: 7px;
    background: #bd1e2d;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
}

.pdf-information {
    min-width: 0;
}

.pdf-name {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.pdf-detail {
    display: block;
    margin-top: 7px;
    color: #6b7280;
    font-size: 0.9rem;
}

/* =========================================================
   Navigation and empty state
   ========================================================= */

.back-button {
    display: inline-block;
    margin-bottom: 22px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #cfd5dc;
    color: #153d66;
    font-weight: 700;
    text-decoration: none;
}

.back-button:hover {
    background: #eaf2fb;
}

.empty-message {
    grid-column: 1 / -1;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #d4d8de;
    border-radius: 12px;
    color: #5f6772;
}

/* =========================================================
   Admin page
   ========================================================= */

.admin-body {
    background: #edf1f5;
}

.admin-container {
    padding-bottom: 50px;
}

.admin-navigation {
    display: flex;
    gap: 18px;
    margin-top: 14px;
}

.admin-navigation a {
    color: #005ca8;
    font-weight: 700;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(280px, 1fr)
    );
    gap: 20px;
    margin-bottom: 24px;
}

.admin-box {
    padding: 22px;
    background: #ffffff;
    border: 1px solid #d6dbe1;
    border-radius: 12px;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.04);
}

.admin-box h1,
.admin-box h2 {
    margin-top: 0;
    color: #163e67;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="file"] {
    display: block;
    width: 100%;
    margin: 0 0 14px;
    padding: 11px;
    border: 1px solid #bfc6cf;
    border-radius: 7px;
    background: #ffffff;
    font: inherit;
}

button {
    display: inline-block;
    padding: 10px 16px;
    border: 0;
    border-radius: 7px;
    background: #075fa8;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: #034b86;
}

.secondary-button {
    background: #596675;
}

.secondary-button:hover {
    background: #414c58;
}

.back-form {
    margin-bottom: 20px;
}

.help-text {
    margin-bottom: 0;
    color: #68717d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.success-message,
.error-message {
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 700;
}

.success-message {
    background: #e2f5e5;
    border: 1px solid #91c99a;
    color: #205929;
}

.error-message {
    background: #fde5e5;
    border: 1px solid #df9696;
    color: #811d1d;
}

/* =========================================================
   Admin item list
   ========================================================= */

.admin-item-list {
    display: grid;
    gap: 10px;
}

.admin-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid #d9dde3;
    border-radius: 8px;
    background: #fafbfc;
}

.item-open-form {
    flex: 1;
    min-width: 0;
}

.folder-open-button {
    width: 100%;
    text-align: left;
    background: transparent;
    color: #153d66;
    padding: 8px;
    overflow-wrap: anywhere;
}

.folder-open-button:hover {
    background: #e5edf6;
}

.admin-item-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.delete-button {
    background: #b4232f;
}

.delete-button:hover {
    background: #861822;
}

/* =========================================================
   Login page
   ========================================================= */

.login-container {
    width: min(440px, calc(100% - 30px));
    margin: 12vh auto 0;
}

.login-box {
    padding: 28px;
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 700px) {
    .container {
        width: min(100% - 20px, 1180px);
    }

    .site-header {
        padding-top: 18px;
        margin-bottom: 20px;
    }

    .event-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .event-cover,
    .event-placeholder {
        height: 160px;
    }

    .event-card-content {
        padding: 16px;
    }

    .admin-item-row {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-item-row form {
        width: 100%;
    }

    .delete-button {
        width: 100%;
    }

    .admin-navigation {
        flex-wrap: wrap;
    }
}

.report-button {
    display: inline-block;
    margin: 5px 8px 5px 0;
    padding: 10px 16px;
    background: #075fa8;
    color: #ffffff;
    border-radius: 7px;
    text-decoration: none;
    font-weight: bold;
}

.report-button:hover {
    background: #034b86;
}
