/* Aber Noticeboard — zine/poster theme */

:root {
    --paper: #f4efe6;
    --ink: #1a1a1a;
    --pink: #ec1f8c;
    --yellow: #f8d94e;
    --card-bg: #ffffff;
    --muted: rgba(26,26,26,0.55);
    --border: rgba(26,26,26,0.15);

    --font-display: 'Anton', Impact, 'Archivo Black', sans-serif;
    --font-month: 'Londrina Shadow', 'Anton', Impact, cursive;
    --font-accent: 'Permanent Marker', cursive;
    --font-body: 'Archivo', -apple-system, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background-color: var(--paper);
    background-image: url('/assets/images/bg-desktop.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

/* Swap to the portrait background on mobile — same breakpoint used for .an-grid and the nav button text swap */
@media (max-width: 620px) {
    body { background-image: url('/assets/images/bg-mobile.png'); }
}

/* Fixed backgrounds are unreliable/janky on iOS Safari — fall back to scrolling with the page there */
@supports (-webkit-touch-callout: none) {
    body { background-attachment: scroll; }
}

a { color: inherit; }

/* The "+ Add an event" button now floats fixed top-right (no topbar to reserve
   space for it any more) — give every page using inc/header.php a bit of
   top clearance so page content doesn't sit directly under it */
main { padding-top: 56px; }

/* ---- Brand (moved out of the old topbar; now sits above the page's own heading) ---- */

.an-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    margin: 0 auto 14px;
    text-decoration: none;
    color: var(--yellow);
    font-family: var(--font-month);
    font-weight: 400;
    font-size: 24px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.an-brand-mark { color: var(--pink); }
.an-brand-name { color: var(--ink); }

/* ---- Add-event button (was in the topbar; now floats top-right on its own) ---- */

.an-btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 800;
    font-family: var(--font-body);
    font-size: 14px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 2px solid transparent;
}

/* Generic pill button used for various form actions (submit.php, edit.php,
   submit-thanks.php) — leave this exactly as it always was, unrelated to the
   header nav button below */
.an-btn-add {
    background: var(--pink);
    color: #fff;
}

.an-btn-add:hover { background: #d0107a; color: #fff; }

/* The header's own "+ Add an event" / "+ ADD" nav button — floats top-right
   now that the topbar wrapper is gone */
.an-nav-cta {
    position: fixed;
    top: 14px;
    right: 20px;
    z-index: 20;
    background: var(--yellow);
    color: var(--ink);
}

.an-nav-cta:hover { background: #d0107a; color: #fff; }

.an-btn-add-short { display: none; }

@media (max-width: 620px) {
    .an-btn-add-full { display: none; }
    .an-btn-add-short { display: inline; }
}

/* ---- Month header ---- */

.an-month-hero {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 16px 20px;
    text-align: center;
    overflow: hidden;
}

.an-month-eyebrow {
    font-family: var(--font-accent);
    font-size: 18px;
    color: var(--pink);
    display: block;
    margin-bottom: 4px;
}

.an-month-title {
    font-family: var(--font-month);
    font-weight: 400;
    font-size: clamp(56px, 14vw, 120px);
    line-height: 0.9;
    margin: 0;
    letter-spacing: 0.01em;
}

.an-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 14px;
    flex-wrap: nowrap;
}

.an-month-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--yellow);
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
}

.an-month-arrow:hover { background: var(--pink); color: #fff; }

.an-month-jump, .an-month-today {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 2px solid var(--ink);
    background: transparent;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
}

.an-month-today:hover { background: var(--ink); color: var(--yellow); }

.an-month-select {
    /* Reset native OS/browser select chrome so our custom border/radius
       actually shows instead of the default rounded control */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 2px solid var(--ink);
    background: transparent;
    color: var(--ink);
    max-width: 42vw;
}

/* Keep prev-arrow / month picker / next-arrow (and Today, when shown) on a
   single row on small screens by shrinking each control rather than wrapping */
@media (max-width: 620px) {
    .an-month-nav {
        gap: 8px;
    }
    .an-month-arrow {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
    .an-month-select {
        padding: 6px 8px;
        font-size: 13px;
    }
    .an-month-today {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ---- Category / area filter chips ---- */

.an-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 6px 16px 22px;
}

.an-chip {
    font-size: 13px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 999px;
    border: 2px solid var(--ink);
    background: var(--card-bg);
    cursor: pointer;
    user-select: none;
}

.an-chip.is-active { background: var(--yellow); }

.an-card.is-dimmed { opacity: 0.25; filter: grayscale(60%); }

/* ---- Event grid ---- */

.an-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
    gap: 22px 24px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

@media (max-width: 900px) {
    .an-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
    .an-grid { grid-template-columns: 1fr; padding: 0 16px 48px; }
}

.an-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: none;
    background: none;
    text-align: left;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.an-date-badge {
    display: inline-block;
    background: var(--yellow);
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.an-card-cat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--pink);
    margin-left: 6px;
}

.an-card-title {
    font-family: var(--font-display);
    font-size: 26px;
    line-height: 1;
    margin: 2px 0 6px;
    letter-spacing: 0.01em;
}

.an-card-meta {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.an-card-venue {
    font-size: 13px;
    color: var(--ink);
    font-weight: 700;
    margin-top: 2px;
}

.an-card-free {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--yellow);
    padding: 2px 8px;
    border-radius: 3px;
}

.an-card-recurring {
    display: block;
    margin: 6px 0 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.an-card-stamp {
    display: inline-block;
    transform: rotate(-8deg);
    border: 3px solid var(--pink);
    color: var(--pink);
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* ---- Empty-month filler card ---- */

.an-card-filler {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 160px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 20px;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

.an-card-filler:hover { border-color: var(--pink); color: var(--pink); }

/* When it's the only card in the grid (empty month), span the full row and
   center it instead of leaving it stuck in the first grid column */
@media (min-width: 621px) {
    .an-grid > .an-card-filler:only-child {
        grid-column: 1 / -1;
        justify-self: center;
        width: 100%;
        max-width: 340px;
    }
}

/* ---- Modal (Bootstrap JS behaviour, fully custom chrome) ---- */

.an-modal .modal-content {
    border-radius: 14px;
    border: 3px solid var(--ink);
    background: var(--card-bg);
}

.an-modal .modal-header {
    border-bottom: 3px solid var(--ink);
    padding: 18px 22px;
}

.an-modal .modal-title {
    font-family: var(--font-display);
    font-size: 30px;
}

.an-modal .modal-body { padding: 22px; }

.an-modal .an-directions-link {
    display: inline-block;
    margin-top: 6px;
    font-weight: 700;
    color: var(--pink);
    text-decoration: underline;
}

@media (max-width: 620px) {
    .an-modal { margin: 0; }
    .an-modal .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }
    .an-modal .modal-content {
        height: 100%;
        border-radius: 0;
        border-width: 0;
    }
}

/* ---- Print bar (bottom of page content, above the site footer) ---- */

.an-print-bar {
    text-align: center;
    padding: 0 16px 32px;
}

/* Force true centering regardless of the button's inline-block default —
   text-align alone wasn't reliably centering it */
.an-btn-print {
    display: block;
    width: fit-content;
    margin: 0 auto;
}

/* ---- Footer ---- */

.an-footer {
    text-align: center;
    padding: 24px 16px 48px;
    font-size: 13px;
    color: var(--muted);
}

.an-footer a { color: var(--pink); font-weight: 700; }

/* ---- Submission form ---- */

.an-submit {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

.an-submit-title {
    font-family: var(--font-display);
    font-size: 44px;
    margin: 0 0 8px;
}

.an-submit-intro {
    color: var(--muted);
    margin-bottom: 20px;
}

.an-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-weight: 600;
}

.an-alert-error { background: #ffe3ee; color: #99114f; border: 1px solid #f4a8cd; }
.an-alert-success { background: #e9f7e5; color: #1e5e2f; border: 1px solid #a9dba0; }

.an-alert-prominent {
    font-size: 16px;
    font-weight: 800;
    padding: 16px 18px;
    border-width: 2px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(153,17,79,0.15);
}

.an-field-invalid input,
.an-field-invalid textarea,
.an-field-invalid select,
input.an-field-invalid,
textarea.an-field-invalid,
select.an-field-invalid {
    border-color: #c21f5b !important;
    background: #fff5f9;
}

.an-field-invalid > label:first-of-type {
    color: #c21f5b;
}

.an-field, .an-submit fieldset {
    margin-bottom: 20px;
    border: none;
    padding: 0;
}

.an-submit fieldset legend {
    font-weight: 800;
    margin-bottom: 6px;
    padding: 0;
}

.an-submit label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.an-submit fieldset > label {
    display: inline-block;
    font-weight: 600;
    margin-right: 16px;
}

.an-submit input[type=text],
.an-submit input[type=email],
.an-submit input[type=url],
.an-submit input[type=date],
.an-submit input[type=time],
.an-submit input[type=number],
.an-submit input[type=file],
.an-submit textarea,
.an-submit select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--ink);
    margin-bottom: 8px;
}

.an-submit input:focus, .an-submit textarea:focus, .an-submit select:focus {
    outline: none;
    border-color: var(--pink);
}

.an-field-row { display: flex; gap: 16px; }
.an-field-row > div { flex: 1; }

.an-hint { font-size: 12px; color: var(--muted); font-weight: 500; margin: 2px 0 8px; }

.an-checkbox-label { font-weight: 600 !important; }
.an-checkbox-label input { width: auto; margin-right: 6px; }

.an-hp { position: absolute; left: -9999px; top: -9999px; }

.an-venue-suggestions {
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-top: -4px;
    margin-bottom: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.an-venue-suggestions:empty { display: none; border: none; }

.an-venue-suggestion {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.an-venue-suggestion:last-child { border-bottom: none; }
.an-venue-suggestion:hover { background: var(--paper); }
.an-venue-suggestion.is-add-new { font-weight: 700; color: var(--pink); }

/* ---- Print ---- */

@media print {
    .an-nav-cta, .an-footer, .an-month-nav, .an-filters, .an-print-bar { display: none !important; }
    body { background: #fff; }

    /* Print as a compact list, not the tiled poster grid */
    .an-grid {
        display: block;
        max-width: 100%;
        padding: 0 10px;
    }
    .an-card {
        display: block;
        width: 100%; /* buttons stay content-sized even under display:block otherwise */
        padding: 10px 0 !important;
        border-bottom: 1px solid #ccc;
        page-break-inside: avoid;
    }
    .an-card-title { font-size: 16px; margin: 2px 0; }
    .an-date-badge { font-size: 11px; padding: 2px 8px; }
    .an-card-meta, .an-card-venue { font-size: 12px; }
    .an-card-filler { display: none; }
    .an-month-title { font-size: 60px; }
}
