/* ═══════════════════════════════════════════════════════════
   main.css — erdemyilmaz.tr Global Stiller
═══════════════════════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --accent:      #d4400a;
  --accent-h:    #b83508;
  --accent-soft: #fff0eb;
  --radius-sm:   4px;
  --radius:      8px;
  --radius-lg:   14px;
  --ease:        cubic-bezier(.25,.46,.45,.94);
  --dur:         .22s;
  --header-h:    60px;
}

/* Light (default) */
[data-theme="light"], :root {
  --bg:         #f5f4f1;
  --bg2:        #ffffff;
  --bg3:        #eeede9;
  --border:     #e0deda;
  --text:       #1a1816;
  --text2:      #5a5550;
  --text3:      #9a948e;
  --shadow:     rgba(0,0,0,.07);
  --shadow-lg:  rgba(0,0,0,.13);
}

/* Dark */
[data-theme="dark"] {
  --bg:         #111210;
  --bg2:        #1c1b19;
  --bg3:        #242320;
  --border:     #2e2d2a;
  --text:       #f0eeea;
  --text2:      #a09890;
  --text3:      #666058;
  --shadow:     rgba(0,0,0,.3);
  --shadow-lg:  rgba(0,0,0,.5);
  --accent-soft:#2a1509;
}

/* Sistem tercihi — kullanıcı henüz seçmediyse */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:         #111210;
    --bg2:        #1c1b19;
    --bg3:        #242320;
    --border:     #2e2d2a;
    --text:       #f0eeea;
    --text2:      #a09890;
    --text3:      #666058;
    --shadow:     rgba(0,0,0,.3);
    --shadow-lg:  rgba(0,0,0,.5);
    --accent-soft:#2a1509;
  }
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  transition: background .3s, color .3s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; object-fit: cover; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, select, textarea { font-family: inherit; }

/* ── HEADER ── */
.site-header {
  position: static; top: 0; z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  min-height: var(--header-h);
  height: auto;
  display: flex; align-items: center;
  box-shadow: 0 2px 12px var(--shadow);
  transition: background .3s, border-color .3s;
}
.site-header.sticky {
  position: sticky;
}
.header-inner {
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
  color: var(--text); text-decoration: none;
}
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }

.main-nav { display: flex; align-items: center; gap: .25rem; flex: 1; }
.main-nav a {
  font-size: .82rem; font-weight: 500;
  padding: .45rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text2);
  transition: color var(--dur), background var(--dur);
  white-space: nowrap; text-decoration: none;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.header-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

.search-wrap { position: relative; }
.search-wrap input {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px;
  padding: .4rem 1rem .4rem 2.2rem;
  font-size: .8rem; color: var(--text);
  width: 180px;
  transition: width var(--dur), border-color var(--dur);
}
.search-wrap input:focus { outline: none; border-color: var(--accent); width: 220px; }
.search-wrap input::placeholder { color: var(--text3); }
.search-icon {
  position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
  color: var(--text3); font-size: .85rem; pointer-events: none;
}

.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: background var(--dur), border-color var(--dur);
}
.theme-toggle:hover { border-color: var(--accent); }

/* Kullanıcı menü */
.user-menu { position: relative; }
.user-btn {
  font-size: .82rem; font-weight: 500; padding: .4rem .8rem;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg3); color: var(--text2);
  transition: all var(--dur);
}
.user-btn:hover { border-color: var(--accent); color: var(--accent); }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + .4rem);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px var(--shadow-lg);
  min-width: 150px; display: none; z-index: 200;
}
.user-dropdown.open { display: block; }
.user-dropdown a {
  display: block; padding: .55rem 1rem;
  font-size: .82rem; color: var(--text2);
  border-bottom: 1px solid var(--border);
  transition: color var(--dur), background var(--dur);
  text-decoration: none;
}
.user-dropdown a:last-child { border-bottom: none; }
.user-dropdown a:hover { color: var(--accent); background: var(--accent-soft); }

/* Giriş yap butonu (header) */
.btn-header-login {
  font-size: .8rem; font-weight: 600;
  padding: .4rem .9rem; border-radius: var(--radius);
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  transition: background var(--dur);
  text-decoration: none;
}
.btn-header-login:hover { background: var(--accent-h); text-decoration: none; }

/* Mobil menü butonu */
.mobile-menu-btn {
  display: none; font-size: 1.2rem;
  padding: .3rem .5rem;
}

/* ── OKUMA İLERLEME ── */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; background: transparent; z-index: 99;
}
.site-header.sticky ~ .reading-progress {
  top: 0;
}
.reading-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), #ff7043);
  transition: width .1s linear;
}

/* ── FLASH MESAJLARI ── */
.flash-wrap { max-width: 1280px; margin: .8rem auto; padding: 0 1.5rem; }
.flash-msg {
  padding: .75rem 1rem; border-radius: var(--radius);
  font-size: .83rem; margin-bottom: .5rem;
  display: flex; align-items: center; gap: .5rem;
  animation: fadeUp .3s ease;
}
.flash-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.flash-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.flash-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }
.flash-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
[data-theme="dark"] .flash-success { background: #052e16; border-color: #166534; color: #86efac; }
[data-theme="dark"] .flash-error   { background: #1c0a0a; border-color: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .flash-info    { background: #0c1a2e; border-color: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .flash-warning { background: #1c1205; border-color: #78350f; color: #fde68a; }

/* ── FOOTER ── */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem 1.2rem;
  margin-top: 2rem;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 2rem; margin-bottom: 1.5rem;
}
.footer-brand .logo { font-size: 1.2rem; margin-bottom: .6rem; display: inline-block; }
.footer-brand p { font-size: .8rem; color: var(--text2); line-height: 1.6; }
.footer-social { display: flex; gap: .5rem; margin-top: .8rem; }
.footer-social a {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; color: var(--text2);
  transition: all var(--dur); text-decoration: none;
}
.footer-social a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.footer-col h5 {
  font-size: .75rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: .8rem; color: var(--text3);
}
.footer-col ul { padding: 0; }
.footer-col ul li { padding: .28rem 0; }
.footer-col ul li a { font-size: .8rem; color: var(--text2); transition: color var(--dur); }
.footer-col ul li a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 1rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .75rem; color: var(--text3);
  flex-wrap: wrap; gap: .5rem;
}
.footer-bottom a { color: var(--accent); }

/* Bülten formu (footer) */
.newsletter-form { display: flex; gap: .4rem; margin-top: .5rem; }
.newsletter-form input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .5rem .75rem;
  font-size: .8rem; color: var(--text);
}
.newsletter-form input:focus { outline: none; border-color: var(--accent); }
.newsletter-form input::placeholder { color: var(--text3); }
.newsletter-form button {
  background: var(--accent); color: #fff;
  border-radius: var(--radius); padding: .5rem .9rem;
  font-size: .8rem; font-weight: 600;
  transition: background var(--dur);
}
.newsletter-form button:hover { background: var(--accent-h); }

/* ── ÇEREZ POPUP ── */
.cookie-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  background: var(--bg2); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px var(--shadow-lg);
  padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  transform: translateY(100%);
  animation: slideUp .4s .8s var(--ease) forwards;
}
@keyframes slideUp { to { transform: translateY(0); } }
.cookie-bar.hidden { display: none; }
.cookie-text { flex: 1; min-width: 200px; font-size: .8rem; color: var(--text2); line-height: 1.5; }
.cookie-text strong { color: var(--text); }
.cookie-text a { color: var(--accent); text-decoration: underline; }
.cookie-actions { display: flex; gap: .5rem; flex-shrink: 0; flex-wrap: wrap; }
.btn-cookie {
  font-family: inherit; font-size: .78rem; font-weight: 600;
  padding: .45rem 1rem; border-radius: var(--radius);
  cursor: pointer; transition: all var(--dur); white-space: nowrap;
}
.btn-accept  { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-accept:hover { background: var(--accent-h); }
.btn-decline { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-decline:hover { border-color: var(--text2); color: var(--text); }
.btn-detail  { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-detail:hover { background: var(--accent-soft); }

.cookie-modal-bg {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.cookie-modal-bg.open { opacity: 1; pointer-events: all; }
.cookie-modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.8rem;
  max-width: 520px; width: 100%;
  box-shadow: 0 16px 48px var(--shadow-lg);
  transform: translateY(16px); transition: transform .25s;
}
.cookie-modal-bg.open .cookie-modal { transform: translateY(0); }
.cookie-modal h3 { font-family: 'Playfair Display', serif; font-size: 1.1rem; margin-bottom: .8rem; }
.cookie-modal p  { font-size: .82rem; color: var(--text2); line-height: 1.6; margin-bottom: .8rem; }
.cookie-modal ul { font-size: .8rem; color: var(--text2); line-height: 1.7; padding-left: 1.2rem; margin-bottom: 1.2rem; list-style: disc; }
.cookie-modal ul li::marker { color: var(--accent); }
.cookie-modal-actions { display: flex; gap: .6rem; justify-content: flex-end; }

/* ── BAŞA GİT ── */
.back-to-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 500;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(212,64,10,.4);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .25s, transform .25s, background .2s;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
.back-to-top:hover { background: var(--accent-h); }

/* ── SAYFALAMAi ── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: .3rem; margin: 2rem 0; flex-wrap: wrap;
}
.pag-btn {
  padding: .45rem .8rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg2);
  color: var(--text2); font-size: .82rem; font-weight: 500;
  transition: all var(--dur); text-decoration: none; display: inline-block;
}
.pag-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pag-btn.pag-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pag-dots { color: var(--text3); padding: .45rem .3rem; }

/* ── ANİMASYONLAR ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg2); border-bottom: 1px solid var(--border);
    padding: .5rem; box-shadow: 0 4px 12px var(--shadow-lg);
    z-index: 99;
  }
  .mobile-menu-btn { display: flex; }
  .search-wrap { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .newsletter-form { flex-direction: column; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}