/* Shared by the front page (index.php) and the video pages (watch.php):
   colors, page width, header, and the "link copied" message. */
:root {
  --bg: #fff;
  --text: #111;
  --muted: #555;
  --line: #111;
  --card-bg: #e9e9e9;
  --accent: #008FFF;   /* links, search focus, subscribe hover */
  --button-bg: #111;
  --button-text: #fff;
  --logo-filter: none;
  --header-shadow: rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --text: #f1f1f1;
    --muted: #aaa;
    --line: #555;
    --card-bg: #272727;
    --button-bg: #f1f1f1;
    --button-text: #0f0f0f;
    --logo-filter: invert(1);
    --header-shadow: rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Poppins, system-ui, -apple-system, sans-serif;
}
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 40px; } }
@media (min-width: 1100px) { .wrap { padding: 0 60px; } }

/* Header: sticks to the top */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  transition: box-shadow 0.2s;
}
.site-header.scrolled { box-shadow: 0 2px 12px var(--header-shadow); }
.header-row {
  display: flex; align-items: center; gap: 16px;
  height: 76px;
}
@media (min-width: 700px) { .header-row { gap: 40px; height: 104px; } }
/* Wide screens: search bar in the center, logo on the left, Subscribe on the right */
@media (min-width: 1320px) {
  .header-row { display: grid; grid-template-columns: minmax(0, 1fr) 615px minmax(0, 1fr); }
  .header-row .logo { justify-self: start; }
  .header-row .search { width: 100%; }
  .header-row .subscribe { justify-self: end; }
}

.logo {
  display: inline-flex; align-items: center; gap: 16px; flex: none;
  color: inherit; text-decoration: none;
  font-weight: 800; font-size: 32px; letter-spacing: -0.01em;
}
.logo img { width: 50px; height: 50px; filter: var(--logo-filter); }
@media (max-width: 699px) {
  .logo span { display: none; }   /* only the icon on phones */
  .logo img { width: 38px; height: 38px; }
}

.search {
  flex: 1; max-width: 615px; position: relative;
}
.search input {
  width: 100%; height: 40px; padding: 0 44px 0 16px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: transparent; color: inherit;
  font: 400 16px Poppins, system-ui, sans-serif;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); }
.search input::-webkit-search-cancel-button { display: none; }
.search svg {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; pointer-events: none;
}

.subscribe {
  margin-left: auto; flex: none;
  height: 40px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--button-bg); color: var(--button-text);
  font: 500 16px Poppins, system-ui, sans-serif; cursor: pointer;
}
.subscribe:hover { background: var(--accent); color: #fff; }
@media (max-width: 699px) { .subscribe { padding: 0 14px; font-size: 14px; } }

/* Dark header (video pages): always black, does not stick to the top */
.site-header.dark {
  position: static;
  --bg: #000;
  --text: #fff;
  --muted: #aaa;
  --line: rgba(255, 255, 255, 0.85);
  --button-bg: #fff;
  --button-text: #000;
  --logo-filter: invert(1);   /* same as the front page in dark mode */
  background: var(--bg); color: var(--text);
}

/* "Feed link copied" message */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 10px;
  background: #111; color: #fff; font-size: 15px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast input {
  display: block; width: 100%; min-width: 260px; margin-top: 8px; padding: 6px 8px;
  border: 0; border-radius: 6px; font: inherit;
}
