/* ===========================================================================
   Dynamic home page (2026-10-26, setup/HOME_PAGE_TASKS.txt phase 5)
   Used by index.php, hi.php, youwin.php, featured-trends.php (linked from
   includes/header.php when $show_home_header is set) and home-listing.php.
   Ported from Share the Pie (index.php search/grid/featured CSS, header.php
   slider + header-logo CSS). Every class is home-* so nothing else on the
   site is affected.
   =========================================================================== */

/* ---- Header on the 4 home-style pages (2026-10-26 UI fix) -------------------
   The site width now comes from css/brand.css for every page (1170 / 970 /
   750 / fluid). It used to be set here on .midcont.home-wide, but
   sb-admin-2.min.css capped every .container at 915px !important, so it never
   applied.

   includes/header.php marks this header .home-head-row: one flex line of
   logo | Hi + YouWin | nav, all vertically centred. It replaced a
   col-md-3/4/5 split that squeezed the nav into 378px, wrapped the passcode
   box onto a second line ("Enter Pas...") and top-aligned the nav. The row
   has no negative margins, so the logo lines up with the tagline below. */
.home-head-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin-left: 0;
    margin-right: 0;
}
.home-head-logo {
    flex: 0 0 auto;
    padding: 0;
}
.home-header-logos {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 40px;
    padding: 0 24px;
}
.home-header-link {
    display: inline-block;
    line-height: 0;
    text-decoration: none !important;
}
.home-header-link img {
    display: block;
    height: 33px;
    width: auto;
    max-width: 100%;
}
.home-header-text {
    display: inline-block;
    line-height: 1;
    font-size: 32px;
    font-weight: bold;
    font-style: italic;
    color: #2140b0;
    letter-spacing: -1px;
}
.home-header-link:hover .home-header-text { color: #083c96; }

/* Nav: New User · Registered User · OR · [passcode][Login] on one line.
   The !important resets beat the Bootstrap 4 spacing utilities (mt-3, pt-2,
   pr-3, px-0) that header.php puts on these elements, and only inside this
   header. */
.home-head-nav {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 0;
}
.home-head-nav .r-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: right;
}
.home-head-nav .r-menu > div {
    display: flex;
    align-items: center;
    gap: 14px;
}
.home-head-nav .r-menu li,
.home-head-nav .r-menu .mt-3,
.home-head-nav .r-menu .pt-2 {
    margin: 0 !important;
    padding: 0 !important;
}
.home-head-nav .r-menu li a {
    padding: 0;
    white-space: nowrap;
}
.home-head-nav .passcodeOr {
    width: auto;
    margin: 0 !important;
    padding: 0 !important;
}
.home-head-nav .navbar-form {
    float: none;
    width: auto;
    margin: 0 !important;
    padding: 0 !important;
}
.home-head-nav .navbar-form .input-group {
    width: auto;
}
.home-head-nav .passcodeIn {
    flex: 0 0 150px;
    width: 150px;
}

@media (min-width: 992px) and (max-width: 1199px) {
    .home-header-logos { gap: 24px; padding: 0 16px; }
    .home-header-link img { height: 33px; }
    .home-header-text { font-size: 28px; }
    .home-head-nav .r-menu,
    .home-head-nav .r-menu > div { gap: 10px; }
    .home-head-nav .passcodeIn { flex-basis: 120px; width: 120px; }
}

/* Below 992px: logo, then Hi + YouWin, then the nav, each centred on its own
   line (the rest of the site already centres the menu at this width). */
@media (max-width: 991px) {
    .home-head-row {
        flex-wrap: wrap;
        justify-content: center;
    }
    .home-head-logo,
    .home-header-logos,
    .home-head-nav {
        flex: 0 0 100%;
        margin-left: 0;
    }
    .home-header-logos {
        gap: 30px;
        padding: 8px 0 4px;
    }
    .home-header-link img { height: 33px; }
    .home-header-text { font-size: 26px; }
    .home-head-nav .r-menu {
        justify-content: center;
        flex-wrap: wrap;
        row-gap: 10px;
        padding: 10px 0 12px;
    }
}
@media (max-width: 767px) {
    .home-header-link img { height: 30px; }
    .home-header-text { font-size: 24px; }
}

/* ---- Slider (marquee) -------------------------------------------------------- */
.home-slider {
    width: 100%;
    overflow: hidden;
    position: relative;
    border: 5px solid #000;
    border-radius: 10px;
    box-sizing: border-box;
    margin: 15px 0 10px;
    background: #000;
}
.home-slider-track {
    display: flex;
    gap: 0;
    will-change: transform;
}
.home-slider-item { flex-shrink: 0; }
.home-slider-item a { display: block; line-height: 0; }
.home-slider-img {
    display: block;
    width: auto;
    max-width: none;
    object-fit: cover;
    user-select: none;
}
@media (prefers-reduced-motion: reduce) {
    /* No animation: let the visitor scroll the strip themselves. */
    .home-slider { overflow-x: auto; }
    .home-slider-track { transform: none !important; }
}

/* ---- Tagline, search, Featured heading -------------------------------------- */
.home-main { padding-bottom: 30px; }
/* Bootstrap 4 (sb-admin) gives rows -11.25px margins, but columns here have
   15px padding, so everything inside a row sat 3.75px in from the tagline.
   Matching margins line every edge up. */
.home-main .row {
    margin-left: -15px;
    margin-right: -15px;
}
.home-tagline {
    font-weight: bold;
    font-size: 16px;
    color: #1f58c1;
    margin: 0;
}
/* Tagline sits above the search inside the left column (Share the Pie layout). */
.home-search-row { margin-top: 14px; }
.home-search-row .home-tagline + .home-search { margin-top: 10px; }
.home-search-row {
    align-items: center;
    margin-bottom: 24px;
}
.home-search {
    display: flex;
    align-items: stretch;
    height: 48px;
    margin: 0;
}
.home-search-loc,
.home-search-q,
.home-search-btn {
    height: 100%;
    font-size: 17px;
    font-family: inherit;
    border: 2px solid #d3d3d3;
    border-radius: 0;
    box-sizing: border-box;
    margin: 0;
}
.home-search-loc {
    flex: 0 0 38%;
    min-width: 160px;
    max-width: 280px;
    padding: 0 10px;
    font-weight: 600;
    color: #222;
    background-color: #fff;
}
.home-search-q {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 14px;
    border-left: none;
    background: #fff;
    color: #222;
}
/* The site-wide text-input style rounds corners; the joined bar must be square. */
.home-search .home-search-loc,
.home-search .home-search-q,
.home-search .home-search-btn {
    border-radius: 0 !important;
    box-shadow: none;
}
.home-search-q:focus,
.home-search-loc:focus {
    outline: none;
    border-color: #2140b0;
}
.home-search-btn {
    flex: 0 0 64px;
    font-size: 18px;
    color: #000;
    border-left: none;
    background: #d3d3d3;
    cursor: pointer;
}
.home-search-btn:hover { background: #c4c4c4; }
.home-featured-head {
    text-align: right;
}
.home-featured-head a {
    display: inline-block;
    max-width: 100%;
    text-decoration: none !important;
}
.home-featured-head img {
    display: block;
    height: 37px;   /* Share the Pie: Featured heading at 37px */
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.home-featured-text {
    font-weight: bold;
    font-style: italic;
    font-size: 28px;
    line-height: 1.1;
    color: #2140b0;
    letter-spacing: -1px;
}
/* Below 992px the two columns stack: Featured heading centred under the search. */
@media (max-width: 991px) {
    .home-featured-head {
        text-align: center;
        margin-top: 18px;
    }
    .home-featured-head img { height: 34px; }
    .home-featured-text { font-size: 26px; }
}
/* Phones: the three search controls stack full width, joined by shared borders. */
@media (max-width: 575px) {
    .home-search {
        flex-direction: column;
        height: auto;
    }
    .home-search-loc,
    .home-search-q,
    .home-search-btn {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        height: 48px;
        border: 2px solid #d3d3d3;
    }
    .home-search-q,
    .home-search-btn { border-top: none; }
    .home-featured-head img { height: 34px; }
    .home-featured-text { font-size: 24px; }
}

/* ---- Join Our Network (2026-10-28, copied from Share the Pie) ---------------
   One box linking to the Contact page, under the listings on index.php. */
.join-network-section { margin: 30px 0; }
.join-network-box {
    display: block;
    border: 2px solid #000;
    border-radius: 14px;
    padding: 30px 30px 20px;
    text-decoration: none !important;
    color: inherit;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.join-network-box:hover,
.join-network-box:focus {
    color: inherit;
    border-color: #1a73e8;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}
.jn-head { margin-bottom: 28px; }
.jn-head h2 {
    margin: 0 0 10px;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    color: #111;
    text-transform: capitalize;
}
.jn-underline {
    display: block;
    width: 62px;
    height: 4px;
    background: #22a247;
}
.join-network-box .jn-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: 0;
    margin-right: 0;
}
.jn-col {
    text-align: left;
    padding: 4px 25px 10px;
}
.jn-col + .jn-col { border-left: 1px solid #dcdfe4; }
.jn-step {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}
.jn-num {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    margin-right: 14px;
    border-radius: 50%;
    background: #e6edfb;
    color: #1a73e8;
    font-size: 17px;
    font-weight: 700;
    line-height: 38px;
    text-align: center;
}
.jn-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #1a73e8;
}
.jn-col p {
    margin: 0;
    color: #222;
    font-size: 15px;
    line-height: 1.7;
}
@media (max-width: 991px) {
    .join-network-box { padding: 24px 18px 10px; }
    .jn-col { padding: 14px 18px; }
    .jn-col + .jn-col {
        border-left: 0;
        border-top: 1px solid #dcdfe4;
    }
}

/* ---- Results line / empty state ---------------------------------------------- */
.home-results {
    font-size: 16px;
    margin: 0 0 15px;
    color: #333;
}
.home-results-clear {
    margin-left: 10px;
    font-size: 14px;
    color: #c0392b;
    text-decoration: underline;
}
.home-empty {
    text-align: center;
    font-size: 18px;
    color: #555;
    padding: 30px 0;
}

/* ---- Listing / Featured cards -------------------------------------------------- */
.home-grid { margin-bottom: 10px; }
.home-card-col { margin-bottom: 25px; }
.home-card {
    display: block;
    height: 100%;
    background: #fff;
    border: 1px solid #ccc;
    padding: 12px;
    text-decoration: none !important;
    transition: box-shadow .18s ease, transform .18s ease;
}
a.home-card:hover,
a.home-card:focus {
    box-shadow: 0 6px 18px rgba(0, 0, 32, .12);
    transform: translateY(-2px);
}
.home-card img {
    display: block;
    width: 100%;
    height: 253px;
    object-fit: cover;
}
.home-card-title {
    margin: 12px 0 0;
    padding: 6px 8px;
    border-left: 8px solid #00008b;
    text-align: center;
    color: #2140b0;
    font-size: 16px;
    line-height: 1.35;
    word-wrap: break-word;
}
.home-feat-img { display: block; position: relative; }
.home-feat-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(31, 88, 193, .92);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .3px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.home-feat-foot {
    text-align: center;
    margin-top: 10px;
    font-size: 15px;
}

/* ---- Pagination (Bootstrap 4 classes: .page-item / .page-link) ----------------- */
.home-pagination { display: flex; justify-content: center; }
.home-pagination .pagination { flex-wrap: wrap; justify-content: center; }
.home-pagination .page-item.active .page-link {
    background-color: #2140b0;
    border-color: #2140b0;
    color: #fff;
}
.home-pagination .page-link { color: #2140b0; }

/* ---- Page headings (Featured Trends, Hi, YouWin) ------------------------------- */
.home-page-head { margin: 20px 0 25px; }
.home-page-title {
    font-size: 26px;
    font-weight: 700;
    color: #2140b0;
    margin: 0 0 8px;
    line-height: 1.3;
}
.home-page-rule {
    display: block;
    width: 62px;
    height: 4px;
    background: #146a40;
    margin-top: 6px;
}

/* ---- Hi / YouWin forms ---------------------------------------------------------- */
.home-form-card {
    max-width: 720px;
    margin: 20px auto 40px;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 1px 1px 10px rgba(0, 0, 0, .2);
}
.home-form-sub { font-size: 16px; color: #333; margin-bottom: 20px; }
.home-form-section {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin: 25px 0 12px;
    padding-top: 15px;
    border-top: 1px solid #e3e6ea;
}
.home-alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 15px;
}
.home-alert-success { background: #e6f5e6; color: #146a40; border: 1px solid #b7dfb7; }
.home-alert-error   { background: #fdecea; color: #a12a1e; border: 1px solid #f5c2bd; }
.home-form .home-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}
.home-form label { font-weight: bold; margin-bottom: 6px; }
.home-form .req { color: red; }
.home-form input[type=text],
.home-form input[type=email],
.home-form input[type=tel],
.home-form select,
.home-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
    font-size: 15px;
    background: #fff;
}
.home-form select { height: 40px; }
.home-radios { display: flex; flex-wrap: wrap; gap: 20px; }
.home-radios label { font-weight: normal; margin: 0; }
.home-field-err { color: #c0392b; font-size: 13px; margin-top: 4px; }
.home-field-err:empty { display: none; }
.home-form-note { font-size: 13px; color: #666; }
.home-form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.home-btn {
    display: inline-block;
    padding: 9px 26px;
    background: #2140b0;
    color: #fff !important;
    border: 1px solid #2140b0;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none !important;
}
.home-btn:hover { background: #083c96; border-color: #083c96; }
.home-btn-light { background: #fff; color: #2140b0 !important; }
.home-btn-light:hover { background: #eef1f8; }
.home-form .g-recaptcha { max-width: 100%; overflow: hidden; }
@media (max-width: 480px) {
    .home-form-card { padding: 20px 15px; }
    .home-form .g-recaptcha { transform: scale(.88); transform-origin: 0 0; }
}

/* ---- Listing detail page (home-listing.php) ------------------------------------ */
.home-detail { padding: 10px 0 40px; }
.home-detail-back { margin: 10px 0; }
.home-detail-back a { color: #2140b0; }
.home-detail-title {
    font-size: 28px;
    font-weight: 700;
    color: #2140b0;
    margin: 10px 0 8px;
    word-wrap: break-word;
}
.home-detail-loc {
    display: inline-block;
    background: #e6f5e6;
    color: #146a40;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 15px;
}
.home-detail-cover img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border: 1px solid #ccc;
    margin-bottom: 15px;
}
.home-detail-gallery { margin-bottom: 10px; }
.home-detail-thumb {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    padding: 4px;
    background: #fff;
}
.home-detail-thumb img {
    display: block;
    width: 100%;
    height: 130px;
    object-fit: cover;
}
.home-detail-desc {
    font-size: 16px;
    line-height: 1.6;
    margin: 10px 0 20px;
    word-wrap: break-word;
}
.home-detail-desc img { max-width: 100%; height: auto; }
.home-detail-missing { text-align: center; padding: 50px 0; }
.home-detail-missing h1 { color: #2140b0; font-size: 28px; }
