/* =========================================================
   Bluegoose Events — Public Styles
   ========================================================= */

/* Screen-reader only utility */
.bge-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Events List */
.bge-events-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

.bge-event-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.bge-event-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

.bge-event-thumb img { width: 100%; height: 200px; object-fit: cover; display: block; }

.bge-event-card-body { padding: 16px; }

/* Raised from 13px → 14px (WCAG secondary text minimum) */
.bge-event-date { font-size: 14px; color: #6b7280; margin-bottom: 6px; }

.bge-event-title { margin: 0 0 8px; font-size: 18px; }
.bge-event-title a { text-decoration: none; color: inherit; }
.bge-event-title a:hover { text-decoration: underline; }

.bge-event-location { font-size: 14px; color: #6b7280; margin: 0 0 8px; }

.bge-event-excerpt { font-size: 14px; color: #374151; margin: 0 0 12px; }

/* Buttons — min-height 44px for touch targets */
.bge-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s, opacity 0.2s;
}
.bge-btn-primary { background: #1a1a2e; color: #fff; }
.bge-btn-primary:hover { background: #16213e; color: #fff; }
.bge-btn-secondary { background: #f3f4f6; color: #374151; }
.bge-btn-secondary:hover { background: #e5e7eb; }
.bge-btn:disabled, .bge-loading .bge-btn { opacity: 0.6; cursor: not-allowed; }

/* Registration Wizard */
.bge-registration-wizard { max-width: 720px; margin: 24px 0; font-family: inherit; }

/* Step indicator — nav > ol > li structure */
.bge-steps-indicator {
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}
.bge-steps-indicator ol {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}
.bge-step-indicator {
    padding: 10px 20px;
    font-size: 14px;
    /* Raised from #9ca3af (2.8:1) to #6b7280 (4.6:1) — passes WCAG AA */
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.bge-step-indicator.bge-step-active {
    color: #1a1a2e;
    border-color: #1a1a2e;
    font-weight: 600;
}
/* Done steps: color + checkmark so color-blind users can distinguish */
.bge-step-indicator.bge-step-done { color: #059669; }
.bge-step-indicator.bge-step-done::before { content: '\2713\00a0'; }

.bge-step h3 { margin-top: 0; }

/* Ticket select table */
.bge-ticket-select-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.bge-ticket-select-table th,
.bge-ticket-select-table td { padding: 10px 12px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.bge-ticket-select-table th { background: #f9fafb; font-size: 14px; color: #6b7280; }
/* Consistent padding with other inputs */
.bge-qty-input { width: 70px; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 4px; }
.bge-free { color: #059669; font-weight: 600; }
.bge-sold-out { color: #ef4444; font-size: 14px; }

/* Form fields */
.bge-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.bge-field-row label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; }
.bge-field-row input { padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 14px; }
.bge-required { color: #ef4444; }

.bge-custom-field { margin-bottom: 16px; }
.bge-custom-field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.bge-custom-field input,
.bge-custom-field textarea,
.bge-custom-field select { width: 100%; max-width: 400px; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 14px; }
.bge-checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.bge-checkbox-label input { width: auto; }

/* Order summary */
.bge-summary-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.bge-summary-table th,
.bge-summary-table td { padding: 8px 12px; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
.bge-summary-table th { background: #f9fafb; color: #6b7280; }
.bge-summary-table tfoot td { background: #f9fafb; }
.bge-total-row td { font-weight: 700; font-size: 15px; }
.bge-registrant-summary { background: #f9fafb; border-radius: 4px; padding: 12px 16px; margin: 12px 0; }
.bge-registrant-summary p { margin: 4px 0; font-size: 14px; }

/* Actions */
.bge-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }

/* Error */
.bge-error { background: #fef2f2; border-left: 4px solid #ef4444; padding: 10px 14px; border-radius: 3px; font-size: 14px; color: #991b1b; margin: 12px 0; }

/* Loading */
.bge-loading { opacity: 0.7; pointer-events: none; position: relative; }
.bge-loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 24px; height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #e5e7eb;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: bge-spin 0.6s linear infinite;
}
@keyframes bge-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .bge-loading::after { animation: none; border-top-color: #1a1a2e; opacity: 0.5; }
    .bge-event-card { transition: none; }
    .bge-btn { transition: none; }
}

/* Payment return */
.bge-payment-return { max-width: 600px; margin: 48px auto; padding: 0 16px; }
.bge-notice { padding: 20px 24px; border-radius: 6px; margin-bottom: 16px; }
.bge-notice h2 { margin-top: 0; }
.bge-notice-success { background: #f0fdf4; border-left: 4px solid #22c55e; }
.bge-notice-error   { background: #fef2f2; border-left: 4px solid #ef4444; }
.bge-notice-info    { background: #eff6ff; border-left: 4px solid #3b82f6; }

/* Status badges */
.bge-status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.bge-status-paid      { background: #dcfce7; color: #166534; }
.bge-status-pending   { background: #fef9c3; color: #854d0e; }
.bge-status-cancelled { background: #fee2e2; color: #991b1b; }
.bge-status-refunded  { background: #f3f4f6; color: #6b7280; }

/* =========================================================
   Shared utilities
   ========================================================= */
.bge-page-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
.bge-btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.bge-section-title { font-size: 20px; margin: 32px 0 12px; border-bottom: 2px solid #e5e7eb; padding-bottom: 8px; }

/* Category badge */
.bge-cat-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #eff6ff;
    color: #1d4ed8;
    text-decoration: none;
    margin-right: 4px;
}
.bge-cat-badge:hover { background: #dbeafe; }

/* =========================================================
   Single Event Page
   ========================================================= */

/* Hero image */
.bge-single-event__hero { width: 100%; max-height: 480px; overflow: hidden; border-radius: 8px; margin-bottom: 24px; }
.bge-single-event__hero-img { width: 100%; height: 480px; object-fit: cover; display: block; }

/* Header */
.bge-single-event__header { margin-bottom: 24px; }
.bge-single-event__cats { margin-bottom: 10px; }
.bge-single-event__title { font-size: 32px; font-weight: 700; margin: 0 0 16px; line-height: 1.2; }

/* Meta strip */
.bge-meta-strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.bge-meta-item { display: flex; align-items: center; gap: 6px; font-size: 15px; color: #374151; }
.bge-meta-icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; background-size: contain; background-repeat: no-repeat; background-position: center; }
.bge-icon-date     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='1.5'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
.bge-icon-location { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='1.5'%3E%3Cpath d='M12 21c-4-4.5-6-8-6-11a6 6 0 0112 0c0 3-2 6.5-6 11z'/%3E%3Ccircle cx='12' cy='10' r='2'/%3E%3C/svg%3E"); }
.bge-icon-ticket   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='1.5'%3E%3Cpath d='M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z'/%3E%3C/svg%3E"); }
.bge-excl-vat { font-size: 12px; color: #9ca3af; }

/* Two-column body */
.bge-single-event__body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}
.bge-single-event__content { min-width: 0; }
.bge-single-event__description { margin-bottom: 24px; }
.bge-single-event__description img { max-width: 100%; }

/* Ticket overview table */
.bge-ticket-overview-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.bge-ticket-overview-table th,
.bge-ticket-overview-table td { padding: 10px 12px; border-bottom: 1px solid #e5e7eb; font-size: 14px; text-align: left; }
.bge-ticket-overview-table th { background: #f9fafb; color: #6b7280; font-weight: 600; }
.bge-ticket-row.bge-ticket-soldout { opacity: 0.6; }
.bge-ticket-desc { font-size: 13px; color: #6b7280; margin-top: 2px; }
.bge-ticket-price { white-space: nowrap; }

/* Availability badges */
.bge-avail-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.bge-avail-ok      { background: #dcfce7; color: #166534; }
.bge-avail-few     { background: #fef9c3; color: #854d0e; }
.bge-avail-soldout { background: #fee2e2; color: #991b1b; }

/* Register section */
.bge-single-event__register { margin-top: 8px; }

/* Sidebar */
.bge-single-event__sidebar { display: flex; flex-direction: column; gap: 20px; }

/* Detail card */
.bge-detail-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 14px;
}
.bge-detail-card__title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; margin: 0 0 12px; }
.bge-detail-row { display: flex; gap: 12px; margin-bottom: 10px; }
.bge-detail-row:last-child { margin-bottom: 0; }
.bge-detail-label { font-weight: 600; min-width: 52px; color: #374151; }
.bge-detail-value { color: #374151; }
.bge-detail-time { color: #6b7280; }
.bge-detail-card a { color: #1d4ed8; text-decoration: none; }
.bge-detail-card a:hover { text-decoration: underline; }

/* Location */
.bge-location-name { margin: 0 0 6px; }
.bge-location-address { font-style: normal; color: #374151; line-height: 1.6; margin: 0 0 12px; }
.bge-map-embed { border-radius: 6px; overflow: hidden; margin-top: 12px; }
.bge-map-embed iframe { display: block; }

/* Contact links */
.bge-contact-link { color: #374151; text-decoration: none; font-size: 13px; word-break: break-all; }
.bge-contact-link:hover { color: #1d4ed8; }

/* =========================================================
   Archive / Events List Page
   ========================================================= */
.bge-archive-wrap { }

/* Archive header */
.bge-archive-header { margin-bottom: 24px; }
.bge-archive-title { font-size: 30px; font-weight: 700; margin: 0 0 6px; }
.bge-archive-subtitle { color: #6b7280; margin: 0; font-size: 15px; }

/* Filters */
.bge-archive-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}
.bge-filter-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.bge-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    transition: background 0.15s;
}
.bge-filter-btn:hover { background: #e5e7eb; }
.bge-filter-btn.bge-filter-active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }
.bge-filter-link { font-size: 13px; color: #6b7280; text-decoration: underline; }
.bge-filter-link:hover { color: #374151; }

/* Archive grid (extends .bge-events-list) */
.bge-archive-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Card thumbnail with badge overlay */
.bge-event-thumb { display: block; position: relative; overflow: hidden; background: #f3f4f6; }
.bge-event-thumb img { width: 100%; height: 200px; object-fit: cover; display: block; transition: transform 0.3s; }
.bge-event-card:hover .bge-event-thumb img { transform: scale(1.04); }
.bge-event-thumb-placeholder { height: 200px; background: #e5e7eb; }
.bge-card-cats { position: absolute; bottom: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.bge-card-cats .bge-cat-badge { background: rgba(255,255,255,0.92); }

/* Card footer */
.bge-event-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}
.bge-event-price { font-size: 15px; font-weight: 700; color: #1a1a2e; }

/* No events */
.bge-no-events { padding: 48px 0; text-align: center; color: #6b7280; font-size: 16px; }

/* Pagination */
.bge-pagination { margin-top: 40px; }
.bge-pagination .page-numbers { display: flex; list-style: none; padding: 0; margin: 0; justify-content: center; gap: 8px; flex-wrap: wrap; }
.bge-pagination .page-numbers li { }
.bge-pagination .page-numbers a,
.bge-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    color: #374151;
}
.bge-pagination .page-numbers a:hover { background: #f3f4f6; }
.bge-pagination .page-numbers .current { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }
.bge-pagination .page-numbers .dots { border: none; }

@media (max-width: 600px) {
    .bge-registration-wizard { padding: 0 16px; }
    .bge-field-row { grid-template-columns: 1fr; }
    .bge-events-list { grid-template-columns: 1fr; }
    .bge-actions { flex-direction: column; align-items: stretch; }
    .bge-actions .bge-btn { width: 100%; justify-content: center; }

    /* Horizontal scroll for tables on small screens */
    .bge-ticket-select-table,
    .bge-summary-table,
    .bge-ticket-overview-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Single event: stack sidebar below content */
    .bge-single-event__body { grid-template-columns: 1fr; gap: 24px; }
    .bge-single-event__sidebar { order: -1; }
    .bge-single-event__title { font-size: 24px; }
    .bge-single-event__hero-img { height: 240px; }

    /* Archive filters: full-width */
    .bge-archive-filters { flex-direction: column; align-items: flex-start; }
    .bge-archive-grid { grid-template-columns: 1fr; }
}
