:root {
    --app-bg: #fafafa;
    --app-border: #dbdbdb;
    --app-text: #262626;
    --app-muted: #737373;
    --app-card: #ffffff;
}
* { box-sizing: border-box; }
body { background: var(--app-bg); color: var(--app-text); min-height: 100vh; display: flex; flex-direction: column; }
.app-container { max-width: 1180px; }
.lang-select { width: 150px; }
.hero-box, .admin-card, .empty-box { background: var(--app-card); border: 1px solid var(--app-border); border-radius: 16px; padding: 24px; }
.empty-box { text-align: center; padding: 70px 20px; color: var(--app-muted); }
.empty-box i { font-size: 52px; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.post-tile { position: relative; aspect-ratio: 1 / 1; border: 0; padding: 0; overflow: hidden; background: #eee; cursor: pointer; }
.post-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease, filter .25s ease; }
.post-tile:hover img { transform: scale(1.04); filter: brightness(.75); }
.post-tile-badge { position: absolute; top: 10px; right: 10px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.55); font-size: 20px; }
.post-modal-content { border-radius: 16px; overflow: hidden; border: 0; }
.modal-close { position: absolute; right: 12px; top: 12px; z-index: 20; background-color: rgba(255,255,255,.8); border-radius: 50%; padding: 10px; }
.post-modal-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(360px, .55fr); min-height: 680px; max-height: 86vh; }
.post-media-panel { background: #000; display: flex; align-items: center; justify-content: center; min-width: 0; }
.post-carousel, .post-carousel .carousel-inner, .post-carousel .carousel-item { width: 100%; height: 100%; }
.post-carousel img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.post-side-panel { background: #fff; display: flex; flex-direction: column; min-height: 0; }
.post-side-header { display: flex; gap: 12px; align-items: center; padding: 16px; border-bottom: 1px solid var(--app-border); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: #111; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.post-caption { padding: 16px; white-space: pre-wrap; line-height: 1.65; border-bottom: 1px solid var(--app-border); }
.post-comments { padding: 12px 16px; overflow-y: auto; flex: 1; }
.comment-item { margin-bottom: 14px; line-height: 1.5; word-break: break-word; }
.comment-name { font-weight: 700; margin-right: 6px; }
.comment-date { color: var(--app-muted); font-size: 12px; margin-top: 2px; }
.comment-form { padding: 12px 16px 16px; }
.site-footer { margin-top: auto; border-top: 1px solid var(--app-border); background: #fff; color: var(--app-muted); font-size: 13px; padding: 18px 0; line-height: 1.7; }
.admin-body { background: #f5f5f5; }
.login-card { max-width: 420px; margin-top: 8vh; }
.selected-preview { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.selected-preview img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--app-border); }
.admin-post-list { display: flex; flex-direction: column; gap: 12px; max-height: 640px; overflow-y: auto; }
.admin-post-item { display: grid; grid-template-columns: 76px 1fr; gap: 12px; border: 1px solid var(--app-border); border-radius: 12px; padding: 10px; background: #fff; }
.admin-post-item img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; background: #eee; }
.admin-post-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.text-alert-ok { color: #198754; }
.text-alert-bad { color: #dc3545; }

@media (max-width: 991px) {
    .post-modal-layout { grid-template-columns: 1fr; max-height: none; min-height: 0; }
    .post-media-panel { height: 62vh; }
    .post-side-panel { min-height: 38vh; max-height: none; }
    .post-comments { max-height: 240px; flex: none; }
}
@media (max-width: 767px) {
    .app-container { padding-left: 10px; padding-right: 10px; }
    .navbar-brand { font-size: 16px; }
    .lang-select { width: 122px; }
    .post-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
    .hero-box, .admin-card, .empty-box { border-radius: 12px; padding: 16px; }
    .post-modal-content { border-radius: 0; }
    .post-media-panel { height: 56vh; }
    .selected-preview { grid-template-columns: repeat(4, 1fr); }
}
