/* header.css — brand override + top bar + footer (shared shell).
   Loaded after tokens.css on every page. */

/* ---- Brand: orange accent (tube-site familiar), layered on the token system.
   tokens.css ships a rose brand; porny overrides the brand channel only, so
   every component that reads var(--c-brand*) recolours automatically. ------- */
:root {
  /* --c-brand TEK KAYNAK: app/config.php → brand.accent; head.php inline :root ile override edilir.
     Diğer tüm marka tonları color-mix ile BURADAN türer → tek değer değişince site komple recolor olur. */
  --c-brand:        #ff9000;
  --c-brand-strong: color-mix(in srgb, var(--c-brand) 90%, #000);
  --c-brand-900:    color-mix(in srgb, var(--c-brand) 70%, #000);
  --c-brand-soft:   color-mix(in srgb, var(--c-brand) 14%, var(--c-bg-elevated));
  --c-focus-ring:   var(--c-brand);
  --sh-focus:       0 0 0 3px color-mix(in srgb, var(--c-brand) 35%, transparent);
  /* Accent used as TEXT colour. */
  --c-accent-text:  var(--c-brand);

  /* Header surface — a touch darker than the page for tube-site contrast. */
  --c-header-bg: #0f0f12;
  --header-h:    60px;
  /* Search field sits clearly above the header surface in both themes. */
  --c-search-bg:        #26262c;
  --c-search-bg-focus:  #2e2e35;
}
:root.theme-light {
  --c-header-bg: #ffffff;
  --c-brand-soft: color-mix(in srgb, var(--c-brand) 12%, #ffffff);
  --c-search-bg:       #ececed;
  --c-search-bg-focus: #ffffff;
  --c-accent-text:  color-mix(in srgb, var(--c-brand) 60%, #000);   /* açık zeminde AA kontrast için koyultulur */
}

/* ---- Accessibility: skip link --------------------------------------------- */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: var(--z-toast);
  background: var(--c-brand); color: #1a1205;
  padding: 10px 16px; border-radius: var(--r-sm); font-weight: var(--fw-bold);
  transition: top var(--d-base) var(--e-out);
}
.skip-link:focus { top: 8px; }

/* ---- Top bar -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: var(--c-header-bg);
  border-bottom: 1px solid var(--c-border);
  padding-top: var(--safe-top);
}
.site-header__inner {
  max-width: var(--container-max); margin: 0 auto;
  min-height: var(--header-h);
  padding: var(--sp-2) var(--gutter);
  display: flex; align-items: center; gap: var(--sp-4);
  flex-wrap: wrap;
}

/* Logo: "porny" wordmark whose "o" is a video play-badge. */
.logo {
  display: inline-flex; align-items: center;
  text-decoration: none; flex-shrink: 0;
  border-radius: var(--r-sm);
}
.logo:focus-visible { outline-offset: 4px; }
.logo__word {
  display: inline-flex; align-items: center;
  font-size: 26px; font-weight: var(--fw-bold);
  letter-spacing: -0.045em; line-height: 1;
  color: var(--c-text);
}
.logo__o {
  display: inline-flex; align-items: center; justify-content: center;
  width: 0.84em; height: 0.84em; margin: 0 0.015em;
  position: relative; top: 0.015em;
  border-radius: 50%;
  background: linear-gradient(135deg,
              color-mix(in srgb, var(--c-brand) 66%, #fff) 0%,
              var(--c-brand) 52%,
              color-mix(in srgb, var(--c-brand) 90%, #000) 100%);
  box-shadow: 0 1px 5px color-mix(in srgb, var(--c-brand) 45%, transparent),
              inset 0 0 0 1px rgba(255, 255, 255, 0.22),
              inset 0 -2px 4px color-mix(in srgb, var(--c-brand) 30%, #000 45%);
  transition: transform var(--d-base) var(--e-out), box-shadow var(--d-base) var(--e-out);
}
.logo__o svg {
  width: 0.4em; height: 0.4em; margin-left: 0.05em;
  fill: #1a1205;
  filter: drop-shadow(0 0.5px 0 rgba(255, 255, 255, 0.35));
}
@media (hover: hover) {
  .logo:hover .logo__o {
    transform: scale(1.06);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--c-brand) 60%, transparent),
                inset 0 0 0 1px rgba(255, 255, 255, 0.3),
                inset 0 -2px 4px color-mix(in srgb, var(--c-brand) 30%, #000 45%);
  }
}

/* Search — grows to fill the bar */
.hsearch {
  position: relative; flex: 1 1 240px; min-width: 0;
  display: flex;
}
.hsearch__input {
  width: 100%; min-width: 0;
  height: 44px; padding: 0 44px 0 16px;
  font: inherit; font-size: var(--fs-300); /* 16px: avoids iOS zoom-on-focus */
  color: var(--c-text); background: var(--c-search-bg);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-pill) 0 0 var(--r-pill);
  transition: background var(--d-base) var(--e-out), border-color var(--d-base) var(--e-out), box-shadow var(--d-base) var(--e-out);
}
.hsearch__input::placeholder { color: var(--c-text-subtle); }
.hsearch__input:focus {
  outline: none; border-color: var(--c-brand);
  background: var(--c-search-bg-focus);
  box-shadow: var(--sh-focus);
}
.hsearch__btn {
  flex-shrink: 0;
  width: 52px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer;
  background: var(--c-brand); color: #1a1205;
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
  transition: background var(--d-base) var(--e-out);
}
@media (hover: hover) { .hsearch__btn:hover { background: var(--c-brand-strong); } }
.hsearch__btn:active { transform: translateY(1px); }
.hsearch__btn svg { width: 20px; height: 20px; }

/* Autocomplete dropdown — anchored under the input (.hsearch is position:relative). */
.hsearch__suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  max-height: min(70vh, 420px); overflow-y: auto;
  padding: 6px;
  background: var(--c-bg-elevated);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg, 0 12px 32px rgba(0,0,0,.28));
  -webkit-overflow-scrolling: touch;
}
.hsearch__suggest[hidden] { display: none; }
.hsearch__opt {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--c-text); text-decoration: none; cursor: pointer;
  font-size: var(--fs-200); line-height: 1.2;
}
.hsearch__opt:hover,
.hsearch__opt.is-active { background: var(--c-bg-hover, rgba(255,255,255,.06)); }
.hsearch__opt-ic {
  flex: 0 0 auto; width: 18px; height: 18px; color: var(--c-text-subtle);
  display: inline-flex; align-items: center; justify-content: center;
}
.hsearch__opt-ic svg { width: 16px; height: 16px; }
.hsearch__opt-txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hsearch__opt-txt b { color: var(--c-brand); font-weight: var(--fw-bold); }   /* matched prefix */
.hsearch__opt-kind {
  flex: 0 0 auto; font-size: var(--fs-100); color: var(--c-text-subtle);
  text-transform: lowercase; letter-spacing: .02em;
}
/* "Search for <query>" action row — visually distinct top row */
.hsearch__opt--go { color: var(--c-text-muted); }
.hsearch__opt--go .hsearch__opt-ic { color: var(--c-brand); }
.hsearch__sep { height: 1px; margin: 5px 6px; background: var(--c-border); }
@media (pointer: coarse) { .hsearch__opt { padding: 12px 10px; } }

/* Icon buttons (theme toggle etc.) — 44px tap target */
.iconbtn {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--c-text-muted);
  border: 1px solid transparent; border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--d-base) var(--e-out), color var(--d-base) var(--e-out);
}
@media (hover: hover) { .iconbtn:hover { background: var(--c-bg-elevated); color: var(--c-text); } }
.iconbtn svg { width: 22px; height: 22px; }
/* sun/moon swap by theme */
.iconbtn .icon-moon { display: none; }
.iconbtn .icon-sun  { display: inline; }
:root.theme-light .iconbtn .icon-moon { display: inline; }
:root.theme-light .iconbtn .icon-sun  { display: none; }

.header-actions { display: flex; align-items: center; gap: var(--sp-1); flex-shrink: 0; }

/* On narrow screens the search drops to its own full-width row */
@media (max-width: 560px) {
  .site-header__inner { gap: var(--sp-2); }
  .hsearch { order: 3; flex-basis: 100%; }
}

/* ---- Mobile nav: hamburger + slide-in category drawer --------------------- */
.nav-toggle { display: none; }            /* desktop: categories show inline */

.nav-scrim {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: var(--c-bg-overlay);
  opacity: 0; transition: opacity var(--d-medium) var(--e-out);
}
.nav-scrim[hidden] { display: none; }
.nav-scrim.is-open { opacity: 1; }

.nav-drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: calc(var(--z-overlay) + 1);
  width: min(82vw, 320px);
  background: var(--c-bg-elevated);
  border-right: 1px solid var(--c-border);
  box-shadow: var(--sh-lg);
  padding-top: var(--safe-top); padding-left: var(--safe-left);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--d-medium) var(--e-emph);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.nav-drawer.is-open { transform: translateX(0); }

.nav-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--c-border); position: sticky; top: 0;
  background: var(--c-bg-elevated);
}
.nav-drawer__title {
  font-size: var(--fs-100); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-text-subtle);
}
.nav-drawer__list { display: flex; flex-direction: column; padding: var(--sp-2); }
.nav-drawer__list a {
  display: flex; align-items: center; min-height: 48px;
  padding: 0 var(--sp-4); border-radius: var(--r-md);
  font-size: var(--fs-300); font-weight: var(--fw-medium); color: var(--c-text);
}
@media (hover: hover) { .nav-drawer__list a:hover { background: var(--c-bg); color: var(--c-accent-text); } }
.nav-drawer__list a.active {
  background: color-mix(in srgb, var(--c-brand) 16%, transparent);
  color: var(--c-accent-text); font-weight: var(--fw-semibold);
}
.nav-drawer__sep { height: 1px; margin: var(--sp-2) var(--sp-4); background: var(--c-border); }

@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; order: -1; }   /* leftmost on mobile */
}
@media (min-width: 769px) {
  /* drawer/scrim never participate on desktop */
  .nav-drawer, .nav-scrim { display: none; }
}

/* ---- Footer --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--c-border);
  margin-top: var(--sp-16);
  padding: var(--sp-8) var(--gutter) calc(var(--sp-8) + var(--safe-bottom));
  color: var(--c-text-subtle); font-size: var(--fs-200);
}
.site-footer__inner {
  max-width: var(--container-max); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-8);
  align-items: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
.site-footer a { color: var(--c-text-muted); }
@media (hover: hover) { .site-footer a:hover { color: var(--c-accent-text); text-decoration: underline; } }
.site-footer__legal { width: 100%; color: var(--c-text-subtle); }
.age-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--c-border-strong); border-radius: var(--r-pill);
  padding: 4px 10px; font-weight: var(--fw-semibold); color: var(--c-text-muted);
}

/* ---- Age verification gate (18+) ------------------------------------------
   Always in the DOM so it survives CDN/HTML caching; the <head> bootstrap adds
   html.age-ok from the porny_age cookie, hiding it before first paint. The
   backdrop is opaque on both themes so no thumbnail shows behind it. */
html.age-ok #age-gate { display: none; }
html:not(.age-ok)      { overflow: hidden; }        /* lock scroll while gated */

#age-gate {
  position: fixed; inset: 0; z-index: calc(var(--z-toast) + 10);
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--sp-5) + var(--safe-top)) var(--sp-5)
           calc(var(--sp-5) + var(--safe-bottom));
  background: radial-gradient(120% 120% at 50% 0%, #15151a 0%, #060608 100%);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  overflow-y: auto;
  animation: age-gate-in var(--d-medium) var(--e-out);
}
@keyframes age-gate-in { from { opacity: 0; } to { opacity: 1; } }

.age-gate__card {
  width: 100%; max-width: 520px; margin: auto;
  background: var(--c-bg-elevated);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  padding: var(--sp-8) var(--sp-6); text-align: center;
}
.age-gate__badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; margin: 0 auto var(--sp-4);
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, #ffb24d 0%, #ff9000 52%, #e67e00 100%);
  color: #1a1205; font-weight: var(--fw-bold); font-size: var(--fs-400);
  box-shadow: 0 8px 24px rgba(255, 144, 0, 0.35);
}
.age-gate__title {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-500); font-weight: var(--fw-bold);
  line-height: var(--lh-snug); color: var(--c-text);
}
.age-gate__body {
  margin: 0 0 var(--sp-3); color: var(--c-text-muted);
  font-size: var(--fs-200); line-height: var(--lh-base);
}
.age-gate__body strong { color: var(--c-text); font-weight: var(--fw-semibold); }
.age-gate__actions {
  display: flex; flex-direction: column; gap: var(--sp-3);
  margin-top: var(--sp-6);
}
.age-gate__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 var(--sp-6);
  border: 1px solid transparent; border-radius: var(--r-pill); cursor: pointer;
  font: inherit; font-size: var(--fs-300); font-weight: var(--fw-bold);
  transition: background var(--d-base) var(--e-out),
              border-color var(--d-base) var(--e-out),
              color var(--d-base) var(--e-out),
              transform var(--d-fast) var(--e-out);
}
.age-gate__btn:active { transform: translateY(1px); }
.age-gate__btn--enter { background: var(--c-brand); color: #1a1205; }
@media (hover: hover) { .age-gate__btn--enter:hover { background: var(--c-brand-strong); } }
.age-gate__btn--leave {
  background: transparent; color: var(--c-text-muted);
  border-color: var(--c-border-strong);
}
@media (hover: hover) {
  .age-gate__btn--leave:hover { color: var(--c-text); border-color: var(--c-text-subtle); }
}
.age-gate__rta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sp-5);
  border: 1px solid var(--c-border-strong); border-radius: var(--r-pill);
  padding: 4px 10px; font-size: var(--fs-100);
  font-weight: var(--fw-semibold); color: var(--c-text-muted);
}
.age-gate__fine {
  margin: var(--sp-4) 0 0; color: var(--c-text-subtle);
  font-size: var(--fs-100); line-height: var(--lh-base);
}
.age-gate__fine a { color: var(--c-accent-text); }

@media (min-width: 480px) {
  .age-gate__actions { flex-direction: row; }
  .age-gate__btn     { flex: 1; }
}

/* Categories katalog erişimi (drawer) */
.nav-drawer__all { color: var(--c-brand) !important; font-weight: var(--fw-bold); }
.nav-drawer__cap { padding: var(--sp-3) var(--sp-4) 4px; font-size: var(--fs-100); text-transform: uppercase; letter-spacing: .08em; color: var(--c-text-subtle); }

/* ── Üyelik: header giriş linki + kullanıcı menüsü (JS'siz <details> dropdown) ── */
.header-login {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: var(--fs-200, .82rem); font-weight: var(--fw-bold, 700);
  color: var(--c-text); text-decoration: none;
  padding: 7px 14px; border: 1px solid var(--c-border); border-radius: var(--r-pill, 999px);
  transition: border-color .12s, color .12s, background .12s;
}
.header-login:hover { border-color: var(--c-brand); color: var(--c-accent-text); }
.usermenu { position: relative; }
.usermenu > summary { list-style: none; cursor: pointer; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu__avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c-brand); color: var(--c-text-on-brand, #1a1205);
  font-weight: 800; font-size: 15px; user-select: none;
}
.usermenu[open] .usermenu__avatar { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-brand) 30%, transparent); }
.usermenu__pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 180px;
  background: var(--c-bg-elevated); border: 1px solid var(--c-border); border-radius: var(--r-md, 12px);
  padding: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.4);
}
.usermenu__name {
  margin: 4px 8px 6px; font-size: var(--fs-300, .85rem); font-weight: 700; color: var(--c-text);
  word-break: break-word; border-bottom: 1px solid var(--c-border); padding-bottom: 8px;
}
.usermenu__item {
  display: block; padding: 9px 10px; border-radius: 8px; text-decoration: none;
  color: var(--c-text-muted); font-size: var(--fs-300, .85rem); font-weight: 600;
}
.usermenu__item:hover { background: var(--c-bg); color: var(--c-text); }

/* --- Library girişi (header, misafir + üye) --- */
.header-lib{position:relative;display:inline-grid;place-items:center;width:40px;height:40px;border-radius:var(--r-md);color:var(--c-text);text-decoration:none;transition:color .15s,background .15s}
.header-lib:hover{color:var(--c-accent-text);background:var(--c-bg-elevated)}
.header-lib:focus-visible{outline:2px solid var(--c-focus-ring,var(--c-accent-text));outline-offset:2px}
.header-lib svg{width:20px;height:20px}
.header-lib__badge{position:absolute;top:1px;right:1px;min-width:17px;height:17px;padding:0 4px;border-radius:999px;background:var(--c-brand);color:var(--c-text-on-brand,#fff);font-size:10.5px;font-weight:800;display:grid;place-items:center;border:2px solid var(--c-bg);font-variant-numeric:tabular-nums;line-height:1}
.header-lib__badge[hidden]{display:none}
