/*
 Theme Name: DevKris Blog
 Description: …
 Version: 1.0
 Author: …
 Text Domain: devkris
*/

/* ====== ZMIENNE / TOKENS (Figmy) ====== */
:root {
    --hero-overlay: rgba(0, 0, 0, .41);

    /* Kolory */
    --bg: #FFFFFF;
    --text: #000000;
    --muted: #515151;
    --line: #707070;
    --panel: #EEEEEE;
    --error: #FF0000;

    /* Typografia */
    --ff-head: "Inter", system-ui, sans-serif;
    --ff-body: "Lato", system-ui, sans-serif;
    --ff-btn: "Roboto", system-ui, sans-serif;

    /* Rozmiary typografii */
    --h1-size: 48px;
    --h1-line: 58px;
    --h2-size: 48px;
    --h2-line: 58px;
    --p-size: 16px;
    --p-line: 24px;

    /* Przyciski */
    --btn-w: 141px;
    --btn-h: 45px;
    --btn-radius: 8px;

    /* Layout / Kontener */
    --container: 1364px;
    --space-sec: 64px;
    --faq-divider-inset: 16px;
}

/* ===== GLOBAL FIX / BOX-SIZING RESET ===== */
html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

/* === GLOBAL TYPOGRAPHY / LAYOUT === */

/* Płynny kontener (RWD) */
.container {
    width: min(100% - 32px, var(--container));
    margin-inline: auto;
    padding-inline: 0;
}

h1,
h2,
h3 {
    margin: 0 0 16px
}

/* Płynny H1/H2 (clamp()) */
h1 {
    font-family: var(--ff-head);
    font-weight: 400;
    font-size: clamp(28px, 4.2vw, 48px);
    line-height: clamp(36px, 5vw, 58px)
}

h2 {
    font-family: var(--ff-head);
    font-weight: 400;
    font-size: clamp(28px, 4.2vw, 48px);
    line-height: clamp(36px, 5vw, 58px)
}

p {
    margin: 0 0 12px;
    font-family: var(--ff-body);
}

img {
    max-width: 100%;
    height: auto;
    display: block
}

/* Globalne przyciski (.btn) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--btn-w);
    height: var(--btn-h);
    padding: 0 16px;
    border-radius: var(--btn-radius);
    background: #000;
    color: #fff;
    font-family: var(--ff-btn);
    font-size: 16px;
    line-height: 19px;
    text-decoration: none;
    box-sizing: border-box;
}

.btn:hover {
    opacity: .92
}

/* Przycisk obrysowany (.btn-outline) */
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--btn-w);
    height: var(--btn-h);
    padding: 0 16px;
    border-radius: var(--btn-radius);
    border: 1px solid #000;
    color: #000;
    text-decoration: none
}

/* Dostępność (Focus) */
:focus-visible {
    outline: 2px solid #000;
    outline-offset: 3px
}

/* ====== HERO / SEKCJA WPROWADZAJĄCA (CTA) ====== */

.hero {
    padding: 32px 0 0;
    background: none
}

/* Kontener ramki */
.hero__frame {
    position: relative;
    width: var(--container);
    height: 581px;
    margin: 0 auto;
    background-size: cover;
    background-position: center;
    background-color: var(--panel, #EEEEEE);
    overflow: hidden;
    aspect-ratio: 1364 / 581;
}

/* Warstwa Overlay */
.hero__overlay {
    position: absolute;
    inset: 0;
    background: var(--hero-overlay)
}

/* Zawartość / Pozycjonowanie */
.hero__content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Tytuł H1 (White, limit 2 linii) */
.hero h1 {
    font-family: "Inter", system-ui, sans-serif;
    font-weight: 400;
    font-size: 48px;
    line-height: 58px;
    margin: 0 0 12px;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Podtytuł (White, limit 3 linii) */
.hero .subtitle {
    max-width: 800px;
    margin: 0 0 16px;
    font: 400 16px/24px "Lato", system-ui, sans-serif;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* RWD: Płynna wysokość ramki (poniżej 1400px) */
@media (max-width: 1400px) {
    .hero__frame {
        width: 100%;
        height: calc(100vw * (581 / 1364));
        max-height: 581px;
    }
}

/* RWD: Tablet (mniejsze marginesy, adaptacyjny tekst) */
@media (max-width: 992px) {
    .hero__frame {
        aspect-ratio: auto;
        min-height: clamp(420px, 70vw, 520px);
    }

    .hero__content {
        align-items: flex-start;
        padding-top: clamp(40px, 8vw, 64px);
        padding-bottom: clamp(40px, 8vw, 64px);
        padding-left: clamp(16px, 4vw, 32px);
        padding-right: clamp(16px, 4vw, 32px);
    }

    .hero h1 {
        font-size: clamp(24px, 4.2vw, 32px);
        line-height: clamp(30px, 5.2vw, 40px);
        margin: 0 0 8px;
    }

    .hero .subtitle {
        font-size: clamp(13px, 2.2vw, 15px);
        line-height: clamp(18px, 3.2vw, 22px);
        max-width: min(92%, 600px);
        margin: 0 0 10px;
    }

    .hero .btn {
        width: 132px;
        height: 42px;
        font-size: 15px;
        line-height: 18px;
    }
}

/* RWD: Telefon */
@media (max-width: 640px) {
    .hero__frame {
        min-height: clamp(400px, 90vw, 500px);
    }

    .hero__content {
        padding-top: clamp(24px, 6vw, 40px);
        padding-bottom: clamp(24px, 6vw, 40px);
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ================= FAQ / AKORDEON ================= */

/* Pozycjonowanie i szerokość (1088px) */
.faq h2 {
    max-width: 1088px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 12px;
}

/* Styl listy FAQ */
.faq__list {
    max-width: 1088px;
    margin: 0 auto;
    background: #EEEEEE;
    border: 0 !important;
}

/* Styl pojedynczego elementu */
.faq__item {
    position: relative;
    border-bottom: 0 !important;
}

/* Własny separator (linia) */
.faq__item:not(:last-child)::after {
    content: "";
    position: absolute;
    left: var(--faq-divider-inset);
    right: var(--faq-divider-inset);
    bottom: 0;
    height: 1px;
    background: var(--line, #707070);
    pointer-events: none;
}

/* Styl pytania (Summary) */
.faq__q {
    list-style: none;
    display: block;
    position: relative;
    cursor: pointer;
    min-height: 48px;
    padding: 12px 40px 12px 16px;
    font: 400 20px/24px var(--ff-body, "Lato", system-ui);
    color: #000;
    background: #EEEEEE;
}

/* Ukrycie natywnej strzałki */
.faq__q::-webkit-details-marker,
.faq__q::marker {
    display: none
}

/* Własna ikona strzałki (CSS) */
.faq__q::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    transform: translateY(-50%) rotate(45deg);
    transition: transform .2s ease;
    pointer-events: none;
}

/* Obrót strzałki po rozwinięciu */
.faq__item[open] .faq__q::after {
    transform: translateY(-50%) rotate(-135deg);
}

/* Styl odpowiedzi */
.faq__a {
    padding: 8px 16px 16px;
    font: 400 16px/24px var(--ff-body, "Lato", system-ui);
    color: #000;
    background: #EEEEEE;
}

.faq__a p {
    margin: 0 0 8px;
}

/* RWD dla FAQ (Tablet) */
@media (max-width: 768px) {
    .faq__list {
        max-width: 100%;
    }

    .faq__q {
        font-size: 18px;
    }
}

/* RWD dla FAQ (Telefon) */
@media (max-width: 480px) {
    .faq__q {
        font-size: 16px;
    }
}

/* ========== BLOG / KARTY ARTYKUŁÓW ========== */

.blog {
    margin-block: 64px;
    padding: 0 0 48px;
}

/* Nagłówek sekcji */
.blog__heading {
    max-width: var(--container, 1364px);
    margin: 0 auto 24px;
    padding: 0 16px;
}

/* Siatka kart (3 kolumny) */
.cards {
    max-width: var(--container, 1364px);
    margin: 0 auto;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

/* Styl karty */
.card {
    background: #fff;
    border-radius: 0px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
    transition: transform .2s ease, box-shadow .2s ease;
    max-width: 444px;
}

/* Efekt :hover */
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
}

.card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.card__link:hover .card__title {
    text-decoration: underline;
}

/* Kontener obrazu */
.card__media {
    position: relative;
    height: 250px;
    overflow: hidden;
    line-height: 0;
    display: block;
}

/* Obraz (object-fit: cover) */
.card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 3 / 2;
}

/* Treść karty */
.card__body {
    background: var(--panel, #EEE);
    height: 341px;
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    margin-top: 0 !important;
    border-top: 0 !important;
}

/* Data */
.card__date {
    font: 500 12px/24px var(--ff-body, "Lato", system-ui);
    color: #000;
    margin-bottom: 6px;
}

/* Tytuł (limit 2 linii) */
.card__title {
    font: 700 20px/1.25 var(--ff-body, "Lato");
    color: #000;
    margin: 0 0 8px;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

/* Opis / Fragment (limit 4 linii) */
.card__excerpt {
    font: 400 16px/1.55 var(--ff-body, "Lato");
    color: var(--muted, #515151);
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

/* Pozycjonowanie przycisku (do prawej/na dół) */
.card .btn {
    align-self: flex-start;
    margin-top: auto;
    margin-left: auto;
    min-width: 141px;
    height: 45px;
    padding: 13px 20px;
    border-radius: 8px;
    background: #000;
    color: #fff;
    font: 400 16px/19px var(--ff-btn, "Roboto", system-ui);
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* RWD dla Bloga (2 kolumny) */
@media (max-width: 1200px) {
    .blog .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* RWD dla Bloga (1 kolumna) */
@media (max-width: 640px) {
    .blog {
        margin-block: 32px;
        padding-bottom: 32px;
    }

    .blog .cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* --- CONTACT / FORMULARZ CF7 --- */
.contact {
    padding: 72px 0
}

/* Ograniczenie szerokości (1088px) */
.contact h2,
.contact form {
    max-width: 1088px;
    margin-left: auto;
    margin-right: auto;
}

.contact h2 {
    margin-bottom: 24px;
}

/* FIX: Nadpisanie domyślnego display */
.wpcf7 form {
    display: block;
}

/* Siatka 2 kolumny (CSS Grid) */
.wpcf7 form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    column-gap: 24px;
    row-gap: 24px;
}

/* Element pełnej szerokości */
.wpcf7 form .field--full {
    grid-column: 1 / -1;
}

.wpcf7 form p {
    margin: 0
}

.contact .field {
    min-width: 0;
}

.wpcf7 form label {
    display: block;
    margin: 0 0 6px;
    font-family: "Lato", system-ui, sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    color: #000;
}

/* Pola tekstowe / inputy */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
    width: 100%;
    height: 51px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #000;
    border-radius: 0px;
    font-family: "Lato", system-ui, sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: #000;
    box-sizing: border-box;
    max-width: 100%;
}

.wpcf7 textarea {
    height: 160px;
    resize: vertical;
}

/* Styl placeholderów */
.wpcf7 ::placeholder {
    font-family: "Lato", system-ui, sans-serif;
    font-style: italic;
    color: #515151;
}

/* Sekcja zgody (Consent Checkbox) */
.wpcf7 form .form-grid>.wpcf7-acceptance.field--full {
    grid-column: 1 / -1;
}

.wpcf7 .wpcf7-acceptance.consent {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.wpcf7 .wpcf7-acceptance.consent .wpcf7-list-item {
    display: flex;
    gap: 12px;
}

.wpcf7 .wpcf7-acceptance.consent .wpcf7-list-item-label {
    color: var(--error, #FF0000);
}

/* Własny styl checkboxa */
.wpcf7 .wpcf7-acceptance.consent input[type="checkbox"] {
    appearance: none;
    width: 19px;
    height: 19px;
    border: 1px solid #707070;
    border-radius: 2px;
    background: #fff;
    margin-top: 2px;
}

.wpcf7 .wpcf7-acceptance.consent input[type="checkbox"]:checked {
    background: #000;
}

.consent-text {
    color: var(--error);
    font-style: italic;
    font-family: var(--ff-body);
    font-weight: 400;
    font-size: var(--p-size);
    line-height: var(--p-line);
}

/* Przycisk 'Wyślij' */
.wpcf7 .actions {
    text-align: center;
    display: block;
    padding: 0;
    margin: 0;
}

.wpcf7 .wpcf7-submit {
    display: block !important;
    margin: 0 auto !important;
    width: 141px;
    height: 45px;
    border-radius: 8px;
    background: #000;
    color: #fff;
    border: 0;
    font-family: "Roboto", system-ui, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 19px;
    cursor: pointer;
}

.wpcf7 .wpcf7-submit:hover {
    opacity: .92
}

/* Komunikaty zwrotne CF7 (Błąd/Sukces) */
.wpcf7-not-valid input[type="text"],
.wpcf7-not-valid input[type="email"],
.wpcf7-not-valid input[type="tel"],
.wpcf7-not-valid textarea {
    border-color: var(--error, #FF0000) !important;
}

div.wpcf7-response-output {
    margin: 1em auto 1em auto;
    max-width: 1088px;
    padding: 1em;
    border: 2px solid;
    font-weight: 700;
    text-align: center;
}

div.wpcf7-response-output.wpcf7-validation-errors {
    border-color: var(--error, #FF0000);
    color: var(--error, #FF0000);
}

div.wpcf7-response-output.wpcf7-mail-sent-ok {
    border-color: #008000;
    color: #008000;
}

/* RWD dla Formularza (1 kolumna) */
@media (max-width: 760px) {
    .wpcf7 form .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ================= RWD / ODSTĘPY MIĘDZY SEKCjami ================= */

/* Odstępy (Desktop: 64px) */
.hero+.faq,
.faq+.blog,
.blog+.contact {
    margin-top: 64px !important;
}

/* RWD (Tablet: 36px) */
@media (max-width: 992px) {

    .hero+.faq,
    .faq+.blog,
    .blog+.contact {
        margin-top: 36px !important;
    }
}

/* RWD (Telefon: 24px) */
@media (max-width: 640px) {

    .hero+.faq,
    .faq+.blog,
    .blog+.contact {
        margin-top: 24px !important;
    }
}

/* Reset Padding */
.faq,
.blog,
.contact {
    padding-top: 0 !important;
}

/* Styl nagłówków sekcji H2 */
.faq h2,
.blog h2,
.contact h2 {
    font-family: "Inter", system-ui, sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 48px;
    line-height: 58px;
    color: #000;
}

/* RWD H2 (Tablet: ≤768px) */
@media (max-width: 768px) {

    .faq h2,
    .blog h2,
    .contact h2 {
        font-size: 36px;
        line-height: 44px;
    }
}

/* RWD H2 (Telefon: ≤480px) */
@media (max-width: 480px) {

    .faq h2,
    .blog h2,
    .contact h2 {
        font-size: 28px;
        line-height: 34px;
    }
}

/* ========== BLOG / KARTY ARTYKUŁÓW ========== */

.blog .card__media {
    margin: 0 !important;
    /* reset figure margin */
    padding: 0 !important;
    line-height: 0;
    /* zabija ewentualny font-gap */
    display: block;
    overflow: hidden;
    /* zostaje radius na górze */
}

.blog .card__img {
    display: block;
    /* eliminuje inline-gap pod <img> */
}

.blog .card__body {
    margin-top: 0 !important;
    /* na wszelki wypadek */
    border-top: 0 !important;
    /* gdy gdzieś był rysowany border */
}