/* 4KGal - Clean Image Gallery */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #0a0a0a;
    --card-bg: #141414;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #d4145a;
    --accent2: #fbb03b;
    --border: #222;
    --radius: 10px;
    --nav-height: 60px;
    --ad-bg: #111;
}

html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ===== Top Bar ===== */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--nav-height);
    background: rgba(10,10,10,0.95);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 16px;
}
.topbar .logo {
    font-size: 22px; font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-decoration: none; letter-spacing: 1px;
}
.topbar .nav { display: flex; gap: 6px; margin-left: auto; overflow-x: auto; }
.topbar .nav a {
    color: var(--text-muted); text-decoration: none;
    font-size: 13px; padding: 6px 14px; border-radius: 20px;
    white-space: nowrap; transition: all 0.2s;
}
.topbar .nav a:hover, .topbar .nav a.active {
    color: #fff; background: var(--accent);
}
.menu-toggle { display: none; color: #fff; font-size: 24px; cursor: pointer; background: none; border: none; margin-left: auto; }

/* ===== Main ===== */
.main { margin-top: var(--nav-height); max-width: 1400px; margin-left: auto; margin-right: auto; padding: 16px; }

/* ===== Ad Placements ===== */
.ad-block {
    background: var(--ad-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 13px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ad-block-inline {
    min-height: 250px;
    margin: 20px 0;
}
.ad-sidebar {
    min-height: 300px;
    margin-bottom: 20px;
}

/* ===== Grid ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    background: #1a1a1a;
    overflow: hidden;
}
.card-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.3s;
}
.card:hover .card-cover img { transform: scale(1.05); }
.card-cover .overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 30px 12px 12px;
}
.card-cover .badge {
    background: var(--accent); color: #fff;
    font-size: 11px; padding: 2px 8px; border-radius: 4px;
    font-weight: 600;
}
.card-cover .photo-count {
    color: #fff; font-size: 12px; margin-left: 8px;
}
.card-body { padding: 12px; }
.card-body h3 {
    font-size: 14px; font-weight: 600;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 6px;
    line-height: 1.3;
}
.card-body h3 a { color: var(--text); text-decoration: none; }
.card-body h3 a:hover { color: var(--accent); }
.card-meta {
    display: flex; justify-content: space-between;
    color: var(--text-muted); font-size: 12px;
}

/* ===== Page Header ===== */
.page-header { margin: 20px 0 10px; }
.page-header h1 { font-size: 24px; font-weight: 700; }
.page-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 30px 0; }
.pagination a, .pagination span {
    padding: 8px 16px; border-radius: 6px;
    background: var(--card-bg); color: var(--text);
    text-decoration: none; font-size: 14px;
    border: 1px solid var(--border);
}
.pagination a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== Detail Page ===== */
.detail-header { margin-bottom: 20px; }
.detail-header h1 { font-size: 22px; }
.detail-header .tags { margin-top: 8px; }
.detail-header .tags a {
    color: var(--accent2); text-decoration: none;
    font-size: 13px; margin-right: 12px;
}
.detail-header .tags a:hover { text-decoration: underline; }

.image-grid {
    display: grid; gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.image-grid img {
    width: 100%; border-radius: 6px;
    cursor: pointer; transition: opacity 0.2s;
}
.image-grid img:hover { opacity: 0.9; }

/* ===== Review/Article ===== */
.article { max-width: 800px; margin: 0 auto; padding: 20px 0; }
.article h1 { font-size: 28px; margin-bottom: 12px; }
.article .meta { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.article p { margin-bottom: 16px; font-size: 16px; line-height: 1.8; }
.article .promo-link {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff; padding: 12px 30px; border-radius: 30px;
    text-decoration: none; font-weight: 700; font-size: 16px;
    margin: 16px 0;
}
.article .promo-link:hover { transform: scale(1.05); }

/* ===== Footer ===== */
.footer {
    text-align: center; padding: 30px;
    color: var(--text-muted); font-size: 13px;
    border-top: 1px solid var(--border); margin-top: 40px;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .topbar .nav { display: none; }
    .topbar .nav.open { display: flex; position: absolute; top: var(--nav-height); left: 0; right: 0; background: rgba(10,10,10,0.98); flex-direction: column; padding: 12px; border-bottom: 1px solid var(--border); }
    .menu-toggle { display: block; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .main { padding: 10px; }
    .image-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .card-body h3 { font-size: 12px; }
}
