/* ==========================================================================
   İçerik platformu: akış, kartlar, profil, içerik penceresi, yorumlar, yönlendirme
   (app.css tasarım değişkenlerini kullanır)
   ========================================================================== */

.posts-page { width: min(100% - 2 * var(--gutter), var(--max)); margin: 0 auto; padding: 32px 0 64px; }
.posts-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 18px; }
.posts-head__title { margin: 0 0 4px; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.02em; }
.posts-head p { margin: 0; }
.posts-search { position: relative; flex: 0 1 360px; min-width: 0; }
.posts-search .input { width: 100%; padding-left: 42px; }
.posts-search__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.posts-sort { margin-bottom: 22px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------- kartlar */

.post-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: 22px 18px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}
.post-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.post-card__link { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; border-radius: var(--radius-md); }
.post-card__cover {
    position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden;
    border-radius: var(--radius-md); background: var(--surface-solid); border: 1px solid var(--border);
}
.post-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-cine) var(--ease); }
.post-card__link:hover .post-card__cover img, .post-card__link:focus-visible .post-card__cover img { transform: scale(1.04); }
.post-card__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.post-card__placeholder {
    display: grid; place-items: center; width: 100%; height: 100%;
    font-size: 64px; font-weight: 800; color: var(--text-3);
    background: radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%), var(--bg-2);
}
.post-badge {
    position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
    background: rgba(8, 9, 11, .78); color: var(--text-1); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.post-badge .icon { width: 14px; height: 14px; color: var(--accent); }
.post-badge--free .icon, .post-badge--owned .icon { color: var(--success); }
.post-badge--expired { color: var(--text-2); }
.post-badge--expired .icon { color: var(--text-3); }
.post-card__body { display: flex; flex-direction: column; gap: 4px; padding: 0 2px; }
.post-card__title { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--text-3); font-size: 13px; }
.post-card__stats > span { display: inline-flex; align-items: center; gap: 4px; }
.post-card__peek { color: var(--text-2); }
.post-card__creator { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 2px; color: var(--text-2); font-size: 14px; text-decoration: none; }
.post-card__creator:hover { color: var(--text-1); }
.post-card__creator > span:not(.post-avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-verified { color: var(--info); }

.post-avatar {
    --size: 44px;
    flex: none; display: inline-grid; place-items: center; width: var(--size); height: var(--size);
    border-radius: 50%; overflow: hidden; font-weight: 800; font-size: calc(var(--size) * .38);
    background: var(--surface-2); color: var(--text-1); border: 1px solid var(--border);
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-avatar--xs { --size: 28px; }
.post-avatar--lg { --size: 72px; }
.post-avatar--xl { --size: 148px; }

/* ---------------------------------------------------------------- üretici profili (kapak + yuvarlak logo) */

.profile { width: min(100% - 2 * var(--gutter), var(--max)); margin: 0 auto; padding-bottom: 64px; }
.profile__banner {
    position: relative; margin: 16px 0 0; aspect-ratio: 3 / 1; max-height: 340px; width: 100%;
    border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-2); border: 1px solid var(--border);
}
.profile__banner[data-empty] { background: radial-gradient(circle at 20% 10%, var(--accent-soft), transparent 55%), linear-gradient(135deg, var(--bg-2), var(--bg-1)); }
.profile__banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile__head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: calc(-148px / 2); padding: 0 8px 28px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.profile__avatar { border: 4px solid var(--bg-0); box-shadow: var(--shadow); position: relative; }
.profile__name { margin: 14px 0 2px; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 8px; }
.profile__name .icon { width: 24px; height: 24px; }
.profile__head > .muted { margin: 0; }
.profile__bio {
    width: min(100%, 640px); margin: 16px auto 0; padding: 14px 18px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-1);
    color: var(--text-2); line-height: 1.55; text-align: left;
}
.profile__bio p { margin: 0; }
.profile__bio p + p { margin-top: 8px; }
.profile__socials { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 0; padding: 0; }
.profile__socials a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-2); }
.profile__socials a:hover { color: var(--text-1); border-color: var(--border-strong); }
.profile__socials .icon { width: 18px; height: 18px; }
.profile__stats { margin: 14px 0 0; color: var(--text-2); }
.profile__stats strong { color: var(--text-1); }
.profile__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.profile__actions form { margin: 0; }
@media (max-width: 640px) {
    .profile__banner { border-radius: var(--radius-md); aspect-ratio: 2 / 1; }
    .post-avatar--xl { --size: 108px; }
    .profile__head { margin-top: -54px; }
}

/* ---------------------------------------------------------------- üretici listesi */

.creator-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.creator-card a {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; height: 100%;
    padding: 0 16px 18px; border-radius: var(--radius-md); overflow: hidden; color: inherit; text-decoration: none;
    background: var(--surface-1); border: 1px solid var(--border); transition: border-color var(--dur-std) var(--ease), transform var(--dur-std) var(--ease);
}
.creator-card a:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.creator-card__banner { display: block; width: calc(100% + 32px); margin: 0 -16px; aspect-ratio: 3 / 1; background: var(--bg-2); }
.creator-card__banner[data-empty] { background: linear-gradient(135deg, var(--accent-soft), var(--bg-2)); }
.creator-card__banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.creator-card__avatar { margin-top: -36px; border: 3px solid var(--bg-1); }
.creator-card__name { margin-top: 8px; font-weight: 800; font-size: 17px; display: inline-flex; align-items: center; gap: 6px; }
.creator-card__bio { color: var(--text-2); }
.creator-card__stats { margin-top: 6px; color: var(--text-3); }
.creator-card__stats strong { color: var(--text-1); }

/* ---------------------------------------------------------------- içerik ayrıntısı (sayfa + pencere) */

.post-crumbs { width: min(100% - 2 * var(--gutter), var(--max)); margin: 20px auto 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-crumbs a { color: var(--text-2); }
.post-page { width: min(100% - 2 * var(--gutter), 1180px); margin: 14px auto 64px; }

.post-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.post-detail__media {
    position: sticky; top: calc(var(--header-h) + 16px);
    aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-solid); border: 1px solid var(--border);
}
.post-detail__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-detail__side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.post-detail__creator { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.post-detail__creator > span:last-child { display: flex; flex-direction: column; }
.post-detail__creator strong { display: inline-flex; align-items: center; gap: 6px; }
.post-detail__title { margin: 0; font-size: clamp(22px, 3vw, 32px); line-height: 1.2; letter-spacing: -.015em; overflow-wrap: anywhere; }
.post-detail__summary { margin: 0; color: var(--text-2); line-height: 1.6; overflow-wrap: anywhere; }

.post-buy { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius-md); background: var(--surface-1); border: 1px solid var(--border); }
.post-buy form { margin: 0; }
.post-buy__state { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text-1); }
.post-buy__state .icon { color: var(--success); width: 20px; height: 20px; }
.post-buy__state.is-expired .icon { color: var(--text-3); }
.post-buy__hint { margin: 0; }
.btn--block { width: 100%; justify-content: center; }

.post-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.post-action {
    display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px;
    border-radius: 999px; border: 1px solid var(--border); background: var(--surface-1);
    color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: color var(--dur-micro), border-color var(--dur-micro), background var(--dur-micro);
}
.post-action:hover { color: var(--text-1); border-color: var(--border-strong); }
.post-action .icon { width: 18px; height: 18px; }
.post-action.is-on { color: #ff6b8a; border-color: rgba(255, 107, 138, .45); background: rgba(255, 107, 138, .1); }
.post-action.is-pop .icon { animation: post-pop .35s var(--ease); }
.post-action--end { margin-left: auto; }
.post-action:disabled { opacity: .5; cursor: not-allowed; }
@keyframes post-pop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }

@media (max-width: 860px) {
    .post-detail { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .post-detail__media { position: static; max-width: 520px; width: 100%; margin: 0 auto; }
}

/* ---------------------------------------------------------------- yorumlar (iç içe) */

.comments { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; border-top: 1px solid var(--border); }
.comments__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.comments__title { margin: 0; font-size: 18px; }
.comments__empty { margin: 0; }
.comments__more { align-self: center; }

.comment-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.comment-form textarea {
    width: 100%; min-height: 46px; resize: vertical; padding: 11px 14px; font: inherit; color: var(--text-1);
    background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.comment-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.comment-form__error { grid-column: 1 / -1; margin: 0; }
.comment-form--reply { margin-top: 8px; grid-template-columns: minmax(0, 1fr) auto auto; }
@media (max-width: 520px) {
    .comment-form, .comment-form--reply { grid-template-columns: minmax(0, 1fr) auto; }
    .comment-form--reply textarea { grid-column: 1 / -1; }
}

.comment-list, .comment__children { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.comment__children:empty { display: none; }
.comment__children { margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--border); }
.comment__children:hover { border-left-color: var(--border-strong); }
.comment__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.comment__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.comment__author { font-size: 14px; }
.comment__badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--accent-soft); color: var(--accent); }
.comment__body { margin: 0; color: var(--text-1); line-height: 1.5; overflow-wrap: anywhere; white-space: normal; }
.comment.is-removed > .comment__main .comment__body { color: var(--text-3); font-style: italic; }
.comment__actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: -8px; }
.comment__act {
    display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 8px;
    border: 0; border-radius: 999px; background: none; color: var(--text-3); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.comment__act:hover { color: var(--text-1); background: var(--surface-1); }
.comment__act.is-on { color: #ff6b8a; }
.comment__act--danger:hover { color: var(--danger); }
.comment.is-new > .comment__main { animation: comment-in 1.6s var(--ease); border-radius: var(--radius-xs); }
@keyframes comment-in { 0% { background: var(--accent-soft); } 100% { background: transparent; } }

/* ---------------------------------------------------------------- açılır pencere */

.post-modal {
    width: min(100% - 24px, 1120px); max-height: calc(100dvh - 32px); padding: 0;
    border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
    background: var(--bg-1); color: var(--text-1); box-shadow: var(--shadow); overflow: hidden;
}
.post-modal::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.post-modal[open] { animation: modal-in var(--dur-std) var(--ease); }
.post-modal__body { max-height: calc(100dvh - 34px); overflow-y: auto; overscroll-behavior: contain; padding: 24px; }
.post-modal__close {
    position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; place-items: center; width: 42px; height: 42px;
    border-radius: 50%; border: 1px solid var(--border-strong); background: rgba(8, 9, 11, .8); color: var(--text-1); cursor: pointer;
}
.post-modal__close .icon { width: 20px; height: 20px; }
.post-modal__loading { margin: 0; padding: 64px 16px; text-align: center; color: var(--text-2); }
.post-modal .post-detail__media { top: 0; }
html.has-post-modal { overflow: hidden; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
    .post-modal { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
    .post-modal__body { max-height: 100dvh; padding: 60px 16px 24px; }
}

/* ---------------------------------------------------------------- yönlendirme sayfası */

.go-page { display: grid; place-items: center; min-height: calc(100dvh - var(--header-h) - 120px); padding: 32px var(--gutter); }
.go-card { width: min(100%, 460px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 28px 24px; }
.go-card__cover { width: 120px; height: 150px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.go-card__title { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.go-card__text { margin: 0; color: var(--text-2); }
.go-card__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.go-card__note { margin: 6px 0 0; }
.go-card p { margin: 0; }
.go-ring { position: relative; width: 84px; height: 84px; margin: 8px 0 4px; }
.go-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.go-ring circle { fill: none; stroke: var(--border-strong); stroke-width: 3.5; }
.go-ring .go-ring__bar { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 125.7; stroke-dashoffset: 0; }
.go-page.is-running .go-ring__bar { animation: go-ring var(--go-total, 10s) linear forwards; }
.go-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 800; }
@keyframes go-ring { to { stroke-dashoffset: 125.7; } }
@media (prefers-reduced-motion: reduce) {
    .go-page.is-running .go-ring__bar, .post-modal[open], .post-action.is-pop .icon, .comment.is-new > .comment__main { animation: none; }
}

/* ---------------------------------------------------------------- Stüdyo ve yönetim */

.post-cover-art { aspect-ratio: 4 / 5; }
.post-edit-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 20px; align-items: flex-start; }
.post-edit-head__title { margin: 8px 0 4px; font-size: 22px; }
.post-edit-head p { margin: 4px 0 0; }
.post-edit-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.post-edit-head__actions form { margin: 0; }
.post-form { display: flex; flex-direction: column; gap: 18px; margin-top: 18px; }
.post-form__peek { margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--border-strong); }
.cover-drop {
    display: grid; place-items: center; width: min(100%, 240px); aspect-ratio: 4 / 5; overflow: hidden; cursor: pointer;
    border: 2px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--bg-1); color: var(--text-2);
}
.cover-drop:hover { border-color: var(--accent); color: var(--text-1); }
.cover-drop__preview, .cover-drop__preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.cover-drop__empty { display: inline-flex; align-items: center; gap: 8px; padding: 12px; text-align: center; }
.post-form__cover input[type="file"] { margin-top: 10px; }
.post-delete { margin-top: 24px; }

.admin-posts { display: flex; flex-direction: column; gap: 14px; }
.admin-post { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-post__cover { display: block; aspect-ratio: 4 / 5; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-2); }
.admin-post__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-post__title { margin: 8px 0 4px; font-size: 18px; overflow-wrap: anywhere; }
.admin-post__title a { color: inherit; }
.admin-post__summary { color: var(--text-2); }
.admin-post__link { display: block; margin-top: 6px; font-family: ui-monospace, monospace; font-size: 13px; overflow-wrap: anywhere; color: var(--text-1); }
.admin-post__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.admin-post__actions form { margin: 0; }
.admin-post__reject { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-post__reject .input { width: min(100%, 300px); min-height: 36px; }
.toolbar__search .input { min-height: 40px; }
@media (max-width: 560px) {
    .admin-post { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
}

.admin-creator__logo { display: block; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin: 4px 0 8px; border: 1px solid var(--border); }
.admin-creator__banner { display: block; width: 240px; max-width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; border-radius: var(--radius-xs); margin: 4px 0 8px; border: 1px solid var(--border); }
.post-report { margin: -6px 0 0; }
.post-report a { color: var(--text-3); }
.post-report a:hover { color: var(--text-1); }
.post-buy__legal { margin: 2px 0 0; font-size: 12px; line-height: 1.5; }
.post-buy__legal a { color: var(--text-2); }

/* Yönetim: ada göre profil bilgisi önerisi */
.profile-lookup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -4px 0 18px; }
.profile-lookup > .muted { flex: 1 1 260px; min-width: 0; }
.profile-lookup__list { list-style: none; margin: 4px 0 0; padding: 0; flex: 1 1 100%; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.profile-lookup__list li { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-1); }
.profile-lookup__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.profile-lookup__source { font-size: 12px; color: var(--text-3); }
a.profile-lookup__source:hover { color: var(--text-1); }
.profile-lookup__tagline { margin: 0; color: var(--text-1); }
.profile-lookup__bio { margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.profile-lookup__list .btn { margin-top: 4px; }
.profile-lookup__url { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.profile-lookup__url .input { flex: 1 1 260px; min-width: 0; min-height: 40px; }
.profile-lookup__links { flex: 1 1 100%; margin: 0; }
.profile-lookup__links a { color: var(--text-1); }
