/* Binbirçare additions to the downloaded site. tools/prepare_site.py links this file (and site-extras.js) on every
   page. It only uses the site's own colour variables, so it follows the design. */

/* 1. Header: always visible at the top of every page, never scrolls away (owner request, 4 Dec 2026).
   Once the page is scrolled it gets a little smaller (site-extras.js sets data-bc-scrolled on <html> and measures
   --bc-header-gap, the height saved). The bar keeps its full height in the page and slides up by that much instead,
   so the content below never moves. */
section[class="relative z-50 py-4"] {
  position: sticky;
  top: 0;
  background: var(--background);
  /* smooth shrink (owner, 4 Dec 2026). All parts share one duration and easing, so the bar's height in the page
     stays the same at every moment of the animation and the content never moves. */
  transition: top 0.25s ease, padding 0.25s ease, box-shadow 0.25s ease;
}
section[class="relative z-50 py-4"] img[alt="Binbircare Logo"] {
  transition: max-height 0.25s ease;
}
/* while site-extras.js measures the small size, and for visitors who ask for less motion: no animation */
html[data-bc-measure] section[class="relative z-50 py-4"],
html[data-bc-measure] section[class="relative z-50 py-4"] img[alt="Binbircare Logo"] {
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  section[class="relative z-50 py-4"],
  section[class="relative z-50 py-4"] img[alt="Binbircare Logo"] {
    transition: none;
  }
}
html[data-bc-scrolled] section[class="relative z-50 py-4"] {
  top: calc(-1 * var(--bc-header-gap, 0px));
  padding-top: calc(0.5rem + var(--bc-header-gap, 0px));
  padding-bottom: 0.5rem;
  box-shadow: 0 1px 0 var(--border), 0 8px 16px -14px rgb(0 0 0 / 0.35);
}
html[data-bc-scrolled] section[class="relative z-50 py-4"] img[alt="Binbircare Logo"] {
  max-height: 2.5rem;
}
/* jump links such as "#contact" stop below the header instead of under it */
html {
  scroll-padding-top: 5.5rem;
}

/* 2. Cookie banner (site-extras.js). "Reddet" and "Kabul Et" look the same on purpose: KVKK expects refusing to be
   as easy and as visible as accepting. */
.bc-consent {
  position: fixed;
  z-index: 60;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 42rem;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--card, #fff);
  color: var(--foreground, #111);
  border: 1px solid var(--border, #ddd);
  border-radius: calc(var(--radius, 8px) + 4px);
  box-shadow: 0 12px 32px -12px rgb(0 0 0 / 0.35);
  font-size: 0.875rem;
  line-height: 1.5;
}
.bc-consent p {
  flex: 1 1 18rem;
  margin: 0;
}
.bc-consent a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bc-consent div {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}
.bc-consent button {
  min-width: 6.5rem;
  height: 2.25rem;
  padding: 0 1rem;
  border: 1px solid var(--primary);
  border-radius: var(--radius, 8px);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.bc-consent button:hover {
  opacity: 0.9;
}
/* 3. "Başa dön" button, bottom left (site-extras.js). Fades in after scrolling down; round arrow on phones,
   arrow + text on wider screens. Always available, also before a cookie choice: where the open banner would cover
   it, it sits just above the banner. */
.bc-top {
  position: fixed;
  z-index: 55;
  left: 1rem;
  /* --bc-top-lift: set by the script while the cookie banner is open and would cover the button (phones) */
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + var(--bc-top-lift, 0px));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 2.75rem;
  min-width: 2.75rem;
  padding: 0 1rem 0 0.875rem;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 20px -8px rgb(0 0 0 / 0.45);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.75rem);
  transition: opacity 0.2s ease, transform 0.2s ease, bottom 0.2s ease, visibility 0s linear 0.2s;
}
.bc-top--on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.2s ease, transform 0.2s ease, bottom 0.2s ease;
}
.bc-top:hover {
  background: color-mix(in oklab, var(--primary) 85%, black);
}
.bc-top:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--primary) 45%, transparent);
  outline-offset: 2px;
}
.bc-top svg {
  width: 1.25rem;
  height: 1.25rem;
}
@media (max-width: 639px) {
  .bc-top {
    width: 2.75rem;
    padding: 0;
  }
  .bc-top span {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bc-top,
  .bc-top--on {
    transition: none;
  }
}
@media print {
  .bc-top,
  .bc-consent {
    display: none;
  }
}

.bc-consent button:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--primary) 45%, transparent);
  outline-offset: 2px;
}
