/* hesap-content base styles. Layout is shared; brand themes override CSS variables in theme.css */

:root {
  --color-bg: #ffffff;
  --color-surface: #f7f8fb;
  --color-text: #1a1f2e;
  --color-text-muted: #5a6377;
  --color-border: #e3e7ef;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-soft: #eef2ff;
  --color-accent: #f59e0b;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
  --font-base: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-base);
  --container-max: 1120px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* HTML hidden attribute must beat explicit display: rules below (.lang-panel-menu / .lang-option use display: flex) */
[hidden] { display: none !important; }
body {
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body { text-align: right; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
}
.header-inner {
  display: flex; align-items: center;
  padding: 14px 20px;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--color-text); font-family: var(--font-display); flex-shrink: 0; }
.brand:hover { color: var(--color-primary); }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }

.primary-nav {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.primary-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.primary-nav a:hover { background: var(--color-surface); color: var(--color-text); }
.primary-nav a.active { background: var(--color-primary-soft); color: var(--color-primary-dark); }
.nav-icon { font-size: 16px; line-height: 1; }

.header-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Hamburger button — hidden on desktop, visible <768px */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  padding: 0;
  cursor: pointer;
  align-items: center; justify-content: center;
  margin-left: auto;
}
.nav-toggle:hover { background: var(--color-surface); border-color: var(--color-primary); }
.nav-toggle-icon { position: relative; display: inline-block; width: 18px; height: 14px; }
.nav-toggle-icon span {
  position: absolute; left: 0; right: 0; height: 2px; background: var(--color-text); border-radius: 1px;
  transition: transform .2s ease, opacity .15s ease;
}
.nav-toggle-icon span:nth-child(1) { top: 0; }
.nav-toggle-icon span:nth-child(2) { top: 6px; }
.nav-toggle-icon span:nth-child(3) { top: 12px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile layout: hamburger swaps in for inline calc nav.
   Primary-nav is anchored to .site-header (full viewport width) so the drop-down
   isn't constrained to the .container's inner padding. */
.site-header { position: relative; }
@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; order: 2; margin-left: 0; }
  .header-tools { order: 3; }
  .brand { order: 1; margin-right: auto; }
  .primary-nav {
    order: 4;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 20px;
    gap: 2px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
  }
  .primary-nav a { padding: 12px 14px; font-size: 15px; }
  .primary-nav:not(.is-open) { display: none; }
  .brand-name { font-size: 16px; }
}
/* Language panel — dropdown listing all 53 languages by native name */
.lang-panel { position: relative; margin-left: 8px; }
.lang-panel-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
}
.lang-panel-toggle:hover { background: var(--color-surface); border-color: var(--color-primary); }
.lang-current { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-arrow { font-size: 10px; opacity: .6; }

.lang-panel-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(380px, 92vw);
  max-height: 70vh;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: flex;
  flex-direction: column;
}
[dir="rtl"] .lang-panel-menu { right: auto; left: 0; }
.lang-search-wrap { padding: 8px; border-bottom: 1px solid var(--color-border); }
.lang-search {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--color-surface);
}
.lang-search:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }
.lang-panel-list {
  overflow-y: auto;
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.lang-empty { padding: 24px 16px; text-align: center; color: var(--color-text-muted); font-size: 13px; margin: 0; }
.lang-option {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.25;
}
.lang-option:hover, .lang-option:focus-visible { background: var(--color-surface); color: var(--color-text); outline: none; }
.lang-option.is-current { background: var(--color-primary-soft); color: var(--color-primary-dark); font-weight: 600; }
.lang-native { font-weight: 600; }
.lang-english { font-size: 11px; color: var(--color-text-muted); }
.lang-option.is-current .lang-english { color: var(--color-primary-dark); opacity: .75; }

/* Footer language directory — grouped by region for easier scanning */
.lang-directory {
  border-top: 1px solid var(--color-border);
  margin-top: 24px;
  padding: 24px 0 8px;
  font-size: 13px;
}
.lang-directory .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.lang-region-title {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-muted);
  font-weight: 700;
}
.lang-region-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-strip-link {
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  padding: 3px 0;
}
.lang-strip-link:hover { color: var(--color-primary); }
.lang-strip-link.is-current { color: var(--color-primary); font-weight: 600; }

/* Main */
.site-main { padding: 40px 0 64px; min-height: 60vh; }

/* Hero */
.hero {
  text-align: center;
  padding: 56px 16px 24px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.2vw, 48px);
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -.02em;
}
.hero-sub {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto 24px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover { background: var(--color-surface); color: var(--color-text); }

/* Calc grid */
.calc-grid-section { margin-top: 32px; }
.calc-grid-section h2 {
  text-align: center;
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 28px;
  letter-spacing: -.015em;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.calc-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  color: var(--color-text);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
  display: block;
}
.calc-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  color: var(--color-text);
}
.calc-card-icon { font-size: 40px; margin-bottom: 10px; }
.calc-card-title { font-family: var(--font-display); margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; }
.calc-card-desc { color: var(--color-text-muted); margin: 0; font-size: 14px; }

/* Breadcrumbs */
.breadcrumbs { font-size: 13px; color: var(--color-text-muted); margin-bottom: 12px; }
.breadcrumbs .sep { margin: 0 8px; opacity: .5; }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }

/* Calculator page */
.calc-page { margin-top: 16px; }
.calc-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.calc-icon-lg {
  font-size: 48px;
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-soft);
  border-radius: var(--radius-lg);
}
.calc-header h1 { margin: 0 0 4px; font-family: var(--font-display); font-size: 30px; letter-spacing: -.015em; }
.calc-desc { color: var(--color-text-muted); margin: 0; }
.calc-shell {
  display: grid;
  grid-template-columns: minmax(0, 380px) 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 800px) {
  .calc-shell { grid-template-columns: 1fr; gap: 20px; }
}

/* Form */
.calc-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.calc-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--color-text-muted); font-weight: 500; }
.calc-form input, .calc-form select {
  font: inherit;
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  width: 100%;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.calc-form input:focus, .calc-form select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.form-actions .btn { flex: 1; }
.note { font-size: 12px; color: var(--color-text-muted); margin: 4px 0 0; }

/* Result */
.calc-result { min-width: 0; }
.result-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin: 0 0 16px;
}
.calc-result h2 { font-family: var(--font-display); font-size: 22px; margin: 0; letter-spacing: -.01em; }
.btn-share {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
}
.btn-share:hover { background: var(--color-surface); color: var(--color-primary); border-color: var(--color-primary); }
.btn-share.is-copied { background: var(--color-primary-soft); color: var(--color-primary-dark); border-color: var(--color-primary); }
.btn-share .share-label { white-space: nowrap; }
.result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.result-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.result-card label { display: block; font-size: 12px; color: var(--color-text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.result-card strong { display: block; font-size: 20px; font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
.result-card.primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.result-card.primary label { color: rgba(255,255,255,.85); }
.result-card.primary strong { color: #fff; }

/* Table */
.schedule-title { font-family: var(--font-display); font-size: 17px; margin: 0 0 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.schedule-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 480px; }
.schedule-table th, .schedule-table td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--color-border); }
.schedule-table th { background: var(--color-surface); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
.schedule-table th:first-child, .schedule-table td:first-child { text-align: left; }
.schedule-table tr:last-child td { border-bottom: none; }
[dir="rtl"] .schedule-table th, [dir="rtl"] .schedule-table td { text-align: left; }
[dir="rtl"] .schedule-table th:first-child, [dir="rtl"] .schedule-table td:first-child { text-align: right; }

/* Legal pages */
.legal-page { max-width: 760px; margin: 0 auto; padding: 8px 0 40px; }
.legal-page h1 { font-family: var(--font-display); font-size: 32px; letter-spacing: -.015em; margin: 0 0 24px; }
.legal-body h2 { font-family: var(--font-display); font-size: 20px; margin: 28px 0 10px; letter-spacing: -.01em; }
.legal-body p, .legal-body ul { font-size: 15px; line-height: 1.7; color: var(--color-text); }
.legal-body ul { padding-left: 22px; }
.legal-body li { margin-bottom: 6px; }
.legal-body a { color: var(--color-primary); text-decoration: underline; }
.legal-body a:hover { color: var(--color-primary-dark); }

/* Footer */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); margin-top: 60px; padding: 32px 0; }
.footer-inner { display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center; }
.footer-brand { display: flex; flex-direction: column; gap: 2px; }
.footer-brand strong { font-family: var(--font-display); font-size: 16px; }
.footer-brand span { color: var(--color-text-muted); font-size: 13px; }
.footer-links { display: flex; gap: 14px; }
.footer-links a { color: var(--color-text-muted); font-size: 14px; }
.footer-links a:hover { color: var(--color-primary); }
.footer-copy { color: var(--color-text-muted); font-size: 12px; }
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-links { justify-content: center; }
}
