/* css/style.css */

/* CSS reset-ish */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Light theme variables (default) */
:root {
    --bg: #f1f5f9;
    --bg-elevated: #ffffff;
    --bg-alt: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --border-subtle: #e2e8f0;
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
}

/* Dark theme if body has .dark or data-theme="dark" */
body.dark {
    --bg: #020617;
    --bg-elevated: #020617;
    --bg-alt: #0f172a;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --accent: #60a5fa;
    --accent-soft: rgba(96, 165, 250, 0.15);
    --border-subtle: #1f2937;
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.9);
}

body[data-theme="dark"] {
    /* for attribute-based styling if used */
}

/* Layout */

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
    background-color: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
    border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0;
}

/* Top nav */
.top-nav {
    display: flex;
    gap: 0.9rem;
    align-items: center;
}

.top-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
}

.top-nav a:hover {
    background-color: var(--accent-soft);
    color: var(--text);
}

.top-nav a.active {
    background-color: var(--accent-soft);
    color: var(--accent);
}

.logo {
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
    gap: 0;
    margin-left: 10px;
}

.logo-main {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text);
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Theme Toggle */

.theme-toggle {
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-elevated);
    border-radius: 999px;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    margin-right: 10px;
}

.theme-toggle-icon {
    font-size: 1rem;
}

/* Hero */

.hero {
    padding: 2.5rem 0 1.5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 2rem;
    align-items: flex-start;
}

.hero-main h1 {
    font-size: 2.1rem;
    margin-bottom: 0.4rem;
}

.hero-sub {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Time card */

.time-card {
    background: radial-gradient(circle at top left, var(--accent-soft), var(--bg-elevated));
    padding: 1rem 1.2rem;
    border-radius: 1.2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-subtle);
    margin-bottom: 1.5rem;
}

.time-card.big-card {
    padding: 1.4rem 1.6rem;
}

.time-main {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.time-sub {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.time-timezone code,
.time-timezone {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Search */

.search-form {
    margin-top: 1rem;
}

.search-form label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.search-row {
    display: flex;
    gap: 0.6rem;
}

.search-row input[type="text"] {
    flex: 1;
    border: 1px solid var(--border-subtle);
    border-radius: 0.8rem;
    padding: 0.55rem 0.8rem;
    font-size: 0.95rem;
    background-color: var(--bg-elevated);
    color: var(--text);
}

.search-row button {
    border: none;
    border-radius: 0.8rem;
    padding: 0.55rem 0.95rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
}

.search-row button:hover {
    filter: brightness(1.05);
}

.search-hint {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.tag-btn {
    border: none;
    background-color: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    font-size: 0.8rem;
    padding: 0.25rem 0.7rem;
    margin-left: 0.2rem;
    cursor: pointer;
}

/* Hero aside */

.hero-aside h2 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}

.timezone-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.tz-card {
    display: block;
    border-radius: 0.9rem;
    padding: 0.75rem 0.9rem;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
}

.tz-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
}

.tz-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* States grid */

.states-section {
    padding: 1.5rem 0 1.5rem;
}

.section-intro {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.states-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.compact-grid {
    margin-top: 0.7rem;
}

.state-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-elevated);
    text-decoration: none;
    font-size: 0.8rem;
    color: var(--text);
}

.state-abbr {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* API section */

.api-section {
    padding: 1.5rem 0 2.5rem;
}

/* Articles section */
.articles-section {
    padding: 1.5rem 0 2.5rem;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.section-link {
    font-weight: 700;
    text-decoration: none;
    color: var(--accent);
    font-size: 0.9rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 0.9rem;
}

.articles-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.article-card {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 1.1rem;
    padding: 0.95rem 1rem;
    box-shadow: var(--shadow-soft);
}

.article-thumb {
    display: block;
    border-radius: 1rem;
    overflow: hidden;
    margin: -0.15rem 0 0.75rem;
    aspect-ratio: 16 / 9;
    background-color: var(--bg-alt);
    border: 1px solid var(--border-subtle);
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-feature {
    margin: 1rem 0 0;
    border-radius: 1.2rem;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-alt);
    box-shadow: var(--shadow-soft);
}

.article-feature img {
    width: 100%;
    height: auto;
    display: block;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

.page-btn,
.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-elevated);
    text-decoration: none;
    color: var(--text);
    font-weight: 800;
    font-size: 0.9rem;
}

.page-btn:hover,
.page-num:hover {
    border-color: var(--accent);
}

.page-btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.page-num.active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 0.3rem;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background-color: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

.dot {
    opacity: 0.65;
}

.article-title {
    font-size: 1.05rem;
    line-height: 1.3;
    margin-bottom: 0.45rem;
}

.article-title a {
    text-decoration: none;
    color: var(--text);
}

.article-title a:hover {
    color: var(--accent);
}

.article-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.article-excerpt.big {
    font-size: 1rem;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.7rem;
}

.tag {
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-alt);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

/* Article page */
.hero-article {
    padding: 2rem 0 2.5rem;
}

.article-header {
    margin-top: 0.6rem;
}

.article-body {
    margin-top: 1.2rem;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 1.2rem;
    padding: 1.1rem 1.15rem;
    box-shadow: var(--shadow-soft);
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 1rem 0 0.45rem;
    line-height: 1.25;
}

.article-content p {
    margin: 0.55rem 0;
    font-size: 0.98rem;
}

.article-content a {
    color: var(--accent);
}

.article-content code {
    background-color: var(--bg-alt);
    padding: 0.12rem 0.3rem;
    border-radius: 0.35rem;
    font-size: 0.9em;
}

.article-list {
    padding-left: 1.25rem;
    margin: 0.6rem 0;
}

.article-cta {
    margin-top: 1.2rem;
    padding: 1rem 1.1rem;
    border-radius: 1.2rem;
    border: 1px solid var(--border-subtle);
    background: radial-gradient(circle at top left, var(--accent-soft), var(--bg-elevated));
}

/* Article blocks on state page */

.hero-state {
    padding: 2rem 0 2.5rem;
}

.breadcrumb {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.hero-state h1 {
    font-size: 2rem;
    margin-bottom: 0.9rem;
}

.state-intro {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.article-block {
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-subtle);
}

.article-block h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.article-block p {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.time-details {
    list-style: disc;
    padding-left: 1.3rem;
    font-size: 0.93rem;
    margin-bottom: 0.5rem;
}

.search-form-inline {
    margin-top: 0.4rem;
}

/* Buttons */

.btn-primary {
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.4);
}

/* Footer */

.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 1rem 0 1.5rem;
    background-color: var(--bg-elevated);
}

.footer-inner {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-meta {
    margin-top: 0.2rem;
}

/* 404 */

.hero-404 {
    padding: 3rem 0;
    text-align: center;
}

.hero-404 h1 {
    font-size: 2rem;
    margin-bottom: 0.6rem;
}

.hero-404 p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Responsive */

@media (max-width: 800px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .hero-main h1,
    .hero-state h1 {
        font-size: 1.7rem;
    }

    .time-main {
        font-size: 2rem;
    }

    .search-row {
        flex-direction: column;
    }

    .top-nav {
        display: none;
    }

    .articles-grid,
    .articles-grid.compact {
        grid-template-columns: 1fr;
    }

    .search-row button {
        width: 100%;
    }
}
