/* ==========================================================================
   DentalOnam - Mobil & Tablet Duyarlılık (Responsive) ve Tipografi Dengesi
   Header ile gövde (body) font büyüklüklerini dengeler, sıfır yatay scroll sağlar.
   ========================================================================== */

/* Global Yatay Taşma Koruması */
html,
body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}

main,
section,
article,
aside,
header,
footer,
.container,
.card,
.form-card,
.step-card,
.law-article-card,
.hero-preview-card,
.hero-preview-wrapper,
.hero-content {
  max-width: 100%;
  min-width: 0;
}

/* Uzun URL, Kod, Hash ve Başlıkların Mobilde Taşmasını Önleme (Tablo hücrelerinde harf bölünmesini engelle) */
p,
li,
h1,
h2,
h3,
h4,
h5,
h6,
.law-article-body,
.law-article-title,
.article-title,
.consent-title,
.faq-question,
.faq-answer {
  overflow-wrap: break-word;
  word-break: normal;
}

td,
th {
  overflow-wrap: normal;
  word-break: normal;
}

code,
pre {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 100%;
}

/* Masaüstü & Genel Gövde-Header Font Oranı Dengesi */
h1,
.library-title {
  font-size: 2.05rem;
  line-height: 1.25;
}

h2 {
  font-size: 1.55rem;
  line-height: 1.3;
}

h3,
.feature-title {
  font-size: 1.18rem;
  line-height: 1.35;
}

.hero-lead {
  font-size: 1rem;
  line-height: 1.6;
}

.section-header p,
.library-subtitle {
  font-size: 0.96rem;
  line-height: 1.55;
}

main p,
.card p {
  font-size: 0.92rem;
}

.btn-lg {
  padding: 0.68rem 1.35rem;
  font-size: 0.92rem;
}

/* İletişim Sayfası 2 Sütunlu Grid Düzeni */
.contact-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 2.25rem;
  align-items: start;
}

/* ==========================================================================
   1. Büyük Tablet & Küçük Dizüstü (<= 1100px)
   ========================================================================== */
@media (max-width: 1100px) {
  .container {
    padding: 0 1.25rem;
  }

  h1,
  .library-title {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .hero-grid {
    gap: 2rem;
  }

  .nav-links {
    gap: 1.1rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/* ==========================================================================
   2. Mobil & Tablet Navigasyon ve Düzen (<= 992px)
   ========================================================================== */
@media (max-width: 992px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .nav-container {
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    min-height: 68px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .nav-container > nav {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
  }

  .nav-links {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: rgba(10, 15, 29, 0.98) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column !important;
    padding: 1.1rem 1.25rem !important;
    gap: 0.7rem !important;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
    display: none !important;
    z-index: 1001;
    pointer-events: auto;
  }

  [data-theme="light"] .nav-links {
    background: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12) !important;
  }

  .nav-links.mobile-open {
    display: flex !important;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-link {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.45rem 0 !important;
    font-size: 0.92rem !important;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    color: var(--text-main, #ffffff);
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
  }

  [data-theme="light"] .mobile-menu-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.5rem !important;
  }

  .hero-section {
    padding: 2rem 0 2rem 0 !important;
    width: 100% !important;
    height: auto !important;
  }

  .contact-layout-grid,
  .library-layout,
  .law-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.5rem !important;
  }

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ==========================================================================
   3. Cep Telefonu Ekranları: Header, Gövde Fontları ve Tablo Düzeni (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  body {
    font-size: 0.84rem !important;
    line-height: 1.5 !important;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  main.container,
  section.container {
    padding-top: 1.25rem !important;
    padding-bottom: 1.75rem !important;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  /* Header: Okunaklı, Net ve Gövdeyle Tam Orantılı */
  .nav-container {
    min-height: 60px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
    gap: 6px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .brand-logo {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  .brand-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 17px !important;
    flex-shrink: 0 !important;
  }

  .brand-text {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .brand-title {
    display: block !important;
    font-size: 1.05rem !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .brand-subtitle {
    display: block !important;
    font-size: 0.56rem !important;
    letter-spacing: 0.02em !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .nav-actions {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin-left: 0 !important;
    flex-shrink: 0 !important;
  }

  .nav-button-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    align-items: stretch !important;
  }

  .nav-actions .btn-nav {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 3.5px 7px !important;
    font-size: 0.68rem !important;
    line-height: 1.15 !important;
    gap: 4px !important;
    border-radius: 5px !important;
    white-space: nowrap !important;
    width: auto !important;
  }

  .nav-actions .btn-nav svg {
    width: 11px !important;
    height: 11px !important;
    flex-shrink: 0 !important;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    padding: 5px !important;
    flex-shrink: 0 !important;
  }

  /* Gövde Başlıkları (Header ile Orantılı Küçültülmüş Ölçek) */
  h1,
  main h1,
  section h1,
  .hero-content h1,
  .library-title,
  .law-main-title {
    font-size: 1.18rem !important;
    line-height: 1.28 !important;
    margin-bottom: 0.65rem !important;
  }

  h2,
  main h2,
  section h2,
  .section-header h2,
  .card h2,
  .portal-main-card h2 {
    font-size: 1.02rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.5rem !important;
  }

  h3,
  main h3,
  .card h3,
  .feature-title,
  .step-content h3,
  .consent-title,
  .article-title,
  .law-article-title,
  .modal-title {
    font-size: 0.92rem !important;
    line-height: 1.32 !important;
    margin-bottom: 0.4rem !important;
  }

  h4,
  main h4,
  .card h4,
  .hero-preview-header h4,
  .footer-title,
  .playlist-title {
    font-size: 0.84rem !important;
    line-height: 1.32 !important;
  }

  /* Gövde Paragrafları ve Açıklama Metinleri */
  .hero-lead,
  .section-header p,
  .library-subtitle {
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1.1rem !important;
  }

  p,
  main p,
  section p,
  .card p,
  .step-card p,
  .law-article-body,
  .law-article-comment,
  .faq-answer,
  .footer-desc,
  .modal-text,
  li {
    font-size: 0.78rem !important;
    line-height: 1.48 !important;
  }

  .card strong,
  main strong {
    font-size: 0.8rem !important;
  }

  .section-header {
    margin-bottom: 1.25rem !important;
  }

  /* Gövde İçi Butonlar ve Rozetler (Header Butonlarıyla Uyumlu) */
  main .btn,
  .hero-actions .btn,
  .btn-lg {
    padding: 0.5rem 0.95rem !important;
    font-size: 0.78rem !important;
    line-height: 1.25 !important;
    border-radius: 8px !important;
    max-width: 100% !important;
    white-space: normal !important;
    text-align: center !important;
    height: auto !important;
    gap: 6px !important;
  }

  main .btn svg,
  .hero-actions .btn svg,
  .btn-lg svg {
    width: 15px !important;
    height: 15px !important;
  }

  main .btn-sm {
    padding: 0.38rem 0.75rem !important;
    font-size: 0.72rem !important;
  }

  .badge,
  .step-badge,
  .preview-badge-status,
  .library-hero-badge {
    font-size: 0.65rem !important;
    padding: 0.2rem 0.55rem !important;
    max-width: 100% !important;
    white-space: normal !important;
    text-align: center;
  }

  /* ==========================================================================
     MOBİL TABLO -> DÜZGÜN KART DÜZENİ (Yönetmelik Uyum Matrisi & Tüm Tablolar)
     ========================================================================== */
  main section {
    padding: 1.15rem 0.95rem !important;
    margin-top: 1.75rem !important;
  }

  main table {
    display: block !important;
    width: 100% !important;
    border: none !important;
  }

  main table thead {
    display: none !important;
  }

  main table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
    width: 100% !important;
  }

  main table tbody tr {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.55rem !important;
    background: rgba(15, 23, 42, 0.65) !important;
    border: 1px solid rgba(56, 189, 248, 0.22) !important;
    border-radius: 12px !important;
    padding: 0.9rem 0.95rem !important;
    width: 100% !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
  }

  [data-theme="light"] main table tbody tr {
    background: #f8fafc !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
  }

  main table tbody td {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
    font-size: 0.78rem !important;
    line-height: 1.48 !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  /* 1. Hücre: Yönetmelik Maddesi Başlığı */
  main table tbody td:nth-child(1) {
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    color: #38bdf8 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding-bottom: 0.45rem !important;
    margin-bottom: 0.1rem !important;
  }

  [data-theme="light"] main table tbody td:nth-child(1) {
    color: #0284c7 !important;
    border-bottom-color: rgba(15, 23, 42, 0.1) !important;
  }

  /* 2. Hücre: Mevzuatın Emrettiği Şart */
  main table tbody td:nth-child(2)::before {
    content: "Mevzuatın Emrettiği Şart";
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 2px;
  }

  /* 3. Hücre: DentalOnam Çözüm Karşılığı */
  main table tbody td:nth-child(3)::before {
    content: "DentalOnam Çözüm Karşılığı";
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #2dd4bf;
    margin-bottom: 2px;
  }

  [data-theme="light"] main table tbody td:nth-child(3)::before {
    color: #0d9488;
  }

  /* 4. Hücre: Uyum Durumu Rozeti */
  main table tbody td:nth-child(4) {
    padding-top: 0.25rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  main table tbody td:nth-child(4) .badge {
    white-space: nowrap !important;
    display: inline-flex !important;
    width: auto !important;
    padding: 0.25rem 0.7rem !important;
    font-size: 0.7rem !important;
  }

  /* Hero Bölümü */
  .hero-section {
    padding: 1.15rem 0 1.35rem 0 !important;
    width: 100% !important;
    height: auto !important;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.15rem !important;
  }

  .hero-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.55rem !important;
    margin-bottom: 1.15rem !important;
  }

  .hero-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .hero-features-list {
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding-top: 0.9rem !important;
  }

  .hero-feat-item {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.6rem !important;
    gap: 6px !important;
  }

  .hero-feat-item svg {
    width: 14px !important;
    height: 14px !important;
  }

  .hero-preview-card {
    padding: 0.95rem !important;
  }

  .hero-preview-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.4rem !important;
    padding-bottom: 0.65rem !important;
    margin-bottom: 0.75rem !important;
  }

  .preview-info-box {
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }

  .preview-info-row {
    flex-wrap: wrap !important;
    gap: 4px !important;
    font-size: 0.74rem !important;
    margin-bottom: 0.35rem !important;
  }

  /* Kartlar, İkonlar ve Gridler */
  .features-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.85rem !important;
    margin-bottom: 1.75rem !important;
  }

  .feature-icon-wrapper {
    width: 38px !important;
    height: 38px !important;
    margin-bottom: 0.65rem !important;
  }

  .feature-icon-wrapper svg {
    width: 19px !important;
    height: 19px !important;
  }

  .card,
  .form-card,
  .step-card,
  .law-article-card,
  .law-header-banner,
  .law-ToC-card,
  .compliance-matrix-card,
  .library-article,
  .opinion-card,
  .portal-main-card,
  .consent-card {
    padding: 1rem 0.9rem !important;
    border-radius: 12px !important;
  }

  .step-card {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .step-number {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.9rem !important;
  }

  /* Form Elemanları */
  .form-label,
  main label {
    font-size: 0.76rem !important;
    margin-bottom: 0.3rem !important;
  }

  .form-control,
  .portal-form-control {
    font-size: 0.82rem !important;
    padding: 0.55rem 0.75rem !important;
  }

  .faq-question {
    font-size: 0.84rem !important;
    padding: 0.85rem 1rem !important;
  }

  /* Yönetmelik & Kütüphane Sayfaları */
  .lib-stat-num {
    font-size: 1.2rem !important;
  }

  .lib-stat-label {
    font-size: 0.7rem !important;
  }

  .law-meta-pills,
  .law-controls,
  .player-controls-row,
  .player-steps-bar {
    flex-wrap: wrap !important;
    gap: 0.45rem !important;
  }

  .law-search-box {
    min-width: 0 !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  .law-article-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.4rem !important;
  }

  /* Sekme (Tab) Menüleri */
  .tab-nav,
  .lib-tabs-header {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    max-width: 100% !important;
    padding-bottom: 0.35rem !important;
    gap: 0.4rem !important;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn,
  .lib-tab-btn {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.76rem !important;
    flex-shrink: 0 !important;
  }

  /* Footer */
  .site-footer {
    padding: 1.75rem 0 1.25rem 0 !important;
    margin-top: 2rem !important;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.25rem !important;
    margin-bottom: 1.25rem !important;
  }

  .footer-links {
    gap: 0.45rem !important;
  }

  .footer-links a,
  .footer-links li {
    font-size: 0.76rem !important;
  }

  .footer-bottom {
    flex-direction: column !important;
    gap: 0.5rem !important;
    text-align: center !important;
    font-size: 0.72rem !important;
    padding-top: 1rem !important;
  }
}

/* ==========================================================================
   4. Küçük Cep Telefonu Ekranları (<= 380px)
   ========================================================================== */
@media (max-width: 380px) {
  .container,
  main.container,
  section.container {
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
  }

  .nav-container {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    gap: 4px !important;
  }

  .brand-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
  }

  .brand-title {
    font-size: 0.92rem !important;
  }

  .brand-subtitle {
    font-size: 0.48rem !important;
  }

  .nav-actions .btn-nav {
    padding: 2.5px 5px !important;
    font-size: 0.62rem !important;
    gap: 3px !important;
  }

  .nav-actions .btn-nav svg {
    width: 10px !important;
    height: 10px !important;
  }

  .mobile-menu-btn {
    width: 30px !important;
    height: 30px !important;
    padding: 4px !important;
  }
}
