/* Bilgi Plus visual-stability patch 1.3.1-vfix.1
   Loaded AFTER the legacy app.css and the inline site theme rules.
   Scoped to the public site: no admin, games or KPSS styles altered. */

/* Ensure theme changes do not animate every component at different speeds. */
html { scroll-behavior: auto; }
body.bp-theme { transition: none !important; }
html.bp-theme-switching *,
html.bp-theme-switching *::before,
html.bp-theme-switching *::after {
  transition: none !important;
  animation: none !important;
}

/* Keep the sticky header inexpensive to paint while preserving design tokens. */
.bp-theme .site-header {
  position: sticky;
  background: var(--sheet, #fffefa);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 4px 18px rgba(46, 33, 22, .055);
  isolation: isolate;
}
html.dark .bp-theme .site-header {
  background: var(--sheet, #2e2925);
  border-color: var(--edge, #534b43);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .16);
}

/* Both dropdowns float below header; neither can move the hero or other content. */
.bp-theme .search-panel,
.bp-theme .mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 80;
  background: var(--sheet, #fffefa);
  border: 1px solid var(--edge, #e6e1d9);
  border-top: 0;
  box-shadow: 0 22px 44px rgba(25, 19, 13, .13);
  color: var(--ink, #171613);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.bp-theme .search-panel { padding: 22px 0 25px; }
.bp-theme .search-panel label { color: var(--ink, #171613); }
.bp-theme .search-panel input {
  min-width: 0;
  width: 100%;
  background: var(--paper, #faf9f6);
  color: var(--ink, #171613);
  border-color: var(--edge, #e6e1d9);
}
.bp-theme .search-panel button { background: var(--accent, #ff7417); color: #201610; }
.bp-theme .mobile-nav {
  max-height: min(75dvh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.bp-theme .mobile-nav a { color: var(--ink, #171613); border-color: var(--edge, #e6e1d9); }
html.dark .bp-theme :is(.search-panel, .mobile-nav) {
  background: var(--sheet, #2e2925);
  color: var(--ink, #faf6ed);
  border-color: var(--edge, #534b43);
}
.bp-theme .search-panel[hidden],
.bp-theme .mobile-nav[hidden] { display: none !important; }

/* The legacy dark palette mixed blue surfaces with the new warm theme.
   Reuse the same semantic surfaces on browsing cards. */
html.dark .bp-theme :is(.tool-card, .article-card, .category-card, .city-card) {
  background: var(--sheet, #2e2925);
  border-color: var(--edge, #534b43);
  color: var(--ink, #faf6ed);
}
html.dark .bp-theme :is(.tool-card, .article-card, .category-card, .city-card)
:is(h2, h3, strong) { color: var(--ink, #faf6ed); }
html.dark .bp-theme :is(.tool-card, .article-card, .category-card, .city-card)
:is(p, small) { color: var(--soft, #c9c0b6); }

/* In dark mode, legacy blue hero surfaces are replaced with Bilgi Plus's
   warm semantic surfaces; typography stays readable as one coherent theme. */
html.dark .bp-theme :is(.listing-hero, .tool-detail-hero, .article-detail-hero,
 .comparison-hero, .city-detail-hero, .account-hero, .page-hero) {
  background: linear-gradient(145deg, var(--peach, #45301f), var(--paper, #221f1c) 78%);
  color: var(--ink, #faf6ed);
  border-color: var(--edge, #534b43);
}
html.dark .bp-theme :is(.listing-hero, .tool-detail-hero, .article-detail-hero,
 .comparison-hero, .city-detail-hero, .account-hero, .page-hero) :is(h1, h2) {
  color: var(--ink, #faf6ed);
}
html.dark .bp-theme :is(.listing-hero, .tool-detail-hero, .article-detail-hero,
 .comparison-hero, .city-detail-hero, .account-hero, .page-hero) :is(p, .eyebrow, .breadcrumbs) {
  color: var(--soft, #c9c0b6);
}
html.dark .bp-theme :is(.icon-button, .mobile-menu-toggle) {
  background: var(--sheet, #2e2925);
  border-color: var(--edge, #534b43);
  color: var(--ink, #faf6ed);
}

/* Auth panel spacing: previously the dark promo area touched the container edge. */
.bp-theme .member-auth-grid { gap: clamp(22px, 4vw, 64px); align-items: stretch; }
.bp-theme .member-auth-copy {
  box-sizing: border-box;
  border-radius: clamp(18px, 2.5vw, 28px);
  min-width: 0;
  padding: clamp(28px, 4vw, 56px) !important;
  background: #332b24;
  color: #fff9f2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-wrap: anywhere;
}
.bp-theme .member-auth-copy > .eyebrow { color: #ffd1ad; }
.bp-theme .member-auth-copy h1 {
  max-width: 17ch;
  margin: 18px 0 20px;
  color: #fff9f2;
  font-size: clamp(32px, 3.8vw, 56px);
  line-height: 1.11;
  letter-spacing: -.045em;
  overflow-wrap: normal;
}
.bp-theme .member-auth-copy > p {
  max-width: 48ch;
  color: #efe1d6;
  line-height: 1.7;
}
.bp-theme .member-auth-copy .member-benefits { margin-top: 26px; }
.bp-theme .member-auth-copy .member-benefits span {
  color: #fff9f2;
  background: rgba(255, 255, 255, .095);
  border: 1px solid rgba(255, 255, 255, .19);
}
.bp-theme .member-auth-copy .privacy-promise {
  color: #fff9f2;
  background: rgba(255, 255, 255, .075);
  border: 1px solid rgba(255, 255, 255, .2);
}
.bp-theme .member-auth-copy .privacy-promise p { color: #efe1d6; }
.bp-theme .member-auth-card { min-width: 0; }

/* The existing login CTA and article links also follow the orange brand. */
.bp-theme .member-primary {
  background: #ff7417;
  color: #23150a;
  box-shadow: 0 10px 20px rgba(192, 89, 16, .16);
}
.bp-theme .member-primary:hover { background: #f56b0c; }
.bp-theme .read-more { color: #a6470d; }
html.dark .bp-theme .read-more { color: #ffb57a; }

/* Guide covers: use the uploaded image; otherwise show content-aware editorial art. */
.bp-theme .article-cover {
  display: block;
  position: relative;
  isolation: isolate;
  height: 195px;
  overflow: hidden;
  background: #f5e8dc;
  color: #503a2c;
}
.bp-theme .article-cover > img.article-cover-photo {
  display: block;
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.bp-theme .article-cover > img.article-cover-photo.is-broken { display: none; }
.bp-theme .article-cover > .article-cover-category {
  z-index: 3;
  max-width: calc(100% - 30px);
  background: rgba(255, 253, 250, .92);
  color: #493221;
  border: 1px solid rgba(68, 42, 20, .09);
  white-space: normal;
}
.bp-theme .article-cover-fallback {
  display: flex;
  position: absolute;
  z-index: 1;
  inset: 0;
  box-sizing: border-box;
  border-radius: 0; /* Override legacy .article-cover > span pill radius. */
  font-size: inherit;
  font-weight: inherit;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
  padding: 52px 24px 22px;
  overflow: hidden;
  background: radial-gradient(ellipse at 80% 0%, #ffd9bd 0%, transparent 65%), linear-gradient(135deg, #f6e8d7, #fff6ef);
}
.bp-theme .article-cover-fallback-mark {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  color: #955a30;
}
.bp-theme .article-cover-fallback-title {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-size: clamp(17px, 1.7vw, 23px);
  line-height: 1.35;
  letter-spacing: -.035em;
  font-weight: 750;
  color: #48301f;
}
.bp-theme .article-cover.cover-2 .article-cover-fallback { background: radial-gradient(ellipse at 88% 5%, #dee9de, transparent 65%), linear-gradient(135deg, #e4ece5, #f7faf3); }
.bp-theme .article-cover.cover-3 .article-cover-fallback { background: radial-gradient(ellipse at 88% 5%, #e6dff1, transparent 65%), linear-gradient(135deg, #ebe7f4, #faf8ff); }
.bp-theme .article-cover.cover-2 .article-cover-fallback-title { color: #2c493b; }
.bp-theme .article-cover.cover-3 .article-cover-fallback-title { color: #423454; }

/* Prevent sub-pixel text movement from card transforms during mouseover. */
.bp-theme :is(.tool-card, .article-card, .category-card, .city-card, .article-tool-grid a) {
  transform: none !important;
  transition-property: box-shadow, border-color !important;
  transition-duration: .15s !important;
  transition-timing-function: ease-out !important;
}
.bp-theme :is(.tool-card, .article-card, .category-card, .city-card, .article-tool-grid a):hover {
  transform: none !important;
}
.bp-theme .article-card { overflow: hidden; }
.bp-theme :is(.atlas h1, .atlas-head h2, .listing-hero h1, .member-auth-copy h1) {
  text-rendering: optimizeLegibility;
}

/* Mobile bounds and readable typography in either theme. */
@media (max-width: 1000px) {
  .bp-theme .member-auth-grid { gap: 22px; }
}
@media (max-width: 720px) {
  .bp-theme .search-panel { padding: 14px 0 18px; }
  .bp-theme .search-panel form div { display: flex; }
  .bp-theme .search-panel input { min-width: 0; }
  .bp-theme .search-panel button { padding-inline: 14px; }
  .bp-theme .member-auth-copy { padding: 30px 26px !important; min-height: 0; }
  .bp-theme .member-auth-copy h1 { max-width: none; font-size: clamp(30px, 9vw, 42px); }
  .bp-theme .member-auth-copy > p { font-size: 15px; }
  .bp-theme .article-cover { height: 205px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .bp-theme *, .bp-theme *::before, .bp-theme *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Mobile theme control: desktop toggle is intentionally hidden below 700px. */
.bp-theme .mobile-nav .mobile-theme-toggle{display:block;width:100%;border:0;border-top:1px solid var(--edge,#e6e1d9);padding:17px 25px;background:transparent;color:var(--ink,#171613);font:inherit;font-weight:700;text-align:left;cursor:pointer}
.bp-theme .mobile-nav .mobile-theme-toggle:focus-visible{outline:3px solid #ff7417;outline-offset:-3px}
@media(min-width:1001px){.bp-theme .mobile-theme-toggle{display:none}}
