/* SES Library - ASU Themed Styles */

/* ================================
   Variables / Colors
   ================================ */
:root {
    --asu-maroon: #8c1d40;
    --asu-gold: #ffc627;
    --asu-dark-gold: #ffb310;
    --asu-dark-maroon: #6a1631;
    --asu-black: #000;
    --asu-gray: #747474;
    --asu-light-gray: #e8e8e8;
    --asu-white: #fff;
}

/* ================================
   Base Styles
   ================================ */
body {
    font-family: Arial, Helvetica, "Nimbus Sans L", "Liberation Sans", FreeSans, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2a2a2a;
    background-color: var(--asu-white);
}

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2000;
    padding: 0.75rem 1rem;
    color: var(--asu-white);
    background: var(--asu-maroon);
    font-weight: 700;
    transform: translateY(-150%);
    transition: transform 0.15s ease-in-out;
}

.skip-link:focus {
    color: var(--asu-white);
    outline: 3px solid var(--asu-gold);
    outline-offset: 2px;
    text-decoration: underline;
    transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--asu-gold);
    outline-offset: 2px;
}

a {
    color: var(--asu-maroon);
    text-decoration: none;
}

a:hover {
    color: var(--asu-dark-gold);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: #191919;
    font-weight: 700;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }

/* ================================
   ASU Header
   ================================ */
.asu-header {
    background-color: var(--asu-white);
    border-bottom: 1px solid var(--asu-light-gray);
}

.asu-header-top {
    padding: 10px 0;
}

.asu-logo img {
    height: 70px;
}

.asu-top-nav {
    white-space: nowrap;
}

.asu-top-nav a {
    color: var(--asu-gray);
    margin-left: 12px;
    font-size: 13px;
}

.asu-top-nav a:hover {
    color: var(--asu-maroon);
    text-decoration: none;
}

.asu-top-nav .nav-divider {
    color: var(--asu-light-gray);
    margin-left: 10px;
}

.asu-top-nav .sign-in-link {
    color: var(--asu-maroon);
    font-weight: 600;
}

.asu-top-nav .sign-in-link:hover {
    color: var(--asu-dark-gold);
}

.asu-top-nav .user-link {
    color: var(--asu-maroon);
    font-weight: 600;
}

.asu-top-nav .sign-out-link {
    color: var(--asu-gray);
}

.asu-top-nav .user-role {
    color: var(--asu-gray);
    font-size: 11px;
    margin-left: 4px;
}

.site-identity {
    border-left: 1px solid var(--asu-light-gray);
    display: flex;
    flex-direction: column;
    margin-left: 1rem;
    padding-left: 1rem;
}

.site-title-header {
    color: var(--asu-black);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.site-title-header:hover {
    color: var(--asu-black);
    text-decoration: underline;
}

.site-stewardship {
    color: #4a4a4a;
    font-size: 1rem;
    line-height: 1.35;
    margin-top: 0.25rem;
}

.site-stewardship a {
    color: #4a4a4a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ================================
   Site Header & Branding
   ================================ */
.site-header {
    background: linear-gradient(135deg, var(--asu-maroon) 0%, #5c0023 100%);
    color: var(--asu-white);
}

.site-branding {
    padding: 20px 0;
    text-align: center;
}

.parent-org {
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--asu-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.site-title {
    font-size: 1.8rem;
    margin: 0;
    color: var(--asu-white);
}

.site-title a {
    color: var(--asu-white);
}

.site-title a:hover {
    color: var(--asu-gold);
    text-decoration: none;
}

/* ================================
   Main Navigation
   ================================ */
.main-nav {
    background-color: var(--asu-white);
    border-top: 1px solid var(--asu-light-gray);
    border-bottom: 1px solid var(--asu-light-gray);
}

.main-nav .navbar-nav {
    width: 100%;
    justify-content: center;
}

.main-nav .nav-link {
    color: var(--asu-gray) !important;
    font-weight: 400;
    padding: 12px 20px !important;
    font-size: 1rem;
    border-bottom: 3px solid transparent;
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
    color: var(--asu-maroon) !important;
    border-bottom-color: var(--asu-gold);
    text-decoration: none;
}

.main-nav .navbar-toggler {
    border-color: var(--asu-maroon);
}

.main-nav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(140, 29, 64, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.mobile-account-nav .dropdown-divider {
    margin: 0.5rem 0;
}

/* Dropdown Menu */
.main-nav .dropdown-menu {
    border: 1px solid var(--asu-light-gray);
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0;
    margin-top: 0;
}

.main-nav .dropdown-item {
    color: var(--asu-gray);
    font-size: 1rem;
    font-weight: 400;
    padding: 10px 20px;
}

.main-nav .dropdown-item:hover,
.main-nav .dropdown-item:focus {
    background-color: var(--asu-light-gray);
    color: var(--asu-maroon);
    text-decoration: none;
}

.main-nav .dropdown-toggle::after {
    margin-left: 6px;
}

/* ================================
   Hero Banner
   ================================ */
.hero-banner {
    background: linear-gradient(rgba(140, 29, 64, 0.8), rgba(140, 29, 64, 0.8)),
                url("../images/yurt.6f0d6a3fd0d6.jpg") center/cover no-repeat;
    min-height: 150px;
    display: flex;
    align-items: center;
    color: var(--asu-white);
}

.hero-content h1 {
    color: var(--asu-white);
    font-size: 2rem;
}

/* ================================
   Main Content
   ================================ */
.main-content {
    padding: 40px 0;
    min-height: 400px;
    background: linear-gradient(to bottom, var(--asu-light-gray) 0%, var(--asu-white) 100px);
}

.main-content a:not(.btn) {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.main-content :is(h1, h2, h3, h4, h5, h6) {
    color: #191919 !important;
}

/* Page title */
.main-content h1:first-child {
    color: #191919;
    border-bottom: 2px solid var(--asu-light-gray);
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.help-page {
    max-width: 700px;
}

.help-page section {
    margin-top: 2rem;
}

.help-page li + li {
    margin-top: 0.75rem;
}

/* ================================
   Case Study Styles
   ================================ */
.case-study-page .resource-info,
.case-study-page .locations,
.case-study-page .description,
.case-study-page .ia-document,
.case-study-page .system-representations {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--asu-white);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.case-study-page h2 {
    color: var(--asu-maroon);
    font-size: 1.4rem;
    border-left: 4px solid var(--asu-gold);
    padding-left: 15px;
    margin-bottom: 20px;
}

.case-study-page dl {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px;
}

.case-study-page dt {
    font-weight: 600;
    color: var(--asu-gray);
}

.case-study-page dd {
    margin: 0;
}

.case-study-page .sysrep {
    border: 1px solid var(--asu-light-gray);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.case-study-page .sysrep h3 {
    color: var(--asu-dark-gold);
    margin-bottom: 15px;
}

.case-study-page .field {
    margin-bottom: 15px;
}

.case-study-page .field strong {
    display: block;
    color: var(--asu-maroon);
    margin-bottom: 5px;
}

/* ================================
   Buttons
   ================================ */
.btn-primary {
    background-color: var(--asu-maroon);
    border-color: var(--asu-maroon);
}

.btn-primary:hover {
    background-color: #6a1530;
    border-color: #6a1530;
}

.btn-secondary {
    background-color: var(--asu-gold);
    border-color: var(--asu-gold);
    color: var(--asu-black);
}

.btn-secondary:hover {
    background-color: var(--asu-dark-gold);
    border-color: var(--asu-dark-gold);
    color: var(--asu-black);
}

/* ================================
   Footer
   ================================ */
.site-footer {
    color: var(--asu-white);
    margin-top: 40px;
}

.footer-primary {
    background-color: #1e1e1e;
    padding: 3rem 0 2rem;
}

.site-footer .footer-heading {
    color: var(--asu-white);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.footer-primary p {
    font-size: 1rem;
    color: var(--asu-light-gray);
}

.footer-description {
    max-width: 24rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-primary a,
.footer-links a {
    color: var(--asu-light-gray);
    font-size: 1rem;
}

.footer-primary a:hover,
.footer-links a:hover {
    color: var(--asu-gold);
}

.footer-license {
    border-top: 1px solid #393939;
    margin-top: 2rem;
    padding-top: 1.5rem;
}

.footer-license > p:first-child {
    margin: 0;
    max-width: 700px;
}

.footer-support-button {
    background-color: var(--asu-gold);
    border-radius: 999px;
    color: #191919 !important;
    display: inline-block;
    font-weight: 700;
    margin-top: 0.5rem;
    padding: 0.625rem 1.25rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.footer-support-button:hover,
.footer-support-button:focus-visible {
    color: #191919 !important;
    transform: scale(1.05);
}

.footer-services {
    color: #191919;
    background: var(--asu-gold);
}

.footer-services__inner {
    align-items: center;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
}

.footer-services nav,
.footer-legal nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    align-items: center;
}

.footer-services nav {
    padding: 1.25rem 0;
    font-weight: 700;
}

.footer-services a,
.footer-legal a {
    color: #191919;
}

.footer-ranking {
    border-left: 1px solid rgb(25 25 25 / 40%);
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    padding-left: 1.5rem;
    text-decoration: none;
}

.footer-ranking strong {
    font-size: 1.125rem;
    line-height: 1.2;
}

.footer-ranking span {
    font-size: 0.75rem;
}

.footer-legal {
    color: #191919;
    background: var(--asu-light-gray);
    padding: 1rem 0;
}

.footer-build-id {
    color: var(--asu-light-gray);
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    margin: 0.5rem 0 0;
}

.footer-build-id code {
    color: inherit;
    font-size: inherit;
}

#manualConsentoptout {
    background: none;
    border: 0;
    color: #191919;
    padding: 0;
    text-decoration: underline;
}

#manualConsentoptout:hover {
    text-decoration-thickness: 2px;
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
    .site-title {
        font-size: 1.4rem;
    }

    .main-nav .nav-link {
        padding: 10px 15px !important;
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .main-nav .nav-link:hover,
    .main-nav .nav-link.active {
        border-left-color: var(--asu-gold);
    }

    .case-study-page dl {
        grid-template-columns: 1fr;
    }

    .asu-header-top .d-flex {
        justify-content: center !important;
    }

    .site-title-header {
        font-size: 1rem;
    }

    .footer-primary nav {
        margin-top: 1.5rem;
    }

    .footer-services nav,
    .footer-legal nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .footer-services__inner {
        align-items: stretch;
        flex-direction: column;
        gap: 0;
    }

    .footer-ranking {
        border-left: 0;
        border-top: 1px solid rgb(25 25 25 / 40%);
        margin-bottom: 1.25rem;
        padding: 1rem 0 0;
    }
}

@media (max-width: 480px) {
    .asu-logo img {
        height: 54px;
    }

    .site-title-header {
        margin-left: 0.75rem;
        padding-left: 0.75rem;
    }

    .footer-services nav,
    .footer-legal nav {
        grid-template-columns: 1fr;
    }
}

/* ================================
   Frontend Edit Controls
   ================================ */
.edit-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.edit-controls .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.edit-controls .btn-outline-primary {
    border-color: var(--asu-maroon);
    color: var(--asu-maroon);
}

.edit-controls .btn-outline-primary:hover {
    background-color: var(--asu-maroon);
    border-color: var(--asu-maroon);
    color: var(--asu-white);
}

/* ================================
   Frontend Edit Form Styles
   ================================ */
.frontend-edit-form {
    background: var(--asu-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.frontend-edit-form .case-header h1 {
    color: var(--asu-maroon) !important;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0.5rem;
}

.frontend-edit-form h1 {
    color: var(--asu-maroon) !important;
    border-bottom: 2px solid var(--asu-gold);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.frontend-edit-form .form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid var(--asu-gold);
}

.frontend-edit-form .form-section h3 {
    color: var(--asu-maroon);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.frontend-edit-form .form-label {
    font-weight: 600;
    color: var(--asu-gray);
}

.frontend-edit-form .form-control:focus,
.frontend-edit-form .form-select:focus {
    border-color: var(--asu-maroon);
    box-shadow: 0 0 0 0.2rem rgba(140, 29, 64, 0.25);
}

.frontend-edit-form .btn-primary {
    background-color: var(--asu-maroon);
    border-color: var(--asu-maroon);
}

.frontend-edit-form .btn-primary:hover {
    background-color: #6a1530;
    border-color: #6a1530;
}

/* Tab navigation for edit form */
.edit-form-tabs .nav-tabs {
    border-bottom: 2px solid var(--asu-light-gray);
}

.edit-form-tabs .nav-link {
    color: var(--asu-gray);
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

.edit-form-tabs .nav-link:hover {
    color: var(--asu-maroon);
    border-bottom-color: var(--asu-light-gray);
}

.edit-form-tabs .nav-link.active {
    color: var(--asu-maroon);
    border-bottom-color: var(--asu-maroon);
    background: transparent;
}

.edit-form-tabs .tab-content {
    padding: 1.5rem 0;
}

/* Inline formset styling */
.inline-formset {
    margin-bottom: 1rem;
}

.inline-formset .inline-item {
    background: var(--asu-white);
    border: 1px solid var(--asu-light-gray);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.inline-formset .inline-item .remove-btn {
    color: #dc3545;
    cursor: pointer;
}

.inline-formset .add-btn {
    color: var(--asu-maroon);
    cursor: pointer;
    font-weight: 600;
}

/* Revision history styles */
.revision-list {
    list-style: none;
    padding: 0;
}

.revision-list li {
    padding: 1rem;
    border-bottom: 1px solid var(--asu-light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.revision-list li:last-child {
    border-bottom: none;
}

.revision-list .revision-info {
    flex: 1;
}

.revision-list .revision-date {
    font-weight: 600;
    color: var(--asu-maroon);
}

.revision-list .revision-user {
    color: var(--asu-gray);
    font-size: 0.9rem;
}

.revision-list .revision-actions .btn {
    margin-left: 0.5rem;
}

/* ================================
   Site Banner
   ================================ */
.banner {
    color: var(--asu-black);
    background: var(--asu-gold);
    border-bottom: 1px solid #d99f00;
}

.banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 56px;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.banner__message {
    margin: 0;
    line-height: 1.4;
}

.banner a {
    color: var(--asu-black);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.banner a:hover {
    color: var(--asu-dark-maroon);
    text-decoration-thickness: 2px;
}

.banner__dismiss {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    color: var(--asu-black);
    background: transparent;
    font-size: 1.25rem;
}

.banner__dismiss:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ================================
   Shared SES Library Banner
   ================================ */
.library-banner {
    min-height: 152px;
    background:
        linear-gradient(rgba(25, 25, 25, 0.12), rgba(25, 25, 25, 0.12)),
        url("../images/yurt.6f0d6a3fd0d6.jpg") center center / cover no-repeat;
}

.library-banner__inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    min-height: 152px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.library-banner__title {
    display: block;
    max-width: 700px;
    padding: 8px 16px;
    color: #ffffff;
    background: #191919;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}

.library-banner__home-heading {
    max-width: 700px;
    margin: 0;
    line-height: 1;
}

.library-banner__home-heading .library-banner__title {
    max-width: none;
}

.library-banner__title:hover {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: #ffc627;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
}

.library-banner__title:focus-visible {
    color: #191919;
    background: #ffc627;
    outline: 3px solid #191919;
    outline-offset: 3px;
}

.compact-search-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.6rem 1rem;
    border: 2px solid #191919;
    color: #191919;
    background: #ffffff;
    font-weight: 700;
}

.compact-search-toggle:hover,
.compact-search-toggle[aria-expanded="true"] {
    background: #ffc627;
}

.compact-search-panel {
    border-top: 4px solid #ffc627;
    background: #ffffff;
    box-shadow: 0 4px 8px rgba(25, 25, 25, 0.16);
}

.compact-search-form {
    max-width: 720px;
    padding: 1rem 0 1.25rem;
}

.compact-search-form label {
    display: block;
    margin-bottom: 0.4rem;
    color: #191919;
    font-weight: 700;
}

.template-homepage .library-banner {
    min-height: 264px;
    background-image:
        linear-gradient(rgba(25, 25, 25, 0.08), rgba(25, 25, 25, 0.08)),
        url("../images/cbie_main_hero3.0192474eea08.jpg");
}

.template-homepage .library-banner__inner {
    min-height: 264px;
}

@media (min-width: 768px) {
    .library-banner__title {
        font-size: 1.75rem;
    }

    .template-homepage .library-banner,
    .template-homepage .library-banner__inner {
        min-height: 384px;
    }
}

@media (max-width: 575.98px) {
    .library-banner__inner {
        align-items: stretch;
        flex-direction: column;
        justify-content: flex-end;
    }

    .library-banner__title {
        max-width: none;
    }

    .compact-search-toggle {
        align-self: flex-start;
    }
}

/* ================================
   Quick Start Form
   ================================ */
.quick-start {
    background: #f5f5f5;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
}
.quick-start-label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}
.quick-start .form-label {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.25rem;
}
.quick-start .form-select,
.quick-start .form-control {
    font-size: 1rem;
}
.quick-start .form-text {
    color: #4a4a4a;
    font-size: 1rem;
}
.btn-go {
    background-color: var(--asu-maroon);
    border-color: var(--asu-maroon);
    color: #fff;
    font-size: 1rem;
}
.btn-go:hover {
    background-color: var(--asu-dark-maroon);
    border-color: var(--asu-dark-maroon);
}

/* ================================
   Bootstrap Pagination — Brand Colors
   ================================ */
.page-link {
    color: var(--asu-maroon);
}
.page-link:hover {
    color: var(--asu-dark-maroon);
    background-color: #f5f5f5;
    border-color: var(--asu-maroon);
}
.page-item.active .page-link {
    background-color: var(--asu-maroon);
    border-color: var(--asu-maroon);
    color: #fff;
}
.page-link:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 198, 39, 0.5);
    border-color: var(--asu-gold);
}
