/*
Theme Name: SEO Optimized FSE Theme
Text Domain: seo-fse-theme
Version: 1.1.0
Description: Nowoczesny, zautomatyzowany motyw blokowy zoptymalizowany pod SEO.
*/

/* ====================================================
   ETAP 1: QUICK WINS — CSS & Layout
   ==================================================== */

/*
  Fix 1: Kompensacja sticky headera.
  Zapobiega przycięciu treści przez przyklejony nagłówek
  przy scroll-to i przy przechodzeniu między stronami.
*/
html {
    scroll-padding-top: 80px;
}

/*
  Fix 2: Redukcja paddingu "above the fold".
  Zgodnie z audytem: sekcja "Najważniejsze dzisiaj"
  miała zbyt duży padding-top, który spychał treść poza
  linię zgięcia. Wartość zmniejszona z ~3rem na 1.5rem.
*/
main.wp-block-group.alignfull>.wp-block-group.alignwide:first-child {
    margin-top: 0 !important;
    margin-bottom: 2rem !important;
}

/*
  Fix 3: Hierarchia wizualna — "Lead Story".
  Wyróżnienie głównego artykułu w hero layoutcie
  (65% kolumna na stronie głównej).
*/
.wp-block-columns>.wp-block-column[style*="flex-basis:65%"] .wp-block-post-title a {
    font-size: clamp(1.6rem, 3vw, 2.4rem) !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    color: var(--wp--preset--color--contrast) !important;
    display: block;
    transition: color 0.2s ease;
}

.wp-block-columns>.wp-block-column[style*="flex-basis:65%"] .wp-block-post-title a:hover {
    color: var(--wp--preset--color--primary) !important;
    text-decoration: none !important;
}

/* Zwiększone zdjęcie lead story */
.wp-block-columns>.wp-block-column[style*="flex-basis:65%"] .wp-block-post-featured-image img {
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wp-block-columns>.wp-block-column[style*="flex-basis:65%"] .wp-block-post-featured-image img:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(30, 27, 75, 0.15);
}

/*
  Fix 4: Poprawna typografia i czytelność list artykułów.
  Auqit: "teksty w listach są zbyt ścieśnione".
  line-height i marginy dla tytułów w sekcjach kategorii.
*/
.wp-block-query .wp-block-post-title {
    line-height: 1.35 !important;
    margin-bottom: 0.25rem;
}

.wp-block-query .wp-block-post-title a {
    transition: color 0.2s ease;
}

.wp-block-query .wp-block-post-title a:hover {
    color: var(--wp--preset--color--primary);
    text-decoration: none !important;
}

/*
  Fix 5: Nagłówki kategorii na stronie głównej.
  Dodanie wyraźnego oddzielenia wizualnego przez
  border-bottom jako "indicator" sekcji.
*/
.wp-block-columns.alignwide>.wp-block-column>h2.has-primary-color {
    padding-bottom: 0.6rem;
    border-bottom: 3px solid var(--wp--preset--color--primary);
    margin-bottom: 1.25rem !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.08em;
}

/*
  Fix 6: Micro-animacje — ogólne linki do artykułów.
*/
.wp-block-post-featured-image a {
    display: block;
    overflow: hidden;
    border-radius: 12px;
}

.wp-block-post-featured-image a img {
    transition: transform 0.3s ease;
    display: block;
    width: 100%;
}

.wp-block-post-featured-image a:hover img {
    transform: scale(1.03);
}

/*
  Fix 7: Zachowanie scroll-margin dla nagłówków treści artykułów.
  Zapobiega CLS przy nawigacji kotwicowej.
*/
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    scroll-margin-top: 90px;
}

/* ====================================================
   RESPONSIVE: Header overlap fix na mobile
   ==================================================== */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 60px;
    }

    .wp-block-columns.alignwide>.wp-block-column>h2.has-primary-color {
        font-size: 0.75rem !important;
    }
}

/* ====================================================
   GLOBAL LINK FIXES: Visited & Hover states
   ==================================================== */

/* 
  Zapobiega zmienianiu koloru linków po kliknięciu (visited).
  Dzięki temu "raz kliknięte" linki nie robią się ciemniejsze/inne.
*/
a,
a:visited {
    color: inherit;
    /* Lub konkretny kolor z presetów jeśli nie dziedziczy */
    text-decoration: none;
}

/* Wzmocnienie dla linków w treści, żeby zawsze były czytelne */
.entry-content a:visited,
.wp-block-post-title a:visited {
    color: var(--wp--preset--color--primary);
}

/* ====================================================
   FOOTER: Link visibility fix
   ==================================================== */

footer a,
footer a:visited {
    color: var(--wp--preset--color--tertiary) !important;
    opacity: 0.8;
    transition: all 0.2s ease;
}

footer a:hover {
    color: #ffffff !important;
    opacity: 1;
    text-decoration: none !important;
}

/* Specyficzne poprawki dla ręcznych linków w HTML blocku stopki */
footer .wp-block-html a,
footer .wp-block-html a:visited,
.footer-links-redakcja a,
.footer-links-redakcja a:visited {
    color: rgba(241, 245, 249, 0.8) !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    opacity: 1 !important;
    /* Usuwamy wszelkie ściemnianie */
}

.footer-links-redakcja a:hover {
    color: #ffffff !important;
    padding-left: 5px;
}

footer .wp-block-html a:hover {
    color: #ffffff !important;
}


/* Kontener główny reklamy */
.baluarte-ad-widget {
    background-color: #0b091a;
    background-image: linear-gradient(135deg, #0b091a 0%, #1a163a 100%);
    color: #ffffff;
    padding: 28px 24px;
    border-radius: 12px;
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 340px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

/* Plakietka "Secure Development" */
.baluarte-ad-widget .baluarte-ad-badge {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: rgba(0, 229, 255, 0.1);
    color: #00e5ff;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-weight: 600;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

/* Nagłówek */
.baluarte-ad-widget .baluarte-ad-title {
    color: #ffffff;
    font-size: 1.6rem;
    margin: 0 0 12px 0;
    line-height: 1.25;
    font-weight: 800;
}

/* Treść główna */
.baluarte-ad-widget .baluarte-ad-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #c4c4d4;
    margin: 0 0 16px 0;
}

.baluarte-ad-widget .baluarte-ad-desc strong {
    color: #00e5ff;
}

/* Lista cech */
.baluarte-ad-widget .baluarte-ad-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    font-size: 1.05rem;
    color: #e0e0e0;
}

.baluarte-ad-widget .baluarte-ad-features li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

/* Przycisk CTA */
.baluarte-ad-widget .baluarte-ad-cta {
    display: block;
    text-align: center;
    background-color: #00e5ff;
    color: #0b091a;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.3);
}

/* Interakcje (Hover/Active) */
.baluarte-ad-widget .baluarte-ad-cta:hover {
    background-color: #ffffff;
    color: #0b091a;
    box-shadow: 0 6px 16px rgba(255, 255, 255, 0.2);
}

.baluarte-ad-widget .baluarte-ad-cta:active {
    transform: translateY(2px);
    box-shadow: none;
}

/* ------------------------------------- */
/* Sidebar "Najnowsze wpisy"             */
/* ------------------------------------- */

.wp-block-latest-posts {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Dodanie linii rozdzielającej pod wpisami */
.wp-block-latest-posts li {
    border-bottom: 1px solid var(--wp--preset--color--tertiary);
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
}

/* Ostatni element nie potrzebuje kreseczki na dole */
.wp-block-latest-posts li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Ukrycie daty w sposób bezpieczny dla SEO i kodu */
.wp-block-latest-posts .wp-block-latest-posts__post-date {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Kontener główny (jasny motyw nawiązujący do designu strony) */
.sg-ad-widget {
    background-color: #ffffff;
    background-image: linear-gradient(135deg, #fbfaff 0%, #ffffff 100%);
    color: #1a1b2e;
    padding: 32px 24px;
    border-radius: 12px;
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 380px;
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.08);
    /* Delikatny, fioletowy cień */
    border: 1px solid #f0e6ff;
    margin-bottom: 20px;
}

/* Plakietka (Pill-shape jak na stronie) */
.sg-ad-badge {
    display: inline-block;
    font-size: 0.75rem;
    background-color: #f3e8ff;
    color: #7e22ce;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Nagłówek */
.sg-ad-title {
    font-size: 1.5rem;
    margin: 0 0 16px 0;
    line-height: 1.3;
    font-weight: 800;
    color: #111827;
}

/* Treść opisu */
.sg-ad-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 24px 0;
}

/* Sekcja statystyk uwiarygadniających */
.sg-ad-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    font-size: 0.8rem;
    color: #6b7280;
    text-align: center;
}

.sg-ad-stats strong {
    display: block;
    font-size: 1.25rem;
    color: #8b00ff;
    /* Fioletowy akcent ze statystyk */
    font-weight: 800;
    margin-bottom: 2px;
}

/* Przycisk CTA */
.sg-ad-cta {
    display: block;
    text-align: center;
    background-color: #8a2be2;
    /* Główny fiolet z przycisku na zrzucie */
    color: #ffffff !important;
    text-decoration: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.2);
}

/* Interakcje (Hover/Active) */
.sg-ad-cta:hover {
    background-color: #721bc4;
    box-shadow: 0 6px 16px rgba(138, 43, 226, 0.3);
}

.sg-ad-cta:active {
    transform: translateY(2px);
    box-shadow: 0 2px 8px rgba(138, 43, 226, 0.2);
}