/* 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; }

main { padding-top: 0; }

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

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

.an-brand-mark {
    color: var(--pink);
    font-size: 75px;
    line-height: 1;
}
.an-brand-name {
    color: var(--ink);
    font-family: var(--font-display);
}

/* ---- 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: 32px;
    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, then draw our
       own dropdown arrow back in via background-image since appearance:none
       also removes it */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    padding: 8px 28px 8px 14px;
    border-radius: 999px;
    border: 2px solid var(--ink);
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 11px 7px;
    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 22px 6px 10px;
        background-position: right 8px center;
        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); }

/* !important is deliberate here: this is a generic "force hidden" utility applied to elements
   (.an-card, .an-card-filler) whose own class already sets a display value later in this
   file — without it, cascade order would let those later rules win over this one. */
.is-hidden { display: none !important; }

.an-filter-empty {
    grid-column: 1 / -1;
    justify-self: center;
    width: 100%;
    max-width: 340px;
    flex-direction: column;
    gap: 12px;
}

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

.an-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
    gap: 44px 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 {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    height: 100%;
    text-decoration: none;
    color: inherit;
    border: none;
    background: none;
    text-align: left;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

/* A finished event stays visible and fully readable (useful browsing a month's archive) — a
   centered, half-transparent "crossed out" stamp signals it's done rather than fading the card. */
.an-card-past::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    aspect-ratio: 1 / 1;
    background-image: url('/assets/images/crossed-out.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.5;
    pointer-events: none;
}

/* ---- Card layout: date square (left) + info (right) — same two-column shape on mobile and desktop ---- */

.an-card-layout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    width: 100%;
}

.an-card-date-col {
    flex: 0 0 auto;
    /* Nudges the badge down past the category tag line above it, so it lines up with the
       title rather than the top of the card. */
    margin-top: 18px;
}

.an-card-info-col {
    flex: 1;
    min-width: 0;
}

.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;
}

/* Inside a card specifically (not the modal, which reuses .an-date-badge as a small inline pill),
   the badge is a content-sized box — number on its own line, day below, equal padding all round
   rather than a fixed square. */
.an-card-date-col .an-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    text-align: center;
    line-height: 1.1;
    padding: 10px;
    margin-bottom: 0;
    border-radius: 6px;
}

.an-date-badge-num,
.an-date-badge-day {
    display: block;
}

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

.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-pin {
    color: var(--pink);
    vertical-align: -1px;
}

.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-image {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 14px;
}

.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;
    }
}

/* ---- Digest mailing-list signup (sits above the print bar) ---- */

.an-digest {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px 32px;
    text-align: center;
}

.an-digest-title {
    font-family: var(--font-display);
    font-size: 32px;
    margin: 0 0 4px;
}

.an-digest-intro {
    color: var(--muted);
    margin: 0 0 16px;
}

.an-digest-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.an-digest-row input[type=email] {
    flex: 1 1 220px;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--ink);
}

.an-digest-row input[type=email]:focus {
    outline: none;
    border-color: var(--pink);
}

.an-digest-frequency {
    display: flex;
    gap: 12px;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.an-digest-frequency label { display: flex; align-items: center; gap: 4px; }
.an-digest-frequency input { width: auto; margin: 0; }

.an-digest-categories {
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    justify-content: center;
    font-size: 13px;
}

.an-digest-categories legend {
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 6px;
    padding: 0;
}

.an-digest-submit {
    display: block;
    margin: 16px auto 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; }
}
