/* =====================================================
   SEARCH PAGE STYLESHEET
   Extends arcanaeum_style.css 
   Matches arcanaeum_a_latestttt visual style
===================================================== */

/* =====================================================
   TOPBAR (Combined Header + Nav)
===================================================== */

.topbar {
    background: rgba(8,12,22,.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
}

.topbar-inner {
    max-width: 1400px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(120,200,255,.45));
}

.brand h1 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    letter-spacing: 3px;
    color: #d9cfff;
    margin: 0;
}

.brand p {
    color: #cfd5e6;
    margin: 4px 0 0 0;
    font-size: 0.9rem;
}

.topbar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.topbar-nav a {
    text-decoration: none;
    color: white;
    padding: 8px 14px;
    transition: .25s ease;
    border-right: 1px solid rgba(190,210,255,.12);
    font-family: 'Cinzel', serif;
    letter-spacing: .5px;
    font-size: 0.95rem;
}

.topbar-nav a:last-child {
    border-right: none;
}

.topbar-nav a:hover {
    color: var(--accent);
    text-shadow: 
        0 0 4px rgba(180,220,255,.8),
        0 0 8px rgba(160,210,255,.6),
        0 0 16px rgba(140,190,255,.4);
    box-shadow: 0 0 8px rgba(140,190,255,.25);
    border-color: rgba(180,220,255,.5);
}

/* =====================================================
   SEARCH BAR
===================================================== */

.search-wrap {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 5%;
}

.search-bar {
    background: rgba(18,24,38,.88);
    border: 1px solid rgba(190,210,255,.28);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
}

.search-bar select,
.search-bar input {
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-family: 'EB Garamond', serif;
    font-size: 1rem;
}

.search-bar select {
    min-width: 150px;
    background: #f4f4f4;
    color: #070b12;
    cursor: pointer;
}

.search-bar input {
    flex: 1;
    min-width: 320px;
    background: #ffffff;
    color: #070b12;
}

.search-bar input::placeholder {
    color: #6f7585;
}

.search-bar button {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #9ca7ff, #d8c8ff);
    font-weight: bold;
    cursor: pointer;
    font-family: 'EB Garamond', serif;
    transition: all .25s ease;
    color: #070b12;
}

.search-bar button:hover {
    background: linear-gradient(135deg, #828bcb, #d8c8ff);
    transform: translateY(-1px);
}

/* =====================================================
   RESULTS TOOLBAR (NO BOX)
===================================================== */

.results-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 16px 0 !important;
    padding: 12px 18px !important;
    flex-wrap: wrap;
    gap: 12px;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.breadcrumb {
    color: #cfd5e6;
    font-size: .95rem;
}

.toolbar-results {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: auto;
}

.toolbar-label {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
}

.toolbar-count {
    color: #cfd5e6;
    font-size: .95rem;
}

.toolbar-sort {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(190,210,255,.28);
    background: rgba(10,14,24,.85);
    color: var(--text);
    font-family: 'EB Garamond', serif;
    cursor: pointer;
    transition: all .25s ease;
    font-size: 0.9rem;
}

.toolbar-sort:hover {
    border-color: rgba(180,220,255,.5);
    background: rgba(18,24,38,.95);
}

/* =====================================================
   LAYOUT (SIDEBAR + RESULTS)
===================================================== */

.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

.sidebar {
    padding: 24px;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: rgba(18,24,38,.88) !important;
    border: 1px solid rgba(190,210,255,.28) !important;
    border-radius: 18px !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 18px rgba(0,0,0,.18) !important;
}

.sidebar h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.active-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0 18px 0;
}

.facet {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(190,210,255,.15);
}

.facet:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.facet h4 {
    margin-bottom: 10px;
    color: #d8c8ff;
    font-family: 'Cinzel', serif;
    font-size: .9rem;
    font-weight: 600;
}

.facet label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    cursor: pointer;
    color: var(--text);
    transition: color .2s ease;
    font-size: .9rem;
}

.facet label:hover {
    color: var(--accent);
}

.facet input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

/* =====================================================
   FILTER CHIPS
===================================================== */

.filter-chip {
    background: rgba(10,14,24,.85);
    border: 1px solid rgba(190,210,255,.28);
    border-radius: 999px;
    padding: 6px 12px;
    color: var(--text);
    cursor: pointer;
    font-size: .9rem;
    transition: all .2s ease;
    font-family: 'EB Garamond', serif;
    text-align: left;
}

.filter-chip:hover {
    border-color: rgba(180,220,255,.5);
    background: rgba(18,24,38,.95);
}

/* =====================================================
   RESULTS GRID (WITH BOXES AROUND EACH RESULT)
===================================================== */

.results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 22px;
    padding: 24px;
    transition: all .25s ease;
    background: rgba(18,24,38,.88) !important;
    border: 1px solid rgba(190,210,255,.28) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.18) !important;
}

.result:hover {
    background: rgba(8,12,22,.75) !important;
    border-color: rgba(210,220,255,.45) !important;
    box-shadow:
        0 0 12px rgba(180,220,255,.18),
        0 0 24px rgba(180,220,255,.08),
        0 4px 18px rgba(0,0,0,.25) !important;
    transform: translateY(-2px);
}

.thumb {
    width: 80px;
    height: 110px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #89704f, #4d3823);
    font-family: 'Cinzel', serif;
    font-size: .75rem;
    color: #cfd5e6;
    font-weight: bold;
    text-align: center;
    padding: 8px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
}

.type {
    color: #9fb4ff;
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--accent);
    margin: 6px 0 12px 0;
    font-weight: 600;
}

.meta {
    color: #cfd5e6;
    margin-bottom: 10px;
    font-size: .9rem;
}

.result p {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 12px;
}

.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.tag {
    padding: 5px 12px;
    border: 1px solid rgba(190,210,255,.28);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: 'EB Garamond', serif;
    font-size: .85rem;
    transition: all .2s ease;
}

.tag:hover {
    border-color: rgba(180,220,255,.5);
    color: var(--accent);
}

/* =====================================================
   CONTENT AREA WITH BACKGROUND IMAGE
===================================================== */

.content.search-page {
    max-width: 1400px;
    margin: auto;
    padding: 0 5% 40px;
    background:
        linear-gradient(
            rgba(5,8,18,.65),
            rgba(5,8,18,.75)
        ),
        url('arcanaeumimage.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* =====================================================
   RESPONSIVE / MOBILE
===================================================== */

@media (max-width: 1100px) {
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .topbar-nav {
        width: 100%;
    }
    
    .layout {
        grid-template-columns: 1fr;
    }
    
    .result {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 14px 18px;
        padding-right: 78px;
    }

    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .brand img {
        width: 88px;
        height: 88px;
    }

    .brand h1 {
        font-size: 2rem;
    }

    .topbar-nav {
        display: none;
        width: 100%;
    }

    .topbar-nav.mobile-open {
        display: flex !important;
        flex-direction: column;
        gap: 0;
        padding: 12px;
        background: rgba(5,8,18,.96);
        border-radius: 12px;
        margin-top: 8px;
        border: 1px solid rgba(190,210,255,.18);
    }

    .topbar-nav.mobile-open a {
        border-right: none;
        padding: 12px;
        border-bottom: 1px solid rgba(190,210,255,.12);
    }

    .topbar-nav.mobile-open a:last-child {
        border-bottom: none;
    }

    .search-wrap {
        padding: 0 4%;
    }

    .search-bar {
        position: relative;
        display: block;
    }

    .search-bar select {
        display: none;
    }

    .search-bar input {
        width: 100%;
        min-width: 0;
        padding: 18px 70px 18px 18px;
    }

    .search-bar button {
        position: absolute;
        right: 6px;
        top: 6px;
        bottom: 6px;
        width: 52px;
        padding: 0 !important;
        min-width: auto;
        border-radius: 10px;
        background: rgba(20,28,44,.95) !important;
        border: 1px solid rgba(190,210,255,.28) !important;
        color: #d8dff7 !important;
        font-size: 0 !important;
    }

    .search-bar button::before {
        content: '🔍';
        font-size: 18px;
    }

    .results-toolbar {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .toolbar-results {
        flex-direction: column;
        gap: 2px;
        width: 100%;
    }

    .toolbar-label {
        font-size: .9rem;
    }

    .toolbar-sort {
        width: 100%;
    }

    .result {
        grid-template-columns: 1fr;
    }

    .mobile-menu-toggle {
        position: fixed;
        right: 16px;
        top: 12px;
        height: 42px;
        padding: 0 12px;
        border-radius: 10px;
        border: 1px solid rgba(190,210,255,.18);
        background: rgba(8,12,22,.75);
        color: #d8dff7;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        cursor: pointer;
        font-family: 'EB Garamond', serif;
    }

    .search-fab {
        position: fixed;
        right: 18px;
        bottom: 18px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: rgba(20,28,44,.95);
        border: 1px solid rgba(190,210,255,.28);
        color: #d8dff7;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        z-index: 9999;
        font-size: 1.5rem;
        box-shadow: 0 6px 18px rgba(0,0,0,.35);
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle,
    .search-fab {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .result,
    .tag,
    .filter-chip,
    .topbar-nav a {
        transition: none !important;
    }
}

/* ==========================================
   MOBILE FILTER DRAWER
========================================== */

.mobile-filter-toggle{
    display:none;
}

@media (max-width:1100px){

    .mobile-filter-toggle{
        display:flex;
        align-items:center;
        justify-content:center;
        gap:8px;

        width:100%;
        margin-bottom:16px;
        padding:14px 18px;

        background:rgba(18,24,38,.88);
        border:1px solid rgba(190,210,255,.28);
        border-radius:12px;

        color:#d9cfff;
        font-family:'Cinzel', serif;
        font-size:.95rem;
        cursor:pointer;

        backdrop-filter:blur(12px);
        transition:.25s ease;
    }

    .mobile-filter-toggle:hover{
        border-color:rgba(180,220,255,.5);
    }

    .sidebar{
        display:none;
        margin-bottom:18px;
    }

    .sidebar.mobile-open{
        display:block;
        animation:filterSlideDown .25s ease;
    }
}

@keyframes filterSlideDown{
    from{
        opacity:0;
        transform:translateY(-8px);
    }

    to{
        opacity:1;
        transform:translateY(0);
    }
}

/* ==========================================
   MOBILE SEARCH TOOLS
========================================== */

.mobile-sort-section{
    display:none;
}

@media (max-width:1100px){

    .results-toolbar .toolbar-sort{
        display:none;
    }

    .mobile-sort-section{
        display:block;
        margin-bottom:20px;
        padding-bottom:16px;
        border-bottom:1px solid rgba(190,210,255,.15);
    }

    .mobile-sort-section h4{
        margin-bottom:10px;
        color:#d8c8ff;
        font-family:'Cinzel', serif;
        font-size:.9rem;
        font-weight:600;
    }

    .mobile-sort-section .toolbar-sort{
        display:block;
        width:100%;
    }
}

/* ==========================================
   MOBILE COMPACT RESULTS HEADER
========================================== */

@media (max-width:1100px){

    .results-toolbar{
        display:grid !important;
        grid-template-columns:1fr auto;
        align-items:center;
        gap:8px;
        padding:8px 0 !important;
    }

    .breadcrumb{
        grid-column:1;
        margin:0;
        font-size:.9rem;
    }

    .toolbar-results{
        grid-column:2;
        margin:0;
        justify-self:end;
    }

    /* Hide the "Search Results" label */
    .toolbar-label{
        display:none;
    }

    /* Keep only the result count */
    .toolbar-count{
        white-space:nowrap;
        font-size:.9rem;
        margin:0;
    }

    /* Sort is now inside Search Tools */
    .results-toolbar .toolbar-sort{
        display:none;
    }

}

/* search card title hover effects*/

.title {
    transition: color .2s ease;
}

.result:hover .title {
    color: #f0e8ff;
}