#pano {
    width: 1200px;
    height: 400px;
}
* {
    box-sizing: border-box;
}
html, body {
    height: 100vh;
    max-height: 100vh;
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    padding: 0;
}
body {
    display: flex;
    flex-direction: column; 
    background: #eeeeee;
    font-family: 'Inter', 'Segoe UI', 'Roboto', Arial, sans-serif;
    color: #222;
}
header, nav, footer, main {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
}
header, nav, footer {
    flex: 0 0 auto;
    padding: 1rem;
}
main {
    flex: 1;
    display: flex;
    flex-flow: row wrap;
    justify-content: space-evenly;
    position: relative;
    width: 100%;
    min-height: 0;
    overflow-y: auto;
}
h3 {
    width: 100%;
    padding: 1ex;
    text-align: center;
    font-size: x-large;
    font-variant: small-caps;
    color: #164b16;
}
  


/* Add a black background color to the top navigation */

nav {
    background: #222;
    box-shadow: 0 2px 8px rgba(36, 120, 37, 0.15);
    border-radius: 0 0 16px 16px;
    padding: 0 clamp(10px, 3vw, 20px);
    display: flex;
    -webkit-box-shadow: 20px 20px 30px 0px rgba(0,0,0,0.75);
    -moz-box-shadow: 20px 20px 30px 0px rgba(0,0,0,0.75);
    box-shadow: 20px 20px 30px 0px rgba(0,0,0,0.75);
    min-height: clamp(42px, 6.5vh, 56px);
    align-items: center;
}

/* Style the links inside the navigation bar */

nav > * {
    color: #fff;
    padding: clamp(6px, 1.2vh, 12px) clamp(10px, 2.5vw, 24px);
    text-decoration: none;
    font-size: clamp(0.75rem, 1.9vw, 1.05rem);
    font-family: inherit;
    font-weight: 500;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    margin: 0 clamp(2px, 0.6vw, 4px);
    line-height: 1.1;
}

/* Change the color of links on hover */

nav > a:not(.current):hover {
    background: #fff;
    color: #247825;
}

/* Add a color to the active/current link */

nav > .current {
    color: #30dd32;
}


/*background-color: #283966;*/

/* Centered text */
.centered {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    color:white;
    font-size: 30px;
    font-family:  serif;
    font-weight: bolder;
 }


header {
    width: 100%;
    background: linear-gradient(90deg, #247825 0%, #164b16 100%);
    color: #fff;
    text-align: center;
    font-weight: 700;
    /* Responsive font size: scales down on small screens, capped at 2.5rem */
    font-size: clamp(1.0rem, 3.2vw + 0.2rem, 2.3rem);
    font-family: 'Montserrat', 'Verdana', 'Geneva', sans-serif;
    letter-spacing: 2px;
    /* Responsive vertical padding */
    padding: clamp(6px, 2vh, 28px) 0 clamp(3px, 1.0vh, 14px) 0;
    box-shadow: 0 4px 24px rgba(36, 120, 37, 0.12);
    font-variant: small-caps;
    flex-shrink: 0;
    flex-grow: 0;

    /* Keep on one line and avoid wrapping */
    white-space: nowrap;
    overflow: hidden;          /* prevent multi-line wrap overflow */
    text-overflow: ellipsis;   /* fallback if it still doesn't fit */
    
    /* Add positioning context for absolute children */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
header h1 {
    font-size: inherit;
}

header img {
    vertical-align: middle;
    margin-left: 16px;
    height: clamp(22px, 1.5em, 44px) !important; /* scale with text size */
    width: auto;
    position: absolute;  /* Change from float to absolute */
    left: clamp(6px, 2vw, 16px);
    top: 50%;
    transform: translateY(-50%);
}

/* Fine-tune spacing on narrower screens */
@media (max-width: 768px) {
    .head {
        letter-spacing: 1px;
    }
}
@media (max-width: 480px) {
    .head {
        letter-spacing: 0.5px;
    }
}

caption, .caption{
    text-align: center;
    font-weight: bolder;
    font-size: larger;
    font-variant: small-caps ;
    font-family:  serif;
    color: #555555;
}
caption{
    caption-side: top;
    flex:0 0 auto;
}

/*
.widget, .graph, .all_sky, .graph_group, .roof_cam {
    border-radius: 18px;
    border: none;
    background: #fff;
    margin: 18px;
    padding: 24px 18px;
    -webkit-box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.5);
    -moz-box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.5);
    box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.5);
    transition: box-shadow 0.2s, transform 0.2s;
} */

.graph {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    width: min(95%, calc(50vh * 3.5));;
    margin: 1em auto; /* vertical margin 1em, horizontal auto centers it */
    aspect-ratio: 3.5 / 1; 
    max-height: 50vh;
    border-radius: 5px;
    box-sizing: border-box;
    box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.5);
}

#conditions .graph {
    width: 76ex;
    height: 38ex;
    max-height: none;
    max-width: none;
    aspect-ratio: 2 / 1;
    margin: 1em auto;
}

#cameras, #conditions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}
.all_sky{
    width: 300px;
    margin: 0 auto;
}

/* camera thumbnails */

.camera {
    margin-top: 1em;
    margin-bottom: 1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    width: 100%; /* Let the grid determine the width */
}


.camera:hover {
    box-shadow: 0 8px 32px rgba(36, 120, 37, 0.18);
    transform: translateY(-4px) scale(1.03);
    cursor: pointer;
    transition: 0.2s;
}

.camera_thumbnail {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* Keeps cameras square; change to 16/9 if preferred */
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.camera_thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

/* Adjust the title header inside the card */
.camera_title {
    background: #247825;
    color: white;
    padding: 8px;
    font-size: 1.1rem;
    width: 100%;
    text-align: center;
    font-variant: small-caps;
}


.button {
    padding: 12px 32px;
    margin: 12px;
    background: linear-gradient(90deg, #43cea2 0%, #247825 100%);
    border-radius: 8px;
    border: none;
    display: inline-block;
    cursor: pointer;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(36, 120, 37, 0.10);
    transition: background 0.2s, box-shadow 0.2s;
}
.button:hover {
    background: linear-gradient(90deg, #247825 0%, #43cea2 100%);
    box-shadow: 0 4px 16px rgba(36, 120, 37, 0.18);
}
.button:active {
    position: relative;
    top: 1px;
}

.login-container {
    position: absolute;
    right: clamp(6px, 2vw, 16px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-email {
    color: #fff;
    font-size: clamp(0.7rem, 1.8vw, 0.9rem);
    font-weight: 400;
}

.login-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: clamp(6px, 1vh, 8px) clamp(12px, 2vw, 16px);
    border-radius: 4px;
    text-decoration: none;
    font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    transition: background 0.3s;
    white-space: nowrap;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .user-email {
        display: none; /* Hide email on small screens */
    }
}

/* Graphana  */


/* 2. Force BOTH children into the exact same cell */
.graph > * {
    grid-column: 1;
    grid-row: 1;
    width: 100%; 
    height: 100%;
}

section {
    width: 100%;
}

/* 3. Layering */
.graph > img {
    z-index: 3; /* Image on top initially */
    transition: opacity 1s ease;
    pointer-events: none; /* Let clicks pass through to graph if needed */
}
    
.graph > object {
    z-index: 2; /* Graph underneath */
}

