/**
 * @file
 * Drupal-specific CSS overrides for the Community Line theme.
 * This file handles differences between static HTML and Drupal-generated markup.
 */

/* ==========================================================================
   Menu Structure Fixes
   ========================================================================== */

.community-portal-style-nav .navbar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.community-portal-style-nav .navbar-nav > li {
    list-style: none;
    position: relative;
}

.community-portal-style-nav .navbar-nav .navbar-dropdown-item {
    display: inline-block;
}

.community-portal-style-nav .navbar-nav .navbar-dropdown-item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.community-portal-style-nav .navbar-nav .dropdown {
    position: relative;
}

.community-portal-style-nav .navbar-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 0;
    z-index: 1000;
    list-style: none;
    margin: 0;
}

.community-portal-style-nav .navbar-nav .dropdown:hover > .dropdown-menu {
    display: block;
}

.community-portal-style-nav .navbar-nav .dropdown-menu .dropdown-menu-item {
    list-style: none;
}

.community-portal-style-nav .navbar-nav .dropdown-menu .dropdown-menu-item a {
    display: block;
    padding: 10px 20px;
    color: #646464;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.875em;
}

.community-portal-style-nav .navbar-nav .dropdown-menu .dropdown-menu-item a:hover {
    color: #5c306d;
    background-color: #f5f5f5;
}

/* ==========================================================================
   Menu Hover States and Active States
   ========================================================================== */

.community-portal-style-nav .navbar-nav > li > a:hover,
.community-portal-style-nav .navbar-nav > li.nav-item-active > a,
.community-portal-style-nav .navbar-nav .dropdown > a:hover,
.community-portal-style-nav .navbar-nav a.active {
    color: #5c306d !important;
}

/* Active dropdown parent */
.community-portal-style-nav .navbar-nav .navbar-dropdown-item.nav-item-active > ul > li > a {
    color: #5c306d !important;
}

/* Active dropdown child */
.community-portal-style-nav .navbar-nav .dropdown-menu .dropdown-menu-item.nav-item-active a,
.community-portal-style-nav .navbar-nav .dropdown-menu .dropdown-menu-item a.active {
    color: #5c306d !important;
    font-weight: bold;
}

/* ==========================================================================
   Field Wrapper Fixes
   ========================================================================== */

.node .field__item {
    display: inline;
}

.node .field__label {
    display: none;
}

.paragraph .field {
    display: block;
}

/* ==========================================================================
   Hero Slider Fixes
   ========================================================================== */

.hero-gallery-slider .field--type-image,
.hero-gallery-slider .field__item {
    display: block;
    width: 100%;
}

.hero-gallery-slider img {
    width: 100%;
    height: auto;
}

.hero-gallery-slider .slick-track {
    display: flex !important;
}

.hero-gallery-slider .slick-slide {
    height: auto;
}

.hero-gallery-slider .slick-slide img {
    width: 100%;
    height: auto;
}

/* ==========================================================================
   Layout Fixes
   ========================================================================== */

/* Fix main content area padding for fixed header */
main {
    padding-top: 60px;
}

body {
    padding-top: 0;
}

/* ==========================================================================
   Footer Menu Styles
   ========================================================================== */

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

.footer-links li {
    list-style: none;
}

.footer-links a {
    color: #fff;
    text-decoration: underline;
}

.footer-links a:hover {
    text-decoration: none;
}

/* Primary footer - stacked vertically */
.footer-primary-navigations .footer-links {
    display: block;
}

.footer-primary-navigations .footer-links li {
    padding-bottom: 12px;
}

.footer-primary-navigations .footer-links a {
    display: block;
    font-family: arial;
    font-size: 12px;
    font-weight: 400;
}

/* Secondary footer - inline with separators */
.footer-secondary-navigations .footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.footer-secondary-navigations .footer-links li {
    position: relative;
    padding: 0 26px 0 0;
}

.footer-secondary-navigations .footer-links li:not(:last-child)::after {
    content: "|";
    position: absolute;
    right: 13px;
    top: 0;
    color: #fff;
}

.footer-secondary-navigations .footer-links a,
.footer-secondary-navigations .footer-links button {
    font-size: 10px;
    color: #fff;
}

.footer-secondary-navigations .ot-sdk-show-settings {
    background-color: transparent;
    border: none;
    color: #fff;
    font-size: 10px;
    padding: 0;
    cursor: pointer;
}

.footer-secondary-navigations .choice-icon.us {
    background-image: url('../images/your_privacy_choices_icon.svg');
    background-position: 0;
    background-repeat: no-repeat;
    background-size: 30px 14px;
    padding-left: 38px !important;
}

/* ==========================================================================
   Card Grid Improvements
   ========================================================================== */

.card-grid .field--name-field-cards {
    display: contents;
}

/* ==========================================================================
   Jobs Section - Fix Drupal field wrapper for 2-column layout
   ========================================================================== */

.job-content-wrapper > div {
    display: contents;
}

.job-content-wrapper > div > div {
    display: contents;
}

/* ==========================================================================
   Notification Section - Community Accordion 2-Column Grid
   ========================================================================== */

.community-accordion.notification-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
}

.community-accordion.notification-grid > div {
    display: contents;
}

.community-accordion.notification-grid > div > div {
    display: contents;
}

.community-accordion.notification-grid .comm-accordion-item {
    background-color: #f5f5f5;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .community-accordion.notification-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Article Block - Image and Text Layout
   ========================================================================== */

.article-content-wrapper {
    display: flex;
    flex-wrap: wrap;
}

.article-figure,
.thumbnail-img {
    width: 100%;
}

.article-figure img,
.thumbnail-img img {
    width: 100%;
    height: auto;
}

.article-info {
    padding: 0 15px;
}

/* ==========================================================================
   Article Page Fixes
   ========================================================================== */

.node--article-page .field--name-body {
    margin-bottom: 1rem;
}

.node--article-page .field--name-body p {
    margin-bottom: 1em;
}

/* ==========================================================================
   Responsive Mobile Navigation
   ========================================================================== */

@media (max-width: 1200px) {
    .community-portal-style-nav .navbar-nav {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .community-portal-style-nav .navbar-nav > li {
        width: 100%;
    }
    
    .community-portal-style-nav .navbar-nav .dropdown-menu {
        position: static;
        box-shadow: none;
        padding-left: 20px;
    }
}

/* ==========================================================================
   Hide Drupal Admin Toolbar on Frontend
   ========================================================================== */

/* Hide the admin toolbar completely */
#toolbar-administration,
.toolbar-oriented,
.toolbar,
.toolbar-bar,
.toolbar-tray,
#toolbar-item-administration-tray,
body.toolbar-loading:before {
    display: none !important;
}

/* Reset body padding that toolbar adds */
body.toolbar-fixed,
body.toolbar-horizontal,
body.toolbar-vertical {
    padding-top: 0 !important;
    padding-left: 0 !important;
}

/* Reset header positioning */
body.toolbar-fixed header#header,
body.toolbar-fixed.toolbar-tray-open header#header {
    top: 0 !important;
}
