/**
 * Casey Building Solutions - Responsive Styles
 * Maintaining original design while adding responsive functionality
 */

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: "Trebuchet MS", Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
    background: #2f2f2f url(../graphics/bodyback.jpg) repeat;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
}

/* Frame - Responsive Container */
#Frame {
    max-width: 1200px;
    width: 100%;
    margin: 10px auto;
    background-color: transparent;
    box-shadow: none;
}

@media (max-width: 768px) {
    #Frame {
        margin: 5px;
    }

    #HeaderNav {
        border-radius: 6px 6px 0 0;
    }

    #Marketing {
        margin: 5px 0;
        border-radius: 6px;
    }

    #Marketing img {
        border-radius: 6px;
    }

    #Content {
        margin-top: 5px;
        border-radius: 6px;
    }

    #Footer {
        margin-top: 5px;
        margin-bottom: 5px;
        border-radius: 0 0 6px 6px;
    }
}

/* Header Navigation */
#HeaderNav {
    padding: 0;
    background-color: #ffffff;
    width: 100%;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-wrapper {
    width: 100%;
}

/* Nav Under - Red bar at top */
#Navunder {
    background: linear-gradient(to bottom, #ff0000 0%, #e20000 100%);
    color: #ffffff;
    line-height: 37px;
    width: 100%;
    text-align: right;
    padding: 0 15px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
}

/* Header Main - White area with logo and navigation */
.header-main {
    background-color: #ffffff;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 10px;
    padding-left: 290px;
    position: relative;
    min-height: 100px;
}

.header-main h1 {
    position: absolute;
    left: 15px;
    top: -25px;
    width: 265px;
    height: 130px;
    background: url(../graphics/Casey-Building-Solutions-Logo.webp) no-repeat center center;
    background-size: 265px auto;
    margin: 0;
    padding: 0;
    z-index: 100;
}

.header-main h1 a {
    display: block;
    width: 100%;
    height: 100%;
    text-indent: -9999px;
}

@media (max-width: 768px) {
    #Navunder {
        text-align: center;
        font-size: 13px;
        padding: 8px 15px;
        border-radius: 6px 6px 0 0;
    }

    .header-main {
        flex-direction: column;
        align-items: center;
        padding-left: 10px;
        padding-top: 60px;
    }

    .header-main h1 {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: -15px;
        width: 200px;
        height: 90px;
        background: url(../graphics/Casey-Building-Solutions-Logo.webp) no-repeat center;
        background-size: contain;
    }

    .nav {
        width: 100%;
    }
}

/* Navigation */
.nav {
    background: transparent;
    margin: 0;
    padding: 0;
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

ul.nav {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}

ul.nav li {
    position: relative;
    margin: 0;
}

ul.nav > li > a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #333333;
    font-size: 15px;
    font-weight: bold;
    white-space: nowrap;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

ul.nav > li > a:hover {
    color: #333333;
    background: #e8e8e8;
}

ul.nav > li > a.nav-selected {
    color: #e60002;
    text-transform: uppercase;
}

/* Dropdown Menus */
ul.nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 240px;
    background-color: #3a3a3a;
    border-radius: 0 0 8px 8px;
    padding: 8px 0;
    z-index: 10000;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    margin-top: 0;
}

ul.nav li:hover > ul {
    display: block;
}

ul.nav ul li {
    width: 100%;
}

ul.nav ul li a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
}

ul.nav ul li a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: #f5f5f5;
    color: #333333;
    border: none;
    border-top: 1px solid #e0e0e0;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-weight: bold;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav {
        max-width: 100%;
        width: 100%;
        display: block;
    }

    ul.nav {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    ul.nav.active {
        display: flex;
    }

    ul.nav > li {
        width: 100%;
        border-bottom: 1px solid #e0e0e0;
    }

    ul.nav > li > a {
        padding: 12px 20px;
        color: #333333;
        font-size: 14px;
        border-radius: 0;
    }

    ul.nav > li > a:hover {
        background: #e8e8e8;
        color: #333333;
    }

    ul.nav ul {
        position: static;
        display: none;
        width: 100%;
        background: #2a2a2a;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
    }

    ul.nav li.active > ul {
        display: block;
    }

    ul.nav ul li a {
        padding: 10px 30px;
        color: #ffffff;
    }

    ul.nav ul li a:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }
}

/* Marketing Image */
#Marketing {
    width: 100%;
    text-align: center;
    overflow: hidden;
    background-color: transparent;
    margin: 10px 0;
    padding: 0;
    border-radius: 8px;
}

#Marketing img {
    max-width: 100%;
    height: auto;
    display: block;
    width: 100%;
    margin: 0 auto;
    border-radius: 8px;
}

/* Content Area */
#Content {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background-color: #ffffff;
    margin-top: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    #Content {
        padding: 15px;
    }
}

/* Content Left Sidebar */
.contentleft {
    flex: 0 0 280px;
    margin-top: 0;
}

@media (max-width: 968px) {
    .contentleft {
        flex: 0 0 240px;
    }
}

@media (max-width: 768px) {
    .contentleft {
        flex: 1 1 100%;
        order: 2;
    }
}

/* Red Box / Black Box */
.redbox, .blackbox {
    width: 100%;
    margin-bottom: 20px;
    padding: 15px;
    border-top-left-radius: 10px;
    border-bottom-right-radius: 10px;
    box-shadow: inset 0px 0px 10px 1px rgba(0, 0, 0, 1);
}

.redbox {
    background: linear-gradient(to bottom, #ff0000 0%, #e20000 100%);
}

.redbox table {
    margin: 0 auto;
}

.redbox td {
    padding: 5px;
}

.redbox img {
    max-width: 100%;
    height: auto;
}

.redbox a {
    color: #ffffff;
    font-size: 14px;
    line-height: 24px;
    text-decoration: none;
}

.blackbox {
    background-color: #1d1d1d;
    color: #ffffff;
    font-size: 14px;
    text-align: center;
}

.blackbox iframe {
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.blackbox h3 {
    color: #ffffff;
    font-variant: small-caps;
    font-weight: bold;
    font-size: 22px;
    text-align: center;
    margin: 10px 0;
}

.blackbox p {
    margin: 10px 0;
    line-height: 1.6;
}

.blackbox a {
    color: #ffffff;
}

/* Content Main */
.contentmain {
    flex: 1;
    min-width: 0;
    margin-top: 0;
}

@media (max-width: 768px) {
    .contentmain {
        order: 1;
    }
}

.contentmain h2 {
    color: #000000;
    margin: 0 0 15px 0;
    font-variant: small-caps;
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 32px;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .contentmain h2 {
        font-size: 26px;
    }
}

.contentmain h3 {
    color: #e60002;
    margin: 20px 0 10px 0;
    font-size: 20px;
}

@media (max-width: 768px) {
    .contentmain h3 {
        font-size: 18px;
    }
}

.contentmain p {
    color: #333333;
    font-size: 0.95em;
    margin-bottom: 15px;
    line-height: 1.7;
}

/* Links */
a {
    color: #382e2b;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: #e60002;
}

/* Footer */
#Footer {
    width: 100%;
    background: linear-gradient(to bottom, #ff0000 0%, #e20000 100%);
    color: #ffffff;
    letter-spacing: 1px;
    text-align: left;
    font-size: 12px;
    line-height: 30px;
    padding: 10px 20px;
    margin-top: 10px;
    margin-bottom: 10px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#Footer a {
    color: #eeeeee;
    text-decoration: none;
}

#Footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 768px) {
    #Footer {
        text-align: center;
        font-size: 11px;
    }
}

/* Forms */
.form {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    box-shadow: 0px 0px 3px #555555;
    border-radius: 4px;
    margin-bottom: 20px;
}

.field {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.field label {
    flex: 0 0 165px;
    color: #555555;
    font-size: 0.9em;
    font-weight: 600;
}

@media (max-width: 768px) {
    .field {
        flex-direction: column;
        align-items: flex-start;
    }

    .field label {
        margin-bottom: 5px;
    }
}

.form input[type=text],
.form input[type=email],
.form input[type=tel],
.form input[type=password],
.form select {
    flex: 1;
    min-width: 0;
    border: solid 1px #eeeeee;
    border-radius: 3px;
    box-shadow: inset 1px 1px 2px #555555;
    padding: 8px 12px;
    color: #555555;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .form input[type=text],
    .form input[type=email],
    .form input[type=tel],
    .form input[type=password],
    .form select {
        width: 100%;
    }
}

.form textarea {
    width: 100%;
    border: solid 1px #eeeeee;
    border-radius: 5px;
    box-shadow: inset 1px 1px 2px #555555;
    padding: 10px;
    line-height: 1.6;
    font-size: 0.9em;
    min-height: 120px;
}

form input[type=submit],
.submit-button {
    background: linear-gradient(to bottom, #ff0000 0%, #e20000 100%);
    border: none;
    border-radius: 5px;
    color: #ffffff;
    padding: 10px 20px;
    margin: 10px 0;
    border-left: 6px solid #c11a03;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

form input[type=submit]:hover,
.submit-button:hover {
    background: #c11a03;
    border-left-color: #981204;
}

/* Utility Classes */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive Iframe Container */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
