/* Integration additions on top of the design's style.css (keep style.css untouched). */

/* Cards / featured post with an uploaded image instead of the texture placeholder */
.post__media--img { background-size: cover; background-position: center; background-repeat: no-repeat; }

/* Rich text coming from the admin editor */
.prose img { max-width: 100%; height: auto; border-radius: var(--r-lg, 8px); }
.prose iframe { max-width: 100%; }
.prose table { width: 100%; }

/* Tag links reuse the .tag look */
a.tag { text-decoration: none; }
a.tag:hover { border-color: var(--c-gold); }

/* Filter buttons rendered as links (blog categories) */
a.filter { text-decoration: none; display: inline-flex; align-items: center; }

/* Header dropdown for categories without their own page (e.g. "Kurumsal") */
.nav__item--sub { position: relative; }
.nav__toggle { background: none; border: 0; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 6px; }
.nav__caret { width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .7; }
.nav__sub {
  position: absolute; top: 100%; left: -18px; min-width: 220px; padding: 10px 0; margin-top: 10px;
  background: var(--c-navy); border-top: 1px solid var(--c-gold); box-shadow: 0 12px 32px rgba(8, 23, 41, .35);
  list-style: none; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
/* hover bridge so the menu does not close while moving the pointer down */
.nav__sub::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.nav__item--sub:hover .nav__sub,
.nav__item--sub:focus-within .nav__sub,
.nav__item--sub.is-open .nav__sub { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__sublink { display: block; padding: 9px 18px; color: rgba(255, 255, 255, .85); font-size: var(--fs-300); white-space: nowrap; }
.nav__sublink:hover, .nav__sublink:focus-visible, .nav__sublink.is-current { color: var(--c-gold-soft); background: rgba(255, 255, 255, .04); }

/* Mobile menu: category label with its page types underneath */
.menu__group { padding: var(--sp-4) 0 var(--sp-3); }
.menu__grouplabel { display: block; font-size: var(--fs-100); letter-spacing: var(--ls-wide); text-transform: uppercase; color: var(--c-gold); }
.menu__sublist { list-style: none; display: flex; flex-direction: column; margin-top: var(--sp-2); padding-left: var(--sp-4); border-left: 1px solid var(--c-gold); }
.menu__link--sub { padding: var(--sp-2) 0; font-size: clamp(1.3rem, 5.5vw, 1.6rem); }

/* ---------- chat assistant (Front.partials.chat, assets/js/chat.js) ---------- */
/* Launcher sits left of the 60px contact toggle; .chat--solo when there is no contact button */
.chat__dock {
  position: fixed; z-index: var(--z-fab);
  right: calc(var(--gutter) + 60px + var(--sp-3) + env(safe-area-inset-right));
  bottom: calc(var(--gutter) + 2px + env(safe-area-inset-bottom));
  transition: transform var(--t-base) var(--ease);
}
.chat--solo .chat__dock { right: calc(var(--gutter) + env(safe-area-inset-right)); }
.fab.is-lifted ~ .chat .chat__dock { transform: translateY(calc(-1 * (var(--cookie-h, 0px) + var(--sp-3)))); }
body.is-menu-open .chat { visibility: hidden; }

.chat__launcher {
  position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--c-white); color: var(--c-navy); border: 1px solid var(--c-gold); box-shadow: var(--sh-lg);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.chat__launcher:hover { background: var(--c-ivory); transform: translateY(-2px); }
.chat__launcher svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.chat__launcher-close { display: none; }
.chat.is-open .chat__launcher { background: var(--c-navy); color: var(--c-gold); border-color: var(--c-navy); }
.chat.is-open .chat__launcher-open { display: none; }
.chat.is-open .chat__launcher-close { display: block; }

/* greeting bubble above the launcher, once per visit */
.chat__teaser {
  position: absolute; right: 0; bottom: calc(100% + var(--sp-3)); width: max-content; max-width: min(280px, calc(100vw - 2 * var(--gutter)));
  display: flex; align-items: flex-start; gap: var(--sp-1);
  background: var(--c-white); border-top: 2px solid var(--c-gold); border-radius: var(--r-md); box-shadow: var(--sh-lg);
  opacity: 0; transform: translateY(8px); transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.chat__teaser[hidden] { display: none; }
.chat__teaser.is-in { opacity: 1; transform: none; }
.chat__teaser::after { content: ""; position: absolute; right: 22px; bottom: -6px; width: 12px; height: 12px; background: var(--c-white); transform: rotate(45deg); box-shadow: 3px 3px 6px rgba(11, 31, 58, .06); }
.chat__teaser-text { padding: var(--sp-3) 0 var(--sp-3) var(--sp-4); text-align: left; font-size: var(--fs-300); line-height: 1.5; color: var(--c-text); }
.chat__teaser-close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin: var(--sp-1); color: var(--c-text-muted); border-radius: 50%; }
.chat__teaser-close:hover { color: var(--c-navy); background: var(--c-stone-100); }
.chat__teaser-close svg, .chat__icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* panel */
.chat__panel {
  position: fixed; z-index: 450;
  right: calc(var(--gutter) + env(safe-area-inset-right));
  bottom: calc(var(--gutter) + 60px + var(--sp-4) + env(safe-area-inset-bottom));
  width: 380px; height: min(600px, calc(100dvh - 140px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--c-ivory); border-radius: var(--r-lg); box-shadow: 0 24px 64px rgba(8, 23, 41, .28);
  animation: chatIn var(--t-base) var(--ease);
}
.chat__panel[hidden] { display: none; }
@media (min-width: 560px) { .fab.is-lifted ~ .chat .chat__panel { transform: translateY(calc(-1 * (var(--cookie-h, 0px) + var(--sp-3)))); } }
@keyframes chatIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.chat__head {
  position: relative; display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-3) var(--sp-4) var(--sp-5); background: var(--c-navy); color: var(--c-white);
}
.chat__head::after { content: ""; position: absolute; left: 0; bottom: 0; width: 120px; height: 2px; background: var(--c-gold); }
.chat__avatar {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--c-gold); color: var(--c-gold-soft); font-family: var(--ff-serif); font-size: 1.375rem; line-height: 1;
}
.chat__heading { flex: 1; min-width: 0; }
.chat__title { font-family: var(--ff-serif); font-size: var(--fs-500); line-height: 1.2; color: var(--c-white); }
.chat__sub { display: flex; align-items: center; gap: 6px; font-size: var(--fs-100); color: rgba(255, 255, 255, .65); letter-spacing: .02em; }
.chat__dot { width: 7px; height: 7px; border-radius: 50%; background: #6FBF8E; }
.chat__icon-btn { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: rgba(255, 255, 255, .75); }
.chat__icon-btn:hover { color: var(--c-gold-soft); background: rgba(255, 255, 255, .08); }

.chat__log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-5) var(--sp-4) var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-4); }
.chat__msg { display: flex; flex-direction: column; gap: var(--sp-2); max-width: 88%; animation: chatIn var(--t-base) var(--ease); }
.chat__msg--bot { align-self: flex-start; align-items: flex-start; }
.chat__msg--user { align-self: flex-end; align-items: flex-end; }
.chat__bubble { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); font-size: var(--fs-300); line-height: 1.6; overflow-wrap: anywhere; }
.chat__bubble p + p { margin-top: var(--sp-1); }
.chat__msg--bot .chat__bubble { background: var(--c-white); color: var(--c-text); border: 1px solid var(--c-line); border-top-left-radius: 2px; }
.chat__msg--user .chat__bubble { background: var(--c-navy); color: var(--c-white); border-top-right-radius: 2px; }

.chat__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chat__action {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 var(--sp-4); border-radius: 999px;
  background: var(--c-navy); color: var(--c-white); font-size: var(--fs-200); font-weight: 600;
}
.chat__action:hover, .chat__action:focus-visible { background: var(--c-gold); color: var(--c-navy); }
.chat__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-1); }
.chat__chips-label { width: 100%; font-size: var(--fs-100); letter-spacing: var(--ls-mid); text-transform: uppercase; color: var(--c-text-muted); }
.chat__chip {
  padding: 6px var(--sp-3); border: 1px solid var(--c-gold); border-radius: 999px; background: transparent;
  color: var(--c-navy); font-size: var(--fs-200); line-height: 1.4; text-align: left;
  transition: background var(--t-fast) var(--ease);
}
.chat__chip:hover, .chat__chip:focus-visible { background: rgba(184, 152, 90, .16); }

.chat__typing .chat__bubble { display: flex; gap: 4px; padding: var(--sp-3) var(--sp-4); }
.chat__typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--c-stone-400); animation: chatDot 1s infinite ease-in-out; }
.chat__typing span:nth-child(2) { animation-delay: .15s; }
.chat__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatDot { 0%, 80%, 100% { opacity: .35; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

.chat__form { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-3) var(--sp-2) var(--sp-4); background: var(--c-white); border-top: 1px solid var(--c-line); }
.chat__input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--c-text); }
.chat__input:focus { outline: none; }
.chat__form:focus-within { box-shadow: inset 0 2px 0 var(--c-gold); }
.chat__send { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--c-gold); color: var(--c-navy); transition: background var(--t-fast) var(--ease); }
.chat__send:hover { background: var(--c-gold-soft); }
.chat__send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.chat__note { padding: 0 var(--sp-4) var(--sp-3); background: var(--c-white); font-size: 11px; line-height: 1.5; color: var(--c-text-muted); }

/* phones: the panel takes the whole screen */
@media (max-width: 559px) {
  .chat__panel { inset: 0; width: auto; height: 100dvh; border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
  .chat__head { padding-top: calc(var(--sp-4) + env(safe-area-inset-top)); }
  .chat__msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .chat__panel, .chat__msg, .chat__teaser { animation: none; transition: none; }
  .chat__typing span { animation: none; }
}
@media print { .chat { display: none !important; } }
