/* ---------------------------------------------------------------
   TOKENS
--------------------------------------------------------------- */
:root {
  --ink: #1A2330;
  --ink-soft: #4A5568;
  --stone: #ECEAE2;
  --surface: #FFFFFF;
  --line: #DAD6C9;
  --navy: #143650;
  --navy-deep: #0E2638;
  --copper: #B8722F;
  --copper-soft: #F1E2CE;
  --teal: #2E6B62;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------
   HEADER
--------------------------------------------------------------- */
.site-header {
  background: var(--navy);
  background-image: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #F2F0E9;
  padding: 2.75rem 1.5rem 2.25rem;
}

.header-inner {
  max-width: 62rem;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-mark {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(242, 240, 233, 0.35);
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}

.brand-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: #C9CFD6;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  letter-spacing: -0.01em;
}

.header-note {
  margin: 1.1rem 0 0;
  color: #C9CFD6;
  font-size: 0.95rem;
  max-width: 32rem;
}

/* ---------------------------------------------------------------
   MAIN / TOOLBAR
--------------------------------------------------------------- */
main {
  flex: 1;
  max-width: 62rem;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-field {
  position: relative;
  flex: 1 1 20rem;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--ink-soft);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
}

.search-field input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(20, 54, 80, 0.15);
}

.search-field input::placeholder {
  color: #8B8C7F;
}

.result-count {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   DIRECTORY LIST (bina tabelası düzeni)
--------------------------------------------------------------- */
.directory {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1.5px solid var(--navy);
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 44rem) {
  .directory {
    grid-template-columns: 1fr 1fr;
  }
}

.directory-row {
  border-bottom: 1px solid var(--line);
}

.directory-row:nth-child(odd) {
  border-right: 1px solid var(--line);
}

@media (max-width: 43.99rem) {
  .directory-row:nth-child(odd) {
    border-right: none;
  }
}

.directory-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.9rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
}

.directory-link:hover,
.directory-link:focus-visible {
  background: var(--copper-soft);
}

.directory-link:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}

.row-badge {
  flex-shrink: 0;
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--navy);
  color: #F2F0E9;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
}

.row-name {
  flex: 1;
  font-size: 0.98rem;
  line-height: 1.35;
}

.row-arrow {
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--copper);
  transform: translateX(0);
  transition: transform 0.15s ease;
}

.directory-link:hover .row-arrow {
  transform: translateX(3px);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: 6px;
  margin-top: 1rem;
}

/* ---------------------------------------------------------------
   DETAIL PAGE HEADER (mudurluk.html)
--------------------------------------------------------------- */
.site-header--compact {
  padding: 1.75rem 1.5rem 1.75rem;
}

.back-link {
  display: inline-block;
  color: #C9CFD6;
  font-size: 0.85rem;
  text-decoration: none;
  margin-bottom: 1rem;
}

.back-link:hover {
  color: #F2F0E9;
  text-decoration: underline;
}

.site-header--compact .brand-text h1 {
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
}

/* ---------------------------------------------------------------
   DETAIL MAIN LAYOUT
--------------------------------------------------------------- */
.detail-main {
  flex: 1;
  max-width: 46rem;
  width: 100%;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 3rem;
}

.faq-section h2,
.chat-section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0 0 1rem;
  color: var(--navy-deep);
}

/* ---------------------------------------------------------------
   FAQ ACCORDION
--------------------------------------------------------------- */
.faq-list {
  border-top: 1.5px solid var(--navy);
  margin-bottom: 2.5rem;
}

.faq-item {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: "+";
  flex-shrink: 0;
  width: 1.3rem;
  height: 1.3rem;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: var(--copper-soft);
  color: var(--copper);
  font-size: 0.95rem;
  line-height: 1;
}

.faq-item[open] summary::before {
  content: "–";
}

.faq-item[open] summary {
  background: var(--copper-soft);
}

.faq-answer {
  margin: 0;
  padding: 0 1rem 1rem 2.9rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------
   CHAT / GEMINI ASSISTANT
--------------------------------------------------------------- */
.chat-section {
  border: 1.5px solid var(--navy);
  border-radius: 8px;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--surface);
}

.chat-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chat-heading-row h2 { margin: 0; }

.chat-subtitle {
  margin: 0.6rem 0 1rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.25rem 0.1rem 0.75rem;
  margin-bottom: 0.75rem;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-bubble--user {
  align-self: flex-end;
  background: var(--navy);
  color: #F2F0E9;
  border-bottom-right-radius: 3px;
}

.chat-bubble--model {
  align-self: flex-start;
  background: var(--stone);
  color: var(--ink);
  border-bottom-left-radius: 3px;
}

.chat-bubble--loading {
  color: var(--ink-soft);
  font-style: italic;
}

.chat-bubble--error {
  background: #F6DDD6;
  color: #7A2E1A;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.chat-form input {
  flex: 1;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.chat-form input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(20, 54, 80, 0.15);
}

.chat-form button {
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: 6px;
  background: var(--copper);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.chat-form button:hover { background: #9E5F23; }
.chat-form button:disabled { opacity: 0.6; cursor: progress; }

/* ---------------------------------------------------------------
   FOOTER
--------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
