/* =====================================================================
   CAFTM News - Theme  (matched to caftm.com main site)
   Brand: green #1F8A3B  |  body text #555555 (faded black)  |  white bg
   ===================================================================== */
:root {
    --brand-blue: #1F8A3B;        /* primary green - matches caftm.com */
    --brand-blue-dark: #166E2E;   /* darker green for hovers */
    --brand-green: #1F8A3B;       /* single-tone green like the main site */
    --brand-green-dark: #166E2E;
    --brand-dark: #383838;        /* charcoal for dark surfaces (hero, panel) */
    --brand-text: #555555;        /* faded-black body text - matches caftm.com */
    --brand-muted: #6c757d;
    --brand-light: #f5f7fa;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    color: var(--brand-text);
    background: #fff;
}

a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----------------------------- Brand bits -------------------------- */
.brand-logo { height: 72px; width: auto; }
.footer-logo { height: 64px; width: auto; }

.btn-brand {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #fff;
}
.btn-brand:hover, .btn-brand:focus {
    background: var(--brand-blue-dark);
    border-color: var(--brand-blue-dark);
    color: #fff;
}
.btn-brand-green {
    background: var(--brand-green);
    border-color: var(--brand-green);
    color: #fff;
}
.btn-brand-green:hover, .btn-brand-green:focus {
    background: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
    color: #fff;
}
.text-brand { color: var(--brand-blue) !important; }
.bg-brand { background: var(--brand-blue) !important; }
.bg-brand-green { background: var(--brand-green) !important; }

.navbar .nav-link { color: #fff; background: var(--brand-blue); font-weight: 600; border-radius: 6px; padding: .4rem .85rem; margin: .15rem .2rem; }
.navbar .nav-link:hover, .navbar .nav-link.active { background: var(--brand-blue-dark); color: #fff; text-decoration: none; }

.section-heading {
    position: relative;
    font-weight: 700;
    color: var(--brand-blue);
    margin-bottom: 1.25rem;
    padding-bottom: .5rem;
}
.section-heading::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 56px; height: 3px;
    background: var(--brand-green);
}

/* ----------------------------- Cards ------------------------------- */
.article-card {
    border: 1px solid #e9ecef;
    border-radius: .6rem;
    overflow: hidden;
    height: 100%;
    transition: transform .15s ease, box-shadow .15s ease;
    background: #fff;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.08);
}
.article-card .card-img-wrap {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--brand-light);
}
.article-card .card-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.article-card .badge-cat {
    background: var(--brand-green);
    color: #fff;
    font-weight: 600;
}
.article-card .card-title a { color: var(--brand-blue); }
.article-card .card-title a:hover { color: var(--brand-blue-dark); text-decoration: none; }

/* Featured hero */
.featured-hero {
    border-radius: .75rem;
    overflow: hidden;
    position: relative;
    min-height: 340px;
    background: var(--brand-dark);
    color: #fff;
    display: flex;
    align-items: flex-end;
}
.featured-hero img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: .55;
}
.featured-hero .hero-body {
    position: relative;
    padding: 1.5rem;
}

/* Category pills */
.cat-pill {
    display: inline-block;
    padding: .6rem 1rem;
    border-radius: 2rem;
    background: var(--brand-light);
    color: var(--brand-dark);
    font-weight: 600;
    border: 1px solid #e3e8ee;
}
.cat-pill:hover {
    background: var(--brand-blue);
    color: #fff;
    text-decoration: none;
}

/* ---------------------- Single article ----------------------------- */
.article-body { font-size: 1.075rem; line-height: 1.8; }
.article-body img { max-width: 100%; height: auto; border-radius: .4rem; margin: 1rem 0; }
.article-body h2, .article-body h3, .article-body h4 { margin-top: 1.5rem; font-weight: 700; }
.article-body blockquote {
    border-left: 4px solid var(--brand-green);
    padding-left: 1rem;
    color: var(--brand-muted);
    font-style: italic;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.article-body th, .article-body td { border: 1px solid #dee2e6; padding: .5rem .75rem; }

.author-box {
    background: var(--brand-light);
    border: 1px solid #e3e8ee;
    border-radius: .6rem;
    padding: 1.25rem;
}
.author-box img.author-photo {
    width: 84px; height: 84px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #e3e8ee;
}
.author-photo-lg {
    width: 130px; height: 130px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 .25rem .75rem rgba(0,0,0,.1);
}

/* ----------------------------- Footer ------------------------------ */
.site-footer { background: var(--brand-green); color: #ffffff; }
.site-footer h6 { color: #fff; }
.site-footer p { color: #ffffff; }
.site-footer .text-muted { color: rgba(255,255,255,.9) !important; }
.site-footer hr { border-color: rgba(255,255,255,.35); opacity: 1; }
.footer-link { color: #ffffff; }
.footer-link:hover { color: #ffffff; text-decoration: underline; }

/* ============================ ADMIN / AUTHOR PANEL ================== */
.panel-wrapper { min-height: 100vh; }
.panel-sidebar {
    background: var(--brand-dark);
    color: #cfd4da;
    width: 250px;
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    padding-top: 1rem;
    z-index: 1040;
    transition: transform .2s ease;
}
.panel-sidebar .brand { padding: .5rem 1.25rem 1rem; }
.panel-sidebar .brand img { height: 38px; background:#fff; padding:4px 6px; border-radius:6px; }
.panel-sidebar .nav-link {
    color: #cfd4da; padding: .65rem 1.25rem; display: flex; align-items: center; gap: .6rem;
    border-left: 3px solid transparent;
}
.panel-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration:none; }
.panel-sidebar .nav-link.active {
    background: rgba(31,138,59,.22);
    color: #fff;
    border-left-color: var(--brand-green);
}
.panel-content { margin-left: 250px; padding: 1.5rem; }
.panel-topbar {
    background: #fff; border-bottom: 1px solid #e9ecef;
    padding: .75rem 1.5rem; margin-left: 250px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1030;
}
.stat-card {
    border: none; border-radius: .6rem; color: #fff;
    box-shadow: 0 .25rem .75rem rgba(0,0,0,.08);
}
.stat-card .stat-num { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-blue   { background: var(--brand-blue); }
.stat-green  { background: var(--brand-green); }
.stat-dark   { background: var(--brand-dark); }
.stat-amber  { background: #e0a106; }

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

@media (max-width: 991.98px) {
    .panel-sidebar { transform: translateX(-100%); }
    .panel-sidebar.open { transform: translateX(0); }
    .panel-content, .panel-topbar { margin-left: 0; }
    .sidebar-backdrop.show { display: block; }
}

/* ----------------------- Rich text editor -------------------------- */
.rte-toolbar {
    border: 1px solid #ced4da; border-bottom: none;
    border-radius: .375rem .375rem 0 0;
    padding: .35rem; background: #f8f9fa;
    display: flex; flex-wrap: wrap; gap: .25rem;
}
.rte-toolbar button {
    border: 1px solid transparent; background: #fff;
    border-radius: .25rem; padding: .25rem .55rem; cursor: pointer;
    font-size: .9rem;
}
.rte-toolbar button:hover { background: var(--brand-light); border-color: #ced4da; }
.rte-editor {
    border: 1px solid #ced4da; border-radius: 0 0 .375rem .375rem;
    min-height: 320px; padding: .75rem 1rem; overflow-y: auto;
    background: #fff;
}
.rte-editor:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 .2rem rgba(31,138,59,.15); }
