﻿/* ================================================================
   base.css - Bootstrap-free utility & component foundation
   Loaded BEFORE site.css so the design layer can override freely.
   ================================================================ */

/* ---- Reboot extras ---- */
*, *::before, *::after { box-sizing: border-box; }
img, svg { vertical-align: middle; }

hr {
    margin: 1rem 0;
    border: 0;
    border-top: 1px solid rgba(0,0,0,.1);
    opacity: .25;
}

small, .small { font-size: .875em; }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    margin-top: 0;
    margin-bottom: .5rem;
    font-weight: 500;
    line-height: 1.2;
}
h1, .h1 { font-size: 2.5rem; }
h2, .h2 { font-size: 2rem; }
h3, .h3 { font-size: 1.75rem; }
h4, .h4 { font-size: 1.5rem; }
h5, .h5 { font-size: 1.25rem; }
h6, .h6 { font-size: 1rem; }

p { margin-top: 0; margin-bottom: 1rem; }

kbd {
    padding: .2rem .4rem;
    font-size: .875em;
    color: #fff;
    background-color: #212529;
    border-radius: .25rem;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}


.visually-hidden,
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---- Grid ---- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -.75rem;
    margin-left: -.75rem;
}
.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: .75rem;
    padding-left: .75rem;
}

@media (min-width: 768px) {
    .col-md-5    { flex: 0 0 auto; width: 41.666667%; }
    .col-md-6    { flex: 0 0 auto; width: 50%; }
    .col-md-7    { flex: 0 0 auto; width: 58.333333%; }
    .col-md-10   { flex: 0 0 auto; width: 83.333333%; }
    .col-md-12   { flex: 0 0 auto; width: 100%; }
    .col-md-offset-2 { margin-left: 16.666667%; }
}
@media (min-width: 992px) {
    .col-lg-8  { flex: 0 0 auto; width: 66.666667%; }
}

/* ---- Display ---- */
.d-block        { display: block !important; }
.d-flex         { display: flex !important; }
.d-grid         { display: grid !important; }

@media (min-width: 768px) {
    .d-md-flex  { display: flex !important; }
}

/* ---- Flex ---- */
.flex-column   { flex-direction: column !important; }
.flex-wrap     { flex-wrap: wrap !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

@media (min-width: 576px) {
    .flex-sm-row { flex-direction: row !important; }
}

.justify-content-center  { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }

@media (min-width: 768px) {
    .justify-content-md-end { justify-content: flex-end !important; }
}

.align-items-start  { align-items: flex-start !important; }
.align-items-end    { align-items: flex-end !important; }

@media (min-width: 576px) {
    .align-items-sm-center { align-items: center !important; }
}

.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }

/* ---- Spacing ---- */
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }

.me-1 { margin-right: .25rem !important; }

.p-3 { padding: 1rem !important; }
.ps-2 { padding-left: .5rem !important; }

/* ---- Text ---- */
.text-center { text-align: center !important; }

.text-muted     { color: #6c757d !important; }
.text-danger    { color: #dc2626 !important; }
.text-success   { color: #16a34a !important; }
.text-info      { color: #0dcaf0 !important; }
.text-white     { color: #fff !important; }
.text-dark      { color: #212529 !important; }
.text-primary   { color: #3b82f6 !important; }

.fw-semibold { font-weight: 600 !important; }
.font-weight-bold { font-weight: 700 !important; }

.fs-5 { font-size: 1.25rem !important; }

@media (min-width: 768px) {
    .fs-md-4 { font-size: 1.5rem !important; }
}

.text-decoration-none { text-decoration: none !important; }

.link-primary { color: #3b82f6; }
.link-primary:hover { color: #2563eb; }

/* ---- Sizing ---- */
.h-100  { height: 100% !important; }

/* ---- Border / Shape / Shadow ---- */
.border        { border: 1px solid rgba(0,0,0,.125) !important; }

.rounded       { border-radius: .375rem !important; }
.rounded-pill  { border-radius: 50rem !important; }

.shadow      { box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important; }
.shadow-sm   { box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important; }

/* ---- Background ---- */
.bg-light       { background-color: #f8f9fa !important; }
.bg-white       { background-color: #fff !important; }
.bg-primary     { background-color: #3b82f6 !important; }

/* ---- Buttons ---- */
/*
 * Base element styling for button / input[type=submit]:
 *   neutral gradient, rounded (--radius-sm), subtle shadow.
 *
 * .btn             = primary (blue gradient, pill)
 * .btn.secondary   = neutral gradient (pill)
 * .btn.accent      = green / success
 * .btn.danger      = red
 * .btn.warning     = amber
 * .btn.info        = cyan
 * .btn.text        = link-like, no background
 * .btn.outline     = primary outline
 * .btn.outline-muted   = neutral outline
 * .btn.outline-blue    = pale-blue border (WpForums unified)
 * .btn.outline-danger  = red outline
 * .btn.outline-accent  = green outline
 * .btn.outline-warning = amber outline
 * .btn.lg / .btn.sm    = size modifiers
 */

/* --- Base element reset (matches WpForums) --- */
button, input[type=submit] {
    appearance: none;
    border: 1px solid rgba(17,25,40,.14);
    background: linear-gradient(145deg,#ffffff,#f1f5f9);
    color: var(--fg);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .3px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: background .18s, box-shadow .18s, transform .12s;
}
button:hover, input[type=submit]:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
button:active, input[type=submit]:active {
    transform: translateY(0) scale(.97);
}
button:focus-visible, input[type=submit]:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* --- .btn (primary action pill) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .3px;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    color: #fff;
    background: linear-gradient(145deg, var(--primary), var(--primary-accent));
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 999px;
    box-shadow: 0 4px 14px -2px rgba(37,99,235,.45);
    transition: box-shadow .18s ease, transform .12s ease;
    appearance: none;
}
.btn:hover {
    box-shadow: 0 6px 20px -2px rgba(37,99,235,.55);
    transform: translateY(-2px);
}
.btn:active  { transform: translateY(0) scale(.97); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled, .btn.disabled { pointer-events: none; opacity: .65; }

/* -- secondary (neutral) -- */
.btn.secondary {
    background: linear-gradient(145deg, #ffffff, #f1f5f9);
    color: var(--fg);
    border: 1px solid rgba(17,25,40,.10);
    box-shadow: 0 3px 10px -2px rgba(17,25,40,.15);
}

.btn.secondary:hover {
    box-shadow: 0 5px 16px -2px rgba(17,25,40,.22);
    transform: translateY(-2px);
}
/* -- accent (green / success) -- */
.btn.accent {
    background: linear-gradient(145deg, var(--accent), #15803d);
    box-shadow: 0 4px 14px -2px rgba(22,163,74,.5);
}

/* -- danger -- */
.btn.danger {
    background: linear-gradient(145deg, #ef4444, #dc2626);
    box-shadow: 0 4px 14px -2px rgba(220,38,38,.5);
}

/* -- warning -- */
.btn.warning {
    background: linear-gradient(145deg, #f59e0b, #d97706);
    color: #000;
    box-shadow: 0 4px 14px -2px rgba(245,158,11,.45);
}

/* -- info -- */
.btn.info {
    background: linear-gradient(145deg, #0dcaf0, #0891b2);
    color: #000;
    box-shadow: 0 4px 14px -2px rgba(13,202,240,.45);
}

/* -- text (link-like) -- */
.btn.text {
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
    color: var(--primary);
    font-weight: 400;
    padding: 6px 10px;
}
.btn.text:hover { text-decoration: underline; transform: none; box-shadow: none; }

/* -- outline (primary) -- */
.btn.outline {
    background: #fff;
    border: 1px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}
.btn.outline:hover { background: linear-gradient(145deg, #f0f7ff, #e6f1ff); box-shadow: var(--shadow-sm); }
.btn.outline:focus-visible { box-shadow: var(--focus-ring); }

/* -- outline-muted -- */
.btn.outline-muted {
    background: #fff;
    border: 1px solid rgba(17,25,40,.20);
    color: var(--fg);
    box-shadow: none;
}
.btn.outline-muted:hover { background: linear-gradient(145deg, #f8fafc, #f1f5f9); box-shadow: var(--shadow-sm); }

/* -- outline-danger -- */
.btn.outline-danger {
    background: #fff;
    border: 1px solid var(--danger);
    color: var(--danger);
    box-shadow: none;
}
.btn.outline-danger:hover { background: linear-gradient(145deg, #fef2f2, #fee2e2); box-shadow: var(--shadow-sm); }

/* -- outline-accent -- */
.btn.outline-accent {
    background: #fff;
    border: 1px solid var(--accent);
    color: var(--accent);
    box-shadow: none;
}
.btn.outline-accent:hover { background: linear-gradient(145deg, #f0fdf4, #dcfce7); box-shadow: var(--shadow-sm); }

/* -- outline-warning -- */
.btn.outline-warning {
    background: #fff;
    border: 1px solid var(--warning);
    color: #92400e;
    box-shadow: none;
}
.btn.outline-warning:hover { background: linear-gradient(145deg, #fffbeb, #fef3c7); box-shadow: var(--shadow-sm); }

/* -- outline-blue (pale blue border - WpForums unified) -- */
.btn.outline-blue {
    background: linear-gradient(#ffffff,#ffffff) padding-box, linear-gradient(var(--soft-blue),var(--soft-blue)) border-box;
    border: 2px solid transparent;
    color: var(--fg);
    box-shadow: 0 2px 6px -2px rgba(0,0,0,.12);
}
.btn.outline-blue:hover {
    background: linear-gradient(#ffffff,#f8fbff) padding-box, linear-gradient(#cfe2fb,#cfe2fb) border-box;
    box-shadow: 0 4px 12px -2px rgba(0,0,0,.16);
    transform: translateY(-2px);
}
.btn.outline-blue:active { transform: translateY(0) scale(.97); }
.btn.outline-blue:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 0 5px var(--soft-blue-ring);
}

/* -- sizes -- */
.btn.lg { padding: 14px 24px; font-size: 1.125rem; }
.btn.sm { padding: 6px 14px; font-size: 12px; }

/* ---- Forms ---- */
.form-label {
    display: inline-block;
    margin-bottom: .5rem;
    font-weight: 500;
}

.form-control {
    display: block;
    width: 100%;
    padding: .5rem .75rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: .375rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    appearance: none;
}
.form-control::placeholder { color: #6c757d; opacity: 1; }
.form-control:focus {
    color: #212529;
    background-color: #fff;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}
.form-control:disabled,
.form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

.form-control-lg {
    padding: .75rem 1rem;
    font-size: 1.25rem;
    border-radius: .5rem;
}

.form-control-plaintext {
    display: block;
    width: 100%;
    padding: .5rem 0;
    margin-bottom: 0;
    line-height: 1.5;
    color: #212529;
    background-color: transparent;
    border: solid transparent;
    border-width: 1px 0;
}

.form-select {
    display: block;
    width: 100%;
    padding: .5rem 2.25rem .5rem .75rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
    border: 1px solid #ced4da;
    border-radius: .375rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    appearance: none;
}
.form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}

.form-floating {
    position: relative;
}
.form-floating > label {
    display: inline-block;
    margin-bottom: .5rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 1rem;
}

.form-horizontal .form-group {
    display: flex;
    flex-wrap: wrap;
    margin-right: -.75rem;
    margin-left: -.75rem;
}

.form-text {
    margin-top: .25rem;
    font-size: .875em;
    color: #6c757d;
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}
.input-group > .form-control,
.input-group > .form-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}
.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: .5rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: .375rem;
}
.input-group > .input-group-text:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-group-append {
    display: flex;
}
.input-group-append > .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* ---- Alerts ---- */
.alert {
    position: relative;
    padding: 1rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: .375rem;
}
.alert-success { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; }
.alert-danger  { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
.alert-warning { color: #664d03; background-color: #fff3cd; border-color: #ffecb5; }
.alert-info    { color: #055160; background-color: #cff4fc; border-color: #b6effb; }

.alert-dismissible { padding-right: 3rem; }
.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 1.25rem 1rem;
}

.fade { transition: opacity .15s linear; }
.fade:not(.show) { opacity: 0; }

/* ---- Cards (base structure) ---- */
.card-body {
    flex: 1 1 auto;
    padding: 1.5rem;
}
.card-header {
    padding: .75rem 1.5rem;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0,0,0,.125);
}
.card-title {
    margin-bottom: .5rem;
    font-weight: 600;
}
.card-text:last-child {
    margin-bottom: 0;
}

/* ---- Tables ---- */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: inherit;
    vertical-align: top;
    border-color: rgba(0,0,0,.1);
    border-collapse: collapse;
}
.table > :not(caption) > * > * {
    padding: .75rem;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: inherit;
}
.table > thead {
    vertical-align: bottom;
    border-bottom: 2px solid currentcolor;
}
.table-hover > tbody > tr:hover > * {
    background-color: rgba(0,0,0,.035);
}
.table-sm > :not(caption) > * > * {
    padding: .375rem;
}
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin-bottom: 1rem;
    list-style: none;
}
.breadcrumb-item + .breadcrumb-item { padding-left: .5rem; }
.breadcrumb-item + .breadcrumb-item::before {
    float: left;
    padding-right: .5rem;
    color: #6c757d;
    content: "/";
}
.breadcrumb-item.active { color: #6c757d; }

/* ---- Badge ---- */
.badge {
    display: inline-block;
    padding: .35em .65em;
    font-size: .75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .375rem;
    color: #fff;
}

/* ---- Nav / Tabs ---- */
.nav {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}
.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
    border-bottom: 2px solid rgba(0,0,0,.1);
}
.nav-tabs .nav-item {
    margin-bottom: -2px;
}
.nav-link {
    display: block;
    padding: .5rem 1rem;
    color: #3b82f6;
    text-decoration: none;
    transition: color .15s ease-in-out, background-color .15s ease-in-out,
                border-color .15s ease-in-out;
}
.nav-link:hover,
.nav-link:focus {
    color: #2563eb;
}
.nav-link.disabled {
    color: #6c757d;
    pointer-events: none;
    cursor: default;
}
.nav-tabs .nav-link {
    margin-bottom: -2px;
    background: none;
    border: 2px solid transparent;
    border-top-left-radius: .375rem;
    border-top-right-radius: .375rem;
}
.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef rgba(0,0,0,.1);
    isolation: isolate;
}
.nav-tabs .nav-link.active {
    color: #495057;
    background-color: #fff;
    border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) #fff;
}

.tab-content > .tab-pane { display: none; }
.tab-content > .active   { display: block; }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
}
.page-link {
    position: relative;
    display: block;
    padding: .375rem .75rem;
    color: #3b82f6;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #dee2e6;
    transition: color .15s ease-in-out, background-color .15s ease-in-out,
                border-color .15s ease-in-out;
}
.page-link:hover {
    color: #2563eb;
    background-color: #e9ecef;
    border-color: #dee2e6;
}
.page-item:first-child .page-link {
    border-top-left-radius: .375rem;
    border-bottom-left-radius: .375rem;
}
.page-item:last-child .page-link {
    border-top-right-radius: .375rem;
    border-bottom-right-radius: .375rem;
}
.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: #3b82f6;
    border-color: #3b82f6;
}
.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

/* ---- Navbar Nav ---- */
.navbar-nav {
    display: flex;
    flex-direction: row;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}
.navbar-nav .nav-link {
    padding-right: .5rem;
    padding-left: .5rem;
}
