/*
/opt/norskdate/static/style.css
Norsk Date v2.5 — финальный CSS
*/
:root {
    --bg: #020208;
    --surface: rgba(18, 18, 35, 0.55);
    --surface-hover: rgba(25, 25, 50, 0.7);
    --text: #eaeaf2;
    --text-dim: #8888a8;
    --accent: #a855f7;
    --accent2: #ec4899;
    --border: rgba(255, 255, 255, 0.05);
    --radius-sm: 12px;
    --radius: 18px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 12px);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-weight: 400; line-height: 1.5; min-height: 100dvh; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

.animated-bg {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(ellipse at 20% 20%, rgba(168,85,247,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 80%, rgba(236,72,153,0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, rgba(100,100,180,0.04) 0%, transparent 70%);
    animation: bg-drift 30s ease-in-out infinite;
}
@keyframes bg-drift { 0%,100% { transform: translate(0,0); } 25% { transform: translate(-20px,10px); } 50% { transform: translate(15px,-15px); } 75% { transform: translate(-10px,-5px); } }

.header { position: sticky; top: 0; z-index: 100; display: flex; flex-direction: column; padding: 8px 12px; background: rgba(2,2,8,0.9); border-bottom: 1px solid var(--border); gap: 8px; }
.header-top { display: flex; align-items: center; justify-content: space-between; }
.header-logo { font-size: 18px; font-weight: 700; background: linear-gradient(135deg, var(--accent2), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; text-decoration: none; white-space: nowrap; }
.header-bottom { display: flex; align-items: center; gap: 8px; }
.search-form { flex: 1; }
.search-input { width: 100%; padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; color: var(--text); font-size: 14px; font-family: var(--font); outline: none; }
.search-input::placeholder { color: var(--text-dim); }
.header-back { color: var(--accent); text-decoration: none; font-size: 14px; padding: 8px 0; min-width: 44px; min-height: 44px; display: flex; align-items: center; }

.breadcrumbs { max-width: 680px; margin: 0 auto; padding: 12px 20px; font-size: 12px; color: var(--text-dim); position: relative; z-index: 1; }
.breadcrumbs a { color: var(--text-dim); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

.intro-text { max-width: 680px; margin: 0 auto 16px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; line-height: 1.7; color: var(--text-dim); position: relative; z-index: 1; }

.container { max-width: 680px; margin: 0 auto; padding: 20px 12px; position: relative; z-index: 1; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
.card:active { transform: scale(0.97); }
.card-photo { height: 170px; background: var(--surface); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.card-img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.card-avatar { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: var(--text-dim); z-index: 1; }
.card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.card-body h3 { font-size: 14px; font-weight: 600; }
.card-location { font-size: 11px; color: var(--text-dim); }
.card-bio { font-size: 11px; color: var(--text-dim); line-height: 1.4; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@keyframes fadeUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
.card { animation: fadeUp 0.5s ease both; }
.card:nth-child(1){animation-delay:0.02s} .card:nth-child(2){animation-delay:0.06s}
.card:nth-child(3){animation-delay:0.10s} .card:nth-child(4){animation-delay:0.14s}
.card:nth-child(5){animation-delay:0.18s} .card:nth-child(6){animation-delay:0.22s}
.card:nth-child(7){animation-delay:0.26s} .card:nth-child(8){animation-delay:0.30s}
.card:nth-child(9){animation-delay:0.34s} .card:nth-child(10){animation-delay:0.38s}
.card:nth-child(11){animation-delay:0.42s} .card:nth-child(12){animation-delay:0.46s}

.load-more { text-align: center; margin-top: 24px; position: relative; z-index: 1; }
.btn-secondary { display: inline-block; padding: 12px 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 14px; transition: background 0.2s; cursor: pointer; }
.btn-secondary:hover { background: var(--surface-hover); }

.profile-header { text-align: center; padding: 20px; position: relative; z-index: 1; }
.profile-photo-img { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius); margin-bottom: 20px; }
.avatar-large { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(236,72,153,0.12)); border: 2px solid transparent; background-clip: padding-box; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 26px; font-weight: 700; color: var(--text-dim); position: relative; }
.avatar-large::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); z-index: -1; }
.profile-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 2px; }
.profile-loc { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }
.profile-stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.profile-stats span { background: var(--surface); padding: 6px 12px; border-radius: 10px; font-size: 12px; color: var(--text-dim); border: 1px solid var(--border); }
.profile-bio { max-width: 460px; margin: 20px auto; padding: 0 20px; font-size: 14px; line-height: 1.7; color: var(--text-dim); text-align: center; position: relative; z-index: 1; }

.similar-section { max-width: 680px; margin: 40px auto; padding: 0 20px; position: relative; z-index: 1; }
.similar-section h2 { font-size: 18px; margin-bottom: 16px; }

.posts-section { max-width: 460px; margin: 0 auto; padding: 0 20px 120px; position: relative; z-index: 1; }
.posts-section h2 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
a.post-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 8px; text-decoration: none; color: var(--text); transition: border-color 0.2s; }
a.post-card:hover { border-color: rgba(168,85,247,0.25); }
.post-body { font-size: 13px; line-height: 1.6; margin-bottom: 6px; }
.post-date { font-size: 10px; color: var(--text-dim); }
.posts-empty { text-align: center; color: var(--text-dim); padding: 40px 0; font-size: 14px; }

/* Лента /siste */
.feed-list { display: flex; flex-direction: column; gap: 16px; max-width: 600px; margin: 0 auto; }
.feed-post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; transition: border-color 0.2s; }
.feed-post:hover { border-color: rgba(168,85,247,0.3); }
.feed-post-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.feed-post-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.feed-post-avatar-placeholder { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(236,72,153,0.12)); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: var(--text-dim); }
.feed-post-meta { display: flex; flex-direction: column; }
.feed-post-author { font-weight: 600; font-size: 14px; color: var(--accent); text-decoration: none; }
.feed-post-author:hover { text-decoration: underline; }
.feed-post-date { font-size: 11px; color: var(--text-dim); }
.feed-post-body { font-size: 14px; line-height: 1.7; color: var(--text); white-space: pre-line; }

.post-author { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.post-author-ava { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(236,72,153,0.12)); border: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: var(--text-dim); flex-shrink: 0; }
.post-author-name { font-weight: 600; font-size: 14px; color: var(--text); }

.bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 14px calc(10px + var(--safe-bottom)); background: linear-gradient(transparent, var(--bg) 35%); z-index: 50; }
.btn { display: block; width: 100%; max-width: 460px; margin: 0 auto; padding: 15px; background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 16px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; box-shadow: 0 6px 28px rgba(168,85,247,0.3); animation: btn-glow 2.5s ease-in-out infinite; }
.btn:active { transform: scale(0.97); }
@keyframes btn-glow { 0%,100%{box-shadow:0 6px 28px rgba(168,85,247,0.3)} 50%{box-shadow:0 8px 38px rgba(236,72,153,0.4)} }

.post-page { max-width: 460px; margin: 0 auto; padding: 20px 16px 120px; position: relative; z-index: 1; }
.post-content { font-size: 15px; line-height: 1.8; }
.post-page h1 { font-size: 24px; margin-bottom: 20px; }

.page-title { font-size: 24px; margin-bottom: 24px; }
.blog-list { display: flex; flex-direction: column; gap: 12px; }
.blog-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; text-decoration: none; color: var(--text); transition: border-color 0.2s; }
.blog-card:hover { border-color: rgba(168,85,247,0.25); }
.blog-card h3 { font-size: 18px; margin-bottom: 8px; }
.blog-card p { font-size: 14px; color: var(--text-dim); line-height: 1.6; }
.blog-date { font-size: 11px; color: var(--text-dim); margin-top: 8px; display: block; }

.static-page { max-width: 460px; margin: 0 auto; padding: 32px 20px; position: relative; z-index: 1; }
.static-page h1 { font-size: 24px; margin-bottom: 20px; }
.static-page h2 { font-size: 18px; margin: 20px 0 10px; color: var(--accent); }
.static-page ul { list-style: none; padding: 0; }
.static-page li { padding: 4px 0; }
.static-page li a { color: var(--text-dim); text-decoration: none; }
.static-page li a:hover { color: var(--accent); }
.static-content { font-size: 14px; line-height: 1.8; color: var(--text-dim); }

.empty-state { text-align: center; padding: 80px 20px; position: relative; z-index: 1; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h2 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--text-dim); margin-bottom: 24px; }

.footer { text-align: center; padding: 20px 16px 40px; font-size: 11px; color: rgba(255,255,255,0.15); position: relative; z-index: 1; }
.footer-links { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.2); text-decoration: none; margin: 0 6px; }
.footer-links a:hover { color: var(--accent); }
.footer-tags { margin-bottom: 8px; }
.footer-tags a { color: rgba(255,255,255,0.1); text-decoration: none; margin: 0 4px; font-size: 10px; }
.footer-tags a:hover { color: var(--accent); }
.footer-count { font-size: 10px; color: rgba(255,255,255,0.1); margin-bottom: 4px; }

@media (min-width: 640px) {
    .header { flex-direction: row; align-items: center; padding: 8px 20px; gap: 12px; background: rgba(2,2,8,0.8); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); }
    .header-top { display: contents; }
    .header-bottom { display: contents; }
    .header-logo { font-size: 20px; }
    .search-input { width: 180px; flex: none; }
    .search-input:focus { width: 240px; }
    .card { backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
    .card:hover { transform: translateY(-4px); box-shadow: 0 16px 48px rgba(168,85,247,0.15); border-color: rgba(168,85,247,0.4); }
    .container { max-width: 720px; }
    .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .card-photo { height: 200px; }
    .card-body h3 { font-size: 15px; }
    .profile-photo-img { max-height: 450px; }
    .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 36px rgba(168,85,247,0.45); }
}

@media (min-width: 1024px) {
    .container { max-width: 960px; }
    .grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
    .card-photo { height: 230px; }
    .card-body { padding: 16px; }
    .card-body h3 { font-size: 16px; }
    .profile-photo-img { max-height: 500px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }