* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    background: radial-gradient(1200px 600px at 10% 10%, #1e3a8a 0%, transparent 60%),
        radial-gradient(900px 500px at 90% 20%, #0f172a 0%, #0b1120 60%);
    color: #e2e8f0;
    min-height: 100vh;
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 48px;
}

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

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

.brand strong {
    display: block;
    font-size: 16px;
}

.brand span {
    font-size: 12px;
    color: #94a3b8;
}

.landing-actions {
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.btn.primary {
    background: #38bdf8;
    color: #0f172a;
}

.btn.ghost {
    border: 1px solid #334155;
    color: #e2e8f0;
}

.landing-main {
    padding: 0 48px 48px;
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 32px;
}

.hero-text h1 {
    font-size: 40px;
    line-height: 1.1;
    margin: 0 0 12px;
}

.hero-text p {
    color: #cbd5f5;
    font-size: 16px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.hero-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 20px;
    border-radius: 16px;
}

.hero-card h3 {
    margin-top: 0;
}

.hero-card ul {
    padding-left: 18px;
    margin: 0;
    color: #cbd5f5;
}

.ad-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 32px;
}

.ad-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 8px;
}

.ad-slot {
    display: block;
    min-height: 90px;
    width: 100%;
}

.ad-link-card {
    display: flex;
    gap: 16px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.7);
    max-width: 680px;
    margin: 0 auto;
}

.ad-link-card:hover {
    border-color: rgba(56, 189, 248, 0.6);
}

.ad-thumb {
    width: 132px;
    min-width: 132px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    background: #0b1120;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.ad-meta strong {
    font-size: 16px;
}

.ad-meta span {
    font-size: 14px;
    color: #cbd5f5;
}

.ad-meta em {
    font-style: normal;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #93c5fd;
}

.public-search {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
}

.public-search-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.public-search-head h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.public-search-head p {
    margin: 0;
    color: #cbd5f5;
    font-size: 14px;
}

.public-search-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #93c5fd;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.public-search-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.public-search-form .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.public-search-form label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.public-search-form input,
.public-search-form select {
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.public-search-status {
    margin-top: 12px;
    font-size: 13px;
    color: #94a3b8;
}

.public-search-status.is-error {
    color: #f87171;
}

.public-search-results {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.public-result-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.public-result-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.public-result-head strong {
    font-size: 16px;
}

.public-result-head span {
    font-size: 12px;
    color: #93c5fd;
    text-transform: uppercase;
}

.public-result-body p {
    margin: 0;
    font-size: 14px;
    color: #e2e8f0;
}

.public-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.public-search-note {
    margin-top: 16px;
    font-size: 12px;
    color: #94a3b8;
}

.public-search-empty {
    padding: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    font-size: 13px;
    color: #cbd5f5;
}

.is-hidden {
    display: none;
}


.features {
    margin-bottom: 32px;
}

.news {
    margin-bottom: 32px;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.news-header h2 {
    font-size: 24px;
    margin: 0 0 6px;
}

.news-header p {
    margin: 0;
    color: #cbd5f5;
    font-size: 14px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.news-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    overflow: hidden;
    min-height: 100%;
}

.news-card:hover {
    border-color: rgba(56, 189, 248, 0.5);
}

.news-thumb {
    width: 100%;
    height: 140px;
    background: #0b1120;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-thumb-fallback {
    font-weight: 700;
    color: #93c5fd;
    font-size: 14px;
    letter-spacing: 0.08em;
}

.news-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-body strong {
    font-size: 15px;
    line-height: 1.3;
}

.news-body span {
    font-size: 13px;
    color: #cbd5f5;
}

.news-body em {
    font-style: normal;
    font-size: 12px;
    color: #94a3b8;
    margin-top: auto;
}

.news-empty {
    padding: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 14px;
    color: #cbd5f5;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.features h2 {
    font-size: 24px;
    margin: 0 0 16px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.feature-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 16px;
}

.feature-card h4 {
    margin: 0 0 8px;
}

.feature-card p {
    margin: 0;
    color: #cbd5f5;
    font-size: 14px;
}

.cta {
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.2), rgba(15, 23, 42, 0.9));
    border-radius: 18px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cta h2 {
    margin: 0 0 8px;
}

.cta p {
    margin: 0;
    color: #cbd5f5;
}

.cta-actions {
    display: flex;
    gap: 10px;
}

.landing-footer {
    padding: 24px 48px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #94a3b8;
    font-size: 12px;
    flex-wrap: wrap;
}

.landing-footer a {
    color: #93c5fd;
    text-decoration: none;
}

@media (max-width: 900px) {
    .landing-header {
        padding: 20px;
        flex-direction: column;
        gap: 12px;
    }

    .landing-main {
        padding: 0 20px 32px;
    }

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

    .landing-footer {
        padding: 20px;
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }

    .public-search-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .ad-link-card {
        flex-direction: column;
    }

    .ad-thumb {
        width: 100%;
        height: 160px;
    }

    .public-search-form {
        grid-template-columns: 1fr;
    }
}



/* GRID LAYOUT: Strict 3 columns of equal width */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Always 3 equal columns */
    gap: 24px;
    margin-top: 24px;
    width: 100%;
    align-items: start;
}

/* On extremely small screens (phones), stack them for readability, 
   unless user strictly demands side-by-side always. 
   Set breakpoint to 600px. */
@media (max-width: 600px) {
    .ads-grid {
        grid-template-columns: 1fr;
        /* Stack vertically */
    }
}

.mini-ad-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0;
    text-decoration: none;
    color: inherit;
    width: 100%;
    /* Fill the grid cell */
    transition: transform 0.2s;
}

.mini-ad-card:hover {
    transform: translateY(-4px);
}

.mini-ad-thumb {
    width: 100%;
    /* Max width helps keep images not too huge on large screens, 
       but centering handles the rest. */
    max-width: 200px;
    aspect-ratio: 1 / 1.4;
    /* Book cover ratio approx */
    background: #0b1120;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.mini-ad-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-ad-body {
    width: 100%;
    max-width: 200px;
    /* Align text width with image max-width */
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-ad-body strong {
    font-size: 15px;
    line-height: 1.3;
    color: #f8fafc;
    font-weight: 600;

    /* Force word break if needed */
    overflow-wrap: break-word;
    word-break: break-word;
}

.mini-ad-body span {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;

    overflow-wrap: break-word;
    word-break: break-word;
}

.ad-card {
    background: transparent;
    border: none;
    padding: 0;
}

.ad-label {
    margin-bottom: 24px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    text-align: center;
    width: 100%;
    opacity: 0.8;
}