:root {
    --bg: #252220;
    --mat: #151210;
    --panel: #151210;
    --text: #959290;
    --bright: #fff;
    --accent: #b43414;
    --hover: #8a8582;
    --side: 72px;
    --cell: 220px;
    --gap: 36px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 13px/1.5 Verdana, Geneva, Tahoma, sans-serif;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--bright); }

.site-header {
    display: flex;
    align-items: baseline;
    gap: 32px;
    padding: 18px var(--side);
    background: #000;
    border-bottom: 1px solid var(--panel);
}
.site-name { color: var(--bright); font-size: 20px; letter-spacing: 0.08em; text-transform: uppercase; }
.site-header nav a { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }

main { flex: 1; padding: 16px var(--side) 40px; }

.site-footer { padding: 16px var(--side); border-top: 1px solid var(--panel); font-size: 11px; }

h1 { margin: 0 0 16px; color: var(--bright); font-size: 18px; font-weight: normal; }

.breadcrumbs { min-height: 20px; margin-bottom: 4px; font-size: 11px; }
.breadcrumbs a { color: var(--accent); }
.breadcrumbs .divider { margin: 0 6px; color: var(--accent); }

.home-links { padding: 0; list-style: none; font-size: 15px; }

/* Folder contents */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cell), 1fr)); gap: var(--gap); }
.tile { display: flex; flex-direction: column; }
.tile img, .tile-empty {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    background: var(--mat);
    border: 7px solid var(--mat);
}
.tile:hover img, .tile:hover .tile-empty { border-color: var(--hover); }
.tile-folder img { box-shadow: 6px 6px 0 -1px var(--bg), 6px 6px 0 0 var(--mat); }
.tile-title { margin-top: 8px; color: var(--bright); }
.tile-summary { font-size: 11px; }

/* Album: grid of equal square cells, each photo fitted whole inside its cell */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cell), 1fr)); gap: calc(var(--gap) - 18px) var(--gap); }
.photo { display: flex; flex-direction: column; align-items: center; }
.photo-cell { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.photo-cell img {
    display: block;
    width: calc(100% * min(1, var(--ar)));
    height: auto;
    aspect-ratio: var(--ar);
    border: 7px solid var(--mat);
    background: var(--mat);
}
.photo:hover img { border-color: var(--hover); }
.photo-title {
    max-width: 100%;
    height: 18px;
    color: var(--bright);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Single photo */
.photo-view { display: flex; flex-direction: column; align-items: center; }
.photo-stage { position: relative; }
.photo-stage img { display: block; max-width: 100%; width: auto; height: auto; max-height: calc(100vh - 190px); }
.photo-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: var(--bright);
    font-size: 48px;
    opacity: 0;
}
.photo-nav:hover { opacity: 0.85; }
.photo-prev { left: 0; }
.photo-next { right: 0; justify-content: flex-end; }
.photo-caption { display: flex; gap: 16px; margin: 10px 0 0; }
.photo-caption-title { color: var(--bright); }

@media (max-width: 600px) {
    :root { --cell: 140px; --side: 16px; --gap: 18px; }
}
