/*-----------------------------------------------------
IMAGE OVERLAY
-----------------------------------------------------*/

/* Main overlay container - full screen dark background */
.image-overlay {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

/* Content wrapper - centers the image in the overlay */
.image-overlay-content {
    position: relative;
    margin: auto;
    top: 50%;
    transform: translateY(-50%);
    max-width: 90%;
    max-height: 90%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image container with border and padding */
.overlay-image-container {
    position: relative;
    display: inline-block;
    padding: 12px;
    border: 1px solid #2f5960;
    border-radius: 40px;
    background: #010708 !important;
}

/* The actual image with rounded corners */
.overlay-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    border-radius: 30px;
}

/* Close button positioned on top right */
.image-overlay-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1002;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color 0.3s ease;
    padding-left: 2px;
    padding-bottom: 2px;
}

/* Close button hover effect */
.image-overlay-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Article images become clickable */
.article-full .article-image {
    cursor: pointer;
}

/* Article image hover effect */
.article-full .article-image:hover {
    filter: brightness(1.2);
    transition: filter 0.3s ease;
}

/*-----------------------------------------------------
ENTITY DATA OVERLAY
-----------------------------------------------------*/

/* Main entity overlay container - full screen dark background */
.entity-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

/* Content wrapper - centers the entity data in the overlay */
.entity-overlay-content {
    position: relative;
    margin: 0;
    width: 100%;
    height: 100vh;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
}

/* Removed media query - using dynamic JavaScript scaling instead */

/* Entity data container with border and padding */
.entity-overlay-container {
    position: relative;
    display: inline-block;
    padding: 20px 20px 4px 20px;
    border: 1px solid #2f5960;
    border-radius: 25px;
    background: #010708 !important;
    min-width: 320px;
    max-width: 840px;
    width: 70%;
    transform-origin: center center;
    transition: transform 0.3s ease;
}

/* Close button for entity overlay */
.entity-overlay-close {
    position: absolute;
    top: 4px;
    right: 4px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color 0.3s ease;
    transform: translate(-1px, -1px);
}

/* Entity name container with dropcap layout */
.entity-name-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

/* Entity name dropcap */
.entity-name-dropcap {
    background: none;
    width: clamp(50px, 8.4vw, 85px);
    height: clamp(50px, 8.4vw, 85px);
    margin-right: 0;
    margin-bottom: 0;
    display: block;
    box-sizing: border-box;
    background-repeat: no-repeat;
    background-size: 120%;
    background-position: center center;
    flex-shrink: 0;
}

/* Entity name content wrapper */
.entity-name-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-width: 0;
}

/* Entity name title */
.entity-name-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(20px, 2.8vw, 40px);
    font-weight: normal;
    color: #9de6f1;
    line-height: 1.3;
    text-transform: none !important;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: -10px;
    text-align: left;
    padding-right: 40px;
}

/* Entity name subtitle */
.entity-name-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: normal;
    color: #32787f;
    line-height: 1.2;
    text-transform: none !important;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0;
    text-align: left;
    padding-right: 40px;
    opacity: 0.8;
}

/* Entity image container */
.entity-image-container {
    position: relative;
    text-align: center;
    margin: 0 0 20px 0;
    width: 100%;
}

/* Entity image styling */
.entity-image {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4/3;
    /* border-radius: 26px; */
    object-fit: cover;
    /* cursor: pointer; */
    /* transition: filter 0.3s ease; */
}

/* Entity image hover effect */
/* TEMPORARILY DISABLED - uncomment when needed
.entity-image:hover {
    filter: brightness(1.2);
}
*/

/* Entity snippet styling */
.entity-snippet {
    font-family: 'Crimson Text', serif;
    font-size: clamp(16px, 2.5vw, 28px);
    line-height: 1.3;
    text-align: left;
    hyphens: auto;
    color: #519dc8;;
    word-wrap: break-word;
    font-weight: 400;
    margin-bottom: 20px;
    margin-top: 10px;
}

.entity-snippet p {
    margin: 0;
}

/* Entity description styling */
.entity-description {
    /* font-family: 'Crimson Text', serif; */
    font-family: 'Outfit', sans-serif;
    font-size: clamp(8px, 2.5vw, 18px);
    line-height: 1.0;
    text-align: left;
    hyphens: auto;
    color: #274e62;
    word-wrap: break-word;
    font-weight: 400;
    margin-bottom: 10px;
}

.entity-description p {
    margin: 0;
}

/* NewsItem overlay specific styling */
#newsitemOverlay .newsitem-source,
#newsitemOverlay .newsitem-url {
    margin: 10px 0;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    color: #3a787f;
    line-height: 1.4;
}

#newsitemOverlay .newsitem-source strong,
#newsitemOverlay .newsitem-url strong {
    display: inline-block;
    width: 60px;
    color: #6daab8;
}

#newsitemOverlay .newsitem-url a {
    font-family: 'Crimson Text', serif;
    font-size: 20px;
    line-height: 1.3;
    text-align: left;
    color: #6f9dc8;
    font-style: italic;
    cursor: pointer;
    opacity: 0.6;
}

#newsitemOverlay .newsitem-url a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* NewsItem specific title styling - smaller and wrapping */
#newsitemOverlay .entity-name-title {
    font-size: clamp(16px, 2.2vw, 32px) !important; /* Smaller than entity title */
    white-space: normal !important; /* Allow wrapping */
    overflow: visible !important; /* Show wrapped text */
    text-overflow: initial !important; /* No ellipsis */
    line-height: 1.2 !important; /* Tighter line height for wrapping */
}

/* NewsItem subtitle - move to top and uppercase */
#newsitemOverlay .entity-name-subtitle {
    order: -1; /* Move above title */
    text-transform: uppercase !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 5px !important;
    margin-top: 0 !important;
}

/* NewsItem name content - adjust for reordered subtitle */
#newsitemOverlay .entity-name-content {
    display: flex;
    flex-direction: column;
}

/* NewsItem dropcap - make it larger */
#newsitemOverlay .entity-name-dropcap {
    width: clamp(60px, 10vw, 100px) !important; /* Larger than default (was 50px-85px) */
    height: clamp(60px, 10vw, 100px) !important;
    background-size: 115% !important; /* Slightly smaller background to fit better */
}