
:root {
    --bs-font-sans-serif: 'Montserrat', sans-serif;
    --bs-body-font-family: 'Montserrat', sans-serif;
    --bs-body-font-size: 1rem;
    --bs-body-font-weight: 400;
    --bs-body-line-height: 1.5;
}

html {
    font-family: 'Montserrat', sans-serif;
}

/* ============================================================
   1. HIDE D365 DEFAULT CHROME
   ============================================================ */
.navbar-expand-xl.navbar.navbar-dark.static-top,
.navbar.navbar-inverse.navbar-static-top,
.navbar-header,
.navbar-default {
    display: none !important;
}

.footer,
footer.footer,
.portal-footer {
    display: none !important;
}

.portal-content-wrapper > .container,
.content-wrapper > .container {
    padding-left: 0;
    padding-right: 0;
    max-width: none;
}


/* ============================================================
   2. BODY & GENERAL LAYOUT
   ============================================================ */

body {
    margin: 0;
    padding: 60px 0 0 0 !important;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 1420px) {
    body {
        padding-top: 100px !important;
    }
}

/* Prevent horizontal scroll from mobile menu */
body.show-mobile-menu {
    overflow-x: hidden;
}
body.show-mobile-menu::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    pointer-events: auto;
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */

:root {
    --font-headings: 'elza-condensed', 'Montserrat', sans-serif;
    --font-body: 'Montserrat', sans-serif;
    --ceda-red: #E11837;
    --ceda-red-dark: #C22032;
    --ceda-black: #1a1a1a;
    --ceda-grey-dark: #333333;
    --ceda-grey-light: #f5f5f5;
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 p .p .li li .ul ul a .a {
    font-family: 'Montserrat', sans-serif !important;
}

.entity-grid a,
.entitylist a,
.entity-form a,
.basicform a,
.breadcrumb a {
    color: var(--ceda-red);
    text-decoration: none;
}
.entity-grid a:hover,
.entitylist a:hover,
.entity-form a:hover,
.basicform a:hover,
.breadcrumb a:hover {
    color: var(--ceda-red-dark);
}


/* ============================================================
   4. CEDA FOOTER — override OOTB theme p/div/span rules
   ============================================================ */

footer[role="contentinfo"] p,
footer[role="contentinfo"] div,
footer[role="contentinfo"] span,
footer[role="contentinfo"] li {
    font-family: 'Montserrat', sans-serif !important;
}

footer[role="contentinfo"] .copyright p {
    font-family: 'Montserrat', sans-serif !important;
    font-size: inherit !important;
    margin-bottom: 0 !important;
    color: #fff !important;
}

footer[role="contentinfo"] .subscribe p,
footer[role="contentinfo"] .subscribe div {
    font-family: 'Montserrat', sans-serif !important;
    color: #fff !important;
}


/* ============================================================
   6. D365 ENTITY LISTS & FORMS
   ============================================================ */

/* Entity list */
.entity-grid .table,
.entitylist .table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9375rem;
}
.entity-grid .table th,
.entitylist .table th {
    background-color: transparent;
    font-family: var(--font-headings);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
}
.entity-grid .table td,
.entitylist .table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    vertical-align: middle;
}
.entity-grid .table tbody tr:hover,
.entitylist .table tbody tr:hover {
    background-color: var(--ceda-grey-light);
}

/* Pagination */
.entity-grid .pagination .page-link,
.entitylist .pagination .page-link {
    color: var(--ceda-red);
    border-color: #e5e5e5;
    padding: 0.5rem 0.75rem;
}
.entity-grid .pagination .active .page-link,
.entitylist .pagination .active .page-link {
    background-color: var(--ceda-red);
    border-color: var(--ceda-red);
    color: #ffffff;
}

/* Entity form / Basic form */
.entity-form .form-group label,
.basicform .form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
    color: var(--ceda-black);
}
.entity-form .form-control,
.basicform .form-control {
    border: 1px solid #d1d1d1;
    border-radius: 0;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease;
}
.entity-form .form-control:focus,
.basicform .form-control:focus {
    border-color: var(--ceda-red);
    box-shadow: 0 0 0 2px rgba(225, 24, 55, 0.15);
    outline: none;
}

/* Form validation */
.entity-form .field-validation-error,
.basicform .field-validation-error {
    color: var(--ceda-red);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
    display: block;
}

/* Submit/action buttons in forms */
.entity-form .btn-primary,
.basicform .btn-primary,
.entity-grid .btn-primary {
    background-color: var(--ceda-red) !important;
    border-color: var(--ceda-red) !important;
    color: #ffffff !important;
    border-radius: 0;
    font-family: var(--font-headings);
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.625rem 1.5rem;
    transition: all 0.2s ease;
}
.entity-form .btn-primary:hover,
.basicform .btn-primary:hover,
.entity-grid .btn-primary:hover {
    background-color: var(--ceda-red-dark) !important;
    border-color: var(--ceda-red-dark) !important;
}


/* ============================================================
   7. BREADCRUMBS
   ============================================================ */

.breadcrumb {
    background: transparent;
    padding: 1rem 0;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border-radius: 0;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    color: #999999;
}
.breadcrumb-item a {
    color: var(--ceda-red);
}
.breadcrumb-item.active {
    color: #666666;
}


/* ============================================================
   8. ALERTS & NOTIFICATIONS
   ============================================================ */

.alert {
    border-radius: 0;
    border-width: 0 0 0 4px;
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
}
.alert-success {
    border-left-color: #28a745;
    background-color: #d4edda;
    color: #155724;
}
.alert-danger,
.alert-error {
    border-left-color: var(--ceda-red);
    background-color: #f8d7da;
    color: #721c24;
}
.alert-warning {
    border-left-color: #ffc107;
    background-color: #fff3cd;
    color: #856404;
}
.alert-info {
    border-left-color: #17a2b8;
    background-color: #d1ecf1;
    color: #0c5460;
}


/* ============================================================
   9. SKIP TO CONTENT
   ============================================================ */

.skip-to-content,
.skip-to-content a,
.skip-nav,
.skip-to-main-content,
a[href="#mainContent"],
a[href="#mainNavigation"],
a[href="#content"] {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    z-index: 99999;
}

.skip-to-content a:focus,
.skip-nav:focus,
.skip-to-main-content:focus,
a[href="#mainContent"]:focus,
a[href="#mainNavigation"]:focus,
a[href="#content"]:focus {
    left: 0 !important;
    top: 0 !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    background: var(--ceda-red);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    text-decoration: none;
}


/* ============================================================
   10. MOBILE MENU
   ============================================================ */

.mobile-menu .submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.mobile-menu li.open .trigger svg {
    transform: rotate(180deg);
}
.mobile-menu .trigger svg {
    transition: transform 0.3s ease;
}

/* Mobile menu slide-in */
.mobile-menu {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ============================================================
   11. PROFILE DROPDOWN
   ============================================================ */

/* .ceda-profile-dropdown .submenu {
    pointer-events: none;
    transition: all 0.2s ease;
} */

.ceda-profile-dropdown .submenu {
    right: auto !important;
    left: 50% !important;
    --tw-translate-x: -50% !important;
    --tw-translate-y: 1.25rem !important; 
    transform: translate(var(--tw-translate-x), var(--tw-translate-y)) !important;
    pointer-events: none;
    transition: all 0.2s ease;
}

.ceda-profile-dropdown:hover .submenu {
    pointer-events: auto;
}


/* ============================================================
   12. PRINT STYLES
   ============================================================ */

@media print {
    header.l-siteHeader,
    .mobile-menu,
    .pre-footer,
    footer,
    .search-overlay,
    .skip-to-content {
        display: none !important;
    }

    main {
        padding-top: 0 !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }
}


@media (min-width: 1420px) {
    /* Add xxl-specific portal overrides here if needed */
}

/* ============================================================
   14. EVENTS LISTING
   ============================================================ */
.event-card .event-date {
    font-family: var(--font-headings);
    font-weight: 700;
    color: var(--ceda-red);
}
.event-card .event-title {
    font-family: var(--font-headings);
    font-weight: 700;
    text-transform: uppercase;
}
.event-card .event-location {
    color: #666666;
    font-size: 0.875rem;
}
