/* Restoration CSS for obsolete WebCom navigation & forms */

/* The original welcome table was wider than its 950px content container. */
.welcome-page .layout_generic_2b > table {
    width: 100%;
    table-layout: fixed;
    height: auto;
}
.welcome-page .layout_generic_2b td {
    overflow-wrap: anywhere;
}
.welcome-page .layout_generic_2b img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 980px) {
    .welcome-page > table,
    .welcome-page > table > tbody,
    .welcome-page > table > tbody > tr,
    .welcome-page > table > tbody > tr > td {
        display: block;
        box-sizing: border-box;
        width: 100%;
    }
    .welcome-page > table > tbody > tr > td:not([colspan]):first-child,
    .welcome-page > table > tbody > tr > td:not([colspan]):last-child {
        display: none;
    }
    .welcome-page #layout,
    .welcome-page #footer,
    .welcome-page #nav,
    .welcome-page #cn_container,
    .welcome-page #kv {
        box-sizing: border-box;
        width: 100%;
        max-width: 960px;
    }
    .welcome-page #cn_container {
        height: auto;
        min-height: 120px;
        padding: 0 5px;
    }
    .welcome-page #globaltext {
        display: none;
    }
    .welcome-page #kv {
        height: auto;
    }
    .welcome-page #kv img {
        width: 100%;
        height: auto;
    }
    .welcome-page .primary-webcomMenuItem {
        flex: 1;
        min-width: 0;
    }
    .welcome-page #styleNav .primary-webcomMenuItem-middle {
        overflow-wrap: anywhere;
    }
    .welcome-page #styleNav .secondary-webcomMenu {
        max-width: 100vw;
    }
}
@media (max-width: 700px) {
    .welcome-page .layout_generic_2b > table,
    .welcome-page .layout_generic_2b > table > tbody,
    .welcome-page .layout_generic_2b > table > tbody > tr,
    .welcome-page .layout_generic_2b > table > tbody > tr > td {
        display: block;
        width: 100% !important;
    }
    .welcome-page .layout_generic_2b > table > tbody > tr > td:nth-child(2) {
        display: none;
    }
    .welcome-page .layout_generic_2b .narrow {
        margin-bottom: 16px;
    }
}

/* Original browserBehavior.js paragraph rules, now independent of WebCom. */
p { margin-top: 0; margin-bottom: 0; }
p + p { margin-top: 1em; }

/* 1. Navigation Structure */
/* Make styleNav visible since inline script hides it */
#styleNav {
    visibility: visible !important;
    position: relative;
    z-index: 100;
}

.primary-webcomMenu,
.secondary-webcomMenu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-webcomMenu {
    display: flex;
    height: 51px;
}

.primary-webcomMenuItem {
    width: 160px;
    height: 51px;
    position: relative;
    cursor: pointer;
}

.primary-webcomMenuItem > a {
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

.secondary-webcomMenu {
    display: none;
    position: absolute;
    top: 51px;
    left: 0;
    width: 160px;
    z-index: 1000;
}

.primary-webcomMenuItem:hover .secondary-webcomMenu,
.primary-webcomMenuItem.hover .secondary-webcomMenu {
    display: block;
}

.secondary-webcomMenuItem {
    width: 160px;
    position: relative;
}

.secondary-webcomMenuItem > a {
    text-decoration: none;
    display: block;
    outline: none;
}

#styleNav a:link, 
#styleNav a:visited, 
#styleNav a:hover, 
#styleNav a:active {
    text-decoration: none;
}

/* Original styles used padding and height. Using flex for vertical align. */
#styleNav .primary-webcomMenuItem-middle {
    display: block;
    box-sizing: content-box;
}

/* 2. Form Restorations */
.restored-webcom-form {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #000;
    width: 434px;
    margin: 0 auto; /* Centered based on the screenshot */
    margin-top: 5px;
    text-align: left;
}

.restored-webcom-form .form-group {
    margin-bottom: 15px;
}

/* Group title like "Name", "Email" */
.restored-webcom-form .group-label {
    display: block;
    margin-bottom: 0;
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #000;
}

.restored-webcom-form .name-group-fields {
    display: flex;
    gap: 4px;
}

.restored-webcom-form .name-group-fields .form-field {
    flex: 1;
}

.restored-webcom-form .form-field {
    display: flex;
    flex-direction: column;
}

/* For first/last name, label is below the field */
.restored-webcom-form .form-field.label-below {
    flex-direction: column;
}

.restored-webcom-form .form-field.label-below label {
    order: 2; /* Put label after input */
    margin-top: 2px;
    margin-bottom: 0;
    font-size: 12px;
    color: #000;
    font-weight: normal;
}

.restored-webcom-form .form-field.label-below input {
    order: 1; /* Put input first */
}


.restored-webcom-form .form-field label {
    margin-bottom: 0;
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #000;
    font-weight: normal;
}

.restored-webcom-form .required {
    color: #c70202;
}

/* All inputs and textareas */
.restored-webcom-form input[type="text"],
.restored-webcom-form input[type="email"],
.restored-webcom-form textarea {
    width: 100%;
    height: 19px; /* Exact height request */
    padding: 0 2px; /* Very tight padding based on old web styles */
    border: 1px solid #b5b8d8;
    font-family: Arial, sans-serif;
    font-size: 12px;
    box-sizing: border-box;
    margin: 0;
    background-color: #fff;
}

/* Override height for textarea */
.restored-webcom-form textarea {
    height: 126px;
    resize: both;
    padding: 2px;
}

.restored-webcom-form .form-actions {
    margin-top: 5px;
    text-align: left;
}

.restored-webcom-form .form-actions button {
    padding: 1px 6px;
    background-color: #f0f0f0;
    color: #000;
    border: 1px solid #7f9db9;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 12px;
    height: 22px;
    border-radius: 2px;
}

.restored-webcom-form .form-actions button:hover {
    background-color: #e5e5e5;
}
