/* =========================================================================
   Modern Teknoloji — layout.css
   Container, grid, header/footer skeleton, homepage & article layout.
   Mobile-first throughout (§5).
   ========================================================================= */

.mt-container {
  max-width: var(--mt-container);
  margin-inline: auto;
  padding-inline: var(--mt-space-4);
}

.mt-section {
  padding-block: var(--mt-space-8);
}

.mt-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--mt-space-4);
  margin-bottom: var(--mt-space-6);
}

.mt-section__title {
  margin: 0;
}

.mt-section__link {
  white-space: nowrap;
  font-weight: 600;
  border: 1px solid var(--mt-color-text);
  border-radius: var(--mt-radius-control);
  padding: var(--mt-space-2) var(--mt-space-4);
}

.mt-section__link:hover {
  border-color: var(--mt-color-accent);
  color: var(--mt-color-accent);
  text-decoration: none;
}

/* ---------------------------------------------------------------------
   Site header (§14)
   --------------------------------------------------------------------- */
.mt-site-header {
  background: var(--mt-color-header-bg);
  border-bottom: 1px solid var(--mt-color-border);
}

.mt-site-header--sticky {
  position: sticky;
  top: 0;
  z-index: 500;
}

.mt-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mt-space-5);
  padding-block: var(--mt-space-4);
}

.mt-logo {
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--mt-color-text);
}

.mt-logo a {
  color: inherit;
  text-decoration: none;
}

.mt-logo img,
.mt-logo .custom-logo {
  max-height: 40px;
  width: auto;
  height: auto;
  max-width: 200px;
  object-fit: contain;
}

.mt-primary-nav {
  display: none;
}

.mt-primary-nav ul {
  display: flex;
  align-items: center;
  gap: var(--mt-space-6);
  list-style: none;
}

.mt-primary-nav a {
  color: var(--mt-color-text);
  font-weight: 500;
  font-size: 15px;
}

.mt-primary-nav a:hover {
  color: var(--mt-color-accent);
  text-decoration: none;
}

.mt-header-actions {
  display: flex;
  align-items: center;
  gap: var(--mt-space-4);
}

.mt-header-actions__cta {
  display: none;
}

.mt-icon-button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mt-color-text);
  display: inline-flex;
  padding: var(--mt-space-1);
}

.mt-mobile-menu-toggle {
  display: inline-flex;
}

/* Mobile drawer nav */
.mt-mobile-drawer {
  position: fixed;
  inset: 0;
  background: var(--mt-color-body-bg);
  z-index: 600;
  transform: translateX(100%);
  transition: transform var(--mt-duration) var(--mt-ease);
  overflow-y: auto;
  padding: var(--mt-space-5);
}

.mt-mobile-drawer[data-open="true"] {
  transform: translateX(0);
}

.mt-mobile-drawer__head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--mt-space-6);
}

.mt-mobile-drawer nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--mt-space-5);
}

.mt-mobile-drawer nav a {
  font-size: 22px;
  font-weight: 700;
  color: var(--mt-color-text);
}

/* ---------------------------------------------------------------------
   Ticker (§15)
   --------------------------------------------------------------------- */
.mt-ticker {
  background: var(--mt-color-ticker-bg);
  color: var(--mt-color-ticker-text);
  overflow: hidden;
}

.mt-ticker__inner {
  display: flex;
  align-items: center;
  gap: var(--mt-space-5);
  padding-block: var(--mt-space-2);
}

.mt-ticker__label {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding-inline: var(--mt-space-4);
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.mt-ticker__track {
  flex: 1 1 auto;
  overflow: hidden;
  white-space: nowrap;
}

.mt-ticker__track ul {
  display: inline-flex;
  list-style: none;
  gap: var(--mt-space-8);
  will-change: transform;
}

.mt-ticker__track li a,
.mt-ticker__track li span {
  color: var(--mt-color-ticker-text);
  font-size: 13px;
}

/* ---------------------------------------------------------------------
   Homepage hero
   --------------------------------------------------------------------- */
.mt-hero {
  display: grid;
  gap: var(--mt-space-6);
  padding-block: var(--mt-space-6) var(--mt-space-8);
}

.mt-hero__secondary {
  display: grid;
  gap: var(--mt-space-5);
}

/* ---------------------------------------------------------------------
   Grids
   --------------------------------------------------------------------- */
.mt-grid {
  display: grid;
  gap: var(--mt-space-6);
  grid-template-columns: 1fr;
}

.mt-grid--2 { grid-template-columns: 1fr; }
.mt-grid--3 { grid-template-columns: 1fr; }
.mt-grid--4 { grid-template-columns: 1fr; }

/* ---------------------------------------------------------------------
   Article / sidebar layout (§82–84, §126)
   --------------------------------------------------------------------- */
.mt-content-layout {
  display: grid;
  gap: var(--mt-space-8);
  align-items: start;
}

/* Grid/flex children default to min-width:auto, which lets their content's
   natural size push them wider than the viewport — the overflow-x:hidden
   backstop in base.css then silently clips that overflow instead of
   wrapping it (this is what caused headings to get cut off on some
   mobile viewports). min-width:0 lets these boxes actually shrink to the
   space they're given so text wraps normally. */
.mt-content-layout > *,
.mt-grid > *,
.mt-hero > *,
.mt-hero__secondary > *,
.mt-card,
.mt-card--horizontal > *,
.mt-card--compact > *,
.mt-header-bar > *,
.mt-footer-top > * {
  min-width: 0;
}

.mt-archive-loop {
  display: grid;
  gap: var(--mt-space-6);
}

.mt-archive-loop .mt-card--horizontal {
  padding-bottom: var(--mt-space-6);
  border-bottom: 1px solid var(--mt-color-border);
}

.mt-archive-loop .mt-card--horizontal:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.mt-article {
  max-width: var(--mt-article-width);
  width: 100%;
}

.mt-article--wide {
  max-width: none;
}

.mt-sidebar {
  display: grid;
  gap: var(--mt-space-6);
}

/* ---------------------------------------------------------------------
   Footer (§85)
   --------------------------------------------------------------------- */
.mt-site-footer {
  background: var(--mt-color-footer-bg);
  color: #f4f2ea;
  margin-top: var(--mt-space-9);
}

.mt-footer-top {
  padding-block: var(--mt-space-9);
  display: grid;
  gap: var(--mt-space-8);
}

.mt-footer-brand p {
  color: #b7bec9;
  max-width: 40ch;
}

.mt-footer-col h4 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b7bec9;
  margin-bottom: var(--mt-space-4);
}

.mt-footer-col ul {
  list-style: none;
  display: grid;
  gap: var(--mt-space-3);
}

.mt-footer-col a {
  color: #f4f2ea;
}

.mt-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-block: var(--mt-space-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--mt-space-4);
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #9aa0a6;
}

.mt-footer-bottom nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mt-space-4);
  list-style: none;
}

.mt-footer-bottom a {
  color: #9aa0a6;
}

/* ---------------------------------------------------------------------
   Back to top (§45)
   --------------------------------------------------------------------- */
.mt-back-to-top {
  position: fixed;
  right: var(--mt-space-5);
  bottom: var(--mt-space-5);
  width: 44px;
  height: 44px;
  border-radius: var(--mt-radius-pill);
  background: var(--mt-color-text);
  color: var(--mt-color-body-bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--mt-duration) var(--mt-ease), transform var(--mt-duration) var(--mt-ease);
  z-index: 400;
}

.mt-back-to-top[data-visible="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}