/**
 * Museum Template Framework CSS
 * 
 * Main styling framework for museum templates, built on the Automuseums brand design system.
 * Uses CSS custom properties from museum-variables.css for consistent theming.
 * 
 * @package Astra-Child
 * @since 1.0.0
 * @author Synergy Marketing info@synergymarekting.mk
 */

/* ============================================
   RESET & BASE STYLES
   ========================================= */

/* Museum template reset */
.automuseums-brand *,
.automuseums-brand *::before,
.automuseums-brand *::after {
    box-sizing: border-box;
}

.automuseums-brand {
    font-family: var(--am-font-body);
    line-height: var(--am-leading-normal);
    color: var(--am-steel-gray-dark);
    background-color: var(--am-ivory-white);
}

/* Improved text rendering */
.automuseums-brand {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================
   TYPOGRAPHY FRAMEWORK
   ========================================= */

/* Headings */
.automuseums-brand h1,
.automuseums-brand h2,
.automuseums-brand h3,
.automuseums-brand h4,
.automuseums-brand h5,
.automuseums-brand h6 {
    font-family: var(--am-font-heading);
    font-weight: var(--am-weight-semibold);
    color: var(--am-heritage-blue);
    line-height: var(--am-leading-tight);
    margin-bottom: var(--am-space-md);
}

.automuseums-brand h1 {
    font-size: var(--am-text-4xl);
    font-weight: var(--am-weight-bold);
}

.automuseums-brand h2 {
    font-size: var(--am-text-2xl);
}

.automuseums-brand h3 {
    font-size: var(--am-text-xl);
}

.automuseums-brand h4 {
    font-size: var(--am-text-lg);
}

.automuseums-brand h5,
.automuseums-brand h6 {
    font-size: var(--am-text-base);
    font-weight: var(--am-weight-medium);
}

/* Paragraphs and text */
.automuseums-brand p {
    margin-bottom: var(--am-space-lg);
    line-height: var(--am-leading-relaxed);
}

.automuseums-brand p:last-child {
    margin-bottom: 0;
}

/* Links */
.automuseums-brand a {
    color: var(--am-engine-red);
    text-decoration: underline;
    transition: color var(--am-duration-fast) var(--am-ease-in-out);
}

.automuseums-brand a:hover {
    color: var(--am-amber-yellow);
}

.automuseums-brand a:focus {
    outline: 2px solid var(--am-heritage-blue);
    outline-offset: 2px;
}

/* ============================================
   SECTION FRAMEWORK
   ========================================= */

/* Base section styling */
.museum-section {
    background: var(--am-card-bg);
    border-left: 4px solid var(--am-card-accent);
    border-radius: var(--am-card-radius);
    padding: var(--am-card-padding);
    margin-bottom: var(--am-space-xl);
    box-shadow: var(--am-card-shadow);
    transition: all var(--am-duration-normal) var(--am-ease-in-out);
    position: relative;
    overflow: hidden;
}

.museum-section:hover {
    box-shadow: var(--am-card-shadow-hover);
    transform: translateY(-2px);
}

.museum-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        var(--am-heritage-blue),
        var(--am-engine-red),
        var(--am-amber-yellow)
    );
    opacity: 0;
    transition: opacity var(--am-duration-normal) var(--am-ease-in-out);
}

.museum-section:hover::before {
    opacity: 1;
}

/* Section titles */
.museum-section-title {
    font-family: var(--am-font-heading);
    font-size: var(--am-text-2xl);
    font-weight: var(--am-weight-semibold);
    color: var(--am-heritage-blue);
    margin-bottom: var(--am-space-lg);
    padding-bottom: var(--am-space-sm);
    border-bottom: 2px solid var(--am-amber-yellow);
    display: flex;
    align-items: center;
    gap: var(--am-space-sm);
}

.museum-section-title .section-icon {
    font-size: var(--am-text-xl);
}

/* ============================================
   FIELD FRAMEWORK
   ========================================= */

/* Base field styling */
.museum-field {
    display: flex;
    flex-direction: column;
    gap: var(--am-space-xs);
    padding: var(--am-space-sm) 0;
    border-bottom: 1px solid rgba(90, 90, 90, 0.1);
}

.museum-field:last-child {
    border-bottom: none;
}

/* Field labels */
.museum-label {
    font-family: var(--am-font-body);
    font-size: var(--am-text-sm);
    font-weight: var(--am-weight-medium);
    color: var(--am-steel-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Field values */
.museum-value {
    font-family: var(--am-font-body);
    font-size: var(--am-text-base);
    color: var(--am-steel-gray-dark);
    line-height: var(--am-leading-normal);
}

/* ============================================
   BUTTON FRAMEWORK
   ========================================= */

/* Base button styles */
.museum-btn,
.museum-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--am-space-sm);
    padding: var(--am-btn-padding-y) var(--am-btn-padding-x);
    border: 2px solid transparent;
    border-radius: var(--am-btn-radius);
    font-family: var(--am-font-body);
    font-size: var(--am-text-sm);
    font-weight: var(--am-weight-semibold);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--am-duration-normal) var(--am-ease-in-out);
    position: relative;
    overflow: hidden;
}

/* Button variants */
.museum-btn-primary,
.museum-cta-primary {
    background-color: var(--am-btn-primary-bg);
    color: var(--am-btn-primary-text);
}

.museum-btn-primary:hover,
.museum-cta-primary:hover {
    background-color: var(--am-btn-primary-hover);
    color: var(--am-heritage-blue);
    transform: translateY(-2px);
    box-shadow: var(--am-shadow-lg);
}

.museum-btn-secondary,
.museum-cta-secondary {
    background-color: var(--am-btn-secondary-bg);
    color: var(--am-btn-secondary-text);
}

.museum-btn-secondary:hover,
.museum-cta-secondary:hover {
    background-color: var(--am-btn-secondary-hover);
    transform: translateY(-2px);
}

.museum-btn-outline {
    background-color: transparent;
    color: var(--am-heritage-blue);
    border-color: var(--am-heritage-blue);
}

.museum-btn-outline:hover {
    background-color: var(--am-heritage-blue);
    color: #ffffff;
}

/* Button animations */
.museum-btn::before,
.museum-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--am-duration-slow) var(--am-ease-in-out);
}

.museum-btn:hover::before,
.museum-cta:hover::before {
    left: 100%;
}

/* ============================================
   TAG FRAMEWORK
   ========================================= */

/* Base tag styles */
.museum-tag,
.vehicle-type-tag,
.location-tag {
    display: inline-block;
    padding: var(--am-space-xs) var(--am-space-sm);
    border-radius: var(--am-radius-sm);
    font-size: var(--am-text-xs);
    font-weight: var(--am-weight-medium);
    text-transform: capitalize;
    transition: all var(--am-duration-fast) var(--am-ease-in-out);
}

/* Tag variants */
.vehicle-type-tag {
    background-color: var(--am-heritage-blue);
    color: #ffffff;
}

.vehicle-type-tag:hover {
    background-color: var(--am-heritage-blue-light);
    transform: translateY(-1px);
}

.location-tag {
    background: linear-gradient(135deg, var(--am-racing-green), #2A5F4A);
    color: #ffffff;
}

.location-tag:hover {
    transform: translateY(-1px);
    box-shadow: var(--am-shadow-sm);
}

/* ============================================
   GRID & LAYOUT FRAMEWORK
   ========================================= */

/* Grid container */
.museum-info-grid {
    display: grid;
    gap: var(--am-space-xl);
    margin-bottom: var(--am-space-3xl);
}

/* Responsive grid */
@media (min-width: 768px) {
    .museum-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: var(--am-space-2xl);
    }
}

@media (min-width: 1024px) {
    .museum-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        gap: var(--am-space-2xl);
    }
    
    /* Full-width sections on larger screens */
    .museum-social,
    .museum-map {
        grid-column: 1 / -1;
    }
}

/* Field layout for larger screens */
@media (min-width: 768px) {
    .museum-field {
        flex-direction: row;
        align-items: flex-start;
        gap: var(--am-space-lg);
    }
    
    .museum-label {
        flex: 0 0 200px;
        text-align: right;
        padding-top: var(--am-space-xs);
    }
    
    .museum-value {
        flex: 1;
    }
}

/* ============================================
   UTILITY CLASSES
   ========================================= */

/* Spacing utilities */
.am-mb-0 { margin-bottom: 0; }
.am-mb-xs { margin-bottom: var(--am-space-xs); }
.am-mb-sm { margin-bottom: var(--am-space-sm); }
.am-mb-md { margin-bottom: var(--am-space-md); }
.am-mb-lg { margin-bottom: var(--am-space-lg); }
.am-mb-xl { margin-bottom: var(--am-space-xl); }
.am-mb-2xl { margin-bottom: var(--am-space-2xl); }
.am-mb-3xl { margin-bottom: var(--am-space-3xl); }

.am-mt-0 { margin-top: 0; }
.am-mt-xs { margin-top: var(--am-space-xs); }
.am-mt-sm { margin-top: var(--am-space-sm); }
.am-mt-md { margin-top: var(--am-space-md); }
.am-mt-lg { margin-top: var(--am-space-lg); }
.am-mt-xl { margin-top: var(--am-space-xl); }
.am-mt-2xl { margin-top: var(--am-space-2xl); }
.am-mt-3xl { margin-top: var(--am-space-3xl); }

/* Text utilities */
.am-text-center { text-align: center; }
.am-text-left { text-align: left; }
.am-text-right { text-align: right; }

.am-font-heading { font-family: var(--am-font-heading); }
.am-font-body { font-family: var(--am-font-body); }
.am-font-mono { font-family: var(--am-font-mono); }

.am-text-xs { font-size: var(--am-text-xs); }
.am-text-sm { font-size: var(--am-text-sm); }
.am-text-base { font-size: var(--am-text-base); }
.am-text-lg { font-size: var(--am-text-lg); }
.am-text-xl { font-size: var(--am-text-xl); }
.am-text-2xl { font-size: var(--am-text-2xl); }
.am-text-3xl { font-size: var(--am-text-3xl); }

.am-weight-normal { font-weight: var(--am-weight-normal); }
.am-weight-medium { font-weight: var(--am-weight-medium); }
.am-weight-semibold { font-weight: var(--am-weight-semibold); }
.am-weight-bold { font-weight: var(--am-weight-bold); }

/* Color utilities */
.am-text-heritage-blue { color: var(--am-heritage-blue); }
.am-text-steel-gray { color: var(--am-steel-gray); }
.am-text-engine-red { color: var(--am-engine-red); }
.am-text-amber-yellow { color: var(--am-amber-yellow); }
.am-text-racing-green { color: var(--am-racing-green); }

.am-bg-heritage-blue { background-color: var(--am-heritage-blue); }
.am-bg-steel-gray { background-color: var(--am-steel-gray); }
.am-bg-ivory-white { background-color: var(--am-ivory-white); }
.am-bg-engine-red { background-color: var(--am-engine-red); }
.am-bg-amber-yellow { background-color: var(--am-amber-yellow); }

/* Display utilities */
.am-flex { display: flex; }
.am-inline-flex { display: inline-flex; }
.am-grid { display: grid; }
.am-block { display: block; }
.am-inline-block { display: inline-block; }
.am-hidden { display: none; }

/* Flexbox utilities */
.am-items-center { align-items: center; }
.am-items-start { align-items: flex-start; }
.am-items-end { align-items: flex-end; }
.am-justify-center { justify-content: center; }
.am-justify-between { justify-content: space-between; }
.am-justify-around { justify-content: space-around; }

.am-gap-xs { gap: var(--am-space-xs); }
.am-gap-sm { gap: var(--am-space-sm); }
.am-gap-md { gap: var(--am-space-md); }
.am-gap-lg { gap: var(--am-space-lg); }
.am-gap-xl { gap: var(--am-space-xl); }

/* Border utilities */
.am-rounded-sm { border-radius: var(--am-radius-sm); }
.am-rounded-md { border-radius: var(--am-radius-md); }
.am-rounded-lg { border-radius: var(--am-radius-lg); }
.am-rounded-xl { border-radius: var(--am-radius-xl); }

/* Shadow utilities */
.am-shadow-sm { box-shadow: var(--am-shadow-sm); }
.am-shadow-md { box-shadow: var(--am-shadow-md); }
.am-shadow-lg { box-shadow: var(--am-shadow-lg); }
.am-shadow-xl { box-shadow: var(--am-shadow-xl); }

/* ============================================
   COMPONENT-SPECIFIC STYLES
   ========================================= */

/* External link icons */
.external-link-icon {
    font-size: 0.8em;
    opacity: 0.7;
    transition: opacity var(--am-duration-fast) var(--am-ease-in-out);
}

a:hover .external-link-icon {
    opacity: 1;
}

/* Loading states */
.museum-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--am-space-xl);
    color: var(--am-steel-gray);
}

.museum-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--am-steel-gray-light);
    border-top: 2px solid var(--am-heritage-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: var(--am-space-sm);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error states */
.museum-error {
    background-color: #fef2f2;
    border-left: 4px solid var(--am-error);
    color: #991b1b;
    padding: var(--am-space-lg);
    border-radius: var(--am-radius-md);
    margin-bottom: var(--am-space-lg);
}

.museum-error-title {
    font-weight: var(--am-weight-semibold);
    margin-bottom: var(--am-space-sm);
}

/* Success states */
.museum-success {
    background-color: #f0fdf4;
    border-left: 4px solid var(--am-success);
    color: #166534;
    padding: var(--am-space-lg);
    border-radius: var(--am-radius-md);
    margin-bottom: var(--am-space-lg);
}

/* ============================================
   RESPONSIVE DESIGN
   ========================================= */

/* Mobile optimizations */
@media (max-width: 640px) {
    .museum-section {
        padding: var(--am-space-lg);
        margin-bottom: var(--am-space-lg);
    }
    
    .museum-section-title {
        font-size: var(--am-text-xl);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--am-space-xs);
    }
    
    .museum-btn,
    .museum-cta {
        width: 100%;
        justify-content: center;
        padding: var(--am-space-sm) var(--am-space-md);
    }
    
    .museum-field {
        padding: var(--am-space-xs) 0;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1023px) {
    .museum-info-grid {
        grid-template-columns: 1fr;
        gap: var(--am-space-xl);
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================= */

/* Focus indicators */
.museum-btn:focus,
.museum-cta:focus,
button:focus {
    outline: 2px solid var(--am-heritage-blue);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .museum-section,
    .museum-btn,
    .museum-cta,
    .museum-tag,
    .vehicle-type-tag,
    .location-tag {
        transition: none;
    }
    
    .museum-spinner {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .museum-section {
        border: 2px solid var(--am-steel-gray-dark);
    }
    
    .museum-btn,
    .museum-cta {
        border-width: 3px;
    }
}

/* Print styles */
@media print {
    .automuseums-brand {
        background: white;
        color: black;
    }
    
    .museum-section {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
    }
    
    .museum-btn,
    .museum-cta,
    .external-link-icon {
        display: none;
    }
    
    .museum-section-title {
        border-bottom: 2px solid #ccc;
    }
}