/* ============================================================================
   Bootstrap Shim — Editorum Front-Facing Pages
   Minimal replacement for Bootstrap 3.3.5 CSS on public (non-admin) pages.
   Only classes actually used in front-facing templates are included.
   ============================================================================ */

/* Reset box-sizing (Bootstrap 3 default) */
*, *::before, *::after { box-sizing: border-box; }

/* ── Container ─────────────────────────────────────────────────────────────── */
.container { max-width: 1170px; margin: 0 auto; padding: 0 15px; }

/* ── Grid ──────────────────────────────────────────────────────────────────── */
.row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
[class*="col-"] { position: relative; padding: 0 15px; min-height: 1px; }

/* xs (always) */
.col-xs-4  { width: 33.3333%; flex: 0 0 33.3333%; }
.col-xs-6  { width: 50%;      flex: 0 0 50%; }
.col-xs-8  { width: 66.6667%; flex: 0 0 66.6667%; }
.col-xs-12 { width: 100%;     flex: 0 0 100%; }

/* sm (≥768px) */
@media (min-width: 768px) {
    .col-sm-2  { width: 16.6667%; flex: 0 0 16.6667%; }
    .col-sm-3  { width: 25%;      flex: 0 0 25%; }
    .col-sm-4  { width: 33.3333%; flex: 0 0 33.3333%; }
    .col-sm-5  { width: 41.6667%; flex: 0 0 41.6667%; }
    .col-sm-6  { width: 50%;      flex: 0 0 50%; }
    .col-sm-8  { width: 66.6667%; flex: 0 0 66.6667%; }
    .col-sm-9  { width: 75%;      flex: 0 0 75%; }
    .col-sm-12 { width: 100%;     flex: 0 0 100%; }
    .col-sm-push-6 { left: 50%; }
    .col-sm-pull-4 { right: 33.3333%; }
    .hidden-sm { display: none !important; }
}

/* md (≥992px) */
@media (min-width: 992px) {
    .col-md-2  { width: 16.6667%; flex: 0 0 16.6667%; }
    .col-md-3  { width: 25%;      flex: 0 0 25%; }
    .col-md-4  { width: 33.3333%; flex: 0 0 33.3333%; }
    .col-md-6  { width: 50%;      flex: 0 0 50%; }
    .col-md-9  { width: 75%;      flex: 0 0 75%; }
    .col-md-10 { width: 83.3333%; flex: 0 0 83.3333%; }
    .col-md-12 { width: 100%;     flex: 0 0 100%; }
}

/* lg (≥1200px) */
@media (min-width: 1200px) {
    .col-lg-2  { width: 16.6667%; flex: 0 0 16.6667%; }
    .col-lg-3  { width: 25%;      flex: 0 0 25%; }
    .col-lg-4  { width: 33.3333%; flex: 0 0 33.3333%; }
    .col-lg-6  { width: 50%;      flex: 0 0 50%; }
    .col-lg-10 { width: 83.3333%; flex: 0 0 83.3333%; }
}

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal { display: none; position: fixed; inset: 0; z-index: 1050; overflow: auto; }
.modal.fade.in, .modal.show { display: block; }
.modal-dialog { max-width: 600px; margin: 30px auto; padding: 0 15px; }
.modal-dialog.modal-md { max-width: 600px; }
.modal-dialog.modal-lg { max-width: 900px; }
.modal-content { background: #fff; border-radius: 8px; box-shadow: var(--ds-shadow-popup, 0 8px 40px rgba(0,0,0,0.18)); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--ds-color-border, #E5E7EB); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--ds-color-border, #E5E7EB); display: flex; justify-content: flex-end; gap: 8px; }
.modal-title { font-size: 16px; font-weight: 700; margin: 0; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1040; }

/* ── Close button ──────────────────────────────────────────────────────────── */
.close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ds-color-secondary, #9CA3AF); padding: 0; line-height: 1; opacity: 0.7; }
.close:hover { opacity: 1; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn { display: inline-block; padding: 8px 16px; border: 1px solid transparent; border-radius: var(--ds-radius-btn, 5px); font-size: 14px; cursor: pointer; text-decoration: none; text-align: center; line-height: 1.5; }
.btn-default { background: var(--ds-color-white, #fff); border-color: var(--ds-color-border, #E5E7EB); color: var(--ds-color-body, #374151); }
.btn-default:hover { background: var(--ds-color-bg, #F9FAFB); }
.btn-primary { background: var(--ds-color-link, #1a56db); color: var(--ds-color-white, #fff); border-color: var(--ds-color-link, #1a56db); }
.btn-primary:hover { background: var(--ds-color-link-hover, #1e429f); }
.btn-secondary { background: var(--ds-color-bg, #F9FAFB); border-color: var(--ds-color-border, #E5E7EB); color: var(--ds-color-body, #374151); }
.btn-secondary:hover { background: var(--ds-color-border-lt, #F3F4F6); }
.btn-success { background: #15803D; color: #fff; border-color: #15803D; }
.btn-success:hover { background: #166534; }
.btn-link { background: none; border: none; color: var(--ds-color-link, #1a56db); padding: 0; text-decoration: underline; }

/* ── Form controls ─────────────────────────────────────────────────────────── */
.form-control { display: block; width: 100%; padding: 8px 12px; border: 1px solid var(--ds-color-border, #E5E7EB); border-radius: var(--ds-radius-btn, 5px); font-size: 14px; line-height: 1.5; background: #fff; }
select { max-width: 100%; }
.form-group select {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--ds-color-border, #E5E7EB);
    border-radius: var(--ds-radius-btn, 5px);
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
}
.form-control:focus { outline: none; border-color: var(--ds-color-link, #1a56db); box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.15); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 13px; }
.control-label { font-weight: 500; }
.checkbox { margin: 8px 0; }
.checkbox label { font-weight: normal; cursor: pointer; }

/* Input group */
.input-group { display: flex; }
.input-group .form-control { flex: 1; border-radius: var(--ds-radius-btn, 5px) 0 0 var(--ds-radius-btn, 5px); }
.input-group-btn { display: flex; }
.input-group-btn .btn { border-radius: 0 var(--ds-radius-btn, 5px) var(--ds-radius-btn, 5px) 0; }

/* ── Dropdown ──────────────────────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-toggle { cursor: pointer; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: var(--ds-color-white, #fff); border: 1px solid var(--ds-color-border, #E5E7EB); border-radius: var(--ds-radius-btn, 5px); min-width: 120px; z-index: 1000; list-style: none; padding: 4px 0; margin: 2px 0 0; box-shadow: var(--ds-shadow-card, 0 2px 8px rgba(0,0,0,0.08)); }
.open > .dropdown-menu { display: block; }
.dropdown-menu > li > a { display: block; padding: 6px 16px; color: var(--ds-color-body, #374151); text-decoration: none; font-size: 13px; }
.dropdown-menu > li > a:hover { background: var(--ds-color-border-lt, #F3F4F6); }
.caret { display: inline-block; width: 0; height: 0; border-top: 4px solid; border-right: 4px solid transparent; border-left: 4px solid transparent; vertical-align: middle; margin-left: 4px; }

/* ── Nav tabs ──────────────────────────────────────────────────────────────── */
.nav { list-style: none; padding: 0; margin: 0; }
.nav-tabs { display: flex; border-bottom: 1px solid var(--ds-color-border, #E5E7EB); }
.nav-tabs > li { margin-bottom: -1px; }
.nav-tabs > li > a { display: block; padding: 8px 14px; color: var(--ds-color-muted, #6B7280); text-decoration: none; border-bottom: 2px solid transparent; font-size: 13px; }
.nav-tabs > li > a:hover { color: var(--ds-color-body, #374151); }
.nav-tabs > li.active > a { color: var(--ds-color-link, #1a56db); border-bottom-color: var(--ds-color-link, #1a56db); }
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; }

/* ── List group ────────────────────────────────────────────────────────────── */
.list-group { padding: 0; margin: 0; list-style: none; }
.list-group-item { padding: 10px 15px; border-bottom: 1px solid var(--ds-color-border, #E5E7EB); display: block; color: var(--ds-color-body, #374151); text-decoration: none; }
.list-group-item:hover { background: var(--ds-color-border-lt, #F3F4F6); }
.list-unstyled { list-style: none; padding: 0; }

/* ── Alert (used in registration form) ─────────────────────────────────────── */
.alert { padding: 12px 16px; border: 1px solid transparent; border-radius: var(--ds-radius-btn, 5px); margin-bottom: 16px; position: relative; }
.alert-success { background: var(--ds-badge-success-bg, #F0FDF4); border-color: var(--ds-badge-success-border, #BBF7D0); color: var(--ds-badge-success-color, #15803D); }

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination { display: inline-flex; list-style: none; padding: 0; margin: 20px 0; border-radius: var(--ds-radius-btn, 5px); }
.pagination > li > a,
.pagination > li > span { display: block; padding: 6px 12px; border: 1px solid var(--ds-color-border, #E5E7EB); margin-left: -1px; color: var(--ds-color-link, #1a56db); text-decoration: none; background: var(--ds-color-white, #fff); font-size: 14px; line-height: 1.5; }
.pagination > li:first-child > a,
.pagination > li:first-child > span { margin-left: 0; border-radius: var(--ds-radius-btn, 5px) 0 0 var(--ds-radius-btn, 5px); }
.pagination > li:last-child > a,
.pagination > li:last-child > span { border-radius: 0 var(--ds-radius-btn, 5px) var(--ds-radius-btn, 5px) 0; }
.pagination > li > a:hover { background: var(--ds-color-bg, #F9FAFB); }
.pagination > .active > a,
.pagination > .active > span { background: var(--ds-color-link, #1a56db); border-color: var(--ds-color-link, #1a56db); color: var(--ds-color-white, #fff); cursor: default; }
.pagination > .disabled > a,
.pagination > .disabled > span { color: var(--ds-color-secondary, #9CA3AF); cursor: not-allowed; background: var(--ds-color-bg, #F9FAFB); }

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.pull-right { float: right; }
.pull-left { float: left; }
.clearfix::after { content: ""; display: table; clear: both; }
.hide, .hidden { display: none !important; }
.center-block { display: block; margin: 0 auto; }

/* ── Visibility / Transition helpers ───────────────────────────────────────── */
.fade { opacity: 0; transition: opacity 0.15s linear; }
.fade.in { opacity: 1; }
.collapse { display: none; }
.collapse.in { display: block; }

/* ── Font Awesome stubs (only the spinner animation used in templates) ──── */
.fa { display: inline-block; font-style: normal; }
.fa-spinner { animation: fa-spin 1s infinite linear; }
.fa-spin { animation: fa-spin 1s infinite linear; }
@keyframes fa-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
