/* ============================================================
   UBD Registration Manager — News & Stories styles
   Frontend archive/single + dashboard editor & list
   ============================================================ */

/* ---------------------------------------------------------- *
   FRONTEND — shared
 * ---------------------------------------------------------- */
.ubdrm-news-shell { --ubdrm-primary: var(--ubdrm-primary, #0b2a64); --ubdrm-accent: var(--ubdrm-accent, #ef5b2a); }
.ubdrm-news-head { text-align: center; margin-bottom: 34px; }
.ubdrm-news-head .ubdrm-kicker {
    display: inline-block; margin-bottom: 12px; padding: 6px 16px;
    color: var(--ubdrm-accent); background: rgba(239, 91, 42, .1);
    border-radius: 99px; font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
}
.ubdrm-news-head h2 { margin: 0; color: var(--ubdrm-primary); font-size: clamp(26px, 4vw, 40px); letter-spacing: -.02em; line-height: 1.15; }

.ubdrm-news-empty {
    padding: 60px 24px; text-align: center; color: #6b7688;
    background: #f7f9fc; border: 1px dashed #d3dbe6; border-radius: 16px;
}

/* Card grid */
.ubdrm-news-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ubdrm-news-cards-paper_news { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }

.ubdrm-news-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border: 1px solid #e7ecf3; border-radius: 16px;
    box-shadow: 0 6px 20px rgba(16, 35, 68, .05);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.ubdrm-news-card:hover { transform: translateY(-5px); box-shadow: 0 18px 40px rgba(16, 35, 68, .12); border-color: #d6deea; }

.ubdrm-news-card-media {
    position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #eef2f7;
}
.ubdrm-news-cards-magazine .ubdrm-news-card-media { aspect-ratio: 3 / 4; }
.ubdrm-news-cards-paper_news .ubdrm-news-card-media { aspect-ratio: 4 / 5; }
.ubdrm-news-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ubdrm-news-card:hover .ubdrm-news-card-media img { transform: scale(1.06); }
.ubdrm-news-card-placeholder {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
    color: #fff; font-size: 44px; font-weight: 900;
    background: linear-gradient(135deg, var(--ubdrm-primary), #17427f);
}
.ubdrm-news-badge {
    position: absolute; top: 12px; left: 12px; max-width: calc(100% - 24px);
    padding: 5px 12px; color: #fff; background: var(--ubdrm-accent);
    border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: .02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 0 6px 14px rgba(239, 91, 42, .3);
}

.ubdrm-news-card-body { display: flex; flex-direction: column; gap: 9px; padding: 18px 18px 20px; flex: 1; }
.ubdrm-news-card-date { color: #8b96a8; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.ubdrm-news-card-body h3 { margin: 0; font-size: 18px; line-height: 1.35; color: #16233d; }
.ubdrm-news-card-body h3 a { color: inherit !important; text-decoration: none; }
.ubdrm-news-card-body h3 a:hover { color: var(--ubdrm-accent) !important; }
.ubdrm-news-card-body p { margin: 0; color: #5c6779; font-size: 14px; line-height: 1.6; flex: 1; }
.ubdrm-news-card-links { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.ubdrm-news-readmore { color: var(--ubdrm-accent) !important; font-weight: 800; font-size: 13px; text-decoration: none; }
.ubdrm-news-readmore:hover { text-decoration: underline; }
.ubdrm-news-ext { color: var(--ubdrm-primary) !important; font-weight: 700; font-size: 12px; text-decoration: none; }

.ubdrm-news-pagination { margin-top: 34px; }

/* Single article */
.ubdrm-news-single { max-width: 860px; }
.ubdrm-news-back {
    display: inline-block; margin-bottom: 20px; color: var(--ubdrm-primary) !important;
    font-weight: 800; font-size: 14px; text-decoration: none;
}
.ubdrm-news-back:hover { color: var(--ubdrm-accent) !important; }
.ubdrm-news-article-head { text-align: center; margin-bottom: 26px; }
.ubdrm-news-article-head .ubdrm-kicker {
    display: inline-block; margin-bottom: 14px; padding: 6px 16px;
    color: var(--ubdrm-accent); background: rgba(239, 91, 42, .1); border-radius: 99px;
    font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
}
.ubdrm-news-article-head h1 { margin: 0 0 16px; color: var(--ubdrm-primary); font-size: clamp(26px, 4vw, 42px); line-height: 1.2; letter-spacing: -.02em; }
.ubdrm-news-article-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; color: #7a8598; font-size: 13px; font-weight: 700; }
.ubdrm-news-article-meta span { position: relative; }
.ubdrm-news-article-meta span + span::before { content: "·"; position: absolute; left: -11px; color: #c2cbd8; }

.ubdrm-news-article-hero { margin: 0 0 28px; overflow: hidden; border-radius: 18px; box-shadow: 0 14px 40px rgba(16, 35, 68, .12); }
.ubdrm-news-article-hero img { display: block; width: 100%; height: auto; }

.ubdrm-news-article-content { color: #2c3853; font-size: 17px; line-height: 1.8; }
.ubdrm-news-article-content p { margin: 0 0 1.15em; }
.ubdrm-news-article-content h2, .ubdrm-news-article-content h3 { color: var(--ubdrm-primary); margin: 1.4em 0 .6em; line-height: 1.3; }
.ubdrm-news-article-content h2 { font-size: 26px; }
.ubdrm-news-article-content h3 { font-size: 21px; }
.ubdrm-news-article-content a { color: var(--ubdrm-accent); font-weight: 700; }
.ubdrm-news-article-content img { max-width: 100%; height: auto; border-radius: 12px; margin: .6em 0; }
.ubdrm-news-article-content ul, .ubdrm-news-article-content ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.ubdrm-news-article-content li { margin-bottom: .5em; }
.ubdrm-news-article-content blockquote {
    margin: 1.2em 0; padding: 14px 20px; color: #364256;
    border-left: 4px solid var(--ubdrm-accent); background: #f6f8fc; border-radius: 0 12px 12px 0;
}

.ubdrm-news-gallery-view { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 30px; }
.ubdrm-news-gallery-view a { display: block; overflow: hidden; border-radius: 12px; aspect-ratio: 1 / 1; }
.ubdrm-news-gallery-view img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.ubdrm-news-gallery-view a:hover img { transform: scale(1.08); }

.ubdrm-news-article-cta { margin-top: 30px; text-align: center; }

@media (max-width: 900px) {
    .ubdrm-news-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ubdrm-news-cards-paper_news { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .ubdrm-news-cards, .ubdrm-news-cards-paper_news { grid-template-columns: 1fr; }
    .ubdrm-news-gallery-view { grid-template-columns: repeat(2, 1fr); }
    .ubdrm-news-article-content { font-size: 16px; }
}

/* ---------------------------------------------------------- *
   DASHBOARD — News management
 * ---------------------------------------------------------- */
.ubdrm-news-alert-success { margin: 15px 0; padding: 14px 17px; color: #0f7a45; background: #e7f8ef; border: 1px solid #bfead1; border-radius: 12px; font-weight: 700; }

.ubdrm-news-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.ubdrm-news-tabs a {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
    color: #3a4a63 !important; background: #eef2f7; border: 1px solid transparent; border-radius: 10px;
    font-weight: 800; font-size: 13px; text-decoration: none; transition: all .18s ease;
}
.ubdrm-news-tabs a:hover { background: #e3eaf3; }
.ubdrm-news-tabs a.active { color: #fff !important; background: linear-gradient(135deg, #0b2a64, #17427f); box-shadow: 0 8px 18px rgba(11, 42, 100, .2); }
.ubdrm-news-tabs a span { display: inline-flex; min-width: 22px; height: 20px; align-items: center; justify-content: center; padding: 0 6px; background: rgba(0, 0, 0, .08); border-radius: 99px; font-size: 11px; }
.ubdrm-news-tabs a.active span { background: rgba(255, 255, 255, .2); }

.ubdrm-news-filter { grid-template-columns: minmax(220px, 1fr) auto auto; }

.ubdrm-news-list { display: grid; gap: 10px; }
.ubdrm-news-row {
    display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px;
    padding: 12px; border: 1px solid #e6ebf2; border-radius: 12px; background: #fff; transition: border-color .18s, box-shadow .18s;
}
.ubdrm-news-row:hover { border-color: #d3dded; box-shadow: 0 8px 18px rgba(17, 36, 70, .06); }
.ubdrm-news-thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: #eef2f7; flex: 0 0 56px; }
.ubdrm-news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ubdrm-news-thumb span { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: #fff; font-weight: 900; background: linear-gradient(135deg, #0b2a64, #17427f); }
.ubdrm-news-row-body { min-width: 0; }
.ubdrm-news-row-body strong { display: block; color: #16233d; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ubdrm-news-row-body small { display: block; margin-top: 4px; color: #7f8b9d; font-size: 12px; }
.ubdrm-news-status { padding: 2px 9px; border-radius: 99px; font-weight: 800; font-size: 11px; }
.ubdrm-news-status.status-published { color: #0f7a45; background: #e6f7ee; }
.ubdrm-news-status.status-draft { color: #9a5e00; background: #fdf1dc; }
.ubdrm-news-row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ubdrm-news-row-actions .ubdrm-small-btn { padding: 7px 11px; font-size: 12px; }
.ubdrm-news-view { color: #0f5c8f !important; background: #e4f0f9 !important; }
.ubdrm-news-delete { color: #c0322f !important; background: #fdeaea !important; }
.ubdrm-news-toggle { color: #6b4bb0 !important; background: #efe9fb !important; }

/* Editor */
.ubdrm-news-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
.ubdrm-news-editor-main { display: grid; gap: 14px; min-width: 0; }
.ubdrm-news-editor-side { display: grid; gap: 16px; align-content: start; }
.ubdrm-news-side-card { padding: 16px; border: 1px solid #e6ebf2; border-radius: 14px; background: #fbfcfe; }
.ubdrm-news-side-card h4 { margin: 0 0 12px; color: #16233d; font-size: 14px; letter-spacing: .01em; }
.ubdrm-news-content-area { min-height: 320px; }

.ubdrm-news-image-preview {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 16 / 10; margin-bottom: 12px; overflow: hidden;
    color: #97a2b3; font-size: 12px; background: #eef2f7; border: 1px dashed #cdd6e2; border-radius: 12px;
}
.ubdrm-news-image-preview.has-image { border-style: solid; border-color: #dbe2ec; }
.ubdrm-news-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.ubdrm-news-image-buttons { display: flex; gap: 8px; margin-bottom: 10px; }
.ubdrm-btn-sm { padding: 8px 12px !important; font-size: 12px !important; }
.ubdrm-news-upload-label { display: block; margin-bottom: 8px; color: #5a6579; font-size: 12px; font-weight: 700; }
.ubdrm-news-upload-label input[type="file"] { margin-top: 6px; width: 100%; }
.ubdrm-news-url-input { width: 100%; }

.ubdrm-news-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.ubdrm-news-gallery-item { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; }
.ubdrm-news-gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.ubdrm-news-gallery-item button {
    position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0;
    display: flex; align-items: center; justify-content: center; line-height: 1;
    color: #fff; background: rgba(192, 50, 47, .92); border: 0; border-radius: 50%; cursor: pointer; font-size: 14px;
}

@media (max-width: 820px) {
    .ubdrm-news-editor-grid { grid-template-columns: 1fr; }
    .ubdrm-news-row { grid-template-columns: 48px minmax(0, 1fr); }
    .ubdrm-news-thumb { width: 48px; height: 48px; flex-basis: 48px; }
    .ubdrm-news-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
