/* =========================================================
   css/base.css  -  tasarım değişkenleri, temel stiller ve
   tüm sayfalarda ortak bileşenler (header, footer, buton,
   rozet, modal, hero)
   ========================================================= */

/* ---------- Renk paleti ve ölçüler ---------- */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-alt: #efece5;
  --border: #ddd8ce;

  --text: #1f2933;
  --text-muted: #5b6470;

  --primary: #2f6f62;
  --primary-hover: #265b50;
  --primary-soft: #e2efeb;
  --on-primary: #ffffff;

  --danger: #b3261e;
  --danger-hover: #8f1d17;
  --danger-soft: #fbe9e7;

  --overlay: rgba(31, 41, 51, 0.6);
  --focus: rgba(47, 111, 98, 0.35);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(31, 41, 51, 0.06), 0 4px 12px rgba(31, 41, 51, 0.06);

  --gutter: clamp(1rem, 4vw, 2rem);
  --container: 1200px;
}

/* ---------- Temel ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
}

body.has-modal {
  overflow: hidden;
}

main {
  flex: 1;
}

img {
  display: block;
  max-width: 100%;
}

/* hidden özniteliği, display veren sınıflara karşı da çalışsın */
[hidden] {
  display: none !important;
}

/* Kaydırma çubukları gizli, kaydırma çalışmaya devam eder */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
}

/* Ekranda görünmez ama klavye ve ekran okuyucu için erişilebilir */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: var(--primary);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* ---------- Bileşen: Header (<site-header>) ---------- */
site-header,
site-footer {
  display: block;
}

site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Header ve footer aynı zemin rengini kullanır */
.site-header {
  background-color: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  min-height: 64px;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
  font-size: clamp(1.1rem, 4.5vw, 1.5rem);
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand__logo {
  width: clamp(28px, 8vw, 40px);
  height: auto;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.user-chip svg {
  width: 20px;
  height: 20px;
}

.user-chip__name {
  max-width: min(40vw, 22ch);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Bileşen: Footer (<site-footer>) ---------- */
/* İnce şerit: solda telif metni, sağda silik imza logosu */
.site-footer {
  background-color: var(--surface-alt);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding-block: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.3;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.site-footer__copy {
  flex: 1;
  min-width: 0;
}

.signature {
  flex: none;
  display: inline-flex;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  opacity: 0.4;
  transition: opacity 0.15s ease;
}

.signature:hover,
.signature:focus-visible {
  opacity: 0.85;
}

.signature img {
  width: auto;
  height: 20px;
}

/* ---------- Bileşen: Buton ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn--sm {
  min-height: 38px;
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
}

.btn--block {
  width: 100%;
}

.btn--primary {
  background-color: var(--primary);
  color: var(--on-primary);
}

.btn--primary:hover {
  background-color: var(--primary-hover);
}

.btn--secondary {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn--secondary:hover {
  background-color: var(--border);
}

.btn--danger {
  background-color: var(--danger-soft);
  color: var(--danger);
}

.btn--danger:hover {
  background-color: var(--danger);
  color: var(--on-primary);
}

.btn:disabled {
  background-color: var(--surface-alt);
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ---------- Bileşen: Rozet ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  border-radius: 999px;
}

.badge--success {
  background-color: var(--primary-soft);
  color: var(--primary-hover);
}

/* ---------- Bileşen: Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: var(--overlay);
  overflow-y: auto;
}

.modal.is-open {
  display: flex;
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: clamp(1rem, 4vw, 1.75rem);
  overflow-y: auto;
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal__dialog:focus {
  outline: none;
}

.modal__dialog--media {
  width: fit-content;
  max-width: 100%;
  padding: 3rem 1rem 1rem;
}

.modal__title {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  padding-right: 2.5rem;
}

.modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.modal__close:hover {
  background-color: var(--surface-alt);
  color: var(--text);
}

.modal__image {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  max-height: calc(100dvh - 9rem);
  margin-inline: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* ---------- Bileşen: Hero (ana sayfa) ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(22rem, 52vw, 38rem);
  padding: var(--gutter);
  overflow: hidden;
}

.hero__image {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__panel {
  display: grid;
  gap: 1rem;
  max-width: 640px;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  text-align: center;
  color: #fff;
  background-color: rgba(31, 41, 51, 0.72);
  border-radius: var(--radius);
}

.hero__panel p {
  font-size: clamp(0.95rem, 2.6vw, 1.15rem);
  line-height: 1.6;
}
