/* Live cams (/cam): templates/cam.html.twig + js/cam.js. Bump ?v= in the template after edits. */
.cam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.cam-tile {
    margin: 0;
}

/* the live cam jumps to the top at full width; the rest stay as previews */
.cam-tile.live {
    grid-column: 1 / -1;
    order: -1;
}

.cam-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #2d3436;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.cam-tile.live .cam-stage {
    border-color: #4a7c59;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.cam-stage .cam-poster,
.cam-stage video-stream {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

article .cam-stage .cam-poster {
    object-fit: cover;
    margin: 0;
    border-radius: 0;
    cursor: pointer;
}

article .cam-stage .cam-poster:not([src]) {
    visibility: hidden;
}

.cam-stage video-stream video {
    object-fit: contain;
}

.cam-btn {
    position: absolute;
    z-index: 2;
    border: 0;
    border-radius: 50%;
    background: rgba(45,80,22,0.85);
    color: white;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.3s, background 0.3s;
}

.cam-btn:hover {
    background: #4a7c59;
}

.cam-btn[hidden],
article .cam-stage .cam-poster[hidden] {
    display: none;
}

.cam-play {
    left: 50%;
    top: 50%;
    width: 72px;
    height: 72px;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.cam-play:hover {
    transform: translate(-50%, -50%) scale(1.06);
}

.cam-stop {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
}

.cam-tile figcaption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.6rem;
    margin-top: 0.75rem;
    color: #636e72;
}

.cam-tile figcaption strong {
    color: #2d5016;
    font-size: 1.15rem;
}

.cam-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: #e8f5e9;
    color: #4a7c59;
}

.cam-tile.live .cam-status {
    background: #d63031;
    color: white;
}
