/* Photoclub Krasnodar - Main Stylesheet */
/* Design Guidelines: Neutral palette (#333, #ececec, #ff7a00), System fonts with Roboto fallback */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ececec;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Focus outline for accessibility (WCAG 2.1 AA) */
*:focus {
    outline: 2px solid #ff7a00;
    outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #ff7a00;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Header Styles */
header {
    background-color: #333;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
}

/* Navigation Styles */
nav {
    text-align: center;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    display: inline-block;
}

nav a:hover,
nav a:focus {
    background-color: #ff7a00;
    color: white;
}

nav a[aria-current="page"] {
    background-color: #ff7a00;
    font-weight: 600;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Section Styles */
section {
    margin-bottom: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #ff7a00;
    padding-bottom: 0.5rem;
}

/* Hero Section */
.hero {
    text-align: center;
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2rem;
    border-bottom: none;
    color: white;
}

.hero p {
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Events Section */
.events-list {
    display: grid;
    gap: 1.5rem;
}

.event-item {
    border: 1px solid #ddd;
    padding: 1.5rem;
    border-radius: 6px;
    background: #f9f9f9;
}

.event-item h3 {
    color: #ff7a00;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.event-date,
.event-location {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.event-description {
    margin-top: 1rem;
    line-height: 1.5;
}

/* Subscription Form */
.subscription-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    border-color: #ff7a00;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #666;
}

button[type="submit"] {
    background-color: #ff7a00;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button[type="submit"]:hover,
button[type="submit"]:focus {
    background-color: #e66a00;
}

/* Message Styles */
.message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Gallery Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.gallery-item img:hover,
.gallery-item img:focus {
    opacity: 0.9;
}

.image-info {
    padding: 1rem;
}

.image-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.image-info .author,
.image-info .date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.image-info .description {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: 0.5rem;
}

.no-images {
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover,
.lightbox-close:focus {
    background: rgba(0, 0, 0, 0.8);
}

#lightbox-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
}

.lightbox-info {
    padding: 1.5rem;
    background: white;
}

.lightbox-info h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.lightbox-nav {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.lightbox-nav button {
    background-color: #ff7a00;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.lightbox-nav button:hover,
.lightbox-nav button:focus {
    background-color: #e66a00;
}

/* Footer Styles */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: auto;
}

footer p {
    margin-bottom: 0.5rem;
}

.disclaimer {
    font-size: 0.9rem;
    color: #ccc;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    nav a {
        display: block;
        margin: 0.25rem 0;
        padding: 0.75rem;
    }
    
    main {
        padding: 1rem 0.5rem;
    }
    
    section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .lightbox-nav {
        flex-direction: column;
    }
    
    .lightbox-nav button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h2 {
        font-size: 1.3rem;
    }
    
    section h2 {
        font-size: 1.3rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    body {
        background-color: white;
        color: black;
    }
    
    section {
        border: 2px solid #333;
    }
    
    .form-group input {
        border: 2px solid #333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print styles */
@media print {
    header,
    footer,
    .subscription,
    .lightbox {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    section {
        box-shadow: none;
        border: 1px solid #333;
        page-break-inside: avoid;
    }
}