/* ============================================================
   CONTENT READER  —  flat civic article/detail pages for
   Articles, Committee Meetings, and Vice Mayor Blogs.
   Mirrors the Legislative Library register aesthetic:
   squared corners, thin green borders, gold rule strip,
   no rounded pills / gradients / hover-lift.
   Scoped under `.civic-reader-page`.
   ============================================================ */

.civic-reader-page {
    --cr-green-deep: #0d351f;
    --cr-green: #14532d;
    --cr-green-mid: #1f7a3d;
    --cr-amber: #f08a24;
    --cr-amber-dark: #cf6d09;
    --cr-gold: #ffc72c;
    --cr-ink: #1c2b22;
    --cr-muted: #5c6b62;
    --cr-line: rgba(20, 83, 45, .16);
    --cr-r-sm: 6px;

    background: #ffffff;
    color: var(--cr-ink);
}

/* ============================================================
   Shell
   ============================================================ */
.civic-reader-page .rd-main {
    width: min(1120px, calc(100% - 32px));
    margin: 28px auto 52px;
}

.civic-reader-page .rd-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

@media (min-width: 900px) {
    .civic-reader-page .rd-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}

/* ============================================================
   Back link — flat, squared
   ============================================================ */
.civic-reader-page .rd-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cr-green);
    text-decoration: none;
    border: 1px solid rgba(20, 83, 45, .28);
    border-radius: var(--cr-r-sm);
    background: #ffffff;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.civic-reader-page .rd-back:hover {
    background: rgba(20, 83, 45, .08);
    border-color: rgba(20, 83, 45, .45);
    color: var(--cr-green-deep);
}

.civic-reader-page .rd-back svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ============================================================
   Article card
   ============================================================ */
.civic-reader-page .rd-article {
    background: #ffffff;
    border: 1px solid var(--cr-line);
    border-radius: var(--cr-r-sm);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
    overflow: hidden;
}

.civic-reader-page .rd-article__rule {
    height: 3px;
    background: linear-gradient(90deg,
            var(--cr-green-mid) 0 55%,
            var(--cr-amber) 55% 85%,
            var(--cr-gold) 85% 100%);
}

.civic-reader-page .rd-article__body {
    padding: 22px 24px 26px;
}

@media (max-width: 640px) {
    .civic-reader-page .rd-article__body {
        padding: 18px 16px 20px;
    }
}

.civic-reader-page .rd-title {
    margin: 4px 0 12px;
    font-size: clamp(1.4rem, 3.4vw, 2rem);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.015em;
    color: var(--cr-ink);
    text-wrap: balance;
}

.civic-reader-page .rd-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--cr-line);
}

.civic-reader-page .rd-meta__date {
    font-variant-numeric: tabular-nums;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cr-muted);
}

.civic-reader-page .rd-meta__sep {
    color: #c2cac5;
}

/* Type chip (shared look with register) */
.civic-reader-page .rd-chip {
    display: inline-block;
    padding: 3px 9px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid rgba(20, 83, 45, .35);
    border-radius: 3px;
    color: var(--cr-green);
    background: rgba(20, 83, 45, .06);
}

/* ============================================================
   Cover image
   ============================================================ */
.civic-reader-page .rd-cover {
    margin: 0 0 18px;
    border: 1px solid var(--cr-line);
    border-radius: var(--cr-r-sm);
    overflow: hidden;
    cursor: pointer;
}

.civic-reader-page .rd-cover img {
    display: block;
    width: 100%;
    height: auto;
}

/* ============================================================
   Body content
   ============================================================ */
.civic-reader-page .rd-content {
    color: #374151;
    line-height: 1.75;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: .98rem;
}

.civic-reader-page .rd-content > * + * {
    margin-top: 1rem;
}

.civic-reader-page .rd-content p,
.civic-reader-page .rd-content ul,
.civic-reader-page .rd-content ol,
.civic-reader-page .rd-content blockquote,
.civic-reader-page .rd-content table,
.civic-reader-page .rd-content figure,
.civic-reader-page .rd-content .rich-table-wrap {
    margin: 1rem 0;
}

.civic-reader-page .rd-content h1,
.civic-reader-page .rd-content h2,
.civic-reader-page .rd-content h3,
.civic-reader-page .rd-content h4,
.civic-reader-page .rd-content h5,
.civic-reader-page .rd-content h6 {
    color: var(--cr-ink);
    font-weight: 700;
    line-height: 1.3;
    margin: 1.5rem 0 0.75rem;
}

.civic-reader-page .rd-content h1 { font-size: 1.6rem; }
.civic-reader-page .rd-content h2 { font-size: 1.4rem; }
.civic-reader-page .rd-content h3 { font-size: 1.2rem; }
.civic-reader-page .rd-content h4 { font-size: 1.05rem; }

.civic-reader-page .rd-content ul,
.civic-reader-page .rd-content ol {
    padding-left: 1.75rem;
}

.civic-reader-page .rd-content ul { list-style: disc; }
.civic-reader-page .rd-content ol { list-style: decimal; }

.civic-reader-page .rd-content li + li {
    margin-top: 0.35rem;
}

.civic-reader-page .rd-content blockquote {
    border-left: 3px solid var(--cr-amber);
    padding-left: 1rem;
    color: #4b5563;
    font-style: italic;
}

.civic-reader-page .rd-content a {
    color: var(--cr-green);
    text-decoration: underline;
}

.civic-reader-page .rd-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--cr-r-sm);
}

.civic-reader-page .rd-content figure.table,
.civic-reader-page .rd-content .rich-table-wrap {
    display: block;
    width: 100% !important;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.civic-reader-page .rd-content table {
    width: 100% !important;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.civic-reader-page .rd-content th,
.civic-reader-page .rd-content td {
    border: 1px solid #d8ddd9;
    padding: 0.75rem;
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.civic-reader-page .rd-content th {
    background: #f6f8f7;
    font-weight: 600;
}

/* ============================================================
   Share row
   ============================================================ */
.civic-reader-page .rd-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--cr-line);
}

.civic-reader-page .rd-share__label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--cr-muted);
    margin-right: 4px;
}

.civic-reader-page .rd-share a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--cr-green);
    text-decoration: none;
    border: 1px solid rgba(20, 83, 45, .25);
    border-radius: var(--cr-r-sm);
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.civic-reader-page .rd-share a:hover {
    background: rgba(20, 83, 45, .08);
    border-color: rgba(20, 83, 45, .45);
    color: var(--cr-green-deep);
}

.civic-reader-page .rd-share a img {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ============================================================
   Sidebar
   ============================================================ */
.civic-reader-page .rd-sidebar {
    background: #ffffff;
    border: 1px solid var(--cr-line);
    border-radius: var(--cr-r-sm);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
    overflow: hidden;
}

@media (min-width: 900px) {
    .civic-reader-page .rd-sidebar {
        position: sticky;
        top: 24px;
    }
}

.civic-reader-page .rd-sidebar__rule {
    height: 3px;
    background: linear-gradient(90deg,
            var(--cr-green-mid) 0 55%,
            var(--cr-amber) 55% 85%,
            var(--cr-gold) 85% 100%);
}

.civic-reader-page .rd-sidebar__body {
    padding: 16px 16px 18px;
}

.civic-reader-page .rd-sidebar__title {
    margin: 0 0 12px;
    padding-bottom: 10px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--cr-green);
    border-bottom: 1px solid var(--cr-line);
}

.civic-reader-page .rd-recent {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.civic-reader-page .rd-recent-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    text-decoration: none;
    border-bottom: 1px solid rgba(20, 83, 45, .08);
}

.civic-reader-page .rd-recent-item:last-child {
    border-bottom: none;
}

.civic-reader-page .rd-recent-thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border: 1px solid var(--cr-line);
    border-radius: var(--cr-r-sm);
    overflow: hidden;
    background: #f6f8f7;
}

.civic-reader-page .rd-recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.civic-reader-page .rd-recent-info {
    min-width: 0;
}

.civic-reader-page .rd-recent-title {
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--cr-ink);
    transition: color .18s ease;
}

.civic-reader-page .rd-recent-item:hover .rd-recent-title {
    color: var(--cr-green);
}

.civic-reader-page .rd-recent-date {
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--cr-muted);
}

.civic-reader-page .rd-recent-empty {
    padding: 8px 0;
    font-size: .84rem;
    color: var(--cr-muted);
}

/* ============================================================
   Image modal — flat
   ============================================================ */
.civic-reader-page .image-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 20, 12, .82);
}

.civic-reader-page .image-modal.is-open {
    display: flex;
}

.civic-reader-page .image-modal-wrapper {
    position: relative;
    display: inline-block;
    max-width: 90%;
    max-height: 90%;
}

.civic-reader-page .image-modal-wrapper .modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(13, 53, 31, .2);
    border-radius: var(--cr-r-sm);
    background: #ffffff;
    color: #374151;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.civic-reader-page .image-modal-wrapper .modal-close:hover {
    background: var(--cr-green);
    color: #ffffff;
}

.civic-reader-page .image-modal-wrapper img {
    display: block;
    max-width: 100%;
    max-height: 82vh;
    border-radius: var(--cr-r-sm);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
    .civic-reader-page .rd-main {
        width: calc(100% - 20px);
        margin: 18px auto 36px;
    }
}
