/* ==========================================================
   QVSTAMPS – STARS STAMP IDENTIFICATION TOOL
   ========================================================== */

*{
    box-sizing:border-box;
}

html{
    min-height:100%;
    scroll-behavior:smooth;
}

body{
    min-height:100vh;

    margin:0;
    padding:0;

    background:
        linear-gradient(
            rgba(25,42,40,.36),
            rgba(25,42,40,.36)
        ),
        url("/images/DISPLAY/ask_background.png")
        center top / cover fixed;

    background-color:#263f3d;

    color:#24221E;

    font-family:
        Georgia,
        "Times New Roman",
        serif;
}

button,
select{
    font:inherit;
}

.sorter-page{
    width:100%;

    padding:1px 0 54px;
}

/* ==========================================================
   INTRODUCTION
   ========================================================== */

.sorter-introduction{
    position:relative;

    width:min(920px, calc(100% - 40px));

    margin:0 auto 24px;
    padding:18px 31px 17px;

    background:
        linear-gradient(
            145deg,
            rgba(255,252,244,0.97),
            rgba(241,226,197,0.96)
        );

    border:1px solid rgba(169,125,30,0.76);
    border-radius:11px;

    box-shadow:
        0 7px 19px rgba(43,31,14,0.14),
        inset 0 1px 0 rgba(255,255,255,0.72);

    text-align:center;
}

.sorter-introduction::before{
    content:"";

    position:absolute;
    inset:6px;

    border:1px solid rgba(169,125,30,0.22);
    border-radius:7px;

    pointer-events:none;
}

.sorter-introduction__diamond{
    position:absolute;
    top:-10px;
    left:50%;

    padding:0 11px;

    transform:translateX(-50%);

    background:#F4E7CC;
    color:#A97D1E;

    font-size:14px;
    line-height:20px;
}

.sorter-introduction h2{
    position:relative;
    z-index:1;

    margin:0 0 8px;

    color:#0B2038;

    font-size:clamp(21px, 2vw, 27px);
    line-height:1.18;
    font-weight:400;
}

.sorter-introduction p{
    position:relative;
    z-index:1;

    max-width:830px;

    margin:0 auto 7px;

    font-size:15px;
    line-height:1.45;
}

.sorter-introduction p:last-child{
    margin-bottom:0;
}

.sorter-introduction__tip{
    color:#173F3C;
    font-weight:700;
}

/* ==========================================================
   GENERAL MESSAGE
   ========================================================== */

.sorter-message{
    width:min(900px, calc(100% - 40px));

    margin:0 auto 22px;
    padding:15px 19px;

    border-radius:10px;

    font-size:15px;
    line-height:1.45;

    text-align:center;
}

.sorter-message--error{
    background:#FFF0ED;
    color:#6A2222;

    border:2px solid #A95353;

    box-shadow:0 6px 16px rgba(80,20,20,0.12);
}

/* ==========================================================
   TWO-STEP SEARCH WORKFLOW
   ========================================================== */

.sorter-workflow{
    width:min(1240px, calc(100% - 40px));

    display:grid;
    grid-template-columns:minmax(0, 3fr) minmax(280px, 1fr);
    align-items:start;

    gap:22px;

    margin:0 auto 28px;
}

.sorter-workflow__filters,
.sorter-workflow__actions{
    min-width:0;
}

.sorter-workflow-heading{
    margin:0 0 12px;

    color:#0B2038;

    font-size:clamp(22px, 2vw, 28px);
    line-height:1.18;
    font-weight:400;

    text-align:center;
}

.sorter-workflow-heading span{
    margin-right:5px;
}

.sorter-results-section{
    width:min(1240px, calc(100% - 40px));

    margin:0 auto 28px;
}

.sorter-results-heading{
    width:max-content;
    max-width:100%;

    margin:0 auto 14px;
    padding:9px 19px;

    background:
        linear-gradient(
            180deg,
            #FFF9EA,
            #E8D5AE
        );

    border:1px solid #C79A3B;
    border-radius:8px;

    box-shadow:
        0 5px 13px rgba(0,0,0,.20),
        inset 0 1px 0 rgba(255,255,255,.75);

    text-align:center;
}

.sorter-results-heading h2{
    margin:0;

    color:#173F3C;

    font-size:clamp(22px,2.2vw,28px);
    line-height:1.15;
    font-weight:400;
}

.sorter-results-heading p{
    margin:3px 0 0;

    color:#554B3D;

    font-size:14px;
    line-height:1.35;
}

/* ==========================================================
   FILTER FORM
   ========================================================== */

.sorter-form{
    position:relative;

    width:100%;
    height:100%;

    margin:0;
    padding:22px;

    background:
        linear-gradient(
            145deg,
            rgba(255,253,248,0.98),
            rgba(238,226,203,0.98)
        );

    border:2px solid rgba(169,125,30,0.78);
    border-radius:15px;

    box-shadow:
        0 8px 22px rgba(40,28,10,0.19),
        inset 0 1px 0 rgba(255,255,255,0.82);
}

.sorter-form::before{
    content:"";

    position:absolute;
    inset:7px;

    border:1px solid rgba(169,125,30,0.18);
    border-radius:9px;

    pointer-events:none;
}

.sorter-filter-grid{
    position:relative;
    z-index:1;

    display:grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap:18px 20px;
}

.sorter-field{
    min-width:0;
}

.sorter-field label{
    display:block;

    margin:0 0 4px;

    color:#0B2038;

    font-size:16px;
    line-height:1.25;
    font-weight:700;
}

.sorter-field__help{
    display:block;

    min-height:34px;

    margin-bottom:6px;

    color:#6A6154;

    font-size:12px;
    line-height:1.3;
}

.sorter-select-wrapper{
    position:relative;
}

.sorter-select-wrapper::after{
    content:"";

    position:absolute;
    top:50%;
    right:14px;

    width:8px;
    height:8px;

    border-right:2px solid #173F3C;
    border-bottom:2px solid #173F3C;

    transform:
        translateY(-68%)
        rotate(45deg);

    pointer-events:none;
}

.sorter-field select{
    width:100%;
    min-height:45px;

    padding:10px 39px 10px 12px;

    appearance:none;
    -webkit-appearance:none;

    background:#FFFDF8;
    color:#24221E;

    border:2px solid rgba(169,125,30,0.72);
    border-radius:8px;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size:15px;
    line-height:1.2;
    font-weight:600;

    cursor:pointer;
}

.sorter-field select:hover{
    border-color:#8F6818;
}

.sorter-field select:focus{
    outline:3px solid rgba(169,125,30,0.24);
    outline-offset:2px;

    border-color:#173F3C;
}

.sorter-action-card{
    position:relative;

    min-height:190px;

    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;

    padding:25px 22px;

    background:
        linear-gradient(
            145deg,
            rgba(255,253,248,0.98),
            rgba(238,226,203,0.98)
        );

    border:2px solid rgba(169,125,30,0.78);
    border-radius:15px;

    box-shadow:
        0 8px 22px rgba(40,28,10,0.19),
        inset 0 1px 0 rgba(255,255,255,0.82);

    text-align:center;
}

.sorter-action-card::before{
    content:"";

    position:absolute;
    inset:7px;

    border:1px solid rgba(169,125,30,0.18);
    border-radius:9px;

    pointer-events:none;
}

.sorter-action-card__arrow{
    position:relative;
    z-index:1;

    margin:0 0 7px;

    color:#A97D1E;

    font-size:28px;
    line-height:1;
}

.sorter-action-card p{
    position:relative;
    z-index:1;

    margin:0 0 20px;

    color:#4E463A;

    font-size:15px;
    line-height:1.45;
}

.sorter-form-actions{
    position:relative;
    z-index:1;

    display:flex;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;

    gap:12px;
}

/* ==========================================================
   BUTTONS
   ========================================================== */

.sorter-button{
    min-height:45px;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    gap:8px;

    padding:11px 20px;

    border-radius:8px;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size:15px;
    line-height:1.2;
    font-weight:700;

    text-align:center;
    text-decoration:none;

    cursor:pointer;

    box-shadow:0 4px 11px rgba(0,0,0,0.17);

    transition:
        transform .18s ease,
        filter .18s ease,
        box-shadow .18s ease;
}

.sorter-button:hover{
    transform:translateY(-2px);
    filter:brightness(1.06);

    box-shadow:0 7px 15px rgba(0,0,0,0.23);
}

.sorter-button:focus-visible{
    outline:3px solid #A97D1E;
    outline-offset:3px;
}

.sorter-button--search{
    background:
        linear-gradient(
            #214E4A,
            #123532
        );

    color:#FFF8E8;

    border:1px solid #0B2927;
}

.sorter-button--search span{
    font-size:21px;
    line-height:1;
}

.sorter-button--clear{
    background:
        linear-gradient(
            #FFF9EA,
            #E6D2AA
        );

    color:#0B2038;

    border:1px solid #A97D1E;
}

.sorter-button--retry{
    margin-top:10px;

    background:
        linear-gradient(
            #214E4A,
            #123532
        );

    color:#FFF8E8;

    border:1px solid #0B2927;
}

/* ==========================================================
   RESULTS
   ========================================================== */

.sorter-results-wrapper{
    width:100%;

    overflow-x:auto;

    background:#FFFDF8;

    border:2px solid rgba(169,125,30,0.78);
    border-radius:13px;

    box-shadow:
        0 8px 21px rgba(40,28,10,0.18),
        inset 0 1px 0 rgba(255,255,255,0.75);

    scrollbar-width:thin;
    scrollbar-color:#A97D1E #EEE2CB;
}

.sorter-results-wrapper:focus{
    outline:3px solid rgba(169,125,30,0.30);
    outline-offset:3px;
}

.sorter-results{
    width:100%;
    min-width:1190px;

    border-collapse:collapse;
    table-layout:fixed;
}

.sorter-results th{
    padding:13px 10px;

    background:
        linear-gradient(
            #214E4A,
            #123532
        );

    color:#FFF8E8;

    border-right:1px solid rgba(255,255,255,0.18);
    border-bottom:2px solid #A97D1E;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size:13px;
    line-height:1.25;
    font-weight:700;

    text-align:left;
    vertical-align:bottom;
}

.sorter-results th:last-child{
    border-right:none;
}

.sorter-results td{
    padding:11px 10px;

    color:#29261F;

    border-right:1px solid rgba(106,85,42,0.19);
    border-bottom:1px solid rgba(106,85,42,0.22);

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size:14px;
    line-height:1.35;
    font-weight:600;

    vertical-align:top;
    overflow-wrap:anywhere;
}

.sorter-results td:last-child{
    border-right:none;
}

.sorter-results tbody tr:nth-child(odd) td{
    background:#FFFDF8;
}

.sorter-results tbody tr:nth-child(even) td{
    background:#F2E8D5;
}

.sorter-results tbody tr:hover td{
    background:#E2ECE6;
}

.sorter-results tbody tr:last-child td{
    border-bottom:none;
}

.sorter-empty{
    color:#8B8173;
    font-weight:400;
}

/*
   Results column widths
*/
.sorter-results th:nth-child(1),
.sorter-results td:nth-child(1){
    width:10%;
}

.sorter-results th:nth-child(2),
.sorter-results td:nth-child(2){
    width:13%;
}

.sorter-results th:nth-child(3),
.sorter-results td:nth-child(3){
    width:8%;
}

.sorter-results th:nth-child(4),
.sorter-results td:nth-child(4){
    width:9%;
}

.sorter-results th:nth-child(5),
.sorter-results td:nth-child(5){
    width:9%;
}

.sorter-results th:nth-child(6),
.sorter-results td:nth-child(6){
    width:8%;
}

.sorter-results th:nth-child(7),
.sorter-results td:nth-child(7){
    width:9%;
}

.sorter-results th:nth-child(8),
.sorter-results td:nth-child(8){
    width:7%;
}

.sorter-results th:nth-child(9),
.sorter-results td:nth-child(9){
    width:6%;
}

.sorter-results th:nth-child(10),
.sorter-results td:nth-child(10){
    width:9%;
}

.sorter-results th:nth-child(11),
.sorter-results td:nth-child(11){
    width:12%;
}

.sorter-results-note{
    width:min(900px, 100%);

    margin:13px auto 0;

    color:#5D5549;

    font-size:13px;
    line-height:1.4;
    font-style:italic;

    text-align:center;
}

/* ==========================================================
   NO RESULTS
   ========================================================== */

.sorter-no-results{
    width:min(700px, 100%);

    margin:0 auto;
    padding:23px 28px;

    background:
        linear-gradient(
            145deg,
            #FFFDF8,
            #EEE2CB
        );

    border:1px solid rgba(169,125,30,0.76);
    border-radius:13px;

    box-shadow:0 7px 19px rgba(40,28,10,0.17);

    text-align:center;
}

.sorter-no-results__symbol{
    width:54px;
    height:54px;

    display:flex;
    align-items:center;
    justify-content:center;

    margin:0 auto 11px;

    background:#173F3C;
    color:#FFF8E8;

    border:2px solid #D1AE57;
    border-radius:50%;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size:27px;
    font-weight:700;
}

.sorter-no-results h3{
    margin:0 0 8px;

    color:#0B2038;

    font-size:22px;
    line-height:1.2;
    font-weight:400;
}

.sorter-no-results p{
    max-width:600px;

    margin:0 auto 8px;

    font-size:15px;
    line-height:1.45;
}

/* ==========================================================
   BACK NAVIGATION
   ========================================================== */

.sorter-navigation{
    width:min(1120px, calc(100% - 40px));

    margin:30px auto 0;

    text-align:center;
}

.sorter-back-link{
    display:inline-flex;
    align-items:center;

    gap:9px;

    padding:10px 17px;

    background:
        linear-gradient(
            #FFF9EA,
            #E8D5AE
        );

    color:#0B2038;

    border:1px solid #A97D1E;
    border-radius:8px;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size:14px;
    line-height:1.2;
    font-weight:700;

    text-decoration:none;

    box-shadow:0 5px 13px rgba(40,28,10,0.17);

    transition:
        transform .18s ease,
        filter .18s ease;
}

.sorter-back-link:hover{
    transform:translateY(-2px);
    filter:brightness(1.05);
}

.sorter-back-link:focus-visible{
    outline:3px solid #A97D1E;
    outline-offset:3px;
}

.sorter-back-link span{
    font-size:19px;
    line-height:1;
}

/* ==========================================================
   MEDIUM SCREENS
   ========================================================== */

@media (max-width:1050px){

    .sorter-workflow{
        grid-template-columns:1fr;
    }

    .sorter-action-card{
        min-height:0;
    }

    .sorter-action-card__arrow{
        transform:rotate(90deg);
    }
}

@media (max-width:900px){

    .sorter-filter-grid{
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================================
   TABLET AND MOBILE
   ========================================================== */

@media (max-width:700px){

    body{
        background-attachment:scroll;
    }

    .sorter-page{
        padding-bottom:36px;
    }

    .sorter-introduction{
        width:calc(100% - 22px);

        margin-bottom:22px;
        padding:20px 17px 18px;
    }

    .sorter-introduction h2{
        font-size:21px;
    }

    .sorter-introduction p{
        font-size:14px;
    }

    .sorter-message,
    .sorter-workflow,
    .sorter-results-section,
    .sorter-navigation{
        width:calc(100% - 22px);
    }

    .sorter-workflow{
        gap:20px;
    }

    .sorter-workflow-heading{
        font-size:22px;
    }

    .sorter-results-heading{
        width:100%;
    }

    .sorter-form{
        padding:20px 16px;
    }

    .sorter-filter-grid{
        grid-template-columns:1fr;

        gap:15px;
    }

    .sorter-field__help{
        min-height:0;
    }

    .sorter-form-actions{
        width:100%;
        flex-direction:column;
        align-items:stretch;
    }

    .sorter-button{
        width:100%;
    }

    .sorter-results-wrapper{
        border-radius:10px;
    }

    .sorter-results{
        min-width:1080px;
    }

    .sorter-no-results{
        padding:21px 18px;
    }
}

/* ==========================================================
   VERY SMALL SCREENS
   ========================================================== */

@media (max-width:420px){

    .sorter-introduction{
        padding-left:14px;
        padding-right:14px;
    }

    .sorter-form{
        padding-left:13px;
        padding-right:13px;
    }

    .sorter-field select{
        font-size:14px;
    }
}

/* ==========================================================
   REDUCED MOTION
   ========================================================== */

@media (prefers-reduced-motion:reduce){

    html{
        scroll-behavior:auto;
    }

    .sorter-button,
    .sorter-back-link{
        transition:none;
    }

    .sorter-button:hover,
    .sorter-back-link:hover{
        transform:none;
    }
}