/* ============================================================
   GABO – STYLE PODSTRONY WPISU BLOGOWEGO (jeden plik)
   Wczytywany WYŁĄCZNIE na pojedynczych wpisach (is_singular('post'))
   oraz w panelu edytora (add_editor_style) – patrz functions.php.
   Marka: #149645.
   ============================================================ */

/* ------------------------------------------------------------
   1. NAWIGACJA / KOTWICE SPISU TREŚCI
   ------------------------------------------------------------ */
/* Kotwica nagłówka nie chowa się pod przyklejonym menu (navbar-fixed-top). */
[id^="toc-"] {
    scroll-margin-top: 95px;
}

/* ------------------------------------------------------------
   2. PASEK META (data / aktualizacja / czas czytania / kategoria)
   ------------------------------------------------------------ */
.gabo-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
    color: #6b6b6b;
    font-size: 14px;
}
.gabo-post-meta a {
    color: #149645;
    font-weight: 600;
    text-decoration: none;
}
.gabo-meta-updated {
    color: #149645;
}

/* ------------------------------------------------------------
   3. OBRAZ WYRÓŻNIAJĄCY
   ------------------------------------------------------------ */
.gabo-featured-img {
    height: auto;
    width: 100%;
    border-radius: 16px;
}

/* ------------------------------------------------------------
   4. SPIS TREŚCI – SIDEBAR (desktop, sticky) + MOBILE (inline)
   ------------------------------------------------------------ */
@media (min-width: 992px) {
    /* sticky dla CAŁEGO sidebara (nie tylko spisu treści) */
    #sidebar1 {
        position: sticky;
        top: 95px;
        align-self: flex-start;
    }
}

/* Mobilny, zwijany spis treści NAD treścią */
.gabo-toc-inline {
    display: none; /* na desktopie korzystamy z TOC w sidebarze */
    margin: 0 0 1.75em;
    padding: 0 1.25em;
    border: 1px solid #d8e8dd;
    border-radius: 14px;
    background: #f4faf5;
}
.gabo-toc-inline__title {
    cursor: pointer;
    list-style: none;
    padding: 1em 0;
    font-weight: 700;
    color: #149645;
    position: relative;
}
.gabo-toc-inline__title::-webkit-details-marker {
    display: none;
}
.gabo-toc-inline__title::after {
    content: "▾";
    position: absolute;
    right: 0;
    transition: transform .2s ease;
}
.gabo-toc-inline[open] .gabo-toc-inline__title::after {
    transform: rotate(180deg);
}
.gabo-toc-inline .gabo-toc-list {
    list-style: none;
    margin: 0;
    padding: 0 0 1em;
}
.gabo-toc-inline .gabo-toc-list a {
    color: #2e2e2e;
    text-decoration: none;
}
.gabo-toc-inline .gabo-toc-list a:hover {
    color: #149645;
    text-decoration: underline;
}
.gabo-toc-inline .gabo-toc-level-3 {
    padding-left: 1.1em;
    font-size: .95em;
}
@media (max-width: 991px) {
    .gabo-toc-inline {
        display: block;
    }
    /* na mobile sidebarowy TOC byłby dopiero pod całą treścią – ukrywamy */
    #sidebar1 .widget_gabo_toc {
        display: none;
    }
}

/* ------------------------------------------------------------
   5. PASEK POSTĘPU CZYTANIA (pod headerem; top ustawia JS)
   ------------------------------------------------------------ */
.gabo-reading-progress {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
    background: rgba(20, 150, 69, .12);
    z-index: 1029; /* tuż pod navbar-fixed-top (1030) */
    pointer-events: none;
}
.gabo-reading-progress__bar {
    display: block;
    height: 100%;
    width: 0;
    background: #149645;
    transition: width .08s linear;
}

/* ------------------------------------------------------------
   6. AKTYWNY NAGŁÓWEK W SPISIE TREŚCI (scroll-spy)
   ------------------------------------------------------------ */
.gabo-toc-list a {
    transition: color .15s ease;
}
.gabo-toc-list a.is-active {
    color: #149645 !important;
    font-weight: 700;
}
#sidebar1 .widget_gabo_toc .gabo-toc-list li {
    position: relative;
}
#sidebar1 .widget_gabo_toc .gabo-toc-list a.is-active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: .35em;
    bottom: .35em;
    width: 3px;
    border-radius: 3px;
    background: #149645;
}

/* ------------------------------------------------------------
   7. CTA KONTAKT (shortcode [gabo_cta] + format "CTA Kontakt")
   ------------------------------------------------------------ */
.gabo-cta-contact {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 40px;
    margin: 50px 0;
    background: linear-gradient(135deg, #169447, #0f6c33);
    border-radius: 20px;
    color: #fff;
}
.gabo-cta-icon {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    font-size: 34px;
}
.gabo-cta-content h3 {
    color: #fff;
    margin-bottom: 12px;
}
.gabo-cta-content p {
    color: rgba(255, 255, 255, .9);
    margin-bottom: 20px;
}
.gabo-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: #169447 !important;
    text-decoration: none;
    font-weight: 700;
    padding: 14px 24px;
    border-radius: 12px;
    transition: .3s;
}
.gabo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
}
.gabo-btn:after {
    content: "→";
}

/* ------------------------------------------------------------
   8. FORMATY TREŚCI (lista "Formaty" w edytorze klasycznym)
   ------------------------------------------------------------ */

/* Lead / Zielona ramka */
.gabo-lead {
    background: #f0f9f3;
    border-left: 5px solid #149645;
    border-radius: 10px;
    padding: 18px 22px;
    margin: 1.5em 0;
    font-size: 1.08em;
    line-height: 1.6;
    color: #1c1c1c;
}
.gabo-lead > :last-child {
    margin-bottom: 0;
}

/* Ważna informacja */
.gabo-note {
    position: relative;
    background: #fff8e6;
    border: 1px solid #f0d9a0;
    border-radius: 12px;
    padding: 18px 22px 18px 56px;
    margin: 1.5em 0;
    color: #5b4708;
}
.gabo-note::before {
    content: "!";
    position: absolute;
    left: 18px;
    top: 18px;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    font-weight: 700;
    color: #fff;
    background: #e0a106;
    border-radius: 50%;
}
.gabo-note > :last-child {
    margin-bottom: 0;
}

/* Lista korzyści (stosowana na <ul>) */
ul.gabo-benefits {
    list-style: none;
    padding-left: 0;
    margin: 1.5em 0;
}
ul.gabo-benefits li {
    position: relative;
    padding-left: 34px;
    margin-bottom: 12px;
    line-height: 1.5;
}
ul.gabo-benefits li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #149645;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M13.485 1.929a1 1 0 0 1 .086 1.32l-.086.094-7 7a1 1 0 0 1-1.32.086l-.094-.086-3-3a1 1 0 0 1 1.32-1.5l.094.086L6 8.585l6.293-6.292a1 1 0 0 1 1.192-.364z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
}

/* Porada eksperta */
.gabo-tip {
    position: relative;
    background: #f0f9f3;
    border: 1px dashed #149645;
    border-radius: 12px;
    padding: 18px 22px;
    margin: 1.5em 0;
}
.gabo-tip::before {
    content: "Porada eksperta";
    display: inline-block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #149645;
}
.gabo-tip > :last-child {
    margin-bottom: 0;
}

/* CTA Darmowa próbka (wariant „outline") */
.gabo-cta-sample {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px 36px;
    margin: 50px 0;
    background: #f0f9f3;
    border: 2px solid #149645;
    border-radius: 20px;
    color: #14532b;
}
.gabo-cta-sample h3 {
    color: #0f6c33;
    margin-bottom: 10px;
}
.gabo-cta-sample > :last-child {
    margin-bottom: 0;
}

/* ------------------------------------------------------------
   9. SIDEBAR „OSTATNIE WPISY" – wygląd taki jak karta „Spis treści"
   Widget jest blokowy (.widget_block z .wp-block-latest-posts),
   dlatego dotychczasowy CSS dla .widget_recent_entries go nie łapał.
   ------------------------------------------------------------ */
#sidebar1 .widget_block {
    margin-bottom: 30px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e4e4e4;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
#sidebar1 .widget_block h2.wp-block-heading {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 15px;
    color: #222;
}
#sidebar1 .widget_block .wp-block-latest-posts__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
#sidebar1 .widget_block .wp-block-latest-posts__list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}
#sidebar1 .widget_block .wp-block-latest-posts__list li:last-child {
    margin-bottom: 0;
}
#sidebar1 .widget_block .wp-block-latest-posts__featured-image {
    flex: 0 0 70px;
    max-width: 70px;
}
#sidebar1 .widget_block .wp-block-latest-posts__featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}
#sidebar1 .widget_block .wp-block-latest-posts__post-title {
    display: block;
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    color: #333 !important;
    text-decoration: none;
}
#sidebar1 .widget_block .wp-block-latest-posts__post-title:hover {
    color: #149645 !important;
    text-decoration: underline;
}
