/* ========================================
   ANALYSIS PAGE LAYOUT
   analysis-layout.css
   ======================================== */

.title-subtitle-single-line {
    font-size: calc(23px * 1.35);
    margin-top: 0;
    align-self: center;
}

#analysis-main {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: 100%;
    overflow: hidden;
}

#analysis-left {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
}

#analysis-right {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f5f5f5;
    border-left: 1px solid #cccccc;
}

/* ========================================
   FEED LIST
   ======================================== */

#analysis-feed {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px 24px 0;
    box-sizing: border-box;
}

.analysis-item {
    padding: 10px 12px 10px 18px;
    border-bottom: 1px solid #e8e8e8;
    border-left: 8px solid transparent;
    cursor: pointer;
    transition:
        background-color 0.22s ease,
        border-left-color 0.22s ease;
}

.analysis-item:hover {
    background-color: #f0f0f0;
}

.analysis-item.selected {
    border-left-color: #c00;
    background: #d4deeb;
    box-shadow: inset 0 0 0 1px #bcc9db;
}

.analysis-item.selected:hover {
    background: #c8d4e4;
}

.analysis-item.selected .analysis-title {
    color: #000;
    font-weight: 600;
}

.analysis-item.selected .analysis-date {
    color: #333;
}

.analysis-item:focus {
    outline: none;
}

.analysis-item:focus-visible:not(.selected) {
    outline: 2px solid #0000CC;
    outline-offset: 2px;
}

.analysis-item:last-child {
    border-bottom: none;
}

/* ========================================
   LIST ITEM CONTENT
   ======================================== */

.analysis-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.analysis-date {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
    color: #666;
    margin: 0;
    transition: color 0.22s ease;
}

.analysis-item .analysis-title {
    margin: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    color: #444;
    transition: color 0.22s ease;
}

.analysis-summary {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #555;
}

/* ========================================
   TAGS
   ======================================== */

.analysis-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.analysis-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #444;
    background: #ebe8e3;
    border-radius: 999px;
}

.analysis-empty {
    padding: 40px 0;
    color: #888;
    font-size: 15px;
}

/* ========================================
   DETAIL VIEW
   ======================================== */

#analysis-detail {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 600px;
    overflow: hidden;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.22s ease;
}

#analysis-detail.is-swapping {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .analysis-item,
    .analysis-item .analysis-title,
    .analysis-item .analysis-date,
    #analysis-detail {
        transition: none;
    }
}

.analysis-detail-header {
    flex-shrink: 0;
    margin-bottom: 0;
    padding: 24px 32px 14px;
    border-bottom: 1px solid #e5e5e5;
}

.analysis-detail-header h1 {
    margin: 0 0 5px;
    font-size: 26px;
    font-weight: 500;
    line-height: 1.25;
    color: #111;
}

.analysis-detail-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25em;
}

.analysis-detail-date {
    font-size: 16px;
    font-weight: 600;
    color: #888;
    margin-bottom: 0;
}

.analysis-detail-author {
    font-size: 16px;
    font-weight: 600;
    color: #888;
}

/* ========================================
   DETAIL BODY PROSE
   ======================================== */

.analysis-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 32px 64px;
    font-size: 16px;
    line-height: 1.65;
    color: #444;
    scrollbar-width: thin;
    scrollbar-color: #cccccc transparent;
}

.analysis-detail-body::-webkit-scrollbar {
    width: 5px;
}

.analysis-detail-body::-webkit-scrollbar-track {
    background: transparent;
}

.analysis-detail-body::-webkit-scrollbar-thumb {
    background: #cccccc;
}

.analysis-detail-body::-webkit-scrollbar-thumb:hover {
    background: #aaaaaa;
}

.analysis-detail-body p {
    margin: 0 0 1.2em;
}

.analysis-detail-body h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 2em 0 0.6em;
    color: #111;
}

.analysis-detail-body h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 1.6em 0 0.5em;
    color: #111;
}

.analysis-detail-body a {
    color: #0000CC;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.analysis-detail-body a:hover {
    color: #000080;
}

.analysis-detail-body ul,
.analysis-detail-body ol {
    margin: 0 0 1.2em;
    padding-left: 1.6em;
}

.analysis-detail-body li {
    margin-bottom: 0.4em;
}

.analysis-detail-body blockquote {
    margin: 1.2em 0;
    padding: 0.4em 0 0.4em 1em;
    border-left: 3px solid #ddd;
    color: #555;
    font-style: italic;
}

.analysis-detail-body img:not(.story-image):not(.story-card-image) {
    display: block;
    width: calc(100% - 40px);
    max-width: calc(100% - 40px);
    height: auto;
    margin: 1.2em 20px;
    border-radius: 4px;
}

/* ========================================
   EMBEDDED STORY CARDS
   ======================================== */

.analysis-story-card {
    margin: 5px 0;
    border: 1px solid #e0e0e0;
    border-left: 3px solid var(--accent-color, #cc0000);
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.analysis-story-card .story {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 8px 8px 11px;
    border-bottom: none;
    cursor: default;
    transition: background-color 0.12s ease;
}

.analysis-story-card .story > a {
    display: contents;
}

.analysis-story-card .story-card-image {
    flex: 0 0 30%;
    width: 30%;
    max-height: 116px;
    object-fit: cover;
    border-radius: 4px;
}

.analysis-story-card .story-body {
    flex: 1;
    min-width: 0;
    cursor: default;
}

.analysis-story-card .story:hover {
    background-color: #f8f8f8;
}

.analysis-story-card .story-body:hover {
    background-color: transparent;
}

.analysis-story-card .story-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 10px 0;
}

.analysis-story-card .story-title {
    font-size: 16px;
    font-weight: 600;
    padding-right: 0;
    margin-bottom: 4px;
}

.analysis-story-card .story-title a {
    color: #111;
    text-decoration: none;
}

.analysis-story-card .story-title a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.story-byline {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.analysis-story-card .story-quote {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 14px;
    margin-bottom: 8px;
}

.story-topics-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.story-topics-tags .analysis-tag {
    font-size: 11px;
    padding: 2px 9px;
}

/* ========================================
   LINK PREVIEW (bare URL lines)
   ======================================== */

.analysis-link-preview {
    margin: 16px 0;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    font-size: 15px;
}

.analysis-link-preview a {
    color: #0000CC;
    text-decoration: none;
    font-weight: 500;
}

.analysis-link-preview a:hover {
    text-decoration: underline;
}

/* ========================================
   SHORTCODE FALLBACK
   ======================================== */

.analysis-shortcode-missing {
    font-size: 14px;
    color: #888;
    margin: 12px 0;
}

.analysis-shortcode-missing a {
    color: #555;
}

.analysis-shortcode-note {
    font-style: italic;
}

/* ========================================
   ACTIVE NAV LINK
   ======================================== */

#menus a.active-nav,
#menus span.active-nav {
    color: #0000CC;
    border-bottom: 2px solid #0000CC;
    padding-bottom: 2px;
}
