/**
 * Wigmorean Calendar – Frontend Styles
 *
 * Design system: Crimson #2271b1, Gold #646970, Deep Brown #1d2327, Cream #f6f7f7
 * Fonts: Cinzel (headings), Cormorant Garamond (body), Jost (UI)
 *
 * Includes:
 * - All 11 view layouts (monthly, weekly, daily, list, tile, map, agenda, timeline, countdown, mini, photo)
 * - WCAG 2.1 AA compliance (#26)
 * - Widget styles (#08)
 * - Social sharing (#42)
 * - Photo view (#16)
 * - Cost display (#43)
 * - Focus styles for keyboard nav (#27)
 *
 * @package Wigmorean\Calendar
 * @since   1.0.0
 */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
    --wig-cal-crimson:     #2271b1;
    --wig-cal-gold:        #646970;
    --wig-cal-brown:       #1d2327;
    --wig-cal-cream:       #f6f7f7;
    --wig-cal-white:       #fff;
    --wig-cal-border:      #e2d9cd;
    --wig-cal-text:        #1d2327;
    --wig-cal-text-muted:  #6b5e52;
    --wig-cal-radius:      6px;
    --wig-cal-shadow:      0 2px 8px rgba(43, 24, 16, 0.08);
    --wig-cal-transition:  0.2s ease;
    --wig-cal-focus-ring:  0 0 0 3px rgba(197, 151, 59, 0.5);
    --wig-cal-font-heading: 'Cinzel', serif;
    --wig-cal-font-body:    'Cormorant Garamond', serif;
    --wig-cal-font-ui:      'Jost', sans-serif;
}

/* ── Screen Reader Only (#26) ──────────────────────────────── */
.wig-cal-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ── Focus Styles (#27) ────────────────────────────────────── */
.wig-cal-wrap *:focus-visible {
    outline: 2px solid var(--wig-cal-gold);
    outline-offset: 2px;
    box-shadow: var(--wig-cal-focus-ring);
}

/* ── Wrapper ───────────────────────────────────────────────── */
.wig-cal-wrap {
    font-family: var(--wig-cal-font-body);
    color: var(--wig-cal-text);
    line-height: 1.5;
}

/* ── Toolbar: View Switcher + Navigation ───────────────────── */
.wig-cal-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 8px 0;
}
.wig-cal-views {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.wig-cal-view-btn {
    font-family: var(--wig-cal-font-ui);
    font-size: 13px;
    padding: 6px 12px;
    border: 1px solid var(--wig-cal-border);
    border-radius: var(--wig-cal-radius);
    background: var(--wig-cal-white);
    color: var(--wig-cal-text-muted);
    cursor: pointer;
    transition: all var(--wig-cal-transition);
}
.wig-cal-view-btn:hover {
    border-color: var(--wig-cal-gold);
    color: var(--wig-cal-brown);
}
.wig-cal-view-btn--active {
    background: var(--wig-cal-crimson);
    color: var(--wig-cal-white);
    border-color: var(--wig-cal-crimson);
}
.wig-cal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.wig-cal-nav-prev,
.wig-cal-nav-next,
.wig-cal-nav-today {
    font-family: var(--wig-cal-font-ui);
    font-size: 13px;
    padding: 6px 12px;
    border: 1px solid var(--wig-cal-border);
    border-radius: var(--wig-cal-radius);
    background: var(--wig-cal-white);
    cursor: pointer;
    transition: all var(--wig-cal-transition);
}
.wig-cal-nav-prev:hover,
.wig-cal-nav-next:hover,
.wig-cal-nav-today:hover {
    border-color: var(--wig-cal-gold);
    background: var(--wig-cal-cream);
}
.wig-cal-nav-label {
    font-family: var(--wig-cal-font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--wig-cal-brown);
    min-width: 180px;
    text-align: center;
}

/* ── Filters ───────────────────────────────────────────────── */
.wig-cal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.wig-cal-filter {
    font-family: var(--wig-cal-font-ui);
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid var(--wig-cal-border);
    border-radius: var(--wig-cal-radius);
    background: var(--wig-cal-white);
    min-width: 140px;
}
.wig-cal-filter-search {
    font-family: var(--wig-cal-font-ui);
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid var(--wig-cal-border);
    border-radius: var(--wig-cal-radius);
    min-width: 200px;
}

/* ── Loading ───────────────────────────────────────────────── */
.wig-cal-loading {
    text-align: center;
    color: var(--wig-cal-text-muted);
    font-style: italic;
    padding: 32px;
}
.wig-cal-content[aria-busy="true"] {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Monthly Grid ──────────────────────────────────────────── */
.wig-cal-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.wig-cal-grid__head {
    font-family: var(--wig-cal-font-ui);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wig-cal-text-muted);
    padding: 8px 4px;
    text-align: center;
    border-bottom: 2px solid var(--wig-cal-border);
}
.wig-cal-grid__cell {
    border: 1px solid var(--wig-cal-border);
    vertical-align: top;
    padding: 4px 6px;
    min-height: 80px;
    height: 100px;
    transition: background var(--wig-cal-transition);
}
.wig-cal-grid__cell:hover {
    background: var(--wig-cal-cream);
}
.wig-cal-grid__cell--empty {
    background: #fafaf8;
}
.wig-cal-grid__cell--today {
    background: rgba(197, 151, 59, 0.08);
    border-color: var(--wig-cal-gold);
}
.wig-cal-grid__cell--today .wig-cal-grid__day-num {
    background: var(--wig-cal-crimson);
    color: var(--wig-cal-white);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wig-cal-grid__day-num {
    font-family: var(--wig-cal-font-ui);
    font-size: 13px;
    font-weight: 500;
    color: var(--wig-cal-text);
    display: inline-block;
    margin-bottom: 4px;
}
.wig-cal-grid__events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wig-cal-grid__event {
    display: flex;
    gap: 4px;
    align-items: center;
    font-family: var(--wig-cal-font-ui);
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    color: var(--wig-cal-white);
    text-decoration: none;
    overflow: hidden;
    transition: opacity var(--wig-cal-transition);
}
.wig-cal-grid__event:hover {
    opacity: 0.85;
}
.wig-cal-grid__event-time {
    flex-shrink: 0;
    opacity: 0.85;
}
.wig-cal-grid__event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wig-cal-grid__more {
    font-family: var(--wig-cal-font-ui);
    font-size: 10px;
    color: var(--wig-cal-text-muted);
    padding: 1px 4px;
}

/* ── List / Agenda View ────────────────────────────────────── */
.wig-cal-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.wig-cal-list__date-head {
    font-family: var(--wig-cal-font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--wig-cal-brown);
    padding: 8px 0;
    border-bottom: 2px solid var(--wig-cal-gold);
    margin: 0 0 8px;
}
.wig-cal-list__item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--wig-cal-border);
}
.wig-cal-list__color {
    width: 4px;
    border-radius: 2px;
    align-self: stretch;
    flex-shrink: 0;
}
.wig-cal-list__title {
    font-family: var(--wig-cal-font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--wig-cal-brown);
    text-decoration: none;
}
.wig-cal-list__title:hover {
    color: var(--wig-cal-crimson);
}
.wig-cal-list__time {
    font-family: var(--wig-cal-font-ui);
    font-size: 13px;
    color: var(--wig-cal-text-muted);
}

/* ── Tile View ─────────────────────────────────────────────── */
.wig-cal-tile__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.wig-cal-tile__card {
    border: 1px solid var(--wig-cal-border);
    border-radius: var(--wig-cal-radius);
    overflow: hidden;
    background: var(--wig-cal-white);
    box-shadow: var(--wig-cal-shadow);
    transition: transform var(--wig-cal-transition), box-shadow var(--wig-cal-transition);
}
.wig-cal-tile__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(43, 24, 16, 0.12);
}
.wig-cal-tile__image {
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.wig-cal-tile__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}
.wig-cal-tile__date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.95);
    border-radius: var(--wig-cal-radius);
    padding: 8px 14px;
    box-shadow: var(--wig-cal-shadow);
}
.wig-cal-tile__month {
    font-family: var(--wig-cal-font-ui);
    font-size: 11px;
    text-transform: uppercase;
    color: var(--wig-cal-crimson);
    font-weight: 600;
}
.wig-cal-tile__day {
    font-family: var(--wig-cal-font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--wig-cal-brown);
    line-height: 1;
}
.wig-cal-tile__body {
    padding: 12px 16px;
}
.wig-cal-tile__title {
    font-family: var(--wig-cal-font-heading);
    font-size: 15px;
    margin: 0 0 6px;
}
.wig-cal-tile__title a {
    color: var(--wig-cal-brown);
    text-decoration: none;
}
.wig-cal-tile__title a:hover {
    color: var(--wig-cal-crimson);
}
.wig-cal-tile__meta {
    font-family: var(--wig-cal-font-ui);
    font-size: 12px;
    color: var(--wig-cal-text-muted);
}
.wig-cal-tile__cost {
    font-family: var(--wig-cal-font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--wig-cal-gold);
    margin-top: 6px;
}

/* ── Timeline View ─────────────────────────────────────────── */
.wig-cal-timeline {
    position: relative;
    padding: 24px 0;
}
.wig-cal-timeline__line {
    position: relative;
    padding-left: 30px;
}
.wig-cal-timeline__line::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--wig-cal-border);
}
.wig-cal-timeline__item {
    position: relative;
    padding: 0 0 24px 24px;
}
.wig-cal-timeline__dot {
    position: absolute;
    left: -22px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--wig-cal-white);
    box-shadow: 0 0 0 2px var(--wig-cal-border);
}
.wig-cal-timeline__date {
    font-family: var(--wig-cal-font-ui);
    font-size: 11px;
    text-transform: uppercase;
    color: var(--wig-cal-gold);
    font-weight: 600;
}
.wig-cal-timeline__title {
    font-family: var(--wig-cal-font-heading);
    font-size: 16px;
    margin: 4px 0;
    color: var(--wig-cal-brown);
}
.wig-cal-timeline__time {
    font-family: var(--wig-cal-font-ui);
    font-size: 13px;
    color: var(--wig-cal-text-muted);
}

/* ── Photo View (#16) ──────────────────────────────────────── */
.wig-cal-photo__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.wig-cal-photo__card {
    border-radius: var(--wig-cal-radius);
    overflow: hidden;
    box-shadow: var(--wig-cal-shadow);
    background: var(--wig-cal-white);
    transition: transform var(--wig-cal-transition);
}
.wig-cal-photo__card:hover {
    transform: scale(1.02);
}
.wig-cal-photo__image-wrap {
    position: relative;
    overflow: hidden;
}
.wig-cal-photo__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.wig-cal-photo__date-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.95);
    border-radius: var(--wig-cal-radius);
    padding: 6px 10px;
    text-align: center;
    box-shadow: var(--wig-cal-shadow);
}
.wig-cal-photo__month {
    display: block;
    font-family: var(--wig-cal-font-ui);
    font-size: 10px;
    text-transform: uppercase;
    color: var(--wig-cal-crimson);
    font-weight: 600;
}
.wig-cal-photo__day {
    display: block;
    font-family: var(--wig-cal-font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--wig-cal-brown);
    line-height: 1;
}
.wig-cal-photo__info {
    padding: 12px 16px;
}
.wig-cal-photo__title {
    font-family: var(--wig-cal-font-heading);
    font-size: 15px;
    margin: 0 0 4px;
}
.wig-cal-photo__title a {
    color: var(--wig-cal-brown);
    text-decoration: none;
}
.wig-cal-photo__meta {
    font-family: var(--wig-cal-font-ui);
    font-size: 12px;
    color: var(--wig-cal-text-muted);
}
.wig-cal-photo__venue::before {
    content: '·';
    margin: 0 4px;
}

/* ── Map View ──────────────────────────────────────────────── */
.wig-cal-map {
    height: 400px;
    border-radius: var(--wig-cal-radius);
    border: 1px solid var(--wig-cal-border);
}

/* ── Countdown View ────────────────────────────────────────── */
.wig-cal-countdown {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: var(--wig-cal-cream);
    border-radius: var(--wig-cal-radius);
}
.wig-cal-countdown__unit {
    text-align: center;
}
.wig-cal-countdown__number {
    font-family: var(--wig-cal-font-heading);
    font-size: 48px;
    font-weight: 700;
    color: var(--wig-cal-crimson);
    line-height: 1;
    display: block;
}
.wig-cal-countdown__label {
    font-family: var(--wig-cal-font-ui);
    font-size: 11px;
    text-transform: uppercase;
    color: var(--wig-cal-text-muted);
    letter-spacing: 0.05em;
}

/* ── Social Sharing (#42) ──────────────────────────────────── */
.wig-cal-social {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}
.wig-cal-social__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: all var(--wig-cal-transition);
    border: 1px solid var(--wig-cal-border);
    background: var(--wig-cal-white);
    color: var(--wig-cal-text-muted);
}
.wig-cal-social__btn:hover {
    background: var(--wig-cal-crimson);
    color: var(--wig-cal-white);
    border-color: var(--wig-cal-crimson);
}
.wig-cal-social__btn--twitter:hover  { background: #000; border-color: #000; }
.wig-cal-social__btn--facebook:hover { background: #1877F2; border-color: #1877F2; }
.wig-cal-social__btn--linkedin:hover { background: #0A66C2; border-color: #0A66C2; }

/* ── Widget Styles (#08) ───────────────────────────────────── */
.wig-cal-widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.wig-cal-widget-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--wig-cal-border);
}
.wig-cal-widget-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.wig-cal-widget-title {
    font-family: var(--wig-cal-font-heading);
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}
.wig-cal-widget-date {
    font-family: var(--wig-cal-font-ui);
    font-size: 12px;
    color: var(--wig-cal-text-muted);
    white-space: nowrap;
}

/* ── Registration / Waitlist Buttons ───────────────────────── */
.wig-cal-register-btn,
.wig-cal-waitlist-btn {
    font-family: var(--wig-cal-font-ui);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border: none;
    border-radius: var(--wig-cal-radius);
    cursor: pointer;
    transition: all var(--wig-cal-transition);
}
.wig-cal-btn--primary {
    background: var(--wig-cal-crimson);
    color: var(--wig-cal-white);
}
.wig-cal-btn--primary:hover {
    background: #6e1414;
}
.wig-cal-registered {
    background: #2e7d32;
    color: var(--wig-cal-white);
    cursor: default;
}
.wig-cal-on-waitlist {
    background: var(--wig-cal-gold);
    color: var(--wig-cal-white);
    cursor: default;
}
.wig-cal-btn--secondary {
    background: var(--wig-cal-cream);
    color: var(--wig-cal-brown);
    border: 1px solid var(--wig-cal-border);
}
.wig-cal-btn--secondary:hover {
    border-color: var(--wig-cal-gold);
}

/* ── Cost Display (#43) ────────────────────────────────────── */
.wig-cal-cost {
    font-family: var(--wig-cal-font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--wig-cal-gold);
}
.wig-cal-cost--free {
    color: #2e7d32;
}

/* ── Empty States ──────────────────────────────────────────── */
.wig-cal-empty {
    text-align: center;
    color: var(--wig-cal-text-muted);
    padding: 40px 20px;
    font-style: italic;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .wig-cal-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .wig-cal-grid__cell {
        height: auto;
        min-height: 40px;
        padding: 2px 4px;
    }
    .wig-cal-grid__event-time {
        display: none;
    }
    .wig-cal-tile__grid,
    .wig-cal-photo__grid {
        grid-template-columns: 1fr;
    }
    .wig-cal-countdown {
        flex-wrap: wrap;
        gap: 12px;
    }
    .wig-cal-countdown__number {
        font-size: 32px;
    }
}
@media (max-width: 480px) {
    .wig-cal-views {
        flex-wrap: wrap;
    }
    .wig-cal-view-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
}
