@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Inter:wght@400;500;600&display=swap');

:root {
    --accent: #1b3a5c;
    --accent-light: #2a5a8c;
    --accent-pale: #e8eef4;
    --bg: #faf9f7;
    --card-bg: #ffffff;
    --border: #ddd9d3;
    --text: #1a1a1a;
    --text-secondary: #6b6b6b;
    --text-muted: #999;
    --annotation-bg: #f0f4f8;
    --annotation-border: #1b3a5c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* --- Header --- */

header {
    background: var(--accent);
    padding: 0 2rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.header-brand-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
}

.header-logo {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

header h1 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    line-height: 1.2;
}

header .tagline {
    font-size: 0.72rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
    margin-top: -0.05rem;
    font-family: "Inter", -apple-system, sans-serif;
    letter-spacing: 0.03em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-nav a {
    font-family: "Inter", -apple-system, sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    letter-spacing: 0.04em;
    padding: 0.3rem 0;
    border-bottom: 1.5px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.header-nav a:hover,
.header-nav a.active {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

/* --- Main --- */

main {
    max-width: 780px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
}

/* --- Hero (landing page one-liner) --- */

.hero {
    max-width: 580px;
    margin: 0 auto 2.5rem;
    text-align: center;
}

.hero p {
    font-size: 1.1rem;
    line-height: 1.75;
    color: #555;
}

.section-heading {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1.75rem;
}

.section-heading::after {
    content: "";
    display: block;
    width: 48px;
    height: 2px;
    background: var(--accent);
    margin: 0.6rem auto 0;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state code {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #eee;
    border-radius: 3px;
    font-size: 0.9rem;
    font-family: "SF Mono", Monaco, monospace;
}

/* --- Politician Grid (Landing Page) --- */

.politician-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.25rem;
}

.politician-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.politician-card:hover {
    box-shadow: 0 6px 24px rgba(27, 58, 92, 0.12);
    transform: translateY(-3px);
}

.politician-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #e0ddd8;
}

.politician-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.politician-card:hover .politician-image {
    filter: grayscale(40%);
}

.politician-image.placeholder {
    width: 100%;
    height: 100%;
}

.politician-info {
    padding: 0.75rem 1rem 0.85rem;
}

.politician-info h3 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.1rem;
}

.politician-handle {
    font-family: "Inter", -apple-system, sans-serif;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.tweet-count {
    font-family: "Inter", -apple-system, sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Politician Detail Page --- */

.politician-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.politician-header-image {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
    margin-bottom: 0.75rem;
    border: 3px solid var(--accent);
}

.politician-header-name {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
}

.politician-header-handle {
    font-family: "Inter", -apple-system, sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* --- Tweet Cards (Twitter-like layout) --- */

.tweet-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.tweet-body {
    display: flex;
    gap: 0.85rem;
    padding: 1.25rem 1.25rem 1rem;
}

.tweet-avatar-col {
    flex-shrink: 0;
}

.tweet-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
}

.tweet-content-col {
    flex: 1;
    min-width: 0;
}

.tweet-author-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.tweet-author-name {
    font-family: "Inter", -apple-system, sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.tweet-author-handle {
    font-family: "Inter", -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tweet-text {
    font-size: 0.93rem;
    line-height: 1.55;
    white-space: pre-wrap;
    margin-bottom: 0.6rem;
    color: #222;
}

.tweet-link {
    font-family: "Inter", -apple-system, sans-serif;
    font-size: 0.78rem;
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.15s;
}

.tweet-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* --- Annotations (collapsible) --- */

.annotation {
    border-top: 1px solid var(--border);
    background: var(--annotation-bg);
}

.annotation-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem 0.75rem calc(1.25rem + 44px + 0.85rem);
    font-family: "Inter", -apple-system, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.15s;
}

.annotation-toggle::-webkit-details-marker {
    display: none;
}

.annotation-toggle::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.annotation[open] > .annotation-toggle::before {
    transform: rotate(45deg);
}

.annotation-toggle:hover {
    background: rgba(27, 58, 92, 0.06);
}

.annotation-text {
    padding: 0 1.25rem 1.25rem calc(1.25rem + 44px + 0.85rem);
    font-size: 0.9rem;
    line-height: 1.75;
    color: #2a2a2a;
}

.annotation-text p {
    margin-bottom: 0.6rem;
}

.annotation-text p:last-child {
    margin-bottom: 0;
}

.no-annotation {
    padding: 0.75rem 1.25rem 0.75rem calc(1.25rem + 44px + 0.85rem);
    border-top: 1px solid var(--border);
}

.no-annotation span {
    font-family: "Inter", -apple-system, sans-serif;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

/* --- About Page --- */

.about-content {
    max-width: 640px;
    margin: 0 auto;
}

.about-heading {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2rem;
    text-align: center;
}

.about-section {
    margin-bottom: 2rem;
}

.about-section h3 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.6rem;
}

.about-section p {
    margin-bottom: 0.75rem;
    color: #333;
}

.about-section ul {
    margin: 0.5rem 0 0.75rem 1.5rem;
    color: #333;
}

.about-section ul li {
    margin-bottom: 0.35rem;
}

.about-supported-by {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.about-supported-by p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* --- Team --- */

.team-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.team-member {
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.team-name {
    font-family: "Inter", -apple-system, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.15rem;
}

.team-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* --- Footer --- */

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}
