/*
 * Legacy Classic — overrides, loaded LAST (after Bootstrap 5 + style.css).
 *
 * The theme now loads Bootstrap 5 (css/bootstrap5.min.css). Every shared app
 * template is authored in Bootstrap 5, so the forms (login, signup, members,
 * etc.) render natively and centered — no compatibility shim required.
 *
 * This file carries two things:
 *   1. A small Bootstrap-3 compatibility layer for the handful of legacy chrome
 *      classes this theme's bespoke markup + style.css still rely on that BS5
 *      dropped (panel, navbar-inverse, visible-xs/hidden-xs, col-xs-*,
 *      btn-default, btn-block, pull-*, input-group-btn, sr-only, center-block).
 *   2. The theme's own visual accents (signup CTA, legal pages, auth card,
 *      sign-in code field, nav spacing).
 *
 * Everything is scoped to .theme-legacy-classic.
 */

/* =====================================================================
   1. Bootstrap 3 chrome compatibility (classes Bootstrap 5 removed)
   ===================================================================== */

/* Responsive visibility (BS3 .visible-xs / .hidden-xs) */
@media (max-width: 767.98px) {
    .theme-legacy-classic .hidden-xs { display: none !important; }
}
@media (min-width: 768px) {
    .theme-legacy-classic .visible-xs { display: none !important; }
}

/* BS3 .col-xs-12 (BS5 renamed to .col-12) */
.theme-legacy-classic .col-xs-12 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

/* Floats / centering helpers (BS3 .pull-* / .center-block) */
.theme-legacy-classic .pull-right { float: right !important; }
.theme-legacy-classic .pull-left  { float: left !important; }
.theme-legacy-classic .center-block { display: block; margin-left: auto; margin-right: auto; }

/* Screen-reader only (BS5 renamed .sr-only → .visually-hidden) */
.theme-legacy-classic .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Buttons (BS3 .btn-default, .btn-block) */
.theme-legacy-classic .btn-default {
    color: #333; background-color: #e7e7e7; border: 1px solid #adadad;
}
.theme-legacy-classic .btn-default:hover,
.theme-legacy-classic .btn-default:focus {
    color: #333; background-color: #d4d4d4; border-color: #8c8c8c;
}
.theme-legacy-classic .btn-block { display: block; width: 100%; }

/* Input-group button wrapper (BS3 .input-group-btn) */
.theme-legacy-classic .input-group-btn { display: flex; }
.theme-legacy-classic .input-group-btn > .btn {
    height: 100%;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Thumbnails (BS3 .thumbnail — used by store/galleries) */
.theme-legacy-classic .thumbnail {
    display: block;
    padding: 4px;
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border .2s ease-in-out;
}
.theme-legacy-classic .thumbnail > img,
.theme-legacy-classic .thumbnail a > img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.theme-legacy-classic .thumbnail .caption { padding: 9px; color: #333; }

/* Misc BS3 components BS5 dropped */
.theme-legacy-classic .btn-xs { padding: 1px 5px; font-size: 12px; line-height: 1.5; border-radius: 3px; }
.theme-legacy-classic .well {
    min-height: 20px; padding: 19px; margin-bottom: 20px;
    background-color: #f5f5f5; border: 1px solid #e3e3e3; border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
}
.theme-legacy-classic .page-header { padding-bottom: 9px; margin: 40px 0 20px; border-bottom: 1px solid #eee; }
.theme-legacy-classic .control-label { font-weight: 600; margin-bottom: 5px; }
.theme-legacy-classic .help-block { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; }

/* Panels (BS3) — render like BS5 cards. style.css keeps the .panel-* skins. */
.theme-legacy-classic .panel {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.theme-legacy-classic .panel-heading {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}
.theme-legacy-classic .panel-heading a { color: inherit; text-decoration: none; }
.theme-legacy-classic .panel-title { margin: 0; font-size: 16px; }
.theme-legacy-classic .panel-body { padding: 15px; }
.theme-legacy-classic .panel-default > .panel-heading { background-color: #f5f5f5; color: #333; }
.theme-legacy-classic .panel-success { border-color: #6B8E23; }
.theme-legacy-classic .panel-success > .panel-heading { background-color: #6B8E23; color: #fff; border-color: #6B8E23; }
.theme-legacy-classic .panel-warning { border-color: #faebcc; }
.theme-legacy-classic .panel-warning > .panel-heading { background-color: #fcf8e3; color: #8a6d3b; border-color: #faebcc; }
.theme-legacy-classic .panel-info { border-color: #bce8f1; }
.theme-legacy-classic .panel-info > .panel-heading { background-color: #d9edf7; color: #31708f; border-color: #bce8f1; }

/* Legacy layout wrapper alignment.
   In sym2's public layout the navbar, header band, content and footer are each
   their own .container-fluid, and the breakpoint files (style1600.css → 1%,
   style2000.css → 5%) give every .container-fluid the SAME side margins — so
   they all line up at one shared left/right inset (the "page wrapper" look).
   The dark navbar is therefore inset and aligned with the content, NOT full-bleed
   (its inner .container-fluid is the bar; My Account/Sign Up sit at that inset's
   right edge, aligning with the right rail).

   BS5 makes .container-fluid width:100%, which + side margins overflows a BLOCK
   container — so the block ones (header band, content, footer) auto-size to
   (viewport − margins). The navbar's .container-fluid is a FLEX item (child of
   <nav.navbar>), so it flex-shrinks to (viewport − margins) by itself — leave its
   width alone so ms-auto can push the links to that inset's right edge. */
.theme-legacy-classic #headerContainer,
.theme-legacy-classic .contentContainer,
.theme-legacy-classic footer.container-fluid {
    width: auto;
}

/* Dark navbar (BS3 .navbar-inverse). .navbar-dark on the <nav> handles the
   light link/toggler colors; we only supply the dark earth-tone background. */
.theme-legacy-classic .navbar { padding-top: 0; padding-bottom: 0; }
.theme-legacy-classic .navbar-inverse {
    background-color: #211a12;
    border-radius: 0;
}
.theme-legacy-classic .navbar .nav-link { padding: 12px 14px; }
.theme-legacy-classic .navbar-brand { color: #cfc3b4; }

/* Breadcrumbs — restore the legacy BS3 skin (light-gray rounded bar, "/ "
   separators). BS5's .breadcrumb is transparent/flat with no bar. Values copied
   from sym2's bootstrap.min.css .breadcrumb rules. */
.theme-legacy-classic .breadcrumb {
    padding: 8px 15px;
    margin: 0 0 20px;
    list-style: none;
    background-color: #f5f5f5;
    border-radius: 4px;
}
.theme-legacy-classic .breadcrumb-item + .breadcrumb-item::before {
    content: "/\00a0";
    padding: 0 5px;
    color: #ccc;
}
.theme-legacy-classic .breadcrumb-item.active { color: #777; }

/* The shared templates wrap the breadcrumb <ol> in <nav class="container-fluid">.
   Inside the content column that wrapper would add its own inset/padding, pushing
   the bar right of the content. Legacy uses a bare <ol class="breadcrumb">, so
   neutralize the container-fluid here to align the bar with the content edge. */
.theme-legacy-classic nav[aria-label="breadcrumb"].container-fluid {
    width: auto;
    margin: 0;
    padding: 0;
}

/* Footer sits on the dark earth-tone band — keep all its links white so
   Privacy Policy / Terms of Use read on the dark background. */
.theme-legacy-classic footer a { color: #fff; }
.theme-legacy-classic footer a:hover,
.theme-legacy-classic footer a:focus { color: #fff; text-decoration: underline; }

/* =====================================================================
   2. Theme accents
   ===================================================================== */

/* FA icons in the sidebar menu / nav sit on a fixed-width slug */
.theme-legacy-classic .list-group-item > i,
.theme-legacy-classic .nav-link > i { width: 1.1em; text-align: center; }

/* Right-column "Create Free Account" CTA (panel-based) */
.theme-legacy-classic .signup-cta { border: 2px solid #6B8E23; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.theme-legacy-classic .signup-cta .panel-heading { background-color: #6B8E23; border-color: #6B8E23; color: #fff; padding: 12px; }
.theme-legacy-classic .signup-cta .panel-heading h3 { margin: 0; font-size: 20px; font-weight: bold; color: #fff; }
.theme-legacy-classic .signup-cta .panel-body { background-color: #f3f7ea; padding: 18px 16px; }
.theme-legacy-classic .signup-cta-lead { margin-bottom: 14px; color: #4a4a4a; }
.theme-legacy-classic .signup-cta-btn { font-size: 17px; font-weight: bold; padding: 12px 16px; text-transform: uppercase; letter-spacing: .5px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18); }
.theme-legacy-classic .signup-cta-btn i { margin-right: 6px; }
.theme-legacy-classic .signup-cta-login { margin: 14px 0 0; font-size: 13px; color: #666; }

/* Legal pages (Privacy Policy / Terms of Use) */
.theme-legacy-classic .legal-page h1 { margin-top: 0; font-size: 28px; }
.theme-legacy-classic .legal-page section { margin-bottom: 24px; }
.theme-legacy-classic .legal-page h2 { font-size: 20px; font-weight: bold; color: #5a3d2b; border-bottom: 1px solid #e6ded3; padding-bottom: 6px; margin-top: 24px; }
.theme-legacy-classic .legal-page h3 { font-size: 16px; font-weight: bold; color: #6b4a33; margin-top: 16px; }
.theme-legacy-classic .legal-page address { font-style: normal; line-height: 1.6; }

/* Auth cards (login / passwordless / code / reset). BS5 .card supplies the
   chrome; we add a max-width, centering and a green accent strip. The login
   templates put content directly in .card (no .card-body), so pad here. */
.theme-legacy-classic .login-card {
    max-width: 540px;
    margin: 8px auto 30px;
    padding: 30px 28px;
    border-top: 4px solid #6B8E23;
}
.theme-legacy-classic .login-card h1 { font-size: 26px; color: #4a3526; }
.theme-legacy-classic .login-card .login-icon i,
.theme-legacy-classic .login-card .fa-3x { color: #6B8E23; }

/* Signup card uses its own .card-body for padding — just size + accent it. */
.theme-legacy-classic .signup-card {
    max-width: 720px;
    margin: 8px auto 30px;
    border-top: 4px solid #6B8E23;
}
.theme-legacy-classic .signup-card h1 { font-size: 26px; color: #4a3526; }

/* 6-digit sign-in code field */
.theme-legacy-classic .code-input {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: .55em;
    text-align: center;
    text-indent: .55em;
    height: 60px;
    color: #4a3526;
}
.theme-legacy-classic .code-input::placeholder { color: #cfc4b4; letter-spacing: .55em; }

/* =====================================================================
   3. Bootstrap "primary" rebrand — stock BS5 blue clashes with the
   earth-tone palette. Public templates use .btn-primary / .bg-primary /
   .btn-outline-primary / .table-primary everywhere (88 templates) as their
   default interactive/chrome color, so this is a global remap rather than
   per-template edits.

   Two-tier scheme, matching the theme's own config_json colors:
     - "primary" family (bg-primary, text-primary, border-primary,
       link-primary, badges, table headers, card headers) -> the theme's
       structural brown (#543d2b) — same family as the header/nav chrome.
     - .btn-primary / .btn-outline-primary (actual clickable CTAs) -> the
       theme's goldenrod accent (#daa520), so buttons still pop against the
       brown chrome instead of blending into it.
   ===================================================================== */

/* Covers .bg-primary, .text-primary, .border-primary, .link-primary,
   .badge.bg-primary — all derive from these two custom properties. */
.theme-legacy-classic {
    --bs-primary: #543d2b;
    --bs-primary-rgb: 84, 61, 43;
}

/* .table-primary hardcodes its own palette rather than deriving from the
   custom properties above, so it needs an explicit override. */
.theme-legacy-classic .table-primary {
    --bs-table-color: #fff;
    --bs-table-bg: #543d2b;
    --bs-table-border-color: #6b5544;
    --bs-table-striped-bg: #4c3727;
    --bs-table-striped-color: #fff;
    --bs-table-active-bg: #453227;
    --bs-table-active-color: #fff;
    --bs-table-hover-bg: #4c3727;
    --bs-table-hover-color: #fff;
}

/* .btn-primary hardcodes its own palette too. */
.theme-legacy-classic .btn-primary {
    --bs-btn-color: #3a2a1c;
    --bs-btn-bg: #daa520;
    --bs-btn-border-color: #daa520;
    --bs-btn-hover-color: #3a2a1c;
    --bs-btn-hover-bg: #c0911c;
    --bs-btn-hover-border-color: #c0911c;
    --bs-btn-focus-shadow-rgb: 218, 165, 32;
    --bs-btn-active-color: #3a2a1c;
    --bs-btn-active-bg: #a67d18;
    --bs-btn-active-border-color: #a67d18;
    --bs-btn-disabled-color: #3a2a1c;
    --bs-btn-disabled-bg: #daa520;
    --bs-btn-disabled-border-color: #daa520;
}

.theme-legacy-classic .btn-outline-primary {
    --bs-btn-color: #b3860f;
    --bs-btn-border-color: #daa520;
    --bs-btn-hover-color: #3a2a1c;
    --bs-btn-hover-bg: #daa520;
    --bs-btn-hover-border-color: #daa520;
    --bs-btn-focus-shadow-rgb: 218, 165, 32;
    --bs-btn-active-color: #3a2a1c;
    --bs-btn-active-bg: #daa520;
    --bs-btn-active-border-color: #daa520;
    --bs-btn-disabled-color: #daa520;
    --bs-btn-disabled-border-color: #daa520;
}

/* =====================================================================
   4. Plain link color — same clash as section 3, different variable.
   Bootstrap's bare <a> color comes from --bs-link-color(-rgb), which is
   independent of --bs-primary, so it needed its own override. Plain
   goldenrod (#daa520) fails WCAG contrast for normal-weight text on white
   (~2.25:1), so this uses a darker amber from the same family (~5.6:1).
   ===================================================================== */
.theme-legacy-classic {
    --bs-link-color: #8a6314;
    --bs-link-color-rgb: 138, 99, 20;
    --bs-link-hover-color: #6e4f0f;
    --bs-link-hover-color-rgb: 110, 79, 15;
}
