/* ============================================================================
   style.css — Editorial news theme layered on top of Bootstrap 5
   "The Daily Ledger"
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
    --ink: #14181f; /* near-black headline color            */
    --ink-soft: #3a4150; /* body text                            */
    --muted: #6b7280; /* meta / captions                      */
    --line: #e5e7eb; /* hairline borders                     */
    --paper: #ffffff; /* card / surface                       */
    --wash: #f6f7f9; /* page background                      */
    --brand: #c0392b; /* masthead red accent                  */
    --brand-dark: #96271b;
    --accent: #14181f;

    --serif: "Playfair Display", Georgia, "Times New Roman", serif;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

    --shadow-sm:
        0 1px 2px rgba(20, 24, 31, 0.06), 0 1px 3px rgba(20, 24, 31, 0.05);
    --shadow-md: 0 6px 18px rgba(20, 24, 31, 0.08);
    --radius: 10px;
}
.searchList {
    text-wrap: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ---- Base ---------------------------------------------------------------- */
* {
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--sans);
    color: var(--ink-soft);
    background: var(--wash);
    line-height: 1.65;
}

h1,
h2,
h3,
h4,
h5,
.headline {
    font-family: var(--serif);
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--brand-dark);
}

.text-muted-2 {
    color: var(--muted) !important;
}
.serif {
    font-family: var(--serif);
}
.sans {
    font-family: var(--sans);
}

/* ---- Masthead / topbar --------------------------------------------------- */
.topbar {
    background: var(--ink);
    color: #cfd4dc;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}
.topbar a {
    color: #cfd4dc;
}
.topbar a:hover {
    color: #fff;
}

.masthead {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.masthead .brand-title {
    font-family: var(--serif);
    font-weight: 900;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1;
}
.masthead .brand-title span {
    color: var(--brand);
}
.masthead .brand-tag {
    font-size: 0.7rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---- Navbar -------------------------------------------------------------- */
.site-nav {
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.site-nav .nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.site-nav .nav-list::-webkit-scrollbar {
    height: 0;
}
.site-nav .nav-link {
    display: block;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.85rem 1rem;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    text-decoration: none;
}
.site-nav .nav-link:hover,
.site-nav .nav-link.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}
.site-nav .nav-live {
    margin-left: auto;
    color: var(--brand);
}

/* ---- Category chip ------------------------------------------------------- */
.chip {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.28rem 0.6rem;
    border-radius: 4px;
    color: #fff;
    background: var(--brand);
}
.chip-outline {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-soft);
}

/* ---- Cards --------------------------------------------------------------- */
.post-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    height: 100%;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #d6dae1;
}
.post-card .thumb {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    width: 100%;
    background: #eef0f3;
}
.post-card .card-title {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25;
}
.post-card a.stretched-title {
    color: var(--ink);
}
.post-card:hover a.stretched-title {
    color: var(--brand);
}
.post-meta {
    font-size: 0.8rem;
    color: var(--muted);
}
.post-meta .dot {
    opacity: 0.5;
}

/* ---- Hero ---------------------------------------------------------------- */
.hero-feature {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 460px;
    display: flex;
    align-items: flex-end;
    color: #fff;
    background: #111;
}
.hero-feature img.bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.82;
}
.hero-feature .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10, 12, 16, 0.92) 8%,
        rgba(10, 12, 16, 0.35) 55%,
        rgba(10, 12, 16, 0.1) 100%
    );
}
.hero-feature .hero-body {
    position: relative;
    padding: 2rem;
}
.hero-feature h1 {
    color: #fff;
    font-size: clamp(1.6rem, 3vw, 2.75rem);
}
.hero-side {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    color: #fff;
    background: #111;
}
.hero-side img.bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}
.hero-side .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10, 12, 16, 0.9),
        rgba(10, 12, 16, 0.15)
    );
}
.hero-side .hero-body {
    position: relative;
    padding: 1.1rem;
}
.hero-side h3 {
    color: #fff;
    font-size: 1.05rem;
}

/* ---- Section headings ---------------------------------------------------- */
.section-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.4rem;
}
.section-head h2 {
    font-size: 1.35rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0;
    white-space: nowrap;
}
.section-head::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}
.section-head .kicker-bar {
    width: 6px;
    height: 22px;
    background: var(--brand);
    border-radius: 2px;
}

/* ---- Sidebar widgets ----------------------------------------------------- */
.widget {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.widget-title {
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    padding-bottom: 0.6rem;
    margin-bottom: 0.9rem;
    border-bottom: 2px solid var(--ink);
}
.recent-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--line);
}
.recent-item:last-child {
    border-bottom: 0;
}
.recent-item img {
    width: 68px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    flex: none;
    background: #eef0f3;
}
.recent-item .t {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--ink);
    line-height: 1.25;
}
.recent-item .t:hover {
    color: var(--brand);
}

.cat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--line);
}
.cat-row:last-child {
    border-bottom: 0;
}
.cat-row a {
    color: var(--ink);
    font-weight: 600;
    font-size: 0.9rem;
}
.cat-row a:hover {
    color: var(--brand);
}
.cat-count {
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--wash);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 0.05rem 0.55rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.tag-cloud a {
    font-size: 0.78rem;
    color: var(--ink-soft);
    background: var(--wash);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 0.25rem 0.7rem;
}
.tag-cloud a:hover {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

/* ---- Buttons ------------------------------------------------------------- */
.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
}
.btn-brand:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}
.btn-ink {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    font-weight: 600;
}
.btn-ink:hover {
    background: #000;
    color: #fff;
}
.btn-outline-ink {
    border: 1px solid var(--ink);
    color: var(--ink);
    font-weight: 600;
}
.btn-outline-ink:hover {
    background: var(--ink);
    color: #fff;
}

/* ---- Pagination ---------------------------------------------------------- */
.pagination {
    gap: 6px;
    justify-content: center;
    margin: 0;
}
.page-item:not(:first-child) .page-link {
    margin-left: 0;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.7rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.9rem;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}
.page-link:hover {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}
.page-link:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18);
}
.page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
    font-weight: 600;
}
.page-item.disabled .page-link {
    color: #aab0bb;
    background: var(--paper);
    border-color: var(--line);
    opacity: 0.7;
    pointer-events: none;
}

/* ---- Article page -------------------------------------------------------- */
.article-hero-img {
    width: 100%;
    border-radius: var(--radius);
    object-fit: cover;
    max-height: 520px;
    background: #eef0f3;
}
.article-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
}
.article-body {
    font-size: 1.12rem;
    color: #2b313c;
}
.article-body p {
    margin-bottom: 1.35rem;
}
.article-body p:first-of-type {
    font-size: 1.22rem;
    color: var(--ink);
}
.share-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    color: var(--ink);
    background: #fff;
}
.share-btn:hover {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}
.author-box {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.avatar-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.3rem;
    flex: none;
}
.comment-item {
    display: flex;
    gap: 0.85rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}
.comment-item:last-child {
    border-bottom: 0;
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
    background: var(--ink);
    color: #aeb4bf;
}
.site-footer h5 {
    color: #fff;
    font-family: var(--serif);
    font-size: 1.05rem;
    margin-bottom: 1rem;
}
.site-footer a {
    color: #aeb4bf;
    font-size: 0.9rem;
}
.site-footer a:hover {
    color: #fff;
}
.site-footer .foot-brand {
    font-family: var(--serif);
    font-weight: 900;
    font-size: 1.5rem;
    color: #fff;
}
.site-footer .foot-brand span {
    color: var(--brand);
}
.social-ico {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.social-ico:hover {
    background: var(--brand);
    color: #fff;
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.82rem;
}

/* ---- Breaking ticker ----------------------------------------------------- */
.ticker {
    background: var(--brand);
    color: #fff;
    overflow: hidden;
}
.ticker .label {
    background: var(--ink);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    padding: 0.5rem 0.9rem;
}
.ticker-track {
    display: flex;
    gap: 3rem;
    white-space: nowrap;
    animation: ticker 32s linear infinite;
    padding: 0.4rem 0;
    font-size: 0.85rem;
}
.ticker:hover .ticker-track {
    animation-play-state: paused;
}
@keyframes ticker {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* ---- Utilities ----------------------------------------------------------- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hover-underline:hover {
    text-decoration: underline;
}
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

/* ============================================================================
   ADMIN PANEL
   ========================================================================== */
.admin-body {
    background: #f1f3f6;
}
.admin-shell {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 250px;
    flex: none;
    background: var(--ink);
    color: #c7ccd6;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.25s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.admin-sidebar .brand {
    font-family: var(--serif);
    font-weight: 900;
    font-size: 1.3rem;
    color: #fff;
}
.admin-sidebar .brand span {
    color: var(--brand);
}
.admin-sidebar .nav-link {
    color: #c7ccd6;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.7rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border-left: 3px solid transparent;
}
.admin-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.admin-sidebar .nav-link.active {
    background: rgba(192, 57, 43, 0.16);
    color: #fff;
    border-left-color: var(--brand);
}
.admin-main {
    flex: 1;
    margin-left: 250px;
    min-width: 0;
}
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.admin-content {
    padding: 1.5rem;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    height: 100%;
}
.stat-card .ico {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}
.stat-card .num {
    font-family: var(--serif);
    font-weight: 800;
    font-size: 2rem;
    color: var(--ink);
    line-height: 1;
}
.stat-card .lbl {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.admin-panel .panel-head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.admin-panel .panel-head h5 {
    margin: 0;
    font-size: 1.1rem;
}
.admin-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
}
.admin-table td {
    vertical-align: middle;
}
.badge-status {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
}
.badge-pub {
    background: #e7f6ee;
    color: #0f7a44;
}
.badge-draft {
    background: #fdf0e6;
    color: #b3600f;
}
.badge-approved {
    background: #e7f6ee;
    color: #0f7a44;
}
.badge-pending {
    background: #fff3cd;
    color: #8a6100;
}

.icon-btn {
    border: 1px solid var(--line);
    background: #fff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
}
.icon-btn:hover {
    background: var(--wash);
    color: var(--ink);
}
.icon-btn.danger:hover {
    background: #fdecea;
    color: var(--brand);
    border-color: #f3c6c1;
}

.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #14181f, #2a3140);
    padding: 1.5rem;
}
.admin-login-card {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 410px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1035;
    display: none;
}

/* ---- Forms (admin) ------------------------------------------------------- */
.form-label {
    color: var(--ink);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    margin-bottom: 0.4rem;
}
.form-control,
.form-select {
    font-family: var(--sans);
    font-size: 0.92rem;
    color: var(--ink-soft);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}
.form-control::placeholder {
    color: #aab0bb;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
    background: var(--paper);
}
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18);
}
.invalid-feedback {
    color: var(--brand);
}

/* file input */
.form-control[type="file"] {
    padding: 0.4rem 0.6rem;
}
.form-control[type="file"]::file-selector-button {
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--wash);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
    margin-right: 0.75rem;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}
.form-control[type="file"]::file-selector-button:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* switch */
.form-check.form-switch .form-check-input {
    width: 2.4rem;
    height: 1.25rem;
    background-color: var(--line);
    border: none;
}
.form-check.form-switch .form-check-input:checked {
    background-color: var(--brand);
}
.form-check.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18);
    border: none;
}
.form-check-label {
    color: var(--ink-soft);
}

/* image preview */
.img-preview {
    width: 130px;
    height: 92px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--wash);
}

/* divider between field groups */
.form-divider {
    border-top: 1px dashed var(--line);
    margin: 1.25rem 0;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 991.98px) {
    /* No-JS admin layout: sidebar becomes a static horizontal top bar */
    .admin-shell {
        flex-direction: column;
    }
    .admin-sidebar {
        position: static;
        width: 100%;
        height: auto;
        flex-direction: column;
    }
    .admin-sidebar nav {
        flex-direction: row !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .admin-sidebar .nav-link {
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }
    .admin-sidebar .nav-link.active {
        border-left: none;
        border-bottom-color: var(--brand);
    }
    .admin-sidebar .sidebar-foot {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .admin-main {
        margin-left: 0;
    }
}
@media (max-width: 575.98px) {
    .hero-feature {
        min-height: 360px;
    }
    .article-body {
        font-size: 1.05rem;
    }
}

/* ---- Header live search dropdown ---- */
.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1080;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(20, 24, 33, 0.14);
    max-height: 360px;
    overflow-y: auto;
}
.search-dropdown .search-result {
    text-decoration: none;
    transition: background 0.12s ease;
}
.search-dropdown .search-result:hover {
    background: var(--wash);
}
