/* article detail page styles */

.wrapper {
    width: 100%;
    box-sizing: border-box;
    margin-top: 1.25rem;
}

/* Bigger gap than the default in cards.css, offset by a narrower right column
   so the article-detail width is unchanged. */
@media (min-width: 880px) {
    .c-newspaper {
        grid-template-columns: minmax(0, 3fr) 308px;
        column-gap: 3rem;
    }
}

.article-detail {
    box-shadow: var(--cardShadow);
    border-radius: 12px;
    margin: 12px 0px;
    padding-bottom: 0;
    font-family: var(--mainFont);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

@media (max-width: 800px) {
    .article-detail {
        margin: 8px 12px;
    }
}

.article-detail:hover {
    transform: translateY(0px) scale(1.00);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}

.article-detail .img-frame {
    height: 250px;
    width: 100%;
    border-radius: 12px 12px 0 0;
}

@media (max-width: 800px) {
    .article-detail .img-frame {
        height: 200px;
    }
}

.article-detail-top {
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.img-attribution-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 0 0 0 0;
}

.img-attribution-overlay {
    position: absolute;
    bottom: 8px;
    right: 16px;
    display: flex;
    align-items: center;
    font-size: 10px;
    color: white;
    pointer-events: auto;
    z-index: 5;
    white-space: nowrap;
}

.img-attribution-overlay--static {
    pointer-events: auto;
}

.attr-prefix {
    color: white;
}

.attr-link {
    color: white;
    text-decoration: none;
}

.attr-from {
    color: white;
}

.article-action-buttons {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.article-action-btn {
    background: none;
    border: none;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.article-action-icon {
    font-size: 22px;
    color: white;
    user-select: none;
    font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24;
    transition: font-variation-settings 0.15s;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.article-action-icon.filled {
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
}

.article-detail-author-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 8px 16px;
}

.article-detail-category {
    text-transform: capitalize;
}

.article-detail-author {
    font-size: 1rem;
    color: gray;
}

.article-detail-author .author-link {
    text-decoration: none;
    color: inherit;
}

.article-detail-author .author-link:hover strong {
    color: #555;
}

.article-detail-title {
    font-size: 1.5rem;
    padding: 0px 16px 8px 16px;
}

.article-detail-metadata {
    font-size: .7rem;
    padding: 0px 16px 8px 16px;
}

.article-detail-solid {
    margin: 4px 16px 0px 16px;
    border-style: solid;
    border-color: #d3d3d373;
    border-width: 0.5px;
}

.article-detail-content {
    font-size: .9rem;
    padding: 16px 16px 16px 16px;
    word-break: break-word;
    line-height: 1.45;
}

/* Markdown element styles */
.article-detail-content--md h1,
.article-detail-content--md h2,
.article-detail-content--md h3,
.article-detail-content--md h4,
.article-detail-content--md h5,
.article-detail-content--md h6 {
    margin: 0.5em 0 0.2em;
    padding: 0;
    line-height: 1.3;
    font-size: 1.25em;
    font-weight: 700;
    text-align: left;
}
.article-detail-content--md p  { margin: 0 0 1.6em; }
.article-detail-content--md a  { color: inherit; text-decoration: none; font-weight: 500; }
.article-detail-content--md a:hover { text-decoration: underline; }
.article-detail-content--md strong { font-weight: 700; }
.article-detail-content--md em     { font-style: italic; }
.article-detail-content--md ul,
.article-detail-content--md ol { padding-left: 1.4em; margin: 0 0 0.7em; }
.article-detail-content--md li { margin-bottom: 0.2em; }
.article-detail-content--md li > p { margin-bottom: 0.3em; }
.article-detail-content--md p:has(+ ul),
.article-detail-content--md p:has(+ ol) { margin-bottom: 0.7em; }
.article-detail-content--md table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    width: 100%;
    margin: 0.2em 0 1.2em;
    font-size: 0.85em;
}
.article-detail-content--md th,
.article-detail-content--md td {
    border: none;
    border-bottom: 1px solid #ebebeb;
    padding: 6px 10px;
    text-align: left;
}
.article-detail-content--md th {
    font-weight: 700;
    background: #f5f5f5;
}
.article-detail-content--md blockquote {
    border-left: 3px solid #ccc;
    margin: 0.2em 0 1.2em;
    padding: 0px 8px;
    color: #666;
}
.article-detail-content--md code {
    background: #f3f3f3;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.88em;
}
.article-detail-content--md pre {
    margin: 0.2em 0 1.2em;
}
.article-detail-content--md pre code {
    display: block;
    padding: 10px;
    overflow-x: auto;
}
.article-detail-content--md > *:last-child { margin-bottom: 0; }

/* ── Article source slits ─────────────────────────── */
.article-sources-wrapper {
    margin-top: 8px;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
    padding: 12px 12px 32px 12px;
}

.sources-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 12px;
    padding: 0px 4px;
}

.article-sources-folder {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: none;
    font-family: var(--mainFont);
    overflow: visible;
}

/*
 * Each slit is a fixed-height slot. The card inside translates upward to
 * peek above the slit opening. clip-path allows overflow above the slit while
 * clipping at the bottom boundary — the slit position never changes.
 */
.source-slit {
    height: 44px;
    border-radius: 10px;
/*     background: #f4f4f4; */
    cursor: pointer;
    position: relative;
    /* Allow card to overflow above; clip at slit's bottom edge */
    clip-path: inset(-1000px -10px 0px -10px round 0 0 10px 10px);
        padding-bottom: 8px;
}

.source-slit--expanded {
    z-index: 10;
}

/* Card is absolutely positioned so it can translate freely */
.source-card-view {
    position: absolute;
    left: 4px;
    right: 4px;
    top: 0;
    background: white;
    border-radius: 8px;
    padding: 10px 12px 12px 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
    transition: transform 0.28s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
    .source-slit:not(.source-slit--expanded):hover .source-card-view {
        transform: translateY(-6px);
        box-shadow: 0 6px 18px rgba(0,0,0,0.14);
    }
}

.source-slit--expanded .source-card-view {
    box-shadow: 0 8px 28px rgba(0,0,0,0.16);
}

/* Clickable fields when expanded — width:fit-content limits the tap area
   to the text itself; clicks in empty space collapse the card instead */
.source-slit--expanded .source-card-name,
.source-slit--expanded .source-card-title-row,
.source-slit--expanded .source-card-quote {
    cursor: pointer;
    width: fit-content;
}

.source-slit--expanded .source-card-name:hover,
.source-slit--expanded .source-card-title-row:hover {
    text-decoration: underline;
}

.source-slit--expanded .source-card-quote:hover {
    color: #333;
    border-left-color: #aaa;
}

.source-card-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: #111;
    text-align: left;
    line-height: 1.4;
}

.source-card-title-row {
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    text-align: left;
    margin-top: 5px;
    line-height: 1.35;
}

.source-card-quotes {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.source-card-quote {
    font-size: 0.75rem;
    color: #555;
    text-align: left;
    padding-left: 10px;
    border-left: 2px solid #ddd;
    line-height: 1.45;
}

.c-newspaper__col .verticalCard .cardBottom-date-short { display: none; }

@media (min-width: 880px) {
    .c-newspaper__col:last-child .verticalCard .cardBottom-date { display: none; }
    .c-newspaper__col:last-child .verticalCard .cardBottom-date-short { display: inline; }
}

.column-title {
    color: #b5b5b5;
    padding-left: 16px;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-size: 1rem;
}
