/* ==========================================================================
   Atom Integration – Astra-compatible styles
   Uses Astra CSS variables and design tokens for visual consistency.
   Theme palette:
     --ast-global-color-0: #ffc03d  (gold — primary accent)
     --ast-global-color-1: #ffae00  (dark gold — hover)
     --ast-global-color-2: #212d45  (dark navy — secondary/text accent)
     --ast-global-color-3: #4b4f58  (dark gray — body text)
     --ast-global-color-4: #f7f7f7  (light gray — section backgrounds)
     --ast-global-color-5: #FFFFFF  (white — card backgrounds)
     --ast-global-color-7: #212d45  (dark navy — header bg)
   ========================================================================== */

/* ---------- Page header (matches UAGB dde5c922 hero pattern) ---------- */
.atom-page-header {
    position: relative;
    background-image: url('../../uploads/2026/03/pexels-photo-5095886.jpeg');
    background-repeat: no-repeat;
    background-position: 50% 50%;
    background-size: cover;
    background-attachment: scroll;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    overflow: visible;
    padding: 0;
}

.atom-page-header.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

.atom-page-header-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 0;
}

.atom-page-header-inner {
    position: relative;
    z-index: 1;
    background-color: var(--ast-global-color-7, #212d45);
    width: 75%;
    padding: 150px 300px 150px 255px;
    border-bottom-right-radius: 300px;
    box-sizing: border-box;
}

.atom-page-header-title {
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

@media only screen and (max-width: 976px) {
    .atom-page-header-inner {
        width: 80%;
        padding: 100px 32px;
        border-bottom-right-radius: 200px;
    }
}

@media only screen and (max-width: 767px) {
    .atom-page-header-inner {
        width: 90%;
        padding: 80px 24px;
        border-bottom-right-radius: 100px;
    }
}

/* Remove Astra's default #primary margins so the header sits flush */
.ast-plain-container.ast-no-sidebar #primary {
    margin-top: 0;
    margin-bottom: 0;
}

/* ---------- Hero search bar (homepage) ---------- */
.atom-hero-search {
    margin-top: 1.5em;
    width: 100%;
    max-width: 500px;
}

.atom-hero-search-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.atom-hero-search-input {
    flex: 1;
    padding: 0.85em 1em;
    border: none;
    border-radius: 6px 0 0 6px;
    font-size: 1rem;
    color: var(--ast-global-color-3, #4b4f58);
    background: #fff;
    outline: none;
}

.atom-hero-search-input::placeholder {
    color: #999;
}

.atom-hero-search-button {
    padding: 0.85em 1.5em;
    border: none;
    border-radius: 0 6px 6px 0;
    background: var(--ast-global-color-0, #ffc03d);
    color: var(--ast-global-color-2, #212d45);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.atom-hero-search-button:hover {
    background: var(--ast-global-color-1, #ffae00);
}

@media only screen and (max-width: 767px) {
    .atom-hero-search {
        max-width: 100%;
    }
}

/* ---------- Search form ---------- */
.atom-search-form {
    margin-bottom: 1.5em;
    color: var(--ast-global-color-3, #4b4f58);
    background: var(--ast-global-color-5, #fff);
    border: 1px solid var(--ast-border-color, #eaeaea);
    border-radius: 6px;
    padding: 1.5em;
}

.atom-search-fields {
    display: flex;
    flex-direction: column;
    row-gap: 1em;
    width: 100%;
}

.atom-search-row {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    width: 100%;
}

.atom-search-row-inner {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.atom-search-label {
    margin-bottom: 0;
    flex: 2 1 0;
}

.atom-search-label-text {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25em;
    color: var(--ast-global-color-2, #212d45);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.atom-search-input,
.atom-search-select {
    width: 100%;
    padding: 0.75em;
    border: 1px solid var(--ast-border-color, #eaeaea);
    border-radius: 6px;
    color: var(--ast-global-color-3, #4b4f58);
    background: var(--ast-global-color-4, #f7f7f7);
    transition: all 0.2s linear;
    font-size: 0.95em;
}

.atom-search-input:focus,
.atom-search-select:focus {
    background-color: #fff;
    border-color: var(--ast-global-color-0, #ffc03d);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 192, 61, 0.2);
}

.atom-search-in-text {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    font-weight: 600;
    color: var(--ast-global-color-3, #4b4f58);
}

.atom-search-operator-row {
    display: flex;
    align-items: flex-end;
    gap: 1em;
}

.atom-search-operator-select {
    width: 160px;
    padding: 0.75em;
    border: 1px solid var(--ast-border-color, #eaeaea);
    border-radius: 6px;
    color: var(--ast-global-color-3, #4b4f58);
    background: var(--ast-global-color-4, #f7f7f7);
}

.atom-search-operator-select:focus {
    border-color: var(--ast-global-color-0, #ffc03d);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 192, 61, 0.2);
}

.atom-search-actions {
    margin-top: 1em;
    display: flex;
    gap: 1em;
    justify-content: flex-end;
}

.atom-search-submit-row {
    margin-top: 1em;
    display: flex;
    gap: 1em;
}

.atom-search-button {
    padding: 0.7em 1.8em;
    border: none;
    border-radius: 6px;
    background: var(--ast-global-color-0, #ffc03d);
    color: var(--ast-global-color-2, #212d45);
    cursor: pointer;
    line-height: 1.6;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.2s linear;
}

.atom-search-button:hover {
    background: var(--ast-global-color-1, #ffae00);
}

.atom-search-add {
    padding: 0.6em 1.2em;
    border: 1px solid var(--ast-global-color-2, #212d45);
    border-radius: 6px;
    background: transparent;
    color: var(--ast-global-color-2, #212d45);
    cursor: pointer;
    line-height: 1.6;
    font-weight: 500;
    font-size: 0.9em;
    transition: all 0.2s linear;
}

.atom-search-add:hover {
    background: var(--ast-global-color-2, #212d45);
    color: #fff;
}

.atom-search-remove {
    padding: 0.6em 1em;
    border: 1px solid var(--ast-border-color, #eaeaea);
    border-radius: 6px;
    background: transparent;
    color: var(--ast-global-color-3, #4b4f58);
    cursor: pointer;
    margin-bottom: 0;
    font-size: 0.9em;
    transition: all 0.2s linear;
}

.atom-search-remove:hover {
    border-color: #c00;
    color: #c00;
}

/* ---------- Top-level descriptions checkbox ---------- */
.atom-toplod-wrap {
    margin-bottom: 2em;
}

.atom-toplod-wrap label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5em;
    color: var(--ast-global-color-3, #4b4f58);
    font-size: 0.95em;
}

.atom-toplod-wrap input[type="checkbox"] {
    margin-right: 0.5em;
    accent-color: var(--ast-global-color-0, #ffc03d);
}

/* ---------- Tabs ---------- */
.atom-results-tabs {
    margin-top: 2em;
}

.atom-tab-buttons {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--ast-border-color, #eaeaea);
    margin-bottom: 1.5em;
}

.atom-tab-btn {
    padding: 0.75em 1.5em;
    border: none;
    background: transparent;
    border-bottom: 3px solid transparent;
    font-weight: 400;
    cursor: pointer;
    color: var(--ast-global-color-3, #4b4f58);
    transition: all 0.2s linear;
    font-size: 0.95em;
}

.atom-tab-btn:hover {
    color: var(--ast-global-color-2, #212d45);
}

.atom-tab-btn.atom-tab-active {
    border-bottom-color: var(--ast-global-color-0, #ffc03d);
    color: var(--ast-global-color-2, #212d45);
    font-weight: 600;
}

.atom-tab-content {
    display: none;
}

.atom-tab-content.atom-tab-content-active {
    display: block;
}

/* ---------- Results list ---------- */
.atom-api-list,
.atom-actors-list {
    color: var(--ast-global-color-3, #4b4f58);
}

.atom-api-item,
.atom-actor-item {
    display: flex;
    align-items: stretch;
    background: var(--ast-global-color-5, #fff);
    border: 1px solid var(--ast-border-color, #eaeaea);
    margin-bottom: 1em;
    padding: 1.25em;
    border-radius: 6px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.atom-api-item:hover,
.atom-actor-item:hover {
    border-color: var(--ast-global-color-0, #ffc03d);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.atom-item-thumb {
    flex: 0 0 120px;
    margin-right: 1.25em;
    display: flex;
    align-items: center;
}

.atom-item-thumb img {
    max-width: 120px;
    max-height: 100%;
    border-radius: 6px;
    object-fit: contain;
    display: block;
}

.atom-item-body {
    flex: 1;
}

.atom-item-body h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.atom-item-body h3 a {
    color: var(--ast-global-color-2, #212d45);
    text-decoration: none;
}

.atom-item-body h3 a:hover {
    color: var(--ast-global-color-0, #ffc03d);
}

.atom-item-info {
    margin-bottom: 0.25em;
    color: var(--ast-global-color-3, #4b4f58);
    font-size: 0.93em;
    line-height: 1.5;
}

.atom-item-meta {
    margin-bottom: 0.5em;
    color: var(--ast-global-color-3, #4b4f58);
    font-size: 0.88em;
}

/* ---------- Pagination ---------- */
.atom-pagination {
    margin: 1.5em 0;
    display: flex;
    align-items: center;
    gap: 0.5em;
    color: var(--ast-global-color-3, #4b4f58);
    font-size: 0.93em;
}

.atom-pagination a {
    display: inline-block;
    padding: 0.5em 1em;
    border: 1px solid var(--ast-global-color-2, #212d45);
    border-radius: 6px;
    color: var(--ast-global-color-2, #212d45);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.atom-pagination a:hover {
    background: var(--ast-global-color-0, #ffc03d);
    border-color: var(--ast-global-color-0, #ffc03d);
    color: var(--ast-global-color-2, #212d45);
}

.atom-pagination .atom-page-info {
    margin-left: 0.5em;
    color: var(--ast-global-color-3, #4b4f58);
}

/* ---------- Children thumbnail carousel ---------- */
.atom-carousel {
    position: relative;
    margin: 1.5em -2em 2em;
    background: var(--ast-global-color-2, #212d45);
    border-radius: 8px;
    padding: 1.5em 0;
}

.atom-carousel-track {
    display: flex;
    gap: 1em;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5em calc(50% - 175px);
}

.atom-carousel-track::-webkit-scrollbar {
    display: none;
}

.atom-carousel-slide {
    flex: 0 0 auto;
    scroll-snap-align: center;
    width: 350px;
    text-decoration: none;
    display: block;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.atom-carousel-slide:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.atom-carousel-slide img {
    width: 350px;
    height: 260px;
    object-fit: cover;
    display: block;
}

.atom-carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5em 0.75em 0.75em;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
    font-size: 0.85em;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.atom-carousel-slide:hover .atom-carousel-caption {
    opacity: 1;
}

.atom-carousel-prev,
.atom-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2.5em;
    line-height: 1;
    cursor: pointer;
    padding: 0.3em;
    transition: color 0.2s ease;
}

.atom-carousel-prev:hover,
.atom-carousel-next:hover {
    color: var(--ast-global-color-0, #ffc03d);
}

.atom-carousel-prev:disabled,
.atom-carousel-next:disabled {
    opacity: 0.15;
    cursor: default;
    pointer-events: none;
}

.atom-carousel-prev {
    left: 0.5em;
}

.atom-carousel-next {
    right: 0.5em;
}

@media (max-width: 768px) {
    .atom-carousel { margin: 1em -1em 1.5em; padding: 1em 0; }
    .atom-carousel-slide { width: 260px; }
    .atom-carousel-slide img { width: 260px; height: 200px; }
    .atom-carousel-track { padding: 0.5em calc(50% - 130px); }
    .atom-carousel-prev,
    .atom-carousel-next { font-size: 2em; padding: 0.2em; }
}

/* ---------- Description layout ---------- */
.atom-description-layout {
    display: flex;
    gap: 2em;
    max-width: 1200px;
    margin: 3em auto 0;
}

/* ---------- Tree view column ---------- */
.atom-treeview-col {
    flex: 0 0 450px;
    min-width: 300px;
    max-width: 450px;
    background: var(--ast-global-color-4, #f7f7f7);
    border: 1px solid var(--ast-border-color, #eaeaea);
    border-radius: 6px;
    padding: 1.25em;
    overflow-x: auto;
}

.atom-treeview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
    padding-bottom: 0.75em;
    border-bottom: 2px solid var(--ast-global-color-0, #ffc03d);
}

.atom-treeview-header h2 {
    margin: 0;
    font-size: 1.1em;
    color: var(--ast-global-color-2, #212d45);
    font-weight: 600;
}

.atom-treeview-header a {
    font-size: 0.85em;
    color: var(--ast-global-color-2, #212d45);
    text-decoration: none;
    font-weight: 500;
}

.atom-treeview-header a:hover {
    color: var(--ast-global-color-0, #ffc03d);
}

.atom-treeview-target {
    min-height: 200px !important;
    display: block !important;
    visibility: visible !important;
    font-size: 0.85em !important;
}

.atom-treeview-target ul,
.atom-treeview-target li,
.atom-treeview-target a {
    visibility: visible !important;
}

.atom-treeview-target ul {
    display: block !important;
}

.atom-treeview-target li {
    display: block !important;
}

.atom-treeview-target a {
    display: inline-block !important;
}

.atom-treeview-target .jstree-container-ul {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.atom-treeview-target .jstree-node {
    display: block !important;
    list-style-type: none !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 22px !important;
    height: auto !important;
    line-height: 22px !important;
    overflow: visible !important;
    position: relative !important;
}

.atom-treeview-target .jstree-node::before,
.atom-treeview-target .jstree-node::after {
    display: none !important;
    content: none !important;
}

.atom-treeview-target .jstree-children {
    padding-left: 8px !important;
}

.atom-treeview-target .jstree-anchor {
    display: inline-block !important;
    padding: 2px 4px 2px 0 !important;
    text-decoration: none !important;
    color: var(--ast-global-color-3, #4b4f58) !important;
    line-height: 22px !important;
    height: auto !important;
    position: relative !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.85em !important;
    max-width: 100% !important;
    vertical-align: middle !important;
}

@media (min-width: 768px) {
    .atom-treeview-target .jstree-anchor {
        font-size: 0.75em !important;
    }
}

.atom-treeview-target .jstree-anchor:hover {
    background-color: rgba(255, 192, 61, 0.1) !important;
    color: var(--ast-global-color-2, #212d45) !important;
    text-decoration: underline !important;
}

/* Bold styling for the current page in the tree */
.atom-tree-current > .jstree-anchor {
    font-weight: 700 !important;
    color: var(--ast-global-color-2, #212d45) !important;
}

.atom-treeview-target .jstree-icon {
    display: inline-block !important;
    line-height: 22px !important;
    vertical-align: middle !important;
    margin-right: 2px !important;
    background: none !important;
}

.atom-treeview-target .jstree-ocl {
    cursor: pointer !important;
    display: inline-block !important;
    vertical-align: middle !important;
    text-align: center !important;
    margin-right: 4px !important;
}

.atom-treeview-target .jstree-ocl::before {
    content: '\25B6' !important;
    display: inline-block !important;
    font-size: 10px !important;
    line-height: 16px !important;
}

.atom-treeview-target .jstree-open > .jstree-ocl::before {
    content: '\25BC' !important;
}

.atom-treeview-target .jstree-leaf > .jstree-ocl {
    visibility: hidden !important;
}

.atom-treeview-target .jstree-themeicon {
    display: none !important;
}

.atom-treeview-target .jstree-loading > .jstree-ocl::before {
    content: '\27F3' !important;
    animation: jstree-spin 1s linear infinite !important;
    display: inline-block !important;
}

@keyframes jstree-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---------- Description page ---------- */
.atom-description-page {
    max-width: 700px;
    margin: 0;
    padding: 0;
}

.atom-description-page h1 {
    margin-bottom: 1em;
    color: var(--ast-global-color-2, #212d45);
}

.atom-description-page section {
    border-bottom: 1px solid var(--ast-border-color, #eaeaea);
    margin-bottom: 1.5em;
}

.atom-description-page section h2 {
    width: 100%;
    font-size: 1.1em;
    margin: 0;
    padding: 0.75em 0;
    border-bottom: 2px solid var(--ast-global-color-0, #ffc03d);
    color: var(--ast-global-color-2, #212d45);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.atom-description-page ul {
    padding: 0 !important;
    margin: 0 !important;
}

.atom-description-page a {
    color: var(--ast-global-color-2, #212d45);
    font-size: 1rem;
    line-height: 1.5;
    text-decoration: none;
    font-weight: 500;
}

.atom-description-page a:hover {
    color: var(--ast-global-color-0, #ffc03d);
}

.atom-description-page ul li {
    color: var(--ast-global-color-3, #4b4f58);
    font-size: 1rem;
    line-height: 1.5;
    list-style-type: none;
}

/* ---------- Field rows ---------- */
.atom-field-row {
    display: flex;
    border-bottom: 1px solid var(--ast-border-color, #eaeaea);
}

.atom-field-label {
    flex: 0 0 30%;
    margin: 0;
    padding: 0.75em;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--ast-global-color-2, #212d45);
    text-align: right;
    border-right: 1px solid var(--ast-border-color, #eaeaea);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.atom-field-value {
    color: var(--ast-global-color-3, #4b4f58);
    flex: 1;
    padding: 0.75em;
}

.atom-field-value ul {
    margin: 0;
    padding-left: 1.5em;
}

/* ---------- Image container ---------- */
.atom-image-container {
    text-align: center;
    margin-bottom: 2em;
}

.atom-image-container img {
    display: inline-block;
    max-width: 100%;
    height: auto;
}

/* ---------- Creator block ---------- */
.atom-creator-block {
    margin-bottom: 1em;
}

.atom-creator-name {
    font-weight: 600;
}

.atom-creator-name a {
    color: var(--ast-global-color-2, #212d45);
    text-decoration: none;
}

.atom-creator-name a:hover {
    color: var(--ast-global-color-0, #ffc03d);
}

.atom-creator-dates {
    margin-bottom: 0.5em;
    color: var(--ast-global-color-3, #4b4f58);
}

.atom-creator-history {
    margin-top: 0.5em;
}

.atom-creator-history h4 {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 0.25em;
    color: var(--ast-global-color-2, #212d45);
}

/* ---------- Back link ---------- */
.atom-back-link {
    margin: 2em 0;
    border: none;
}

a.atom-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.5em 1em;
    border: 1px solid var(--ast-global-color-2, #212d45);
    border-radius: 6px;
    color: var(--ast-global-color-2, #212d45);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.93em;
    transition: all 0.2s ease;
}

a.atom-back-link:hover {
    background: var(--ast-global-color-0, #ffc03d);
    border-color: var(--ast-global-color-0, #ffc03d);
    color: var(--ast-global-color-2, #212d45);
}

/* ---------- Actor page ---------- */
.atom-actor-thumb {
    margin-bottom: 2em;
}

.atom-actor-thumb img {
    max-width: 400px;
    height: auto;
    border-radius: 6px;
}

/* ---------- Description column ---------- */
.atom-description-col {
    flex: 1;
}

/* ---------- Up one level link ---------- */
.atom-up-level {
    font-size: 0.85em;
    color: var(--ast-global-color-2, #212d45);
    text-decoration: none;
    font-weight: 500;
}

.atom-up-level:hover {
    color: var(--ast-global-color-0, #ffc03d);
}

/* ---------- Error messages ---------- */
.atom-error {
    color: #c00;
    padding: 1em;
    border: 1px solid #fcc;
    border-radius: 6px;
    background: #fff5f5;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .atom-description-layout {
        flex-direction: column;
    }

    .atom-treeview-col {
        flex: none;
        max-width: 100%;
        min-width: 0;
    }

    .atom-field-row {
        flex-direction: column;
    }

    .atom-field-label {
        text-align: left;
        border-right: none;
        border-bottom: 1px solid var(--ast-border-color, #eaeaea);
        flex: none;
    }

    .atom-search-row-inner {
        flex-direction: column;
    }

    .atom-search-in-text {
        flex: none;
    }
}
