@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");

:root,
html[data-theme="light"] {
    /* Layout */
    --page-width: 70rem;
    --display-h1-decoration: 0;

    /* Typography */
    --heading-font:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Helvetica Neue", Arial, sans-serif;

    /* Colors - Light theme */
    --background-color: #fff;
    --font-color: #151515;
    --invert-font-color: #fff;
    --primary-color: #1a95e0;
    --secondary-color: #727578;
    --error-color: #d20962;
    --progress-bar-background: #727578;
    --progress-bar-fill: #151515;
    --code-bg-color: #e8eff2;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --background-color: #222225;
        --font-color: #e8e9ed;
        --invert-font-color: #222225;
        --secondary-color: #a3abba;
        --primary-color: #fbbf24;
        --error-color: #ff3c74;
        --progress-bar-background: #3f3f44;
        --progress-bar-fill: #fbbf24;
        --code-bg-color: #3f3f44;
    }
}

html[data-theme="dark"] {
    --background-color: #222225;
    --font-color: #e8e9ed;
    --invert-font-color: #222225;
    --secondary-color: #a3abba;
    --primary-color: #fbbf24;
    --error-color: #ff3c74;
    --progress-bar-background: #3f3f44;
    --progress-bar-fill: #fbbf24;
    --code-bg-color: #3f3f44;
}

/* base */
html {
    scroll-behavior: smooth;
}

body {
    line-height: 1.6;
    letter-spacing: 0.02em;
}

.container {
    max-width: var(--page-width);
}

/* Heading font family */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.eats-card-overlay h3.eats-card-title {
    font-family: var(--heading-font) !important;
    letter-spacing: -0.02em;
}

/* Remove theme underline from headings */
h1::after,
h2::after,
h3::after {
    content: none !important;
    display: none !important;
}

/* Heading sizes and spacing */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

h5 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
}

h6 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
}

/* Smaller headings in post lists */
.posts-list .post h1,
.posts-list .post h2 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.25rem;
}

blockquote {
    border-left: 0.25em solid var(--primary-color);
    margin: 1em 0;
    padding: 0 1em;
    font-style: italic;
}

blockquote::after {
    content: none;
}

blockquote p {
    margin-bottom: 0;
}

blockquote cite::before {
    content: "— ";
}

/* css transitions */
@view-transition {
    navigation: auto;
}

/* Root page transitions */
::view-transition-old(root) {
    animation: fade-out 200ms ease-out;
}

::view-transition-new(root) {
    animation: fade-in 200ms ease-in;
}

@keyframes fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Eats transitions */
.eats-single {
    view-transition-name: eats-card;
}

::view-transition-old(eats-card) {
    animation: slide-out 250ms ease-in;
}

::view-transition-new(eats-card) {
    animation: slide-in 250ms ease-out;
}

@keyframes slide-out {
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* Remove theme border on code blocks */
pre {
    border: none !important;
}

/* Remove chroma syntax highlighter background */
.chroma {
    background: none !important;
}

.posts-list {
    padding-left: 150px;
}

.posts-list .post {
    margin-bottom: 2rem;
}

.post-meta {
    margin: 1em 0;
    opacity: 0.8;
}

.post-meta span {
    margin-right: 1em;
}

/* Responsive posts list */
@media (max-width: 850px) {
    .posts-list {
        padding-left: 0;
    }

    .posts-list .date {
        display: block;
        position: static;
        width: auto;
        margin-bottom: 0.25rem;
    }
}

/* Gallery grid */
.eats-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Card base */
.eats-card {
    position: relative;
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 8px;
    text-decoration: none;
    background-color: #333;
}

.eats-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.eats-card:hover img {
    transform: scale(1.05);
}

/* Card overlay */
.eats-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem 1.25rem 1.25rem;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.8) 100%
    );
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.eats-card-overlay h3.eats-card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.eats-card-location {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    opacity: 0.85;
    color: #fff;
}

.eats-card-date {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* Card without image fallback */
.eats-card-no-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.eats-card-no-image .eats-card-overlay {
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.5) 100%
    );
}

/* Single eats page layout */
.eats-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.eats-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.eats-photo {
    border-radius: 8px;
    overflow: hidden;
}

.eats-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.eats-map {
    height: 280px;
    border-radius: 8px;
    border: 1px solid var(--secondary-color);
}

.eats-content {
    min-width: 0;
}

.rating {
    color: var(--primary-color);
}

/* Responsive eats layout */
@media (max-width: 700px) {
    .eats-layout {
        grid-template-columns: 1fr;
    }

    .eats-sidebar {
        flex-direction: row;
    }

    .eats-photo,
    .eats-map {
        flex: 1;
        min-width: 0;
    }

    .eats-map {
        height: 200px;
    }
}

.map-single,
.map-all {
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
}

.map-filters {
    margin: 1rem 0;
}

.map-filters label {
    margin-right: 0.5rem;
}

/* Custom select dropdown styling */
.map-filters select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.4rem 2rem 0.4rem 0.6rem;
    font-family: inherit;
    font-size: inherit;
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
    background: #fff
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23727578' d='M6 8L1 3h10z'/%3E%3C/svg%3E")
        no-repeat right 0.6rem center;
    cursor: pointer;
}

/* Dark mode select dropdown */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .map-filters select {
        background: var(--background-color)
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a3abba' d='M6 8L1 3h10z'/%3E%3C/svg%3E")
            no-repeat right 0.6rem center;
        color: var(--font-color);
    }
}

html[data-theme="dark"] .map-filters select {
    background: var(--background-color)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a3abba' d='M6 8L1 3h10z'/%3E%3C/svg%3E")
        no-repeat right 0.6rem center;
    color: var(--font-color);
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s ease;
}

#theme-toggle:hover {
    transform: scale(1.1);
}
