/* ── Palette (heytivity) ──────────────────────────────────────────────────── */
:root {
    --page-bg:       #f7f5ef;
    --surface:       #fffdf8;
    --surface-muted: #f0ede4;
    --text-strong:   #252525;
    --text-soft:     #727067;
    --line:          rgba(93, 78, 63, .12);
    --brand:         #f26f4c;
    --brand-soft:    rgba(242, 111, 76, .10);
    --shadow-sm:     0 .5rem 1.5rem rgba(15, 23, 42, .05);
    --shadow-lg:     0 1.5rem 4rem rgba(15, 23, 42, .09);
}

[data-bs-theme="dark"] {
    --page-bg:       #0c0806;
    --surface:       #15100c;
    --surface-muted: #1e160f;
    --text-strong:   #f2ede8;
    --text-soft:     #9a8870;
    --line:          rgba(242, 111, 76, .14);
    --brand:         #f26f4c;
    --brand-soft:    rgba(242, 111, 76, .12);
    --shadow-sm:     0 .5rem 1.5rem rgba(0, 0, 0, .40);
    --shadow-lg:     0 1.5rem 4rem rgba(0, 0, 0, .65);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background: var(--page-bg);
    color: var(--text-strong);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    line-height: 1.6;
}

a { text-decoration: none; }

/* ── Bootstrap overrides ─────────────────────────────────────────────────── */
.btn-primary {
    --bs-btn-color:              #fff;
    --bs-btn-bg:                 var(--brand);
    --bs-btn-border-color:       var(--brand);
    --bs-btn-hover-color:        #fff;
    --bs-btn-hover-bg:           #c85a38;
    --bs-btn-hover-border-color: #c85a38;
    --bs-btn-active-bg:          #b84c2c;
    --bs-btn-active-border-color:#b84c2c;
    --bs-btn-focus-shadow-rgb:   242, 111, 76;
}

.btn-outline-secondary {
    --bs-btn-color:              var(--text-soft);
    --bs-btn-border-color:       var(--line);
    --bs-btn-hover-color:        var(--brand);
    --bs-btn-hover-bg:           var(--brand-soft);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-color:       var(--brand);
    --bs-btn-active-bg:          var(--brand-soft);
}

.pagination {
    --bs-pagination-color:               var(--text-strong);
    --bs-pagination-bg:                  var(--surface);
    --bs-pagination-border-color:        var(--line);
    --bs-pagination-hover-bg:            var(--surface-muted);
    --bs-pagination-hover-color:         var(--brand);
    --bs-pagination-hover-border-color:  var(--line);
    --bs-pagination-active-bg:           var(--brand);
    --bs-pagination-active-border-color: var(--brand);
    --bs-pagination-active-color:        #fff;
    --bs-pagination-disabled-bg:         var(--surface-muted);
    --bs-pagination-disabled-color:      var(--text-soft);
    --bs-pagination-disabled-border-color: var(--line);
    --bs-pagination-focus-box-shadow:    0 0 0 .2rem rgba(242, 111, 76, .25);
    --bs-pagination-font-size:           .875rem;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: color-mix(in srgb, var(--page-bg) 84%, transparent);
    border-color: var(--line) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.site-header .navbar {
    min-height: 3.75rem;
}

/* ── Brand ───────────────────────────────────────────────────────────────── */
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: var(--text-strong);
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .04em;
}

.brand-mark:hover { color: var(--text-strong); }

.brand-icon {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: .45rem;
    background: var(--surface);
    color: var(--brand);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

/* ── Theme toggle ────────────────────────────────────────────────────────── */
.theme-toggle-icon {
    display: inline-grid !important;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--line) !important;
    border-radius: 999px !important;
    background: var(--surface) !important;
    color: var(--text-strong) !important;
    cursor: pointer;
    transition: color .15s ease;
    box-shadow: var(--shadow-sm);
}

.theme-toggle-icon:hover,
.theme-toggle-icon:focus-visible {
    color: var(--brand) !important;
    outline: none;
}

/* ── Hero / Search ───────────────────────────────────────────────────────── */
.hero-section {
    padding: 3.25rem 0 2.25rem;
}

.hero-title {
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 900;
    font-size: clamp(1.9rem, 6vw, 3.25rem);
    color: var(--text-strong);
    margin-bottom: .4rem;
    line-height: 1.1;
}

[data-bs-theme="dark"] .hero-title {
    background: linear-gradient(135deg, #f2ede8 30%, #f5956f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: .95rem;
    color: var(--text-soft);
    margin-bottom: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--brand);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
}

/* ── Search form ─────────────────────────────────────────────────────────── */
.search-form {
    max-width: 42rem;
    margin: 0 auto;
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .4rem .4rem 1rem;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.search-wrap:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow-sm);
}

.search-icon {
    color: var(--text-soft);
    font-size: .875rem;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: 0 !important;
    background: transparent !important;
    color: var(--text-strong) !important;
    padding: .3rem .4rem;
    font-size: .925rem;
    box-shadow: none !important;
    outline: none;
    min-width: 0;
}

.search-input::placeholder { color: var(--text-soft); }

.btn-clear {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    color: var(--text-soft);
    background: var(--surface-muted);
    font-size: .75rem;
    flex-shrink: 0;
    transition: color .15s;
}

.btn-clear:hover { color: var(--brand); }

.search-btn {
    border-radius: 999px !important;
    padding: .4rem 1.1rem !important;
    font-size: .875rem !important;
    font-weight: 600 !important;
    flex-shrink: 0;
}

.search-meta {
    font-size: .85rem;
    color: var(--text-soft);
}

/* ── Results section ─────────────────────────────────────────────────────── */
.results-section {
    flex: 1;
    padding-bottom: 4rem;
}

.results-list {
    max-width: 52rem;
    margin: 0 auto;
}

/* ── Result card ─────────────────────────────────────────────────────────── */
.result-card {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    margin-bottom: .55rem;
    border: 1px solid var(--line);
    border-radius: .85rem;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.result-card:hover {
    border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.result-thumb {
    flex-shrink: 0;
    width: 5.25rem;
    display: grid;
    place-items: center;
    background: var(--surface-muted);
    border-right: 1px solid var(--line);
}

.result-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.result-thumb-favicon {
    width: 22px;
    height: 22px;
    opacity: .7;
}

.result-body {
    flex: 1;
    min-width: 0;
    padding: .85rem .75rem .85rem 1rem;
}

.result-host {
    font-size: .75rem;
    color: var(--brand);
    font-weight: 600;
    margin-bottom: .1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .2rem;
    line-height: 1.35;
}

.result-title a { color: var(--text-strong); }

.result-title a:hover { color: var(--brand); }

.result-desc {
    font-size: .835rem;
    color: var(--text-soft);
    margin: 0;
    line-height: 1.5;
}

.result-visit {
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-muted);
    color: var(--text-soft);
    font-size: .7rem;
    align-self: flex-start;
    margin: .85rem .85rem 0 0;
    transition: background .15s, color .15s, border-color .15s;
}

.result-visit:hover {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: color-mix(in srgb, var(--brand) 28%, transparent);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
    max-width: 30rem;
    margin: 0 auto;
}

.empty-icon {
    font-size: 2.75rem;
    color: var(--text-soft);
    display: block;
}

/* ── Error state ─────────────────────────────────────────────────────────── */
.error-state {
    max-width: 28rem;
    margin: 0 auto;
}

.error-icon {
    font-size: 3rem;
    color: #ef4444;
    display: block;
}

/* ── Results count ───────────────────────────────────────────────────────── */
.results-count {
    max-width: 52rem;
    margin: .75rem auto 0;
    text-align: right;
    font-size: .78rem;
    color: var(--text-soft);
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination-nav {
    max-width: 52rem;
    margin-left: auto;
    margin-right: auto;
}

.page-link {
    min-width: 2.25rem;
    text-align: center;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
    border-color: var(--line) !important;
    background: transparent;
    margin-top: auto;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .65rem;
    padding: 1.1rem 0;
}

.footer-copy {
    font-size: .825rem;
    color: var(--text-soft);
}

.footer-link {
    font-size: .825rem;
    color: var(--text-soft);
    transition: color .15s;
}

.footer-link:hover { color: var(--brand); }

/* ── Dark mode tweaks ────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .site-header {
    background: color-mix(in srgb, #0c0806 88%, transparent);
    border-color: rgba(242, 111, 76, .1) !important;
}

[data-bs-theme="dark"] .result-card {
    border-color: rgba(242, 111, 76, .08);
}

[data-bs-theme="dark"] .result-card:hover {
    border-color: rgba(242, 111, 76, .28);
}

[data-bs-theme="dark"] .search-wrap {
    border-color: rgba(242, 111, 76, .14);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .hero-section { padding: 2.25rem 0 1.75rem; }

    .result-thumb { width: 4rem; }

    .result-visit { display: none; }

    .results-count { text-align: center; }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}
