/**
 * Polaris Locations Stylesheet
 * 
 * Styles for the 'campus_locations' shortcode output
 * Design based on Polaris Academy brand colors and style
 */

/* Variables */
:root {
    --polaris-navy: #272b74; /* Deep navy blue from logo/header */
    --polaris-blue: #2e3192; /* Slightly lighter navy blue */
    --polaris-yellow: #ffc107; /* CTA button yellow */
    --polaris-teal: #4dd0e1; /* Accent color from background elements */
    --polaris-white: #ffffff;
    --polaris-light-gray: #f5f5f5;
    --polaris-gray: #e0e0e0;
    --polaris-text: #333333;
    --card-radius: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Enable smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Add padding to account for fixed headers */
}

/* Ensure the top anchor works across themes */
#polaris-locations-top-anchor {
    display: block;
    position: relative;
    visibility: hidden;
    top: -80px; /* Larger offset to account for fixed headers */
    height: 1px;
    width: 1px;
}

/* Container */
.polaris-locations-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 40px;
    font-family: inherit;
    color: var(--polaris-text);
}

/* Map container styling */
#polaris-locations-map-container {
    margin-bottom: 40px;
}

/* Grid Layout */
.polaris-locations-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Responsive Grid */
@media (min-width: 576px) {
    .polaris-locations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .polaris-locations-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Location Cards */
.polaris-location-card {
    border-radius: var(--card-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--polaris-white);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--polaris-gray);
}

.polaris-location-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Location Image Container */
.polaris-location-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background-color: var(--polaris-light-gray);
}

.polaris-location-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.polaris-location-card:hover .polaris-location-thumb {
    transform: scale(1.05);
}

/* Status Badge */
.polaris-location-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.polaris-status-open {
    background-color: var(--polaris-yellow);
    color: var(--polaris-navy);
}

.polaris-status-coming-soon {
    background-color: var(--polaris-navy);
    color: var(--polaris-white);
}

/* Location Details */
.polaris-location-details {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--polaris-white);
}

.polaris-location-title {
    margin: 0 0 15px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--polaris-navy);
    border-bottom: 2px solid var(--polaris-yellow);
    padding-bottom: 10px;
}

.polaris-location-address,
.polaris-location-hours,
.polaris-location-phone,
.polaris-location-email,
.polaris-location-age-group,
.polaris-location-description {
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.5;
}

.polaris-location-description-container {
    margin-top: 15px;
}

.polaris-location-read-more {
    background-color: var(--polaris-navy);
    color: var(--polaris-white);
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.polaris-location-read-more:hover {
    background-color: var(--polaris-blue);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.polaris-location-description {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--polaris-gray);
}

.polaris-location-description p {
    margin-bottom: 15px;
}

.polaris-location-details strong {
    color: var(--polaris-navy);
    font-weight: 600;
}

.polaris-location-details a {
    color: var(--polaris-blue);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.polaris-location-details a:hover {
    color: var(--polaris-navy);
    border-bottom: 1px solid var(--polaris-navy);
}

/* Google Map */
.polaris-locations-map {
    width: 100%;
    border-radius: var(--card-radius);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--polaris-gray);
}

.polaris-locations-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 25px;
    background: var(--polaris-navy);
    color: var(--polaris-white);
    border-radius: 30px;
    font-weight: bold;
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Empty State */
.polaris-locations-empty {
    padding: 40px;
    text-align: center;
    background-color: var(--polaris-light-gray);
    border-radius: var(--card-radius);
    color: var(--polaris-navy);
    font-weight: 600;
    font-size: 16px;
    box-shadow: var(--shadow);
}

/* Google Maps Info Window Styling */
.polaris-location-info-window {
    padding: 5px;
    max-width: 250px;
    font-family: inherit;
}

.polaris-location-info-window h3 {
    margin: 0 0 8px;
    color: var(--polaris-navy);
    font-weight: 700;
    font-size: 16px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--polaris-yellow);
}

.polaris-location-info-window p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

.polaris-location-info-window strong {
    color: var(--polaris-blue);
    font-weight: 600;
}
