/**
 *------------------------------------------------------------------------+
 * {VHOST_ROOT}/public/css/tec-photo-override.css
 *
 * Copyright (c) 2002-2026 Elysian Labs
 * All rights reserved.
 *
 * Revision history at end of file.
 *------------------------------------------------------------------------+
 * TEC Photo View Overrides for Goodtown Events Card Styling
 *
 * Adapted from Goodtown Events plugin CSS with TEC-specific selectors.
 * Includes responsive grid layout, card styling, light/dark modes.
 *
 * @package    Elabs_Goodtown_Theme
 * @subpackage Elabs_Goodtown_Theme/public
 * @version    1.0.0
 *------------------------------------------------------------------------+
 */

/* ==========================================================================
   Remove Default TEC Photo View Styles
   ========================================================================== */

/* Hide TEC's default date tag - we use our own */
.tribe-events-pro-photo__event-date-tag {
    display: none !important;
}

/* ==========================================================================
   Grid Layout Configuration
   ========================================================================== */

.tribe-events-pro-photo {
    max-width: 1200px;
    margin: 30px auto !important;
    padding: 0 20px !important;
}

.tribe-events-pro-photo .tribe-events-pro-photo__events,
.tribe-events-pro-photo .tribe-common-g-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
    gap: 30px !important;
    align-items: stretch !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tribe-events-pro-photo .tribe-common-g-row--gutters {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.tribe-events-pro-photo .tribe-common-g-row--gutters > * {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.tribe-events-pro .tribe-events-pro-photo__event {
    margin-bottom: 0 !important;
}

/* Override TEC's tablet breakpoint margin */
@media (min-width: 768px) {
    .tribe-common--breakpoint-medium.tribe-events-pro .tribe-events-pro-photo__event {
        margin-bottom: 0 !important;
    }
}
@media (min-width: 768px) {
    .tribe-events-pro-photo .tribe-events-pro-photo__events,
    .tribe-events-pro-photo .tribe-common-g-row {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-auto-rows: auto !important;
        gap: 25px !important;
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .tribe-events-pro-photo .tribe-events-pro-photo__events,
    .tribe-events-pro-photo .tribe-common-g-row {
        grid-template-columns: repeat(3, 1fr) !important;
        grid-auto-rows: auto !important;
        gap: 25px !important;
    }
}

/* ==========================================================================
   GOODTOWN EVENT CARD - ADAPTED FROM GOODTOWN EVENTS
   ========================================================================== */

/* Event List Item */
.tribe-events-pro-photo__event {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 350px !important;
    width: 100% !important;
    max-width: none !important;
}

.tribe-common--breakpoint-medium.tribe-events-pro .tribe-events-pro-photo__event,
.tribe-common--breakpoint-full.tribe-events-pro .tribe-events-pro-photo__event {
    width: 100% !important;
    max-width: none !important;
}

/* Event Card */
.goodtown-event-card {
    background: #fff !important;
    border: 2px solid #ddd !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.4s ease, box-shadow 0.4s ease !important;
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    color: inherit !important;
    min-height: 420px !important;
    flex: 1 1 auto !important;
}

.goodtown-event-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    text-decoration: none !important;
}

/* Card Header */
.goodtown-event-card-header {
    display: flex !important;
    gap: 12px !important;
    padding: 15px !important;
    background: #f8f8f8 !important;
    border-bottom: 2px solid #ddd !important;
}

.goodtown-event-card-link {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    flex: 1 1 auto !important;
    align-items: stretch !important;
    text-decoration: none !important;
    color: inherit !important;
}

/* Date Box */
.goodtown-event-date-box {
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 70px !important;
    padding: 10px !important;
    background: #ef4327 !important;
    color: #fff !important;
    border-radius: 16px !important;
    text-align: center !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    border: 2px solid #ef4327 !important;
    transition: all 0.4s ease !important;
}

.goodtown-event-card:hover .goodtown-event-date-box {
    background: #000 !important;
    border-color: #000 !important;
}

.goodtown-event-date-day {
    display: block !important;
    font-size: 12px !important;
    letter-spacing: 0.5px !important;
}

.goodtown-event-date-number {
    display: block !important;
    font-size: 32px !important;
    margin: 5px 0 !important;
}

.goodtown-event-date-month {
    display: block !important;
    font-size: 14px !important;
    letter-spacing: 0.5px !important;
}

/* Title Box */
.goodtown-event-title-box {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.goodtown-event-title {
    margin: 0 0 8px 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #333 !important;
}

.goodtown-event-featured-badge {
    display: inline-block !important;
    background: #ffd700 !important;
    color: #000 !important;
    padding: 3px 8px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    margin-right: 6px !important;
    text-transform: uppercase !important;
    border: 1px solid #ffd700 !important;
}

.goodtown-event-soldout-badge {
    display: inline-block !important;
    background: #dc3232 !important;
    color: #fff !important;
    padding: 3px 8px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    border: 1px solid #dc3232 !important;
}

/* Image Wrapper - 16:9 ratio */
.goodtown-event-image-wrapper {
    position: relative !important;
    width: 100% !important;
    padding-bottom: 56.25% !important; /* 16:9 aspect ratio */
    overflow: hidden !important;
    background: #f0f0f0 !important;
    display: block !important;
}

.goodtown-event-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition: opacity 0.3s ease !important;
}

.goodtown-event-card:hover .goodtown-event-image {
    opacity: 0.8 !important;
}

.goodtown-event-image-placeholder {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #e0e0e0 !important;
}

.goodtown-event-image-placeholder .dashicons {
    font-size: 64px !important;
    width: 64px !important;
    height: 64px !important;
    color: #999 !important;
}

/* Card Body */
.goodtown-event-card-body {
    padding: 16px 14px !important;
    background: #fff !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

/* Override TEC Pro order properties */
.goodtown-event-card-body > * {
    order: initial !important;
}

/* Set explicit order for Goodtown elements */
.goodtown-event-datetime {
    order: 1 !important;
}

.goodtown-event-price {
    order: 2 !important;
}

.goodtown-event-location {
    order: 3 !important;
}

.goodtown-event-category {
    order: 4 !important;
}

.goodtown-event-button {
    order: 99 !important;
}

.goodtown-event-datetime {
    margin-bottom: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #333 !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

.goodtown-event-date {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
}

.goodtown-event-date .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
}

.goodtown-event-time {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
}

.goodtown-event-time .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
}

/* Category Badge */
.goodtown-event-category {
    margin: 4px 0 0 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.goodtown-event-category-badge {
    display: inline-block !important;
    padding: 5px 12px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.goodtown-event-card:hover .goodtown-event-category-badge {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px) !important;
}

.goodtown-event-price {
    margin-bottom: 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #ef4327 !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
}

.goodtown-event-price .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
}

.goodtown-event-location {
    margin: 4px 0 0 0 !important;
    font-size: 14px !important;
    color: #666 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
}

.goodtown-event-location .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    color: #666 !important;
}

/* Button */
.goodtown-event-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 12px 18px !important;
    background: #ef4327 !important;
    color: #fff !important;
    text-align: center !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border-radius: 32px !important;
    border: 2px solid #ef4327 !important;
    transition: all 0.4s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-top: auto !important;
    cursor: pointer !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
}

.goodtown-event-card:hover .goodtown-event-button {
    background: #000 !important;
    border-color: #000 !important;
}

/* ==========================================================================
   LIGHT MODE STYLES
   ========================================================================== */

.goodtown-events-light .goodtown-event-card {
    background: #fff !important;
    border-color: #ddd !important;
    color: #333 !important;
}

.goodtown-events-light .goodtown-event-card-header {
    background: #f8f8f8 !important;
    border-bottom-color: #ddd !important;
}

.goodtown-events-light .goodtown-event-title {
    color: #333 !important;
}

.goodtown-events-light .goodtown-event-card-body {
    background: #fff !important;
}

.goodtown-events-light .goodtown-event-datetime {
    color: #333 !important;
}

.goodtown-events-light .goodtown-event-location {
    color: #666 !important;
}

.goodtown-events-light .goodtown-event-location .dashicons {
    color: #666 !important;
}

.goodtown-events-light .goodtown-event-image-placeholder {
    background: #e0e0e0 !important;
}

.goodtown-events-light .goodtown-event-image-placeholder .dashicons {
    color: #999 !important;
}

/* ==========================================================================
   DARK MODE STYLES
   ========================================================================== */

.goodtown-events-dark .goodtown-event-card {
    background: #1a1a1a !important;
    border-color: #333 !important;
    color: #fff !important;
}

.goodtown-events-dark .goodtown-event-card:hover {
    box-shadow: 0 4px 16px rgba(239, 67, 39, 0.3) !important;
}

.goodtown-events-dark .goodtown-event-card-header {
    background: #0f0f0f !important;
    border-bottom-color: #333 !important;
}

.goodtown-events-dark .goodtown-event-title {
    color: #fff !important;
}

.goodtown-events-dark .goodtown-event-card-body {
    background: #1a1a1a !important;
}

.goodtown-events-dark .goodtown-event-datetime {
    color: #fff !important;
}

.goodtown-events-dark .goodtown-event-location {
    color: #999 !important;
}

.goodtown-events-dark .goodtown-event-location .dashicons {
    color: #999 !important;
}

.goodtown-events-dark .goodtown-event-image-placeholder {
    background: #0f0f0f !important;
}

.goodtown-events-dark .goodtown-event-image-placeholder .dashicons {
    color: #333 !important;
}

.goodtown-events-dark .goodtown-event-card:hover .goodtown-event-date-box {
    background: #c23319 !important;
    border-color: #c23319 !important;
}

.goodtown-events-dark .goodtown-event-card:hover .goodtown-event-button {
    background: #c23319 !important;
    border-color: #c23319 !important;
}

/* ==========================================================================
   TEC Navigation & Pagination Styling
   ========================================================================== */

.tribe-events-pro-photo .tribe-events-c-nav {
    margin-top: 30px;
    padding: 20px 0;
}

.tribe-events-pro-photo .tribe-events-c-nav__list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* ==========================================================================
   Loading State & Empty State
   ========================================================================== */

.tribe-events-pro-photo.tribe-common--loading {
    opacity: 0.6;
    pointer-events: none;
}

.tribe-events-pro-photo .tribe-events-pro-photo__event-placeholder {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */

.tribe-events-pro-photo__event .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
.tribe-events-pro-photo__event .goodtown-event-card-link:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

.rtl .tribe-events-pro-photo .tribe-events-pro-photo__events {
    direction: rtl;
}

.rtl .goodtown-event-datetime,
.rtl .goodtown-event-price,
.rtl .goodtown-event-location {
    direction: rtl;
    text-align: right;
}

/* ==========================================================================
   Accessibility & Keyboard Navigation
   ========================================================================== */

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

/* Focus visible for keyboard navigation */
.goodtown-event-card-link:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .tribe-events-pro-photo .tribe-events-pro-photo__events {
        grid-template-columns: 1fr !important;
    }

    .goodtown-event-card-link {
        color: #000 !important;
        text-decoration: none !important;
    }
}

/*------------------------------------------------------------------------+
 * Revision History
 *------------------------------------------------------------------------+
 * 2026-02-16 • Darren Debono
 * Add TEC Category Colours support with coloured category badges.
 * Fix card size and spacing issues in the grid layout.
 *------------------------------------------------------------------------+
 * 2026-02-15 • Darren Debono
 * Fix margin and padding issues in the grid layout.
 * - added !important to ensure overrides work correctly.
 *------------------------------------------------------------------------+
 * 2026-02-10 • Darren Debono
 * Integrated complete Goodtown Events card styling into TEC Photo View.
 * Added light and dark mode support with wrapper classes.
 * Includes grid layout, card design, buttons, and badges from Goodtown.
 * Updated for full TEC Photo View compatibility.
 *------------------------------------------------------------------------+
 */
