*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;color:#172a46;background:#f4f7fb;line-height:1.55}a{color:#1b5b98}.wrap{width:min(1140px,92%);margin:auto}.public-header{background:linear-gradient(135deg,#0d2c55,#174e83);color:#fff;padding:64px 0}.header-inner{display:flex;align-items:end;justify-content:space-between;gap:25px}.kicker,.section-title span{font-size:11px;letter-spacing:2px;font-weight:900;color:#e8c65e}.public-header h1{font-size:clamp(36px,5vw,58px);margin:7px 0 8px}.public-header p{color:#d7e4f2}.home-btn{background:#fff;color:#123963;text-decoration:none;font-weight:800;padding:11px 16px;border-radius:10px}.public-grid{display:grid;grid-template-columns:.82fr 1.18fr;gap:45px;padding:65px 0}.section-title h2{font-size:32px;margin:6px 0 25px;color:#0d315f}.notice-list,.event-list{display:grid;gap:16px}.notice{display:grid;grid-template-columns:72px 1fr;gap:18px;background:#fff;padding:20px;border-radius:16px;box-shadow:0 8px 30px #153b6610}.date-badge{width:62px;height:62px;border-radius:15px;background:#ecf3fa;color:#174e83;display:grid;place-items:center;text-align:center;font-weight:900;font-size:12px}.notice h3,.event h3{margin:0 0 6px}.notice p,.event p{color:#617187;margin:0}.event{background:#fff;border-radius:18px;overflow:hidden;box-shadow:0 8px 30px #153b6610}.event-cover{display:block;width:100%;height:285px;object-fit:cover}.event-body{padding:22px}.event-date{font-size:11px;font-weight:900;color:#a57914;letter-spacing:1px;margin-bottom:5px}.photo-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin-top:16px}.photo-grid img{width:100%;height:92px;object-fit:cover;border-radius:8px}.empty{padding:22px;background:#fff;border-radius:14px;color:#7b8795}.public-footer{background:#0a2548;color:#cdd9e7;padding:26px 0;font-size:13px}
.admin-bg{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#0c2c55,#174e83)}.auth-card{width:min(430px,92%);background:#fff;border-radius:22px;padding:32px;box-shadow:0 30px 80px #071a3338}.admin-logo{width:60px;height:60px;border-radius:50%;background:#123963;color:#fff;border:3px solid #d7aa36;display:grid;place-items:center;font-weight:900}.auth-card h1{margin-bottom:5px}.auth-card>p{color:#6b7889;margin-top:0}label{display:block;font-size:13px;font-weight:800;margin:14px 0 5px}input,textarea{width:100%;padding:11px 12px;border:1px solid #ccd6e2;border-radius:9px;font:inherit;background:#fff}input[type=file]{padding:9px}.check{font-weight:600;display:flex;gap:8px;align-items:center}.check input{width:auto}.primary-btn{border:0;background:#103b6c;color:#fff;font-weight:900;padding:12px 18px;border-radius:9px;cursor:pointer;margin-top:13px}.cancel-link{margin-left:12px}.alert{padding:11px 13px;border-radius:9px;margin:12px 0;font-size:13px}.alert.ok{background:#e6f5eb;color:#22613a}.alert.error{background:#fde9e9;color:#8a2929}.admin-header{background:#0c2c55;color:#fff;padding:17px 4%;display:flex;align-items:center;justify-content:space-between}.admin-header b,.admin-header span{display:block}.admin-header span{font-size:11px;color:#c6d5e7}.admin-header nav{display:flex;gap:15px}.admin-header a{color:#fff;font-size:13px}.admin-wrap{width:min(1180px,92%);margin:35px auto}.admin-columns{display:grid;grid-template-columns:1fr 1fr;gap:22px}.panel{background:#fff;border-radius:17px;padding:24px;box-shadow:0 8px 28px #153b6610;margin-bottom:22px}.panel h2{margin-top:0;color:#103b6c}.wide{width:100%}.admin-list{display:grid;gap:9px}.admin-item{display:flex;align-items:center;justify-content:space-between;gap:15px;border:1px solid #e0e7ef;border-radius:11px;padding:11px 13px}.admin-item b,.admin-item span{display:block}.admin-item span{font-size:11px;color:#768394}.item-actions{display:flex;align-items:center;gap:10px}.item-actions form{margin:0}.item-actions button{border:0;background:#f8e5e5;color:#8a2828;padding:7px 10px;border-radius:7px;cursor:pointer}.admin-event-title{display:flex;align-items:center;gap:10px}.admin-event-title img{width:60px;height:45px;object-fit:cover;border-radius:7px}.thumb-row{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.thumb-row img{width:70px;height:55px;object-fit:cover;border-radius:7px}.small,label small{font-size:11px;color:#788597;font-weight:500}
@media(max-width:850px){.public-grid,.admin-columns{grid-template-columns:1fr}.header-inner{align-items:flex-start;flex-direction:column}.photo-grid{grid-template-columns:repeat(2,1fr)}.admin-header{align-items:flex-start;gap:12px;flex-direction:column}.admin-item{align-items:flex-start;flex-direction:column}.item-actions{width:100%;justify-content:flex-end}}

/* V12.1 additions */
.card-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:13px;font-size:12px;font-weight:800}.card-actions a{text-decoration:none}.card-actions span{color:#8a6a1f}.existing-file{background:#f4f7fb;border-radius:9px;padding:10px 12px;margin-top:10px;font-size:12px}.cover-picker{margin-top:12px}.cover-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:8px}.cover-choice{margin:0;position:relative;border:2px solid transparent;border-radius:10px;overflow:hidden;background:#eef3f8;cursor:pointer}.cover-choice img{display:block;width:100%;height:82px;object-fit:cover}.cover-choice input{position:absolute;top:7px;left:7px;width:auto}.cover-choice span{position:absolute;bottom:5px;right:5px;background:#0d315fe6;color:#fff;border-radius:5px;padding:2px 6px;font-size:10px}
.detail-header{background:#0d315f;color:#fff;padding:20px 0}.detail-header .wrap{display:flex;align-items:center;justify-content:space-between;gap:20px}.back-link{color:#fff;text-decoration:none;font-weight:800}.detail-main{padding:55px 0 80px;max-width:950px}.detail-card{background:#fff;border-radius:20px;padding:clamp(24px,5vw,48px);box-shadow:0 12px 38px #153b6614}.detail-card h1{font-size:clamp(31px,5vw,48px);line-height:1.15;color:#0d315f;margin:8px 0 24px}.detail-copy{font-size:17px;color:#52657d;line-height:1.85}.attachment-btn{display:inline-block;margin-top:28px;background:#0d315f;color:#fff;text-decoration:none;font-weight:800;padding:12px 16px;border-radius:9px}.event-gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:11px;margin-top:32px}.gallery-photo{padding:0;border:0;background:none;cursor:pointer;border-radius:12px;overflow:hidden;aspect-ratio:4/3}.gallery-photo img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .25s}.gallery-photo:hover img{transform:scale(1.04)}
.event-lightbox{position:fixed;inset:0;z-index:999;background:#000e;display:none;align-items:center;justify-content:center;padding:30px}.event-lightbox.show{display:flex}.event-lightbox img{max-width:88vw;max-height:84vh;object-fit:contain}.event-lightbox button{position:absolute;border:0;background:#ffffff1f;color:#fff;cursor:pointer;border-radius:50%}.lb-close{top:20px;right:25px;font-size:35px;width:48px;height:48px}.lb-prev,.lb-next{top:50%;transform:translateY(-50%);font-size:52px;width:55px;height:65px}.lb-prev{left:25px}.lb-next{right:25px}.event-lightbox>div{position:absolute;bottom:16px;color:#fff;font-weight:800}
@media(max-width:700px){.cover-grid{grid-template-columns:repeat(2,1fr)}.event-gallery{grid-template-columns:repeat(2,1fr)}.lb-prev{left:8px}.lb-next{right:8px}}

/* V12.2 photo-management additions */
.photo-help{margin:6px 0 10px}.photo-manage-card{border:1px solid #dfe7f0;border-radius:11px;padding:6px;background:#fff}.photo-manage-card .cover-choice{display:block}.remove-photo-check{display:flex;align-items:center;gap:7px;margin:7px 3px 2px;font-size:11px;font-weight:800;color:#8a2828}.remove-photo-check input{width:auto;margin:0}.remove-photo-check span{line-height:1.2}

/* V12.3 notice attachment management */
.attachment-manager{margin:14px 0 4px;padding:14px;border:1px solid #dfe7f0;border-radius:12px;background:#f8fafc}
.attachment-current{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;background:#fff;border:1px solid #e1e8f0;border-radius:9px}
.attachment-current b,.attachment-current span{display:block}
.attachment-current span{font-size:12px;color:#68788c;margin-top:2px;overflow-wrap:anywhere}
.attachment-open{white-space:nowrap;text-decoration:none;background:#eef4fb;color:#123963;font-size:12px;font-weight:900;padding:8px 10px;border-radius:8px}
.attachment-note{margin:6px 0 8px}
.remove-attachment-check{display:flex;align-items:center;gap:8px;margin:8px 0 0;font-size:12px;font-weight:900;color:#8a2828}
.remove-attachment-check input{width:auto;margin:0}
@media(max-width:600px){.attachment-current{align-items:flex-start;flex-direction:column}.attachment-open{white-space:normal}}


/* V12.3.1 — Remove Attachment checkbox alignment fix */
label.remove-attachment-check{
    display:inline-flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:9px !important;
    width:auto !important;
    margin:10px 0 4px !important;
    padding:0 !important;
    line-height:1.2 !important;
}
label.remove-attachment-check input[type="checkbox"]{
    display:inline-block !important;
    flex:0 0 auto !important;
    width:16px !important;
    height:16px !important;
    margin:0 !important;
    padding:0 !important;
    vertical-align:middle !important;
}
label.remove-attachment-check span{
    display:inline !important;
    margin:0 !important;
    padding:0 !important;
    line-height:1.2 !important;
}

/* V12.4 — quick publish/unpublish controls */
.item-actions form{display:inline-flex}
.item-actions .visibility-btn{border:0;padding:7px 10px;border-radius:7px;cursor:pointer;font:inherit;font-size:12px;font-weight:900}
.item-actions .hide-btn{background:#fff2d8;color:#7a5600}
.item-actions .show-btn{background:#e5f5ea;color:#1f6339}
.item-actions .visibility-btn:hover{filter:brightness(.97)}


/* V12.5 — automatic publish/expiry scheduling */
.schedule-box{
    margin:13px 0 16px;
    padding:13px 14px 10px;
    border:1px solid #dfe7f0;
    border-radius:11px;
    background:#f8fafc;
}
.schedule-box>b{display:block;color:#123963;margin-bottom:5px}
.schedule-box>b small{font-weight:500;color:#7a8798}
.schedule-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.schedule-grid label{margin-top:7px}
.schedule-box .small{margin:7px 0 0}
@media(max-width:620px){.schedule-grid{grid-template-columns:1fr}}

/* V12.6 — Smart Status System */
.item-info{min-width:0}.item-title-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.item-title-row>b{line-height:1.3}.item-meta{margin-top:3px}
.status-badge{display:inline-flex!important;align-items:center;justify-content:center;width:auto!important;padding:4px 8px;border-radius:999px;font-size:9px!important;line-height:1!important;font-weight:900;letter-spacing:.7px;white-space:nowrap}
.status-live{background:#e5f5ea;color:#1f6339!important;border:1px solid #c9e9d3}.status-scheduled{background:#e9f1ff;color:#245a9a!important;border:1px solid #cdddf5}.status-expired{background:#fff0dd;color:#8a5a0a!important;border:1px solid #f0d5af}.status-hidden{background:#f1f3f6;color:#5d6876!important;border:1px solid #dde2e8}
@media(max-width:700px){.item-title-row{align-items:flex-start}.status-badge{margin-top:1px}}


/* V12.7 — Dashboard Polish */
.status-legend{
    display:flex;
    align-items:center;
    gap:7px;
    flex-wrap:wrap;
    margin:0 0 18px;
    padding:10px 12px;
    border:1px solid #dde6f0;
    border-radius:12px;
    background:#ffffff;
    box-shadow:0 5px 18px #153b660a;
}
.legend-title{
    font-size:11px;
    font-weight:900;
    color:#123963;
    margin-right:2px;
}
.legend-help{
    font-size:10px;
    color:#748397;
    margin-right:7px;
}

/* Make status badges unmistakably visible */
.status-badge{
    padding:5px 9px !important;
    border-radius:999px !important;
    font-size:9px !important;
    font-weight:900 !important;
    letter-spacing:.75px !important;
    box-shadow:inset 0 0 0 1px rgba(0,0,0,.03);
}
.status-live{
    background:#dff4e6 !important;
    color:#176337 !important;
    border:1px solid #b8dfc6 !important;
}
.status-scheduled{
    background:#e4efff !important;
    color:#1d5598 !important;
    border:1px solid #bad0ef !important;
}
.status-expired{
    background:#fff0d7 !important;
    color:#875306 !important;
    border:1px solid #eccd99 !important;
}
.status-hidden{
    background:#eceff3 !important;
    color:#566170 !important;
    border:1px solid #d4dae2 !important;
}

/* Status-aware rows */
.status-row{
    border-left-width:4px !important;
    transition:box-shadow .18s ease, transform .18s ease;
}
.status-row:hover{
    box-shadow:0 8px 22px #153b660d;
    transform:translateY(-1px);
}
.row-live{border-left-color:#5cad77 !important}
.row-scheduled{border-left-color:#6f9bd3 !important}
.row-expired{border-left-color:#d6a34e !important}
.row-hidden{border-left-color:#9da6b2 !important}

/* Cleaner action buttons */
.item-actions>a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:32px;
    padding:6px 9px;
    border-radius:7px;
    text-decoration:none;
    font-size:12px;
    font-weight:800;
    background:#edf3fa;
    color:#174e83;
}
.item-actions>a:hover{background:#e3edf8}
.item-actions form button{
    min-height:32px;
    font-size:12px;
    font-weight:800;
}
.item-actions form:last-child button{
    background:#f9e7e7;
    color:#922f2f;
}
.item-actions .hide-btn{
    background:#fff1d8 !important;
    color:#7a5600 !important;
}
.item-actions .show-btn{
    background:#e3f5e9 !important;
    color:#1c683b !important;
}

/* Better hierarchy in list metadata */
.item-title-row>b{font-size:14px}
.item-meta{
    color:#748397 !important;
    font-size:10.5px !important;
    line-height:1.45;
}

@media(max-width:760px){
    .status-legend{align-items:flex-start}
    .legend-help{display:none}
    .item-actions{justify-content:flex-start !important;flex-wrap:wrap}
}


/* V12.7.1 — Force status badges to render as colored pills */
.admin-item .item-title-row .status-badge{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:auto !important;
    min-width:auto !important;
    margin:0 !important;
    padding:5px 9px !important;
    border-radius:999px !important;
    font-size:9px !important;
    line-height:1 !important;
    font-weight:900 !important;
    letter-spacing:.75px !important;
    white-space:nowrap !important;
}

/* Main-site manager patch: clear selected cover state */
.cover-choice.is-cover{border-color:#1d5598;box-shadow:0 0 0 2px #dbe9fb}.cover-choice:not(.is-cover) span{display:none}


/* EVENT GALLERY V2 — quality-preserving layout */
.event-detail{max-width:none}
.detail-main{max-width:1180px}
.event-gallery{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:18px !important;
    margin-top:34px !important;
    align-items:start;
}
.gallery-photo{
    display:block !important;
    width:100% !important;
    padding:0 !important;
    border:1px solid #dde6f0 !important;
    border-radius:14px !important;
    overflow:hidden !important;
    background:#fff !important;
    cursor:zoom-in !important;
    aspect-ratio:auto !important;
    box-shadow:0 8px 22px #153b660b;
    text-align:left;
}
.gallery-photo-frame{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    min-height:220px;
    max-height:330px;
    padding:8px;
    background:#f3f6fa;
    overflow:hidden;
}
.gallery-photo img{
    display:block !important;
    width:100% !important;
    height:auto !important;
    max-height:314px !important;
    object-fit:contain !important;
    object-position:center !important;
    transform:none !important;
    image-rendering:auto;
}
.gallery-photo:hover img{transform:none !important}
.gallery-photo-label{
    display:block;
    padding:9px 12px 10px;
    font-size:11px;
    font-weight:800;
    color:#66768a;
    background:#fff;
}
.gallery-photo:hover{
    box-shadow:0 12px 30px #153b6617;
    border-color:#bfd0e3 !important;
}

/* Full-resolution viewer */
.event-lightbox{
    position:fixed !important;
    inset:0 !important;
    z-index:9999 !important;
    background:rgba(0,0,0,.94) !important;
    display:none;
    align-items:center;
    justify-content:center;
    padding:20px 76px 64px !important;
}
.event-lightbox.show{display:flex !important}
.lb-stage{
    width:100%;
    height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}
.event-lightbox img{
    display:block;
    width:auto !important;
    height:auto !important;
    max-width:94vw !important;
    max-height:88vh !important;
    object-fit:contain !important;
    image-rendering:auto;
    box-shadow:0 20px 70px #0008;
}
.event-lightbox button{
    position:absolute;
    border:0;
    background:rgba(255,255,255,.14) !important;
    color:#fff;
    cursor:pointer;
    border-radius:50%;
    backdrop-filter:blur(4px);
}
.event-lightbox button:hover{background:rgba(255,255,255,.24) !important}
.lb-close{top:18px !important;right:22px !important;font-size:34px !important;width:46px !important;height:46px !important}
.lb-prev,.lb-next{top:50% !important;transform:translateY(-50%) !important;font-size:46px !important;width:52px !important;height:64px !important}
.lb-prev{left:16px !important}.lb-next{right:16px !important}
.lb-bottom{
    position:absolute !important;
    left:50% !important;
    bottom:16px !important;
    transform:translateX(-50%);
    display:flex;
    align-items:center;
    gap:14px;
    color:#fff;
    font-weight:800;
    white-space:nowrap;
}
.lb-bottom a{
    color:#fff;
    text-decoration:none;
    background:rgba(255,255,255,.16);
    border:1px solid rgba(255,255,255,.28);
    padding:7px 11px;
    border-radius:8px;
    font-size:12px;
}
.lb-bottom a:hover{background:rgba(255,255,255,.24)}

@media(max-width:900px){
    .event-gallery{grid-template-columns:repeat(2,minmax(0,1fr)) !important}
}
@media(max-width:600px){
    .detail-main{padding-top:28px}
    .event-gallery{grid-template-columns:1fr !important;gap:14px !important}
    .gallery-photo-frame{min-height:180px;max-height:none}
    .gallery-photo img{max-height:none !important}
    .event-lightbox{padding:52px 10px 68px !important}
    .lb-prev,.lb-next{width:42px !important;height:54px !important;font-size:38px !important}
    .lb-prev{left:5px !important}.lb-next{right:5px !important}
    .lb-bottom{gap:8px;font-size:12px}
}


/* V2.1 — Public Updates event cover: show the full image without top cropping */
.event-list .event-cover{
    width:100% !important;
    height:285px !important;
    object-fit:contain !important;
    object-position:center center !important;
    background:#f2f5f8 !important;
}
