.glass-header-bar {
    background: rgba(255, 255, 255, 0.4); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: var(--space-xl);
    width: 100%; 
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.glass-header-bar::before {
    content: '';
    position: absolute;
    top: 0; left: -150%;
    width: 70%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    animation: sheen-animation 5s ease-in-out infinite;
}

@keyframes sheen-animation {
    0% {
        left: -150%;
    }
    100% {
        left: 150%;
    }
}


.glass-header-bar .page-header {
    padding: var(--space-md) 0; 
    border-bottom: none;
    margin-bottom: 0;
}

.glass-header-bar .page-header-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    width: 100%;
}

.glass-header-bar .page-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin: 0;
}

.glass-header-bar .page-slogan {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-text-subtle);
    margin: 0;
}

/* --- Page-Level Styles --- */
body#page-insights {
    background-color: #F0F2F5;
    min-height: 1080px;
}

.insights-page .container {
    max-width: var(--container-width-md);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* This is the old header style, no longer used by the glass bar */
.keynote-title-card {
    padding: var(--space-xl) 0;
    text-align: center;
    border-bottom: 1px solid var(--color-bg-light);
    margin-bottom: var(--space-xl);
}

/* --- 2. Main 3-Column Layout --- */
.insights-layout {
    display: grid;
    grid-template-columns: 240px 1fr 340px;
    gap: var(--space-lg);
    align-items: flex-start;
    margin-bottom: 40px;
}

.left-column, .right-column {
    position: sticky;
    top: 64px;
}

.feed-container {
    max-width: 100%;
}

/* --- 3. Sidebar Column Components --- */
.left-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.mini-box {
    background-color: var(--color-bg-white);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    border: 1px solid var(--color-bg-light);
}

.mini-box h3 {
    margin: 0 0 var(--space-xs) 0;
    font-size: 1rem;
    font-weight: 600;
}

.topic-list, .links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
}

.topic-list a, .links-list a {
    color: var(--color-text-subtle);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.topic-list a:hover, .links-list a:hover {
    color: var(--color-text-link);
}

.featured-character-card {
    background-color: var(--color-bg-white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-bg-light);
    overflow: hidden;
}

.featured-character-card .character-image {
    width: 100%;
    aspect-ratio: 1 / 1.2;
    object-fit: cover;
    display: block;
}

.featured-character-card .character-info {
    padding: var(--space-md);
    text-align: center;
}

.featured-character-card h3 {
    margin: 0 0 4px 0;
    font-size: 1.2rem;
}

.featured-character-card p {
    margin: 0 0 var(--space-md) 0;
    font-size: 0.9rem;
    color: var(--color-text-subtle);
}

.featured-character-card .btn {
    width: 100%;
}

/* --- 4. Center Feed Components --- */
.main-feed {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.article-card {
    background-color: var(--color-bg-white);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    box-shadow: none;
    border: 1px solid #DADDE1;
    transition: border-color 0.3s ease;
}

.post-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.post-header img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--color-bg-light);
}

.post-header .author-info {
    line-height: 1.3;
}

.post-header .author-name {
    font-weight: 600;
    color: var(--color-text-dark);
}

.post-header .post-date {
    font-size: 0.9rem;
    color: var(--color-text-subtle);
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-xs);
    margin-top: var(--space-xs);
}

.post-actions-buttons {
    display: flex;
    justify-content: flex-start;
    flex-grow: 1;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: transparent;
    border: none;
    padding: 10px;
    border-radius: var(--radius-xs);
    width: 50%;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-subtle);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.action-btn:hover {
    background-color: var(--color-bg-light);
}

.action-btn.active {
    color: var(--color-text-link);
}

.action-btn .count {
    font-weight: 400;
    font-size: 0.9rem;
}

.view-count {
    font-size: 0.9rem;
    color: var(--color-text-subtle);
    padding: 0 var(--space-sm);
}

.media-grid {
    display: grid;
    grid-gap: 1px; 
    margin-top: var(--space-md);
    border-radius: var(--radius-xs);
    overflow: hidden; 
}

.media-item {
    cursor: pointer;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.media-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-item.video-thumbnail {
    position: relative;
}

.play-button-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.3);
    color: white;
    font-size: 4rem;
    transition: background-color 0.2s ease;
}

.media-item.video-thumbnail:hover .play-button-overlay {
    background-color: rgba(0,0,0,0.5);
}
.read-more-btn {
  color: var(--color-text-link);
  cursor: pointer;  
  font-weight: 500; 
}

.read-more-btn:hover {
  text-decoration: none;
  color: var(--color-primary-gold-hover);
}

.lightbox-video-container {
    display: none; /* Hidden by default */
    background-color: #000;
    padding: 20px;
    grid-area: viewer;

}

.lightbox-video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.media-grid[data-media-count="1"] .media-item {
    aspect-ratio: 16 / 9;
}

.media-grid[data-media-count="2"] {
    grid-template-columns: 1fr 1fr;
}

.media-grid[data-media-count="3"] {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 16 / 9; 
    grid-template-areas:
        "large small-1"
        "large small-2";
}
.media-grid[data-media-count="3"] .media-item:nth-child(1) { grid-area: large; }
.media-grid[data-media-count="3"] .media-item:nth-child(2) { grid-area: small-1; }
.media-grid[data-media-count="3"] .media-item:nth-child(3) { grid-area: small-2; }

.media-grid[data-media-count="4"] {
    /* Defines a 2-column grid where the left is twice as wide as the right */
    grid-template-columns: 2fr 1fr;
    /* Defines three equal-height rows */
    grid-template-rows: 1fr 1fr 1fr;
    /* A square aspect ratio often looks good for this layout */
    aspect-ratio: 1 / 1;
    /* This creates a visual map of our new layout */
    grid-template-areas:
        "large small-1"
        "large small-2"
        "large small-3";
}

/* Assigns the 1st image to the "large" area */
.media-grid[data-media-count="4"] .media-item:nth-child(1) {
    grid-area: large;
}

/* Assigns the 2nd image to the top-right "small-1" area */
.media-grid[data-media-count="4"] .media-item:nth-child(2) {
    grid-area: small-1;
}

/* Assigns the 3rd image to the middle-right "small-2" area */
.media-grid[data-media-count="4"] .media-item:nth-child(3) {
    grid-area: small-2;
}

/* Assigns the 4th image to the bottom-right "small-3" area */
.media-grid[data-media-count="4"] .media-item:nth-child(4) {
    grid-area: small-3;
}

.media-grid[data-media-count="5+"] {
    grid-template-columns: 1fr 1fr;
}

/* This rule hides the 5th, 6th, etc., images from view */
.media-grid[data-media-count="5+"] .media-item:nth-child(n+5) {
    display: none;
}

/* This rule targets the 4th (last visible) item to prepare it for the overlay */
.media-grid[data-media-count="5+"] .media-item:nth-child(4) {
    position: relative;
    cursor: pointer;
}

/* This pseudo-element IS the overlay. It reads the text from our data attribute. */
.media-grid[data-media-count="5+"] .media-item:nth-child(4)::after {
    content: attr(data-overlay-text); 
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 2.5rem;
    font-weight: 600;
}

.btn.linkedin-like {
  width: 100%;
  background: transparent;
  border: 1px solid var(--color-primary-gold);
  color: var(--color-primary-gold);
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color .15s ease, color .15s .05s ease, transform .06s ease;
  cursor: pointer;
}
.lightbox-actions .btn.linkedin-like {
  width: 100%; 
  padding: 8px 14px;
}

.btn.linkedin-like:not(.disabled):not([disabled]):hover,
.btn.linkedin-like:not([disabled]):not(.disabled):focus {
  background-color: var(--color-primary-gold);
  color: var(--color-bg-white);
  transform: translateY(-1px);
}

.btn.linkedin-like.disabled,
.btn.linkedin-like[disabled] {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
  background: transparent;
  color: var(--color-primary-gold);
}

/* Optional: visible focus ring for accessibility */
.btn.linkedin-like:focus {
  outline: 3px solid rgba(255, 210, 124, 0.18);
  outline-offset: 2px;
}
/* --- 5. LinkedIn-Style Lightbox --- */
.linkedin-lightbox-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.linkedin-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.linkedin-lightbox-modal {
    width: 100%;
    height: 100%;
    max-width: 1680px;
    max-height: 1200px;
    background-color: var(--color-bg-white);
    border-radius: var(--radius-xs);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.linkedin-lightbox-overlay.active .linkedin-lightbox-modal {
    transform: scale(1);
}

.lightbox-header {
    display: flex;
    justify-content: flex-end;
    padding: 4px 8px;
    border-bottom: 1px solid var(--color-bg-light);
    flex-shrink: 0;
}

.lightbox-close {
    font-size: 1.5rem; 
    color: var(--color-text-subtle);
    background-color: transparent;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.lightbox-close:hover {
    background-color: var(--color-bg-light);
}

.lightbox-content-area {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "viewer sidebar";
    height: 100%;
    overflow: hidden;
    position: relative;
}

.lightbox-image-viewer {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--color-bg-dark);
    overflow: hidden;
    grid-area: viewer;
}

#lightbox-image { 
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-counter {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: rgba(0,0,0,0.5);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex; /* Arrows are now always visible */
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    z-index: 10; /* This ensures they appear ON TOP of the video iframe */
}

.lightbox-nav:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

.lightbox-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--color-bg-white);
}

.lightbox-viewer-wrapper {
    position: relative;
    display: grid; 
    grid-template-areas: "media";
    height: 100%;
}

.lightbox-image-viewer, 
.lightbox-video-container {
    grid-area: media;
}

.sidebar-section {
    padding: var(--space-xs);
}

#lightbox-author-info.sidebar-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--space-sm) var(--space-md); 
}

.sidebar-post-text {
    padding: 0 var(--space-md) var(--space-md) var(--space-md);
}

.sidebar-post-text p {
    margin:0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.sidebar-comments-stream {
    flex-grow: 1; 
}

.sidebar-comments-stream .no-comments {
    color: var(--color-text-subtle);
}

.sidebar-comment-form {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-bg-light);
}

.sidebar-comment-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: var(--space-xs);
    border-radius: var(--radius-xs);
    border: 1px solid #DADDE1;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    min-height: 44px;
    resize: none;
    overflow-y: hidden;
    margin-bottom: var(--space-xs);
    background-color: var(--color-bg-medium);
}

.sidebar-comment-form textarea:focus {
    outline: none;
    box-shadow: 0 0 0 0 ;
}

.sidebar-comment-form .button-wrapper {
    display: flex;
    justify-content: flex-end;
}

.sidebar-comment-form .btn {
    width: auto;
    padding: 0 var(--space-md);
    height: 38px;
}


/* --- 6. Skeleton Loading Placeholders --- */
body.is-loading .keynote-title-card h1,
body.is-loading .keynote-title-card p {
    animation: placeholder-shimmer 2s linear infinite;
    background-color: #e0e0e0;
    background-image: linear-gradient(to right, #e0e0e0 0%, #f0f0f0 40%, #e0e0e0 80%, #e0e0e0 100%);
    background-repeat: no-repeat;
    background-size: 2000px 100%;
    color: transparent !important;
    border-radius: var(--radius-xs);
    margin-left: auto;
    margin-right: auto;
}

body.is-loading .keynote-title-card h1 { height: 48px; width: 250px; }
body.is-loading .keynote-title-card p { height: 24px; width: 450px; margin-top: 16px; }
body.is-loading .article-card { visibility: hidden; }

.media-item {
    animation: placeholder-shimmer 2s linear infinite;
    background-color: #e0e0e0;
    background-image: linear-gradient(to right, #e0e0e0 0%, #f0f0f0 40%, #e0e0e0 80%, #e0e0e0 100%);
    background-repeat: no-repeat;
    background-size: 2000px 100%;
}

.media-item img {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.media-item.loaded img {
    opacity: 1;
}

.media-item.loaded {
    background-image: none;
    animation: none;
}
.lightbox-image-viewer.is-loading {
    animation: placeholder-shimmer 2s linear infinite;
    background-color: #222; 
    background-image: linear-gradient(to right, #222 0%, #333 40%, #222 80%, #222 100%);
    background-repeat: no-repeat;
    background-size: 2000px 100%;
}

.lightbox-image-viewer.is-loading #lightbox-image {
    opacity: 0;
}

.article-card.is-loading-placeholder .placeholder-avatar,
.article-card.is-loading-placeholder .placeholder-line {
    animation: placeholder-shimmer 2s linear infinite;
    background-color: #e0e0e0;
    background-image: linear-gradient(to right, #e0e0e0 0%, #f0f0f0 40%, #e0e0e0 80%, #e0e0e0 100%);
    background-repeat: no-repeat;
    background-size: 2000px 100%;
    border-radius: var(--radius-xs);
}

.article-card.is-loading-placeholder .placeholder-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%; /* Make the avatar placeholder a circle */
}

.article-card.is-loading-placeholder .placeholder-line {
    height: 16px;
    margin-bottom: 10px;
}

@media (max-width: 1340px) {
    .insights-layout {
        display: flex;
        justify-content: center;
        padding: 0 var(--space-md); /* This still protects the edges */
    }

    .left-column,
    .right-column {
        display: none;
    }
    .article-card {
    width: 100%;    
    max-width: 580px;
    } 
   .linkedin-lightbox-modal{
    height:70%;
    border-radius: 0;
   } 
   .lightbox-sidebar{
    display: none;
   }
    .lightbox-content-area {
        grid-template-columns: 1fr;
        width: 100%; 
    }
}

@media (max-width: 734px) {
    .glass-header-bar {
        margin-bottom: 1rem;
    }

    .glass-header-bar .page-header-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 0;
    }
    .left-column,
    .right-column {
        display: none;
        }
    .insights-layout {
        display: block;
        padding: 0;
        }
    .insights-page .container {
        padding: 0;
        }
    .main-feed {
        gap: 0;
        }
.lightbox-sidebar{
    display: none;
}
    .article-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
        padding-left: 0;
        padding-right: 0;
        border-bottom: 8px solid var(--color-bg-light); 
    }

  .article-card:last-child {
    border-bottom: 1px solid #DADDE1;
  }
    .post-header,
  .post-content,
  .post-actions {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  .media-grid {
    border-radius: 1rem;
  }
.linkedin-lightbox-overlay{
    padding: 0;
}
}