/**
 * institution.bd — Custom Collision-Free Bootstrap-Style Article UI Kit
 * File: /assets/css/article-custom.css
 *
 * Why `c`-prefixed classes?
 * Standard Bootstrap classes (.btn, .card, .collapse, .table, .row, .border) collide with
 * Tailwind CSS utilities used across institution.bd. Using `c`-prefixed classes (`cbtn` / `cbtm`,
 * `ccard`, `calert`, `cbadge`, `ctable`, `crow`, `ccol-md-*`) gives you 100% Bootstrap ergonomics,
 * 100% automatic Dark Mode (`html.dark`) support, and 0% conflict with Tailwind CSS.
 *
 * You can also add your own global custom article CSS rules at the bottom of this file,
 * or via Article Studio -> Settings -> Global Custom Article CSS.
 */

/* ==========================================================================
   1. BUTTONS (.cbtn and .cbtm alias)
   Usage: <a href="..." class="cbtn cbtn-primary">Click Here</a>
          <a href="..." class="cbtm cbtm-success"><i class="fa fa-download"></i> Download</a>
   ========================================================================== */
.cbtn,
.cbtm {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  padding: 0.625rem 1.25rem !important;
  font-size: 0.875rem !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  border-radius: 0.75rem !important;
  border: 1px solid transparent !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  white-space: nowrap !important;
  user-select: none !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
  background-color: #18181b;
  color: #ffffff !important;
}

.cbtn:hover,
.cbtm:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16) !important;
  text-decoration: none !important;
  filter: brightness(1.06);
}

.cbtn:active,
.cbtm:active {
  transform: translateY(0) scale(0.98) !important;
}

/* Variants */
.cbtn-primary,
.cbtm-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

.cbtn-success,
.cbtm-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}

.cbtn-warning,
.cbtm-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  border-color: #d97706 !important;
  color: #09090b !important;
}

.cbtn-danger,
.cbtm-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
}

.cbtn-info,
.cbtm-info {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important;
  border-color: #0f766e !important;
  color: #ffffff !important;
}

.cbtn-dark,
.cbtm-dark {
  background-color: #09090b !important;
  border-color: #27272a !important;
  color: #ffffff !important;
}
.dark .cbtn-dark,
.dark .cbtm-dark {
  background-color: #f4f4f5 !important;
  border-color: #e4e4e7 !important;
  color: #09090b !important;
}

.cbtn-outline,
.cbtm-outline {
  background-color: transparent !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: none !important;
}
.cbtn-outline:hover,
.cbtm-outline:hover {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}
.dark .cbtn-outline,
.dark .cbtm-outline {
  border-color: #3f3f46 !important;
  color: #f4f4f5 !important;
}
.dark .cbtn-outline:hover,
.dark .cbtm-outline:hover {
  background-color: #27272a !important;
  border-color: #52525b !important;
}

/* Sizes & Shapes */
.cbtn-sm,
.cbtm-sm {
  padding: 0.4rem 0.85rem !important;
  font-size: 0.75rem !important;
  border-radius: 0.55rem !important;
}

.cbtn-lg,
.cbtm-lg {
  padding: 0.85rem 1.65rem !important;
  font-size: 1rem !important;
  border-radius: 0.9rem !important;
}

.cbtn-pill,
.cbtm-pill {
  border-radius: 9999px !important;
}

.cbtn-block,
.cbtm-block {
  display: flex !important;
  width: 100% !important;
  white-space: normal !important;
  text-align: center !important;
}

@media (max-width: 480px) {
  .cbtn,
  .cbtm {
    white-space: normal !important;
    text-align: center !important;
  }
}

/* ==========================================================================
   2. CARDS (.ccard, .ccard-header, .ccard-body, .ccard-footer)
   ========================================================================== */
.ccard {
  background-color: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 1rem;
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.06);
  margin: 1.5rem 0;
  overflow: hidden;
  color: #18181b;
  display: flex;
  flex-direction: column;
}
.dark .ccard {
  background-color: #121215;
  border-color: #27272a;
  color: #f4f4f5;
  box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.45);
}

/* Keep equal height when inside .crow grid */
.crow > [class*="ccol-"] > .ccard {
  height: 100%;
  margin: 0;
}

.ccard-header {
  padding: 0.9rem 1.25rem;
  background-color: #f8fafc;
  border-bottom: 1px solid #e4e4e7;
  font-weight: 800;
  font-size: 0.95rem;
  color: #09090b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.dark .ccard-header {
  background-color: #18181b;
  border-bottom-color: #27272a;
  color: #ffffff;
}

.ccard-body {
  padding: 1.25rem;
  flex: 1 1 auto;
}

.ccard-footer {
  padding: 0.85rem 1.25rem;
  background-color: #fafafa;
  border-top: 1px solid #e4e4e7;
  font-size: 0.82rem;
  color: #52525b;
}
.dark .ccard-footer {
  background-color: #18181b;
  border-top-color: #27272a;
  color: #a1a1aa;
}

/* Protect headings & paragraphs inside .ccard from global .newspaper-article-body / .article-preview-content margins/underlines */
.ccard .ccard-title,
.newspaper-article-body .ccard h3,
.newspaper-article-body .ccard h4,
.article-preview-content .ccard h3,
.article-preview-content .ccard h4 {
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  margin-top: 0 !important;
  margin-bottom: 0.5rem !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  color: #09090b !important;
  line-height: 1.4 !important;
}
.dark .ccard .ccard-title,
.dark .newspaper-article-body .ccard h3,
.dark .newspaper-article-body .ccard h4,
.dark .article-preview-content .ccard h3,
.dark .article-preview-content .ccard h4 {
  color: #ffffff !important;
}

.ccard .ccard-text,
.newspaper-article-body .ccard p,
.article-preview-content .ccard p {
  font-size: 0.95rem !important;
  line-height: 1.65 !important;
  margin-bottom: 0.75rem !important;
  color: #3f3f46 !important;
}
.dark .ccard .ccard-text,
.dark .newspaper-article-body .ccard p,
.dark .article-preview-content .ccard p {
  color: #d4d4d8 !important;
}
.newspaper-article-body .ccard p:last-child,
.article-preview-content .ccard p:last-child {
  margin-bottom: 0 !important;
}

/* ==========================================================================
   3. ALERTS / CALLOUTS (.calert, .calert-info, .calert-success, .calert-warning, .calert-danger)
   ========================================================================== */
.calert {
  position: relative;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0.875rem;
  border: 1px solid #e4e4e7;
  border-left-width: 4px;
  background-color: #f8fafc;
  color: #1e293b;
  font-size: 0.95rem;
  line-height: 1.65;
}
.dark .calert {
  background-color: #18181b;
  border-color: #27272a;
  color: #e4e4e7;
}

.newspaper-article-body .calert h4,
.calert-title {
  margin-top: 0 !important;
  margin-bottom: 0.35rem !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
  color: inherit !important;
}

.newspaper-article-body .calert p {
  margin-bottom: 0.4rem !important;
  font-size: 0.92rem !important;
  line-height: 1.65 !important;
  color: inherit !important;
}
.newspaper-article-body .calert p:last-child {
  margin-bottom: 0 !important;
}

.calert-info,
.calert-primary {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  border-left-color: #2563eb;
  color: #1e3a8a;
}
.dark .calert-info,
.dark .calert-primary {
  background-color: rgba(37, 99, 235, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  border-left-color: #3b82f6;
  color: #dbeafe;
}

.calert-success {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  border-left-color: #059669;
  color: #064e3b;
}
.dark .calert-success {
  background-color: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  border-left-color: #10b981;
  color: #d1fae5;
}

.calert-warning {
  background-color: #fffbeb;
  border-color: #fde68a;
  border-left-color: #d97706;
  color: #78350f;
}
.dark .calert-warning {
  background-color: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  border-left-color: #f59e0b;
  color: #fef3c7;
}

.calert-danger {
  background-color: #fef2f2;
  border-color: #fecaca;
  border-left-color: #dc2626;
  color: #7f1d1d;
}
.dark .calert-danger {
  background-color: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  border-left-color: #ef4444;
  color: #fee2e2;
}

/* ==========================================================================
   4. BADGES (.cbadge, .cbadge-primary, .cbadge-success, .cbadge-warning, .cbadge-danger)
   ========================================================================== */
.cbadge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.3;
  border-radius: 0.45rem;
  background-color: #e4e4e7;
  color: #18181b;
  vertical-align: middle;
}
.dark .cbadge {
  background-color: #27272a;
  color: #f4f4f5;
}

.cbadge-pill {
  border-radius: 9999px;
}

.cbadge-primary {
  background-color: #dbeafe;
  color: #1d4ed8;
}
.dark .cbadge-primary {
  background-color: rgba(37, 99, 235, 0.22);
  color: #93c5fd;
}

.cbadge-success {
  background-color: #d1fae5;
  color: #047857;
}
.dark .cbadge-success {
  background-color: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}

.cbadge-warning {
  background-color: #fef3c7;
  color: #b45309;
}
.dark .cbadge-warning {
  background-color: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
}

.cbadge-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}
.dark .cbadge-danger {
  background-color: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

.cbadge-dark {
  background-color: #18181b;
  color: #ffffff;
}
.dark .cbadge-dark {
  background-color: #f4f4f5;
  color: #09090b;
}

/* ==========================================================================
   5. TABLES (.ctable-responsive, .ctable, .ctable-bordered, .ctable-striped, .ctable-hover)
   ========================================================================== */
.ctable-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: 0.875rem;
  border: 1px solid #e4e4e7;
}
.dark .ctable-responsive {
  border-color: #27272a;
}

.newspaper-article-body table.ctable,
table.ctable {
  display: table !important;
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  background-color: #ffffff;
  color: #18181b;
}
.ctable-responsive > table.ctable,
.newspaper-article-body .ctable-responsive > table.ctable {
  margin: 0 !important;
}
.dark .newspaper-article-body table.ctable,
.dark table.ctable {
  background-color: #121215;
  color: #e4e4e7;
}

table.ctable th,
table.ctable td {
  padding: 0.75rem 1rem !important;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #e4e4e7;
}
.dark table.ctable th,
.dark table.ctable td {
  border-bottom-color: #27272a;
}

table.ctable thead th {
  background-color: #18181b !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.03em;
  text-transform: none !important;
}
.dark table.ctable thead th {
  background-color: #27272a !important;
  color: #ffffff !important;
}

/* .ctable-bordered */
table.ctable-bordered th,
table.ctable-bordered td {
  border: 1px solid #e4e4e7 !important;
}
.dark table.ctable-bordered th,
.dark table.ctable-bordered td {
  border: 1px solid #27272a !important;
}

/* .ctable-striped */
table.ctable-striped tbody tr:nth-of-type(even) {
  background-color: #f8fafc;
}
.dark table.ctable-striped tbody tr:nth-of-type(even) {
  background-color: #18181b;
}

/* .ctable-hover */
table.ctable-hover tbody tr:hover {
  background-color: #f1f5f9;
}
.dark table.ctable-hover tbody tr:hover {
  background-color: #222226;
}

/* ==========================================================================
   6. 12-COLUMN RESPONSIVE GRID (.crow & .ccol-*)
   Zero negative-margin overflow! Uses modern 12-column CSS Grid.
   ========================================================================== */
.crow {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.crow.cg-2 { gap: 0.5rem; }
.crow.cg-3 { gap: 1rem; }
.crow.cg-4 { gap: 1.5rem; }

/* Default mobile: full width 12 columns unless .ccol-6 etc. specified */
.crow > [class*="ccol-"] {
  grid-column: span 12 / span 12;
  min-width: 0;
}

.crow > .ccol-12 { grid-column: span 12 / span 12; }
.crow > .ccol-6  { grid-column: span 6 / span 6; }
.crow > .ccol-4  { grid-column: span 4 / span 4; }
.crow > .ccol-3  { grid-column: span 3 / span 3; }

/* Small devices (>= 576px) */
@media (min-width: 576px) {
  .crow > .ccol-sm-12 { grid-column: span 12 / span 12; }
  .crow > .ccol-sm-6  { grid-column: span 6 / span 6; }
  .crow > .ccol-sm-4  { grid-column: span 4 / span 4; }
}

/* Medium devices / Tablets & Desktop (>= 768px) */
@media (min-width: 768px) {
  .crow > .ccol-md-12 { grid-column: span 12 / span 12; }
  .crow > .ccol-md-9  { grid-column: span 9 / span 9; }
  .crow > .ccol-md-8  { grid-column: span 8 / span 8; }
  .crow > .ccol-md-7  { grid-column: span 7 / span 7; }
  .crow > .ccol-md-6  { grid-column: span 6 / span 6; }
  .crow > .ccol-md-5  { grid-column: span 5 / span 5; }
  .crow > .ccol-md-4  { grid-column: span 4 / span 4; }
  .crow > .ccol-md-3  { grid-column: span 3 / span 3; }
}

/* Large devices / Desktops (>= 1024px) */
@media (min-width: 1024px) {
  .crow > .ccol-lg-12 { grid-column: span 12 / span 12; }
  .crow > .ccol-lg-8  { grid-column: span 8 / span 8; }
  .crow > .ccol-lg-6  { grid-column: span 6 / span 6; }
  .crow > .ccol-lg-4  { grid-column: span 4 / span 4; }
  .crow > .ccol-lg-3  { grid-column: span 3 / span 3; }
}

/* ==========================================================================
   7. LIST GROUP & DOWNLOAD BOX (.clist-group, .cdownload-box)
   ========================================================================== */
.clist-group {
  list-style: none !important;
  margin: 1.25rem 0 !important;
  padding: 0 !important;
  border: 1px solid #e4e4e7;
  border-radius: 0.875rem;
  overflow: hidden;
  background-color: #ffffff;
}
.dark .clist-group {
  border-color: #27272a;
  background-color: #121215;
}

.clist-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e4e4e7;
  margin-bottom: 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.92rem;
}
.clist-item:last-child {
  border-bottom: none;
}
.dark .clist-item {
  border-bottom-color: #27272a;
}

.cdownload-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  border-radius: 1rem;
  border: 1.5px solid #10b981;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
}
.dark .cdownload-box {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.35) 0%, rgba(15, 23, 42, 0.85) 100%);
}
@media (min-width: 640px) {
  .cdownload-box {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}