/* LimageCMS public frontend — F0.20 foundation */

:root {
    --site-bg: #f5f6f8;
    --surface: #ffffff;
    --text: #18202a;
    --muted: #687586;
    --border: #dfe4ea;
    --accent: #1f5eff;
    --accent-hover: #164bd1;
    --container: 1180px;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(20, 31, 45, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body.public-body {
    margin: 0;
    min-width: 320px;
    background: var(--site-bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
}

a {
    color: var(--accent);
}

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

img {
    max-width: 100%;
}

.container {
    width: min(calc(100% - 32px), var(--container));
    margin-inline: auto;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.site-logo {
    color: var(--text);
    font-size: 1.45rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--text);
    padding: 9px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
}

.site-nav a:hover {
    background: #eef2f7;
    color: var(--text);
}

.site-main {
    padding: 34px 0 56px;
    min-height: calc(100vh - 145px);
}

.page-header {
    margin-bottom: 26px;
}

.page-header h1,
.public-page h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 3vw, 2.45rem);
    line-height: 1.15;
}

.page-header p {
    margin: 0;
    color: var(--muted);
}

.section {
    margin-top: 34px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.gallery-card {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.gallery-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.gallery-card__cover {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #e9edf2;
}

.gallery-card__placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #e9edf2;
    color: var(--muted);
}

.gallery-card__body {
    padding: 14px 15px 16px;
}

.gallery-card__title {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.35;
}

.gallery-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.86rem;
}

.gallery-card__model {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.86rem;
}

.gallery-card:hover {
    box-shadow: 0 5px 18px rgba(20, 31, 45, 0.1);
}

.public-page,
.gallery-page {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

.gallery-page__description {
    margin: 0 0 18px;
    color: var(--muted);
}

.gallery-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 0.92rem;
}

.gallery-images {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.gallery-image {
    margin: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #e9edf2;
}

.gallery-image img {
    display: block;
    width: 100%;
    height: auto;
}

.categories-list,
.models-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.categories-list a,
.models-list a {
    display: block;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow);
}

.categories-list a:hover,
.models-list a:hover {
    border-color: #c9d3df;
    color: var(--text);
}

.empty-state {
    padding: 28px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted);
}

.site-footer {
    padding: 24px 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 960px) {
    .site-header__inner {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 16px;
        padding-bottom: 16px;
        gap: 12px;
    }

    .site-nav {
        justify-content: flex-start;
    }

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

    .categories-list,
    .models-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .container {
        width: min(calc(100% - 20px), var(--container));
    }

    .site-main {
        padding: 22px 0 38px;
    }

    .public-page,
    .gallery-page {
        padding: 20px;
    }

    .gallery-grid,
    .gallery-images,
    .categories-list,
    .models-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 460px) {
    .site-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-nav a {
        text-align: center;
    }

    .gallery-grid,
    .gallery-images,
    .categories-list,
    .models-list {
        grid-template-columns: 1fr;
    }
}
