/* Base Styles */
caption {
    background-color: navy; 
    color: white; 
    padding: 5px; 
    font-weight: bold; 
    font-size: 14px; 
    font-family: sans-serif;
}

table {
    padding-bottom: 5px;
}

body { 
    margin: 0; 
    padding: 0; 
}

.container { 
    max-width: 90vw; 
    margin: 0 auto; 
    padding: 0; 
    background-color: white;
}

.header-background {
    background-color: #00B5F8;
    padding: 20px 0;
}

.nav { 
    text-align: center; 
    margin-bottom: 20px; 
    margin-top: 30px;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.nav a { 
    margin: 0; 
    text-decoration: none; 
    color: #0066cc; 
    white-space: nowrap;
}

.nav a:hover { 
    text-decoration: underline; 
}

/* Header styles */
.header-link {
    text-decoration: none;
    display: contents;
}

.header-image {
    width: auto !important;
    height: 60px !important;
}

.header-image.home {
    height: 100% !important;
    width: auto !important;
}

.header-container {
    text-align: left !important;
    display: flex;
    align-items: center;
}

.header-container.home {
    text-align: center !important;
    display: block;
}

.header-slice {
    height: 60px;
    width: 100%;
    display: block;
}

/* Kayak Build SEO Page */
.kayak-build-seo .container {
    padding-top: 0 !important;
}

.build-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.build-gallery {
    max-width: 1200px;
    margin: 0 auto;
}

.build-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.build-image-container {
    text-align: center;
}

#build-image {
    max-width: 100%;       /* Don't get wider than the grid column */
    max-height: 100%;      /* Don't get taller than the grid row */
    width: auto;           /* Keep original proportions */
    height: auto;          /* Keep original proportions */
    object-fit: contain;   /* Fits the whole image inside without cropping */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.build-description h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.2em;
}

.build-description p {
    line-height: 1.6;
    color: #666;
    font-size: 1em;
}

.build-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0,0,0,0.9);
    padding: 15px 25px;
    border-radius: 25px;
    z-index: 1000;
}

.nav-btn, .build-nav button {
    padding: 8px 16px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.nav-btn:hover, .build-nav button:hover {
    background: #0052a3;
}

#current-step {
    color: white;
    font-weight: bold;
    min-width: 100px;
    text-align: center;
}

/* Kayak Build Interactive Page */
#kayak-build-viewer {
    height: 85vh;
}

.build-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    border-radius: 8px;
}

.build-navigation button {
    padding: 10px 20px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.build-navigation button:hover {
    background: #0052a3;
}

.build-navigation button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#image-counter {
    font-weight: bold;
    font-size: 14px;
}

.build-content {
    display: grid;
    /* Use 3fr and 1fr instead of 75% and 25% */
    grid-template-columns: 3fr 1fr; 
    grid-template-rows: auto 1fr auto;
    grid-template-areas: 
        "photo nav"
        "photo description"
        "photo controls";
    gap: 30px;
    height: 100%;
    width: 100%;       /* Ensure it stays inside the parent */
    box-sizing: border-box; /* Includes padding/border in the width */
}

.image-container {
    grid-area: photo;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;       /* Force it to occupy the full 1fr height */
    min-height: 0;      /* CRITICAL: Allows grid item to shrink */
    overflow: hidden;
}

.build-navigation {
    grid-area: nav;
    align-self: start; /* Sticks to the top */
    background: #f5f5f5;
    border-radius: 8px;
    display: flex; /* Ensure the buttons/counter stay in a row */
    padding: 10px;
}

.build-description {
    grid-area: description;
    align-self: start; /* Keeps text starting just under the nav */
    overflow-y: auto; /* Adds a scrollbar if the description is long */
}

.build-controls {
    grid-area: controls;
    align-self: end; /* Sticks to the bottom */
    padding-top: 10px;
}

.build-controls button {
    padding: 8px 16px;
    background: #666;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 5px;
}

.build-controls button:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .build-item {
        grid-template-columns: 1fr;
    }
    
    .build-nav {
        position: static;
        transform: none;
        margin: 20px auto;
        width: fit-content;
    }
    
    .build-content {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "nav"
            "photo"
            "description"
            "controls";
    }
    
    .build-navigation {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }
    
    .image-container {
        width: 100%;
    }
    
    #kayak-build-viewer {
        width: 100%;
        height: auto;
    }
    
    .build-controls {
        flex-direction: column;
    }
}
