:root {   /* share some styling */
    --border-width: .175rem;
    --border-color: deepskyblue;
    --border-radius: .5rem;
    --primary-color: #333;  /* go to shared eventually for header */
}
/* Reset all margins and paddings for consistency */
*,
::before,
::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;  /* Align elements in a column layout */
    min-height: 100vh;       /* Full viewport height */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    line-height: 1.6; /* Default line height */
    font-family: sans-serif; /* Default font family */
}

html { font-size: 1rem; /* Default root font size; adjust others with rem not px */ }

/* Header Container (Text + Links) */
.main-header-container {
    background-color: deepskyblue; /* Background color for the header */
    display: flex;
    justify-content: center; /* Center the items horizontally */
    align-items: center; /* Align items vertically in the center */
    gap: 1.25rem; /* Space between header text and links */
    width: 100%;
}

.main-header {
    font-size: 1.375rem; /* Header text size */
    font-weight: bold; /* Make the header text bold */
    color: black;
    padding: 0.125rem;
    line-height: 1;
}

.main-header a {
    color: black; /* Set the link color to black */
    text-decoration: none; /* Remove underline from the link */
}

.main-header a:hover {
    color: black; /* Ensure the link color stays black on hover */
    text-decoration: underline; /* Underline the link on hover */
}
.header-links {
    display: flex;
    flex-direction: row; /* Links in a row by default */
    gap: .625rem; /* Space between links */
    flex-wrap: wrap; /* Allow links to wrap onto the next line */
    line-height: 1;
}

.header-links a {
    color: white;
    text-decoration: none;
    font-size: 1.275rem;
}

.header-links a:hover {
    color: black;
    text-decoration: underline;
}
/* Title styling index, webcams, avy, nordic */
.header h2 {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);  /*dark grey easier on the eys they say */
    padding: 0 .125rem;
    text-align: center; /* Center the text */
    line-height: 1.2; /* Adjust line height to reduce vertical spacing */
    margin: 0.5rem auto .5rem auto;
}
/* Button Row */
.button-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;  /* Align rows at the top to avoid spacing issues */
    flex-wrap: wrap;  /* Allow buttons to wrap */
    background-color: white;
    margin-top: 0.25rem;
}
.btn {
    padding: .125rem .325rem;  /* inside the border of element */
    margin: 0.25rem .375rem; /* outside of element: top and bottom, left and right */
    background-color: deepskyblue;
    color: black;
    border: none;
    display: inline-block;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
}

.btn:hover {
    color: white;
    text-decoration: underline;
}

/* Footer */
.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 0.125rem;
    width: 100%;
    flex-shrink: 0; /* Prevent the footer from shrinking */
}

.footer a {
    color: white; /* Make the link color white */
    text-decoration: underline;
}

@media (max-width: 52.375rem) {   /* 838px / 16px = 53.375rem */
    .main-header-container {
        flex-direction: column; /* Stack the header text and links vertically on smaller screens */
        gap: 0; /* Space between the text and links */
    }
    .header-links {
        justify-content: center; /* Center the links */
        gap: 0.5rem; /* Space between the links when narrowed */
    }
    .header-links a {
        font-size: 1.275rem; /* Adjust the font size for smaller screens */
    }

     .header h2 {
        font-size: 1rem;
    }
}

@media (max-width: 25rem) {  /* 400px / 16px = 25rem */
    html {
        font-size: .875rem; /* Decrease root font size */
    }
    .main-header {
        font-size: 1.3rem;
    }
}
