/* fatihkovka.ru — small overrides on top of the captured Elementor markup.
 *
 * Header CTA "Онлайн-каталог" (Royal Elementor button, widget 93fa745).
 *
 * The header row is: logo (fixed) + menu (~71% width) + CTA. The CTA used to
 * be the only shrinkable item, so below ~1440px it was squeezed to 65-140px
 * while its label needs ~116px: the text spilled out of the red box and the
 * header looked broken. Now the menu absorbs the space and the CTA keeps its
 * natural width; under 1440px it switches to a compact style (13px, no icon).
 *
 * Selectors avoid the page id so the shared header template is fixed on
 * every page that uses it.
 */

/* --- header row: logo fixed, menu flexible, CTA never squeezed ---------- */

.elementor-element.elementor-element-e918d78 {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
}

.elementor-element.elementor-element-3c5ce98 {
    flex: 0 0 auto !important;
    width: auto !important;
    padding-right: 0 !important;
}

.elementor-element.elementor-element-3c5ce98 > .e-con-inner {
    align-items: center !important;
    justify-content: flex-end !important;
    width: auto !important;
    padding: 0 !important;
}

.elementor-element.elementor-element-93fa745 {
    align-self: center !important;
    width: auto !important;
    max-width: none !important;
    margin-left: auto !important;
    text-align: right !important;
}

.elementor-element.elementor-element-93fa745 .wpr-button-wrap {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
}

.elementor-element.elementor-element-93fa745 .wpr-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-height: 44px !important;
    padding: 10px 14px !important;
    border-radius: 4px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    color: #fff !important;
    background-image: linear-gradient(180deg, #ec0303 0%, #b00000 100%) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-image 0.18s ease !important;
}

.elementor-element.elementor-element-93fa745 .wpr-button .wpr-button-content {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
}

.elementor-element.elementor-element-93fa745 .wpr-button .wpr-button-text {
    display: inline-block !important;
    white-space: nowrap !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0.2px !important;
    color: #fff !important;
}

.elementor-element.elementor-element-93fa745 .wpr-button .wpr-button-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 12px !important;
    height: 12px !important;
    margin: 0 !important;
    font-size: 12px !important;
    flex: 0 0 auto !important;
    color: #fff !important;
}

.elementor-element.elementor-element-93fa745 .wpr-button .wpr-button-icon svg {
    width: 12px !important;
    height: 12px !important;
    fill: currentColor !important;
    display: block !important;
}

.elementor-element.elementor-element-93fa745 .wpr-button:hover,
.elementor-element.elementor-element-93fa745 .wpr-button:focus {
    color: #fff !important;
    background-image: linear-gradient(180deg, #ff1a1a 0%, #c40000 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.26) !important;
}

.elementor-element.elementor-element-93fa745 .wpr-button:focus-visible {
    outline: 2px solid #fff !important;
    outline-offset: 3px !important;
}

/* --- narrower screens --------------------------------------------------- */

/* The CTA cell sits flush against the row's right edge in the original
   Elementor header (padding-right: 0). Give it real breathing room so the
   button can never be pushed off the screen, whatever the font metrics. */
.elementor-element.elementor-element-3c5ce98 {
    padding-right: 14px !important;
}

/* Below 1520px the header has no room for the full-size CTA: use a compact
   variant that still fits the label on one line. (At 1440-1519 the full-size
   button used to occupy the whole row and touch the viewport edge.) */
@media (max-width: 1519px) {
    .elementor-element.elementor-element-93fa745 .wpr-button {
        padding: 9px 12px !important;
    }

    .elementor-element.elementor-element-93fa745 .wpr-button .wpr-button-text {
        font-size: 13px !important;
        letter-spacing: 0 !important;
    }

    .elementor-element.elementor-element-93fa745 .wpr-button .wpr-button-icon {
        display: none !important;
    }
}

/* Tablet range: the inline menu needs ~600px; trim the item gaps so the row
   stays on one line instead of wrapping and making the fixed header tall. */
@media (max-width: 1100px) {
    .elementor-element.elementor-element-e918d78 .wpr-nav-menu > li {
        margin-left: 5px !important;
        margin-right: 5px !important;
    }
}

/* Elementor hides the CTA from 768px to 1024px; make that independent of
   fractional viewport widths so the row can never overflow in that band. */
@media (min-width: 700px) and (max-width: 1024px) {
    .elementor-element.elementor-element-3c5ce98 {
        display: none !important;
    }
}

/* --- remove the light-blue top strip ----------------------------------- *
 * Template 689 opens with a #48A8FF bar (social icons + "Organize Sanayi
 * Bölgesi, Honaz / Denizli" + e-mail + phone). It flashes on load and then
 * scrolls/hides away, which made the header jump. Removed on every page:
 * 1e6606b = desktop copy, dd2efee = its mobile duplicate.
 * The contact data stays on /контакты/ and in the footer. */
.elementor-element.elementor-element-1e6606b,
.elementor-element.elementor-element-dd2efee {
    display: none !important;
}

/* --- reserve space for the fixed header ---------------------------------- *
 * Template 689's header is position: fixed, so its body-level wrapper has
 * zero height. The first Elementor section used a negative top margin to
 * cover the former (in-flow) header; with the fixed header that margin
 * collapses through the empty wrapper and pulls the page underneath it.
 *
 * Keep this correction limited to Elementor canvas pages. The blog and the
 * semantic article template use different body classes and must keep their
 * existing spacing. Header heights below are the measured heights of the
 * rendered 689 row at each responsive breakpoint. */
body.page-template-elementor_canvas {
    --fk-header-height: 88px;
}

@media (min-width: 1025px) and (max-width: 1366px) {
    body.page-template-elementor_canvas {
        --fk-header-height: 84.6875px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    body.page-template-elementor_canvas {
        --fk-header-height: 78px;
    }
}

@media (max-width: 767px) {
    body.page-template-elementor_canvas {
        /* The mobile row follows the logo width (50% of the available width,
           capped at 212px): 9.25px + 15.3125vw, capped at the measured
           maximum row height of 86.4297px. */
        --fk-header-height: clamp(
            60.8516px,
            calc(9.25px + 15.3125vw),
            86.4297px
        );
    }
}

body.page-template-elementor_canvas > div.elementor.elementor-689 {
    height: var(--fk-header-height) !important;
}

body.page-template-elementor_canvas > div.elementor.elementor-689 + div.elementor > :first-child {
    --margin-top: 0px !important;
    margin-top: 0 !important;
}

/* --- /контакты/: keep the contact hero below the fixed header ------------ *
 * The Elementor page bundle gives this hero a negative top margin so it
 * could cover the former in-flow header. Template 689 is now fixed, so the
 * hero must start at the header's lower edge instead. The explicit contact
 * selector also protects this page if its position in the Elementor tree
 * changes; min-height and all internal spacing stay untouched. */
body.page-template-elementor_canvas .elementor-11 .elementor-element.elementor-element-371833f {
    --margin-top: 0px !important;
    margin-top: 0 !important;
}

/* --- /блог/: semantic, responsive post index ---------------------------- *
 * index.php renders this markup for `template: blog`:
 *   .fk-blog > .fk-blog-title, .fk-blog-lead, .fk-blog-list > .fk-post
 * The page is plain flow — the site header (template 689) is fixed and its
 * height is already reserved by site.css, so nothing here repeats it.
 *
 * Brand: navy #041A42, red #ec0303, paper #f5f7fa, rule #dbe4f0.
 * Headings Montserrat, body Poppins (fonts already loaded by the shell). */
body.blog {
    background: #f5f7fa;
}

/* The 689 header is fixed: reserve its row on <body>, so the page never
 * starts under the header and nothing overlaps at any breakpoint. */
body.blog {
    padding-top: 88px !important;
}

@media (max-width: 1366px) {
    body.blog {
        padding-top: 84.6875px !important;
    }
}

@media (max-width: 1024px) {
    body.blog {
        padding-top: 78px !important;
    }
}

@media (max-width: 700px) {
    body.blog {
        /* The mobile header row scales with the logo: 70.6875px at 390px. */
        padding-top: clamp(60.8516px, calc(9.25px + 15.7531vw), 87px) !important;
    }
}

body.blog .fk-blog {
    box-sizing: border-box;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 64px) clamp(64px, 8vw, 104px);
    color: #26354a;
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

body.blog .fk-blog-title {
    margin: 0 0 16px;
    padding: 0;
    font-family: "Montserrat", sans-serif;
    font-size: clamp(32px, 4.4vw, 48px);
    font-weight: 700;
    line-height: 1.15;
    color: #041a42;
}

body.blog .fk-blog-title::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    margin-top: 18px;
    border-radius: 2px;
    background: #ec0303;
}

body.blog .fk-blog-lead {
    max-width: 74ch;
    margin: 0 0 clamp(28px, 4vw, 44px);
    font-size: 17px;
    line-height: 1.7;
    color: #526176;
}

body.blog .fk-blog-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(22px, 3vw, 32px);
    align-items: stretch;
}

body.blog .fk-post {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(4, 26, 66, 0.08);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.blog .fk-post:hover {
    transform: translateY(-4px);
    border-color: #ec0303;
    box-shadow: 0 14px 34px rgba(4, 26, 66, 0.14);
}

body.blog .fk-post-media {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #f5f7fa;
}

body.blog .fk-post-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.24s ease;
}

body.blog .fk-post-media:hover img {
    transform: scale(1.025);
}

body.blog .fk-post-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: clamp(20px, 2.6vw, 28px);
}

body.blog .fk-post-date {
    display: block;
    margin: 0 0 10px;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #ec0303;
}

body.blog .fk-post-title {
    margin: 0 0 12px;
    padding: 0;
    font-family: "Montserrat", sans-serif;
    font-size: clamp(18px, 1.8vw, 22px);
    font-weight: 600;
    line-height: 1.35;
    color: #041a42;
}

body.blog .fk-post-title a {
    color: inherit;
    text-decoration: none;
}

body.blog .fk-post-title a:hover {
    color: #ec0303;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

body.blog .fk-post-excerpt {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.7;
    color: #526176;
}

body.blog .fk-post-more {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding: 9px 16px;
    border-radius: 6px;
    background-image: linear-gradient(180deg, #ec0303 0%, #b00000 100%);
    color: #fff !important;
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

body.blog .fk-post-more:hover {
    box-shadow: 0 6px 16px rgba(176, 0, 0, 0.34);
}

body.blog .fk-post-more:focus-visible {
    outline: 2px solid #041a42;
    outline-offset: 3px;
}

body.blog .fk-blog-empty {
    margin: 0;
    padding: 28px;
    border: 1px dashed #dbe4f0;
    border-radius: 12px;
    background: #fff;
    color: #526176;
    font-size: 15px;
    text-align: center;
}

/* Single post: the two-column card grid would leave the card on the left half.
 * One post gets one readable column, capped where a full-width row would turn
 * the whole list into a banner. */
body.blog .fk-blog-list:has(> .fk-post:only-child) {
    grid-template-columns: minmax(0, 720px);
    justify-content: center;
}

@media (max-width: 900px) {
    body.blog .fk-blog-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 767px) {
    body.blog .fk-blog {
        padding: 32px 18px 56px;
    }

    body.blog .fk-blog-lead {
        font-size: 15.5px;
    }

    body.blog .fk-post-body {
        padding: 18px;
    }
}

@media (max-width: 390px) {
    body.blog .fk-blog {
        padding: 26px 14px 44px;
    }

    body.blog .fk-blog-title {
        font-size: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.blog .fk-post,
    body.blog .fk-post-media img,
    body.blog .fk-post-more {
        transition: none;
    }

    body.blog .fk-post:hover,
    body.blog .fk-post-media:hover img {
        transform: none;
    }
}

/* The 689 header switches from position: fixed (>=1201px) to position: relative
 * at <=1200px. The page padding for the fixed row therefore drops when the
 * header stops floating, and shrinks once the relative row itself shrinks. */
@media (max-width: 1200px) {
    body.blog {
        padding-top: 0 !important;
    }
}

@media (max-width: 767px) {
    body.blog {
        padding-top: 0 !important;
    }
}
