/*
  The 首页, 笔记 list and reader screens: the landing hero, the post cards, the
  search box and the article. Loaded after base.css, which holds the design system.

  These rules are NOT scoped to a screen, so anything named here that the 播客 screen
  also uses (.hero, .intro) reaches it too — which is why podcast.css restates those
  two under .podcast. Prefer a name this file owns over adding to that overlap.
*/

/* Landing */
.hero { padding: 80px 0 64px; }
.avatar {
    width: 400px;
    height: 400px;
    max-width: 100%;
    border-radius: 40px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 48px;
    font-weight: 700;
    color: #2a2a2a;
    background: transparent;
    overflow: hidden;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hero .lead {
    margin: 0 auto;
    max-width: 560px;
    color: var(--muted);
    font-size: 20px;
    line-height: 1.6;
}
.hero-actions {
    margin-top: 32px;
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Section intro on the posts page */
.intro h1 { margin-bottom: 12px; }
.intro p {
    margin: 0;
    color: var(--muted);
    font-size: 18px;
}

@media (max-width: 600px) {
    .hero .lead { font-size: 18px; }
}

/* Post list (cards) */
.posts {
    padding: 8px 0 64px;
    display: grid;
    gap: 32px;
}

.post-card {
    display: flex;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.post-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
}

.card-banner {
    flex: 0 0 42%;
    align-self: stretch;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: #2a2a2a;
    background-size: cover;
    background-position: center;
}
.banner-icon { font-size: 46px; line-height: 1; }

.card-body {
    flex: 1;
    min-width: 0;
    padding: 28px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 640px) {
    .post-card { flex-direction: column; }
    .card-banner {
        flex: none;
        width: 100%;
        min-height: 0;
        aspect-ratio: 16 / 7;
    }
    .card-body { padding: 22px 24px 24px; }
}

.post-title {
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
    transition: color 0.15s ease;
}
.post-card:hover .post-title { color: var(--muted); }
.post-desc {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.read-link {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.post-card:hover .read-link { color: var(--muted); }

/* Search */
.search {
    position: relative;
    padding-top: 24px;
}
.search-input {
    width: 100%;
    font: inherit;
    font-size: 16px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 16px;
    outline: none;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--muted); }

.dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    z-index: 10;
}
.dropdown-item {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover,
.dropdown-item.active { background: var(--line); }
.dropdown-item .d-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
}
.dropdown-item .d-snippet {
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
    margin-bottom: 4px;
}
.dropdown-item .d-meta {
    font-size: 12px;
    color: var(--muted);
}
.dropdown-empty {
    padding: 14px 16px;
    color: var(--muted);
    font-size: 15px;
}
.dropdown mark {
    background: transparent;
    color: var(--text);
    font-weight: 700;
}

/* Article reader */
article {
    padding: 56px 0 80px;
}
article .meta { margin-bottom: 14px; }
article h1 {
    font-size: 36px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin: 0 0 32px;
    font-weight: 800;
}
article h2 {
    font-size: 24px;
    letter-spacing: -0.02em;
    margin: 40px 0 12px;
}
article p { margin: 0 0 20px; }
article img { max-width: 100%; height: auto; border-radius: 12px; margin: 4px 0 24px; }
article blockquote {
    margin: 0 0 20px;
    padding: 4px 18px;
    border-left: 3px solid var(--muted);
    color: var(--muted);
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0 8px 8px 0;
}
article blockquote p { margin: 12px 0; }
article ul, article ol { padding-left: 22px; margin: 0 0 20px; }
article li { margin-bottom: 8px; }
article hr { border: none; border-top: 1px solid var(--muted); opacity: 0.3; margin: 32px 0; }
article code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 5px;
}
article strong { font-weight: 700; }
article a { color: var(--text); }

.back {
    display: inline-block;
    margin: 8px 0 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 15px;
}
.back:hover { color: var(--text); }

.loading { color: var(--muted); padding: 40px 0; }

@media (max-width: 600px) {
    article h1 { font-size: 28px; }
}
