/* =========================================================
   Nihat Yıldız — WordPress / Gutenberg layer
   (loads after digiflex.css and nihatyildiz.css)
   ========================================================= */

/* ---------- Page structure ---------- */
.wp-site-blocks { padding: 0; }
.ny-main, main.wp-block-group { display: block !important; width: 100%; margin: 0 !important; background: var(--bg); position: relative; z-index: 1; }
.wp-site-blocks > * + * { margin-block-start: 0 !important; }
.ny-site-header, .ny-site-footer { margin: 0 !important; }
body.ny-no-hero .ny-main { padding-top: 120px; }

/* Our full-width blocks ignore the constrained content width. */
.is-layout-constrained > :is(.slider, .page-header, .content-section, .m-rows, .footer),
.is-layout-constrained > .alignfull {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100%;
}
/* Free-standing core blocks get a comfortable gutter. */
.wp-block-post-content.is-layout-constrained > :not(.slider):not(.page-header):not(.content-section):not(.m-rows):not(.alignfull) {
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Admin bar offset for the fixed navbar/menu */
.admin-bar .navbar, .admin-bar .mobile-menu { top: 32px; }
@media (max-width: 782px) { .admin-bar .navbar, .admin-bar .mobile-menu { top: 46px; } }
@media (max-width: 600px) { .admin-bar .navbar { top: 0; } }

/* ---------- Reveal effect: content scrolls over the hero / header band ---------- */
@media (min-width: 768px) {
  .slider, .page-header { position: sticky !important; top: 0; z-index: 0; }
  .admin-bar .slider, .admin-bar .page-header { top: 32px; }
  :is(.slider, .page-header) ~ * { position: relative; z-index: 1; }
  /* plain blocks placed right after the band still get a full-width background */
  :is(.slider, .page-header) ~ :not(.content-section):not(.m-rows):not(.slider):not(.page-header) {
    background-color: var(--bg);
    box-shadow: 0 0 0 100vmax var(--bg);
    clip-path: inset(0 -100vmax);
  }
}
.page-header { background-size: cover; background-position: center; }
.page-header .container { width: 100%; }

/* ---------- Robust content: whatever editors add must not overflow ---------- */
.content-section .container { min-width: 0; }
.content-section :is(p, li, h1, h2, h3, h4, h5, h6, a) { overflow-wrap: anywhere; word-break: normal; }
.content-section img, .content-section video, .content-section iframe { max-width: 100%; height: auto; }
.content-section iframe.map { height: 100%; }
.content-section .wp-block-table, .content-section table { display: block; max-width: 100%; overflow-x: auto; }
.content-section .wp-block-embed { width: 100%; }
.content-section ul:not([class]), .content-section ol:not([class]) { padding-inline-start: 1.2em; }
.content-section .wp-block-image { margin: 0 0 30px; }
.content-section .wp-block-image img { width: 100%; height: auto; display: block; }
.content-section .wp-block-heading { margin: 0 0 .6em; }

/* Body text inside sections (matches .lead-p of the static design) */
.content-section:not(.dark-section) :is(.container, .ny-col) > p { font-size: var(--wp--preset--font-size--medium, 17px); line-height: 1.75; color: var(--muted); }
.dark-section :is(.container, .ny-col) > p { line-height: 1.75; }

/* Core buttons look like the theme's .custom-button */
.wp-block-buttons { margin-top: 20px; gap: 12px; }
.wp-block-button__link, .wp-element-button {
  display: inline-block; height: 66px; line-height: 62px; padding: 0 50px !important; border-radius: 0;
  background: var(--color-main); color: #fff !important; font-weight: 800; border: 2px solid transparent;
  text-decoration: none !important; transition: all .35s ease-in-out;
}
.wp-block-button__link:hover, .wp-element-button:hover { background: transparent; border-color: var(--color-main); color: var(--color-main) !important; }
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; border-color: var(--color-main); color: var(--color-main) !important; }

/* ---------- Section title wrapper ---------- */
.ny-section-title { width: 100%; }
.dark-section .section-title, .quote-section .section-title { color: var(--alt-text); }

/* ---------- Box grid ---------- */
.ny-grid { display: grid; grid-template-columns: repeat(var(--ny-cols, 3), minmax(0, 1fr)); gap: 30px; counter-reset: nystep; margin-bottom: 10px; }
.ny-grid + .ny-cols, .ny-grid + .ny-grid { margin-top: 40px; }
.ny-grid > * { min-width: 0; margin: 0 !important; }
.ny-grid .step-box { height: 100%; counter-increment: nystep; }
.ny-grid .step-no:before { content: counter(nystep, decimal-leading-zero); }
.ny-grid .contact-box { height: 100%; }
.ny-grid .service-box { margin-bottom: 10px; }
@media (max-width: 1199px) { .ny-grid { gap: 24px; } }
@media (max-width: 991px) and (min-width: 768px) {
  .ny-grid:not([style*="--ny-cols:1"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ny-grid[style*="--ny-cols:3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .ny-grid { gap: 16px; }
  .ny-grid--m-stack { grid-template-columns: minmax(0, 1fr) !important; }
  .ny-grid--m-two { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ny-grid--m-scroll {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin: 0 -20px; padding: 0 14px 6px; gap: 12px;
  }
  .ny-grid--m-scroll::-webkit-scrollbar { display: none; }
  .ny-grid--m-scroll > * { flex: 0 0 80%; scroll-snap-align: center; }
}

/* ---------- Two columns ---------- */
.ny-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px 60px; width: 100%; }
.ny-cols--1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 30px; }
.ny-cols--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 30px; }
.ny-cols--center { align-items: center; }
.ny-cols--top { align-items: start; }
.ny-col { min-width: 0; }
.ny-col > .wp-block-image:last-child, .ny-col > p:last-child { margin-bottom: 0; }
.ny-col .wp-block-image img { width: 100%; }
.dark-section .ny-cols--1-1 > .ny-col:nth-child(2):has(.section-title) { padding-inline-start: 10px; }
.ny-contact-row { margin-top: 50px; }
@media (max-width: 991px) {
  .ny-cols, .ny-cols--1-2, .ny-cols--2-1 { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .ny-cols--reverse-m > .ny-col:first-child { order: 2; }
  .ny-contact-row .map { min-height: 320px; margin-top: 0; }
}

/* ---------- Project detail ---------- */
.ny-project-text p { margin-bottom: 18px; line-height: 1.8; color: var(--muted); }
.ny-project-text > :not(p) { margin-bottom: 18px; }
.ny-project-detail .gallery-row { margin-top: 60px; }
@media (max-width: 767px) { .ny-project-detail .gallery-row { margin-top: 30px; } }
.ny-noimg { display: block; aspect-ratio: 4 / 5; background: #1c1c1c; }
.ny-empty { color: var(--muted); }

/* ---------- Contact form ---------- */
.ny-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ny-form-msg { padding: 14px 18px; margin-bottom: 18px; font-weight: 600; border-left: 3px solid; }
.ny-form-msg--ok { background: rgba(80, 160, 90, .12); border-color: #4eb04b; }
.ny-form-msg--err { background: rgba(200, 60, 60, .12); border-color: #d9534f; }
[dir="rtl"] .ny-form-msg { border-left: 0; border-right: 3px solid; }

/* ---------- Blog / query list ---------- */
.ny-post-list .wp-block-post { padding: 26px 0; border-bottom: 1px solid var(--border); }
.ny-post-list .wp-block-post-title a { color: var(--text); text-decoration: none; }
.ny-post-list .wp-block-post-date { font-size: 14px; color: var(--muted); }
.wp-block-query-pagination { margin-top: 30px; gap: 12px; }

/* ---------- Mobile: no sticky band, mobile-only blocks ---------- */
@media (max-width: 767px) {
  .page-header { position: relative !important; }
  body.ny-no-hero .ny-main { padding-top: 90px; }
}
