/* Mobile layout overrides. Page layouts are inline styles, so these rules match
   the inline values and need !important. Linked from every page by seo-prerender.js. */

img[alt="Odak Pencere logo"] { height: auto !important; }
body { overflow-x: clip; }
img, video, iframe, image-slot { max-width: 100%; }
/* image-slot has a wide intrinsic size; without this, grid columns grow to fit it */
[style*="grid-template-columns"] > * { min-width: 0; }

@media (max-width: 900px) {
  /* Grids: 4 and 7 columns fold to 2 and 4; every other multi-column layout stacks */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: 1fr 1fr !important; }
  [style*="grid-template-columns: repeat(7, 1fr)"] { grid-template-columns: repeat(4, 1fr) !important; }

  /* Section spacing */
  [style*="px 64px"] { padding-left: 20px !important; padding-right: 20px !important; }
  [style*="padding: 100px"], [style*="padding: 90px"], [style*="padding: 80px"] {
    padding-top: 56px !important; padding-bottom: 56px !important;
  }
  [style*="64px 100px"] { padding-bottom: 56px !important; }
  [style*="padding: 0px 28px 0px 0px"] { padding: 0 0 24px 0 !important; border-right: 0 !important; }
  [style*="padding: 36px 32px"] { padding: 24px 20px !important; }

  /* Headings */
  [style*="font-size: 64px"], [style*="font-size: 56px"], [style*="font-size: 52px"], [style*="font-size: 48px"] {
    font-size: 36px !important;
  }
  [style*="font-size: 42px"], [style*="font-size: 40px"], [style*="font-size: 38px"], [style*="font-size: 36px"] {
    font-size: 30px !important;
  }
  [style*="font-size: 34px"], [style*="font-size: 32px"] { font-size: 26px !important; }

  /* Fixed-height blocks: let content set the height, keep images visible */
  [style*="min-height: 640px"], [style*="min-height: 480px"] { min-height: 0 !important; }
  [style*="height: 420px"], [style*="height: 380px"] { height: auto !important; }
  [style*="height: 420px"] > *, [style*="height: 380px"] > * { min-height: 240px; }
  [style*="height: 340px"], [style*="height: 300px"] { height: 240px !important; }
  section > div[style*="overflow: hidden"] { min-height: 260px; }

  /* Header */
  header { padding: 10px 16px !important; }
  header nav { gap: 10px 14px !important; }
  img[alt="Odak Pencere logo"] { width: 150px !important; }
  [style*="display: flex"][style*="gap: 40px"] { gap: 20px !important; flex-wrap: wrap; }
  [style*="display: flex"][style*="gap: 16px"] { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  /* The menu wraps to 3 rows on phones; sticky it would cover a quarter of the screen */
  header { position: static !important; }
  [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns: repeat(7, 1fr)"] { grid-template-columns: repeat(3, 1fr) !important; }
  [style*="justify-content: space-between"][style*="align-items: flex-end"] {
    flex-direction: column; align-items: flex-start !important; gap: 16px;
  }
}
