*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #000;
  --acc:     #ffffff;
  --dim:     #b0b0b0;
  --faint:   #d8d8d8;
  --font:    'EB Garamond', Georgia, serif;
  --sidebar: 250px;
}

html {
  background: var(--bg);
  color: var(--acc);
  font-family: var(--font);
  font-size: 16px;
  scrollbar-width: thin;
  scrollbar-color: #333 #000;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #000;
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
  background: #666;
}

body { background: var(--bg); min-height: 100vh; }
.hidden { display: none !important; }
a { text-decoration: none; }

.login-page {
  position: fixed; inset: 0; background: #000;
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.login-box {
  display: flex; flex-direction: column; align-items: center;
  gap: 36px; width: 100%; max-width: 320px; padding: 0 24px;
}
.login-title {
  font-family: var(--font); font-weight: 400; font-style: normal;
  font-size: clamp(2.8rem, 10vw, 4.2rem); color: var(--acc);
  letter-spacing: 0.08em; text-align: center;
}
#login-form { display: flex; flex-direction: column; gap: 16px; width: 100%; }
#login-form input {
  background: transparent; border: none; border-bottom: 1px solid #666;
  color: var(--acc); font-family: var(--font); font-size: 1.15rem;
  padding: 9px 0; outline: none; width: 100%; letter-spacing: 0.04em;
}
#login-form input:focus { border-bottom-color: var(--acc); }
#login-form input::placeholder { color: #999; }
.login-buttons-group {
  display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px;
}
#btn-author-login {
  background: transparent; border: 1px solid var(--dim);
  color: var(--acc); font-family: var(--font); font-size: 1rem;
  padding: 11px 0; cursor: pointer; letter-spacing: 0.12em;
  transition: background .2s, color .2s, border-color .2s;
  width: 100%;
}
#btn-author-login:hover:not(:disabled) { background: var(--acc); color: #000; }
#btn-author-login:disabled { opacity: 0.4; cursor: not-allowed; border-color: #444; color: #777; }
.reader-login-btn {
  background: transparent; border: 1px solid #555;
  color: #c0c0c0; font-family: var(--font); font-size: 0.94rem;
  padding: 10px 0; cursor: pointer; letter-spacing: 0.12em;
  transition: background .2s, color .2s, border-color .2s;
  width: 100%;
}
.reader-login-btn:hover { border-color: #999; color: #fff; background: rgba(255,255,255,0.06); }
#login-error { color: #ff6b6b; font-size: 0.85rem; text-align: center; min-height: 18px; line-height: 1.4; }

.main-site { background: var(--bg); min-height: 100vh; }

/* HERO */
.hero-wrap {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url('bg-desktop.png') right top / cover no-repeat;
}
.hero-fade {
  position: absolute; bottom: 0; left: 0; right: 0; height: 55%;
  background: linear-gradient(to bottom, transparent, #000);
}

@media (max-width: 600px) {
  .hero-bg { background-image: url('bg-mobile.png'); background-position: right top; }
}

.layout {
  position: relative; z-index: 1;
  display: flex; min-height: 100vh;
}

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  min-height: 100vh;
}
.sidebar-inner {
  position: sticky; top: 0;
  padding: 52px 0 52px 44px;
  display: flex; flex-direction: column; gap: 0;
  min-height: 100vh;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.role-badge {
  font-size: 0.74rem;
  color: #999;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.logout-btn {
  background: transparent;
  border: 1px solid #444;
  color: #aaa;
  font-family: var(--font);
  font-size: 0.8rem;
  padding: 6px 14px;
  cursor: pointer;
  letter-spacing: 0.08em;
  width: fit-content;
  transition: color .2s, border-color .2s;
}
.logout-btn:hover {
  border-color: #888;
  color: #fff;
}

.site-title {
  font-family: var(--font); font-weight: 300; font-style: normal;
  font-size: clamp(2.6rem, 4vw, 3.8rem);
  color: var(--acc); letter-spacing: 0.06em;
  line-height: 1; margin-bottom: 40px;
  user-select: none;
}

.panel-nav {
  display: flex; flex-direction: column; gap: 0;
}
.panel-link {
  font-family: var(--font); font-size: 1rem;
  color: #a0a0a0;
  letter-spacing: 0.05em;
  padding: 9px 0; display: block;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: color .2s, border-color .2s;
}
.panel-link:hover,
.panel-link.active {
  color: var(--acc);
  border-left-color: var(--acc);
}

.content-area {
  flex: 1; min-width: 0;
  padding: 52px 52px 120px 52px;
  background: transparent;
}

/* ARAMA VE KAYDEDİLENLER BARI */
.search-wrap {
  margin-bottom: 52px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  max-width: 500px;
}
.search-input {
  flex: 1;
  background: transparent; border: none; border-bottom: 1px solid #777;
  color: var(--acc); font-family: var(--font); font-size: 1.15rem;
  padding: 8px 0; outline: none;
  letter-spacing: 0.04em;
}
.search-input:focus { border-bottom-color: var(--acc); }
.search-input::placeholder { color: #aaa; }

.saved-toggle-btn {
  background: transparent;
  border: none;
  border-bottom: 1px solid #777;
  color: #ccc;
  font-family: var(--font);
  font-size: 0.92rem;
  padding: 8px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.06em;
  transition: all 0.2s;
  white-space: nowrap;
}
.saved-toggle-btn:hover {
  border-bottom-color: var(--acc);
  color: #fff;
}
.saved-count-badge {
  background: #181818;
  border: 1px solid #444;
  color: #fff;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 10px;
}

/* SVG AYRAÇ İKONU */
.bookmark-svg {
  fill: none;
  stroke: #aaa;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.2s ease;
}
.saved-toggle-btn:hover .bookmark-svg,
.bookmark-card-btn:hover .bookmark-svg {
  stroke: #fff;
}
.bookmark-card-btn.active .bookmark-svg,
.saved-toggle-btn.active .bookmark-svg {
  fill: #ffffff;
  stroke: #ffffff;
}

.panel { display: none; }
.panel.active { display: block; }

.add-btn {
  background: transparent; border: 1px solid #666;
  color: #ccc; font-family: var(--font); font-size: 0.88rem;
  padding: 10px 22px; cursor: pointer; letter-spacing: 0.1em;
  margin-bottom: 44px; display: inline-block;
  transition: border-color .2s, color .2s;
}
.add-btn:hover { border-color: var(--acc); color: var(--acc); }

.entries-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 500px;
}

.entry-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #4a4a4a;
  cursor: pointer;
  transition: opacity .15s;
  align-items: start;
  width: 100%;
}
.entry-card:hover { opacity: 0.85; }
.entry-card.entry-hidden { opacity: 0.35; }

.entry-thumb {
  width: 72px; height: 72px; flex-shrink: 0;
  background: #181818; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-logo {
  font-family: var(--font); font-size: 0.68rem;
  color: #888; letter-spacing: 0.12em; text-align: center;
  line-height: 1.3; padding: 6px;
}

.entry-meta { 
  min-width: 0; 
  overflow-wrap: anywhere; 
  word-break: break-word;
}
.entry-cat {
  font-size: 0.76rem; color: #bfbfbf;
  letter-spacing: 0.18em;
  text-transform: uppercase; margin-bottom: 5px;
}
.entry-title {
  font-size: 1.18rem; color: #ffffff; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 5px;
}
.entry-own {
  font-size: 0.82rem; color: #f0f0f0;
  font-style: italic;
  margin-bottom: 6px; letter-spacing: 0.06em;
}
.entry-preview {
  font-size: 0.97rem; color: #dedede;
  line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.entry-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 12px;
}
.entry-date {
  font-size: 0.78rem; color: #b5b5b5;
  letter-spacing: 0.07em;
}
.entry-stats {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: #aaa;
}
.stat-views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.like-card-btn, .bookmark-card-btn {
  background: transparent;
  border: none;
  color: #aaa;
  font-family: var(--font);
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  transition: color 0.2s;
}
.like-card-btn:hover, .like-card-btn.active {
  color: #fff;
}
.heart-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.entry-actions {
  display: flex; flex-direction: column;
  gap: 6px; align-items: flex-end; flex-shrink: 0;
}
.act-btn {
  background: none; border: none; color: #b8b8b8;
  font-family: var(--font); font-size: 0.74rem;
  cursor: pointer; letter-spacing: 0.08em; padding: 2px 0;
  transition: color .2s; white-space: nowrap;
}
.act-btn:hover { color: var(--acc); }

.empty { color: #888; font-size: 0.85rem; letter-spacing: 0.12em; padding: 40px 0; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.92);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
}
.modal-box {
  background: #0a0a0a; border: 1px solid #484848;
  padding: 44px 40px; width: 100%; max-width: 580px;
  position: relative; max-height: 92vh; overflow-y: auto;
  overflow-x: hidden;
}
.modal-wide { max-width: 700px; }
.modal-close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none; color: #999; font-size: 1rem;
  cursor: pointer; transition: color .2s;
}
.modal-close:hover { color: var(--acc); }
.modal-title {
  font-family: var(--font); font-weight: 400; font-size: 1.25rem;
  color: var(--acc); margin-bottom: 32px; letter-spacing: 0.06em;
}

.mf { margin-bottom: 24px; }
.mf > label:first-child {
  display: block; font-size: 0.72rem; color: #a0a0a0;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 10px;
}
.mf-sub { text-transform: none; color: #888; font-size: 0.68rem; letter-spacing: 0.04em; margin-left: 6px; }

.mf input[type="text"],
.mf input[type="password"],
.mf textarea {
  width: 100%; background: transparent; border: none;
  border-bottom: 1px solid #555; color: var(--acc);
  font-family: var(--font); font-size: 1.07rem; padding: 8px 0;
  outline: none; resize: vertical;
  letter-spacing: 0.03em; line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.mf input:focus, .mf textarea:focus { border-bottom-color: var(--acc); }
.mf textarea { min-height: 140px; }

.cat-select-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cat-btn {
  background: transparent; border: 1px solid #555;
  color: #a0a0a0; font-family: var(--font); font-size: 0.82rem;
  padding: 6px 14px; cursor: pointer; letter-spacing: 0.08em;
  transition: border-color .2s, color .2s;
}
.cat-btn:hover { border-color: #aaa; color: #fff; }
.cat-btn.active { border-color: var(--acc); color: var(--acc); }

.mf input[type="file"] { display: none; }
.file-pick-label {
  display: inline-block; border: 1px solid #555; color: #a0a0a0;
  font-family: var(--font); font-size: 0.82rem; padding: 7px 16px;
  cursor: pointer; letter-spacing: 0.08em; transition: border-color .2s, color .2s;
}
.file-pick-label:hover { border-color: var(--acc); color: var(--acc); }
.file-preview { margin-top: 12px; }
.file-preview img { max-width: 140px; max-height: 140px; object-fit: cover; border: 1px solid #333; }
.file-preview .fname { font-size: 0.8rem; color: #999; letter-spacing: 0.06em; word-break: break-all; }
.remove-file-btn:hover {
  border-color: #ff5555 !important;
  color: #fff !important;
  background: rgba(255, 85, 85, 0.2) !important;
}

.cb-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.88rem; color: #ccc; cursor: pointer;
}
.cb-label input[type="checkbox"] { width: 13px; height: 13px; accent-color: var(--acc); cursor: pointer; }

.submit-btn {
  width: 100%; background: transparent; border: 1px solid var(--dim);
  color: var(--acc); font-family: var(--font); font-size: 0.9rem;
  padding: 13px 0; cursor: pointer; letter-spacing: 0.12em; margin-top: 8px;
  transition: background .2s, color .2s;
}
.submit-btn:hover { background: var(--acc); color: #000; }

.view-cat  { font-size: 0.72rem; color: #a0a0a0; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 10px; }
.view-ttl  { 
  font-size: 1.4rem; color: var(--acc); font-weight: 400; margin-bottom: 8px; letter-spacing: 0.04em;
  overflow-wrap: anywhere; word-break: break-word;
}
.view-own  { font-size: 0.8rem; color: #aaa; font-style: italic; margin-bottom: 16px; letter-spacing: 0.06em; }
.view-file { margin-bottom: 22px; }
.view-file img { max-width: 100%; max-height: 420px; object-fit: contain; border: 1px solid #383838; }
.view-file a   { color: var(--acc); font-size: 0.88rem; text-decoration: underline; word-break: break-all; }

.view-text { 
  font-size: 0.97rem; 
  color: var(--acc); 
  line-height: 1.85; 
  white-space: pre-wrap; 
  overflow-wrap: anywhere; 
  word-break: break-word;  
  width: 100%;
}

.view-author-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  float: right;
  margin-top: 24px;
  padding: 8px 16px;
  border: 1px solid #4a4a4a;
  background: #111;
  font-size: 0.86rem;
  letter-spacing: 0.05em;
}
.view-author-box .author-lbl {
  color: #999;
  font-style: italic;
  font-size: 0.8rem;
}
.view-author-box .author-val {
  color: #fff;
  font-weight: 500;
}
.view-body-clear {
  clear: both;
}

/* YORUMLAR BÖLÜMÜ */
.view-comments-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #333;
}
.comments-header {
  font-size: 0.85rem;
  color: #aaa;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 6px;
}
.comment-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 12px;
  background: #111;
  border: 1px solid #222;
  gap: 12px;
}
.comment-content {
  flex: 1;
  min-width: 0;
}
.comment-text {
  font-size: 0.92rem;
  color: #e0e0e0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-date {
  display: block;
  font-size: 0.72rem;
  color: #666;
  margin-top: 4px;
}
.comment-delete-btn {
  background: transparent;
  border: none;
  color: #666;
  font-size: 0.78rem;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.2s;
  padding: 2px 4px;
}
.comment-delete-btn:hover {
  color: #fff;
}
.no-comments {
  color: #666;
  font-size: 0.85rem;
  font-style: italic;
}
.comment-input-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.comment-input-wrap textarea {
  flex: 1;
  background: #080808;
  border: 1px solid #444;
  color: #fff;
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 8px 12px;
  outline: none;
  resize: vertical;
  min-height: 48px;
}
.comment-input-wrap textarea:focus {
  border-color: #888;
}
.comment-submit-btn {
  background: transparent;
  border: 1px solid #555;
  color: #ccc;
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 10px 18px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: all 0.2s;
  height: 48px;
}
.comment-submit-btn:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.view-actions {
  display: flex; gap: 14px; margin-top: 28px;
  padding-top: 20px; border-top: 1px solid #333;
  flex-wrap: wrap;
}

/* Okuyucu Modu Kısıtlamaları */
body.role-reader .add-btn,
body.role-reader .entry-actions,
body.role-reader #view-actions,
body.role-reader #add-modal,
body.role-reader #edit-modal {
  display: none !important;
}

.site-contact-footer {
  position: fixed;
  bottom: 24px;
  right: 32px;
  z-index: 100;
  font-family: var(--font);
  font-size: 0.88rem;
  color: #999;
  letter-spacing: 0.05em;
  background: rgba(8, 8, 8, 0.75);
  padding: 6px 14px;
  border: 1px solid #333;
  backdrop-filter: blur(4px);
}
/* GROTESK YAZARLARI & PROFİL PANELİ */
.panel-header-title {
  font-family: var(--font);
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--acc);
  margin-bottom: 28px;
  font-weight: 400;
}

.authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  width: 100%;
}

.author-card {
  border: 1px solid #333;
  padding: 22px;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.author-card:hover {
  border-color: #777;
  background: #111;
}

.author-card-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.author-card-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid #444;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

.author-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.author-card-name {
  font-size: 1.15rem;
  color: var(--acc);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.author-card-nick {
  font-size: 0.76rem;
  color: #888;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.author-role-tag {
  font-size: 0.68rem;
  color: #fff;
  background: #1c1c1c;
  border: 1px solid #555;
  padding: 1px 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.author-admin-btn {
  background: transparent;
  border: 1px solid #444;
  color: #bbb;
  font-family: var(--font);
  font-size: 0.74rem;
  padding: 4px 10px;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: all .2s;
  align-self: flex-start;
  margin-top: 4px;
}
.author-admin-btn:hover {
  border-color: #fff;
  color: #fff;
}
.author-admin-btn.is-admin {
  border-color: #552222;
  color: #ff9999;
}
.author-admin-btn.is-admin:hover {
  border-color: #ff5555;
  color: #fff;
  background: rgba(255, 85, 85, 0.1);
}

.author-card-bio {
  font-size: 0.9rem;
  color: #bfbfbf;
  line-height: 1.6;
  font-style: italic;
  white-space: pre-line;
}

.author-card-stats {
  font-size: 0.78rem;
  color: #777;
  letter-spacing: 0.08em;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #222;
}

.profile-box {
  max-width: 460px;
  width: 100%;
}

.profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-avatar-img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px solid #555;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

.profile-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-divider {
  border-top: 1px solid #333;
  margin: 36px 0 28px 0;
}

.form-status-msg {
  font-size: 0.85rem;
  min-height: 20px;
  margin: 8px 0;
  color: #888;
  line-height: 1.4;
}
.form-status-msg.error { color: #ff6b6b; }
.form-status-msg.success { color: #51cf66; }

.author-clickable {
  cursor: pointer;
  transition: color 0.15s;
}
.author-clickable:hover {
  color: #ffffff;
  text-decoration: underline;
}

.author-inline-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #444;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

.entry-own {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.site-contact-footer a {
  color: #dcdcdc;
  text-decoration: none;
  transition: color 0.2s;
}
.site-contact-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

@media (max-width: 680px) {
  :root { --sidebar: 0px; }

  .layout { flex-direction: column; }

  .sidebar {
    width: 100%; min-height: auto;
  }
  .sidebar-inner {
    position: relative; padding: 40px 24px 24px;
    min-height: auto; gap: 0;
  }
  .site-title { font-size: 2.6rem; margin-bottom: 20px; }
  .panel-nav { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; }
  .panel-link { border-left: none; padding-left: 0; border-bottom: 1px solid transparent; font-size: 0.9rem; }
  .panel-link.active, .panel-link:hover { border-left: none; border-bottom-color: var(--acc); }

  .content-area { padding: 32px 20px 80px; }

  .entries-list { max-width: 100%; }

  .entry-card { grid-template-columns: 52px 1fr auto; gap: 12px; }
  .entry-thumb { width: 52px; height: 52px; }

  .modal-box { padding: 28px 20px; }

  .site-contact-footer {
    bottom: 12px;
    right: 14px;
    font-size: 0.76rem;
    padding: 4px 10px;
  }
}
