/* Styles moved from Views/Home/Articles.cshtml */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.article-ai-search {
    margin: 24px 0 28px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(177, 141, 71, 0.16), rgba(0, 0, 0, 0.72));
    border: 1px solid rgba(177, 141, 71, 0.28);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.22);
}

.article-ai-search-page {
    margin-top: 36px;
}

.article-ai-search-inner {
    padding: 26px;
}

.article-ai-search-kicker,
.article-ai-answer-label {
    margin: 0 0 10px;
    color: #B18D47;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.article-ai-search-title {
    margin: 0;
    color: #fff;
    font-size: 32px;
    line-height: 1.2;
    font-family: 'Open Sans', sans-serif;
}

.article-ai-search-copy {
    margin: 10px 0 0;
    max-width: 760px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 16px;
    line-height: 1.6;
}

.article-ai-search-form {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-top: 20px;
}

.article-ai-search-input {
    flex: 1 1 auto;
    min-height: 56px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(9, 9, 9, 0.66);
    color: #fff;
    padding: 0 18px;
    font-size: 16px;
}

.article-ai-search-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.article-ai-search-button {
    min-width: 132px;
    border-radius: 14px;
}

.article-ai-search-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.article-ai-suggestion {
    border: 1px solid rgba(177, 141, 71, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    padding: 8px 14px;
    font-size: 13px;
    transition: background .2s ease, border-color .2s ease;
}

.article-ai-suggestion:hover {
    background: rgba(177, 141, 71, 0.2);
    border-color: rgba(177, 141, 71, 0.48);
}

.article-ai-search-status {
    min-height: 24px;
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.82);
}

.article-ai-search-results {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.article-ai-answer-card,
.article-ai-citation {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px;
}

.article-ai-answer-text,
.article-ai-citation-snippet {
    color: #fff;
    line-height: 1.7;
}

.article-ai-key-points {
    margin: 16px 0 0;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.88);
}

.article-ai-citations {
    display: grid;
    gap: 12px;
}

.article-ai-citation h3 {
    margin: 0;
    font-size: 18px;
}

.article-ai-citation h3 a {
    color: #fff;
}

.article-ai-citation-meta {
    margin: 8px 0 0;
    color: #B18D47;
    font-size: 13px;
}

.article-ai-citation-snippet {
    margin: 10px 0 0;
}

.article-ai-citation-actions {
    margin-top: 16px;
}

.article-ai-citation-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
}

.article-ai-citation-linkedin {
    background-color: #1a1a1a !important;
    border-color: #1a1a1a !important;
    color: #B18D47 !important;
}

.article-ai-citation-linkedin:hover {
    background-color: #333 !important;
    border-color: #333 !important;
    color: #B18D47 !important;
}

/* Toggle switch styles */
.image-toggle { display: flex; align-items: center; gap: 12px; margin: 15px 0; }
.image-toggle .toggle-label { color: #B18D47; font-size: 18px; }
.switch { position: relative; display: inline-block; width: 56px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #9aa0a6; transition: .2s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; top: 4px; background-color: #000; transition: .2s; border-radius: 50%; }
.switch input:checked + .slider { background: linear-gradient(90deg, #B18D47 0%, #907041 100%); box-shadow: inset 0 2px 6px rgba(0,0,0,0.25); }
.switch input:checked + .slider:before { transform: translateX(28px); background: #000; box-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.slider:before { box-shadow: 0 1px 2px rgba(0,0,0,0.35); }

/* Article image */
.article-image { display: block; }

/* Top category bar styles */
.top-category-bar { background: rgba(0,0,0,0.25); padding: 8px 0; margin-bottom: 12px; border-radius: 4px; transition: background .2s ease; display: flex; align-items: center; justify-content: center; }
.top-category-bar.dark { background: rgba(0,0,0,0.55); }
.top-category-inner { width: 100%; max-width: 100%; padding: 6px 8px; display: flex; align-items: center; gap: 12px; overflow: hidden; }
.categories-nav { display: flex; gap: 10px; align-items: center; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; }
.top-category-inner .view-controls { flex: 0 0 auto; margin-left: auto; }
.top-category-inner > .toggle-label { flex: 0 0 auto; white-space: nowrap; margin: 0; }

/* Mobile: hide chips and show a select instead */
.mobile-category-select { display: none; }
@media (max-width: 600px) {
    .categories-nav { display: none; }
    .mobile-category-select { display: inline-block; background: rgba(255,255,255,0.03); color: #fff; border: none; padding: 6px 8px; border-radius: 8px; }
}

.category-link { display: inline-flex; align-items: center; color: #fff; padding: 6px 12px; border-radius: 16px; background: rgba(255,255,255,0.03); text-decoration: none; font-size: 14px; }
.category-link.active { background: #B18D47; color: #000; font-weight: 600; }
.category-link:hover { background: rgba(255,255,255,0.06); }

/* view control buttons */
.view-controls { display: inline-flex; gap: 8px; margin-right: 12px; vertical-align: middle; align-items: center; flex-wrap: nowrap; }
.view-btn { background: transparent; border: 1px solid rgba(255,255,255,0.06); color: #fff; padding: 6px; border-radius: 6px; cursor: pointer; }
.view-btn svg { display: block; }
.view-btn.active { background: rgba(255,255,255,0.04); box-shadow: 0 0 0 2px rgba(177,141,71,0.12); color: #B18D47; }

/* Smaller switch when placed in the top bar view-controls */
.view-controls .image-toggle { display: inline-flex; align-items: center; gap: 6px; }
.view-controls .toggle-label { font-size: 12px; color: #B18D47; line-height: 1; }
.view-controls .switch { width: 32px; height: 16px; }
.view-controls .switch .slider:before { height: 12px; width: 12px; left: 2px; top: 2px; }
.view-controls .switch input:checked + .slider:before { transform: translateX(16px); }

@media (max-width: 1200px) {
    .top-category-inner { flex-wrap: wrap; }
    .top-category-inner .view-controls { margin-left: 0; }
    .categories-nav { overflow-x: auto; }
    .categories-nav::-webkit-scrollbar { height: 6px; background: transparent; }
    .categories-nav { -ms-overflow-style: none; scrollbar-width: none; }
}

/* Articles list/grid styles */
.articles-container.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.articles-container.list { display: block; }
.article-card { background: transparent; padding: 12px; border-radius: 8px; }
.article-card .img-responsive { width: 100%; height: auto; display: block; }

/* Ensure main content is above the top-category-bar so clicks are not blocked */
.top-category-bar { position: relative; z-index: 1; }
.probootstrap-section .container .row > .col-md-9,
.probootstrap-section .container .row > .col-md-3 { position: relative; z-index: 2; }

/* Grid-specific adjustments */
.articles-container.grid .article-card { background: rgba(255,255,255,0.02); padding: 18px; }
.articles-container.grid .article-desc {
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis;
}
.article-card h2 { margin: 8px 0 6px; }
.article-card h2 a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; color: inherit; }
.article-meta { margin-bottom: 8px; }
.article-meta i { color: #fff; font-size: small; }
.meta-grid { display: none; }
.articles-container.grid .meta-grid { display: inline; }
.articles-container.grid .meta-list { display: none; }
.article-actions { display: flex; gap: 8px; align-items: center; }
.article-actions .btn { min-width: 280px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; text-align: center; box-sizing: border-box; }
.article-actions .article-actions-original { order: 1; }
.article-actions .article-readnow { order: 2; }
.articles-container.grid .article-actions-original { display: none; }
.articles-container.grid .article-readnow { display: inline-flex !important; min-width: auto; width: 100%; }
.category { margin-top: 10px; display: block; }

@media (max-width: 992px) {
    .articles-container.grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .articles-container.grid { grid-template-columns: 1fr; }

    .article-ai-search-inner {
        padding: 18px;
    }

    .article-ai-search-title {
        font-size: 24px;
    }

    .article-ai-search-form,
    .article-ai-search-results {
        grid-template-columns: 1fr;
        display: grid;
    }

    .article-ai-search-button {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .article-ai-search-results {
        grid-template-columns: 1fr;
    }
}

/* When grid view is active hide the right filter column and expand the left column */
.hide-right #RightPage-Filter { display: none !important; }
.hide-right .col-md-9 { -ms-flex: 0 0 96%; flex: 0 0 96%; max-width: 96%; margin-left: auto; margin-right: auto; }

/* Article title link in card */
.article-title-link { cursor: pointer; color: inherit; text-decoration: none; }
.article-title-link:hover { color: #B18D47; text-decoration: underline; }

/* ArticleDetail slide-out panel */
.article-detail-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1200; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.article-detail-overlay.open { opacity: 1; pointer-events: auto; }

.article-detail-panel { position: fixed; top: 0; right: 0; width: 480px; max-width: 90vw; height: 100%; background: #1a1a1a; color: #fff; z-index: 1210; transform: translateX(100%); transition: transform .3s ease; overflow-y: auto; box-shadow: -4px 0 20px rgba(0,0,0,0.4); }
.article-detail-panel.open { transform: translateX(0); }

.article-detail-top-bar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 10px 16px 0; }
.article-detail-close { background: transparent; border: none; color: #fff; font-size: 28px; cursor: pointer; z-index: 10; line-height: 1; padding: 8px 12px; }
.article-detail-close:hover { color: #B18D47; }

.article-detail-share { background: rgba(255,255,255,0.08); border: none; color: #fff; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .2s, color .2s; }
.article-detail-share:hover { background: rgba(177,141,71,0.3); color: #B18D47; }
.article-detail-share.copied { background: rgba(76,175,80,0.3); color: #4caf50; }

.article-detail-image-wrap { position: relative; margin-bottom: 16px; }
.article-detail-image-wrap .article-detail-image { width: 100%; height: auto; border-radius: 6px; margin-bottom: 0; display: block; }
.article-detail-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.55); border: none; color: #fff; font-size: 28px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .2s, color .2s; z-index: 2; }
.article-detail-nav-btn.nav-prev { left: 8px; }
.article-detail-nav-btn.nav-next { right: 8px; }
.article-detail-nav-btn:hover { background: rgba(177,141,71,0.7); color: #fff; }

.article-detail-content { padding: 24px 28px; }
.article-detail-image { width: 100%; height: auto; border-radius: 6px; margin-bottom: 16px; }
.article-detail-title { font-size: 22px; font-family: 'Open Sans', sans-serif; margin: 0 0 8px; color: #fff; }
.article-detail-date { color: #B18D47; font-size: 14px; margin-bottom: 16px; }
.article-detail-desc { font-size: 15px; line-height: 1.6; margin-bottom: 20px; }
.article-detail-summary-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #B18D47; margin: 20px 0 8px; font-weight: 600; }
.article-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.article-detail-actions .btn { min-width: 280px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; text-align: center; box-sizing: border-box; }

/* Latest Articles cards alignment on Home page */
.latest-articles-row { display: flex; flex-wrap: wrap; }
.latest-articles-row > .col-md-4 { display: flex; }
.latest-articles-row .probootstrap-card { display: flex; flex-direction: column; width: 100%; }
.latest-articles-row .probootstrap-card-text { display: flex; flex-direction: column; flex: 1; }
.latest-articles-row .probootstrap-card-text > p:last-child { margin-top: auto; }
