/**
 * Traffic Camera Gallery Styles for Elm City Daily
 */

/* Header section */
.cams-header {
    margin-bottom: 1.5rem;
}

.cams-intro {
    margin: 0.5rem 0;
    color: var(--muted-ink, #666);
    font-size: 14px;
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cams-attribution {
    margin: 0.5rem 0;
    font-size: 12px;
    color: var(--muted-ink, #666);
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cams-attribution a {
    color: var(--accent, #0066cc);
    text-decoration: underline;
}

/* Camera grid */
.cam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .cam-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .cam-grid {
        grid-template-columns: 1fr;
    }
}

/* Camera card */
.cam-card {
    cursor: pointer;
    border: 1px solid var(--line, #ddd);
    border-radius: 4px;
    padding: 0;
    text-align: center;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cam-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cam-card:focus {
    outline: 2px solid var(--accent, #0066cc);
    outline-offset: 2px;
}

.cam-card__image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #f0f0f0;
    overflow: hidden;
}

.cam-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cam-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    pointer-events: none;
}

.cam-card:hover .cam-card__overlay {
    background: rgba(0, 0, 0, 0.3);
}

.cam-card__click-hint {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cam-card:hover .cam-card__click-hint {
    opacity: 1;
}

.cam-card__info {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cam-label {
    margin: 0 0 0.5rem 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cam-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.cam-highway {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent, #0066cc);
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cam-direction {
    font-size: 11px;
    color: var(--muted-ink, #666);
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cam-location {
    font-size: 11px;
    color: var(--muted-ink, #666);
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin-top: 0.25rem;
}

/* Error state */
.cam-error {
    padding: 2rem;
    text-align: center;
    color: var(--muted-ink, #666);
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Modal */
.cam-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
}

.cam-modal-content {
    background: #fff;
    padding: 1.5rem;
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.cam-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    background: none;
    border: none;
    color: #666;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
    z-index: 10;
}

.cam-close:hover {
    color: #000;
}

.cam-close:focus {
    outline: 2px solid var(--accent, #0066cc);
    outline-offset: 2px;
    border-radius: 2px;
}

.cam-modal-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: "Newsreader", Georgia, Cambria, "Times New Roman", Times, serif;
    color: #333;
}

.cam-modal-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    font-size: 13px;
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cam-modal-highway {
    font-weight: 600;
    color: var(--accent, #0066cc);
}

.cam-modal-direction {
    color: var(--muted-ink, #666);
}

.cam-modal-location {
    color: var(--muted-ink, #666);
}

.cam-modal-image-wrapper {
    flex: 1;
    min-height: 300px;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.cam-modal-image {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    display: block;
}

.cam-modal-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--line, #ddd);
}

.cam-modal-source {
    margin: 0 0 0.5rem 0;
    font-size: 12px;
    color: var(--muted-ink, #666);
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cam-modal-source a {
    color: var(--accent, #0066cc);
    text-decoration: underline;
}

.cam-modal-note {
    margin: 0;
    font-size: 11px;
    color: var(--muted-ink, #666);
    font-style: italic;
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Loading state */
.cam-card__image[src=""] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

