/*
Theme Name:  Pola Kids
Theme URI:   https://example.com
Description: Kolorowy motyw edukacyjny dla dzieci. Zaprojektowany z myślą o nauce przez zabawę — duże fonty, radosne kolory i przyjazne animacje.
Version:     1.0.0
Author:      Rodzic
Text Domain: pola-kids
*/

/* ══════════════════════════════════════════════════════════════════
   ZMIENNE
══════════════════════════════════════════════════════════════════ */
:root {
    --pink:      #FF6B9D;
    --coral:     #FF6B6B;
    --yellow:    #FFD93D;
    --green:     #6BCB77;
    --blue:      #4D96FF;
    --purple:    #C77DFF;
    --teal:      #4ECDC4;
    --orange:    #FF9F43;

    --bg:        #FFF9F3;
    --card:      #ffffff;
    --text:      #2D3436;
    --text-muted:#888;
    --border:    #F0E8FF;

    --grad-header: linear-gradient(135deg, #667eea 0%, #a29bfe 40%, #fd79a8 100%);
    --grad-nav:    linear-gradient(90deg, #4D96FF, #C77DFF);
    --shadow-sm:   0 4px 12px rgba(102,126,234,.18);
    --shadow-md:   0 8px 28px rgba(102,126,234,.22);
    --shadow-lg:   0 16px 48px rgba(102,126,234,.25);
    --radius-sm:   12px;
    --radius-md:   20px;
    --radius-lg:   32px;
    --radius-full: 999px;
    --font-main:   'Nunito', 'Segoe UI', Tahoma, sans-serif;
}

/* ══════════════════════════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-decoration: none; transition: color .2s; }
a:hover { color: var(--purple); }

/* ══════════════════════════════════════════════════════════════════
   GWIAZDKI W TLE (czysto CSS)
══════════════════════════════════════════════════════════════════ */
.pk-stars {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.pk-star {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,.7);
    border-radius: 50%;
    animation: pkTwinkle 3s ease-in-out infinite alternate;
}
.pk-star:nth-child(1)  { top:12%; left:8%;  width:8px;  height:8px;  animation-delay: 0s; }
.pk-star:nth-child(2)  { top:25%; left:20%; width:5px;  height:5px;  animation-delay: .4s; }
.pk-star:nth-child(3)  { top:8%;  left:40%; width:10px; height:10px; animation-delay: .8s; }
.pk-star:nth-child(4)  { top:40%; left:55%; width:6px;  height:6px;  animation-delay: .2s; }
.pk-star:nth-child(5)  { top:15%; left:70%; width:8px;  height:8px;  animation-delay: 1s; }
.pk-star:nth-child(6)  { top:30%; left:85%; width:5px;  height:5px;  animation-delay: .6s; }
.pk-star:nth-child(7)  { top:55%; left:10%; width:7px;  height:7px;  animation-delay: 1.2s; }
.pk-star:nth-child(8)  { top:60%; left:30%; width:4px;  height:4px;  animation-delay: .3s; }
.pk-star:nth-child(9)  { top:20%; left:92%; width:9px;  height:9px;  animation-delay: .9s; }
.pk-star:nth-child(10) { top:70%; left:75%; width:6px;  height:6px;  animation-delay: 1.5s; }
.pk-star:nth-child(11) { top:5%;  left:55%; width:5px;  height:5px;  animation-delay: .5s; }
.pk-star:nth-child(12) { top:45%; left:90%; width:7px;  height:7px;  animation-delay: .1s; }

@keyframes pkTwinkle {
    from { opacity: .2; transform: scale(.8); }
    to   { opacity: 1;  transform: scale(1.3); }
}

/* Pływające kółka dekoracyjne */
.pk-bubble {
    position: absolute;
    border-radius: 50%;
    opacity: .12;
    animation: pkFloat 6s ease-in-out infinite;
}
.pk-bubble:nth-child(13) { width:120px; height:120px; background:var(--yellow);  top:10%; left:5%;  animation-delay:0s; }
.pk-bubble:nth-child(14) { width:80px;  height:80px;  background:var(--teal);   top:40%; left:90%; animation-delay:2s; }
.pk-bubble:nth-child(15) { width:60px;  height:60px;  background:var(--pink);   top:70%; left:15%; animation-delay:4s; }
.pk-bubble:nth-child(16) { width:100px; height:100px; background:var(--green);  top:20%; left:78%; animation-delay:1s; }

@keyframes pkFloat {
    0%,100% { transform: translateY(0)  rotate(0deg); }
    33%      { transform: translateY(-20px) rotate(5deg); }
    66%      { transform: translateY(10px)  rotate(-5deg); }
}

/* ══════════════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════════════ */
#pk-header {
    background: var(--grad-header);
    position: relative;
    padding: 32px 24px 80px;
    overflow: hidden;
}

.pk-header-inner {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

/* Logo / tytuł */
.pk-site-title {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}
.pk-site-title-icon {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,.25);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    backdrop-filter: blur(6px);
    border: 2px solid rgba(255,255,255,.4);
    flex-shrink: 0;
    transition: transform .3s;
}
.pk-site-title:hover .pk-site-title-icon { transform: rotate(15deg) scale(1.1); }

.pk-site-title-text { color: #fff; }
.pk-site-title-text .pk-name {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,.2);
    display: block;
}
.pk-site-title-text .pk-tagline {
    font-size: .85rem;
    opacity: .85;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

/* Przycisk "hamburger" — mobile */
.pk-menu-toggle {
    display: none;
    background: rgba(255,255,255,.2);
    border: 2px solid rgba(255,255,255,.4);
    color: #fff;
    font-size: 1.4rem;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    backdrop-filter: blur(6px);
}
.pk-menu-toggle:hover { background: rgba(255,255,255,.35); }

/* Fala na dole headera */
.pk-header-wave {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 1;
}
.pk-header-wave svg { display: block; width: 100%; }

/* ══════════════════════════════════════════════════════════════════
   NAWIGACJA
══════════════════════════════════════════════════════════════════ */
#pk-nav {
    background: var(--card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.pk-nav-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pk-primary-menu {
    list-style: none;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px 0;
    margin: 0;
}

#pk-primary-menu li a {
    display: block;
    padding: 9px 22px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: .95rem;
    color: var(--text);
    transition: all .2s;
    white-space: nowrap;
}
#pk-primary-menu li a:hover,
#pk-primary-menu li.current-menu-item a,
#pk-primary-menu li.current_page_item a {
    background: var(--grad-nav);
    color: #fff;
    box-shadow: 0 4px 12px rgba(77,150,255,.35);
    transform: translateY(-2px);
}

/* Kolory kolejnych itemów */
#pk-primary-menu li:nth-child(1) a:hover,
#pk-primary-menu li:nth-child(1).current-menu-item a { background: linear-gradient(135deg, #4D96FF, #667eea); }
#pk-primary-menu li:nth-child(2) a:hover,
#pk-primary-menu li:nth-child(2).current-menu-item a { background: linear-gradient(135deg, #C77DFF, #fd79a8); }
#pk-primary-menu li:nth-child(3) a:hover,
#pk-primary-menu li:nth-child(3).current-menu-item a { background: linear-gradient(135deg, #6BCB77, #4ECDC4); }
#pk-primary-menu li:nth-child(4) a:hover,
#pk-primary-menu li:nth-child(4).current-menu-item a { background: linear-gradient(135deg, #FFD93D, #FF9F43); }
#pk-primary-menu li:nth-child(5) a:hover,
#pk-primary-menu li:nth-child(5).current-menu-item a { background: linear-gradient(135deg, #FF6B9D, #FF6B6B); }

#pk-primary-menu .current-menu-item a,
#pk-primary-menu .current_page_item a {
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
    transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════════════
   LAYOUT GŁÓWNY
══════════════════════════════════════════════════════════════════ */
#pk-main {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px 60px;
}

/* ══════════════════════════════════════════════════════════════════
   HERO (strona główna)
══════════════════════════════════════════════════════════════════ */
.pk-hero {
    text-align: center;
    padding: 56px 24px 48px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.pk-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102,126,234,.06) 0%, rgba(253,121,168,.06) 100%);
}

.pk-hero-emoji {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 20px;
    display: block;
    animation: pkBounce 2s ease-in-out infinite;
}

@keyframes pkBounce {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

.pk-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    background: var(--grad-header);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    line-height: 1.2;
}

.pk-hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 540px;
    margin: 0 auto 28px;
}

.pk-btn {
    display: inline-block;
    padding: 14px 36px;
    border-radius: var(--radius-full);
    font-size: 1.05rem;
    font-weight: 800;
    text-decoration: none;
    transition: all .25s;
    cursor: pointer;
    border: none;
}
.pk-btn--primary {
    background: var(--grad-header);
    color: #fff;
    box-shadow: 0 6px 20px rgba(102,126,234,.4);
}
.pk-btn--primary:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 10px 28px rgba(102,126,234,.5);
    color: #fff;
}
.pk-btn--secondary {
    background: var(--card);
    color: var(--purple);
    border: 2.5px solid var(--purple);
}
.pk-btn--secondary:hover {
    background: var(--purple);
    color: #fff;
    transform: translateY(-2px);
}

/* Kolorowe karty zadań na stronie głównej */
.pk-subjects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
    margin: 40px 0;
}

.pk-subject-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 28px 16px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all .25s;
    text-decoration: none;
    color: var(--text);
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.pk-subject-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: var(--shadow-md);
    color: var(--text);
}
.pk-subject-card:nth-child(1) { border-color: var(--blue);   }
.pk-subject-card:nth-child(2) { border-color: var(--pink);   }
.pk-subject-card:nth-child(3) { border-color: var(--green);  }
.pk-subject-card:nth-child(4) { border-color: var(--yellow); }
.pk-subject-card:nth-child(5) { border-color: var(--purple); }
.pk-subject-card:nth-child(6) { border-color: var(--orange); }

.pk-subject-icon {
    font-size: 2.8rem;
    line-height: 1;
    display: block;
    transition: transform .3s;
}
.pk-subject-card:hover .pk-subject-icon { transform: rotate(10deg) scale(1.2); }

.pk-subject-title {
    font-size: 1rem;
    font-weight: 800;
    display: block;
}
.pk-subject-desc {
    font-size: .8rem;
    color: var(--text-muted);
    display: block;
}

/* ══════════════════════════════════════════════════════════════════
   TREŚĆ STRONY (page.php / shortcode)
══════════════════════════════════════════════════════════════════ */
.pk-page-header {
    text-align: center;
    margin-bottom: 36px;
}
.pk-page-header h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 900;
    background: var(--grad-header);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 10px;
}
.pk-page-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.pk-content-wrap {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════════
   TYPOGRAFIA W TREŚCI
══════════════════════════════════════════════════════════════════ */
.pk-content h1, .pk-content h2, .pk-content h3,
.pk-content h4, .pk-content h5, .pk-content h6 {
    font-weight: 800;
    line-height: 1.3;
    margin: 1.4em 0 .6em;
    color: var(--text);
}
.pk-content h2 { font-size: 1.7rem; }
.pk-content h3 { font-size: 1.35rem; }

.pk-content p     { margin-bottom: 1.1em; }
.pk-content ul,
.pk-content ol    { padding-left: 24px; margin-bottom: 1.1em; }
.pk-content li    { margin-bottom: .4em; }

.pk-content blockquote {
    border-left: 5px solid var(--purple);
    background: #f9f5ff;
    padding: 16px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 20px 0;
    font-style: italic;
    color: #555;
}

/* Kafelki bez zadań (placeholder) */
.pk-subject-card--placeholder {
    opacity: .45;
    pointer-events: none;
    cursor: default;
    filter: grayscale(.6);
}
.pk-subjects--empty { position: relative; }
.pk-no-tasks-hint {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: .9rem;
    margin-top: 8px;
}

/* ══════════════════════════════════════════════════════════════════
   WPISY BLOGA (archiwum)
══════════════════════════════════════════════════════════════════ */
.pk-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.pk-post-card {
    background: var(--card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all .25s;
    border: 2px solid var(--border);
    display: flex;
    flex-direction: column;
}
.pk-post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--purple);
}

.pk-post-thumbnail {
    height: 180px;
    background: var(--grad-header);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    overflow: hidden;
}
.pk-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pk-post-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pk-post-meta {
    font-size: .78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.pk-post-title a {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
    display: block;
}
.pk-post-title a:hover { color: var(--purple); }

.pk-post-excerpt {
    font-size: .88rem;
    color: var(--text-muted);
    flex: 1;
    line-height: 1.5;
}

.pk-post-readmore {
    align-self: flex-start;
    padding: 7px 18px;
    background: var(--grad-header);
    color: #fff;
    border-radius: var(--radius-full);
    font-size: .82rem;
    font-weight: 700;
    transition: all .2s;
    margin-top: 8px;
}
.pk-post-readmore:hover {
    color: #fff;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102,126,234,.4);
}

/* Brak wpisów */
.pk-no-posts {
    text-align: center;
    padding: 56px 24px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.pk-no-posts .pk-np-icon { font-size: 4rem; margin-bottom: 16px; }
.pk-no-posts h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 10px; }
.pk-no-posts p  { color: var(--text-muted); }

/* Paginacja */
.pk-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 40px;
}
.pk-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: .95rem;
    background: var(--card);
    color: var(--text);
    border: 2px solid var(--border);
    transition: all .2s;
}
.pk-pagination .page-numbers:hover,
.pk-pagination .page-numbers.current {
    background: var(--grad-header);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102,126,234,.35);
    transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════════════
   404
══════════════════════════════════════════════════════════════════ */
.pk-404 {
    text-align: center;
    padding: 64px 24px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.pk-404-code {
    font-size: clamp(5rem, 15vw, 9rem);
    font-weight: 900;
    background: var(--grad-header);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}
.pk-404 h2 { font-size: 1.8rem; font-weight: 800; margin: 16px 0 12px; }
.pk-404 p  { color: var(--text-muted); margin-bottom: 28px; font-size: 1.05rem; }

/* ══════════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════════ */
#pk-footer {
    background: linear-gradient(135deg, #2d3436 0%, #1e1e2e 100%);
    color: rgba(255,255,255,.75);
    padding: 0;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

.pk-footer-wave {
    line-height: 0;
    margin-bottom: -2px;
}
.pk-footer-wave svg { display: block; width: 100%; }

.pk-footer-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.pk-footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pk-footer-brand .pk-footer-icon {
    font-size: 2.2rem;
    animation: pkBounce 2.5s ease-in-out infinite;
}
.pk-footer-brand .pk-footer-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    display: block;
}
.pk-footer-brand .pk-footer-tagline {
    font-size: .78rem;
    opacity: .6;
    display: block;
}

.pk-footer-emojis {
    font-size: 1.8rem;
    letter-spacing: 8px;
    opacity: .5;
    animation: pkFooterDance 4s ease-in-out infinite;
}
@keyframes pkFooterDance {
    0%,100% { letter-spacing: 8px; }
    50%      { letter-spacing: 14px; }
}

.pk-footer-copy {
    font-size: .82rem;
    opacity: .5;
    text-align: center;
    padding-bottom: 20px;
    position: relative;
    z-index: 2;
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSYWNOŚĆ
══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    #pk-main          { margin: 20px auto; padding: 0 14px 40px; }
    .pk-content-wrap  { padding: 20px 16px; }
    .pk-hero          { padding: 36px 16px 32px; }
    .pk-subjects      { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .pk-menu-toggle   { display: flex; }
    #pk-primary-menu  { display: none; flex-direction: column; padding: 8px 16px 16px; gap: 4px; }
    #pk-primary-menu.pk-open { display: flex; }
    #pk-primary-menu li a { width: 100%; text-align: center; }
    .pk-nav-inner     { flex-direction: column; align-items: flex-start; padding: 10px 16px; }
    .pk-footer-inner  { flex-direction: column; text-align: center; align-items: center; }
    .pk-posts-grid    { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
    .pk-subjects { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════
   ANIMACJA WEJŚCIA
══════════════════════════════════════════════════════════════════ */
@keyframes pkFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pk-content-wrap,
.pk-hero,
.pk-post-card,
.pk-subject-card {
    animation: pkFadeUp .5s ease both;
}
.pk-post-card:nth-child(2) { animation-delay: .1s; }
.pk-post-card:nth-child(3) { animation-delay: .2s; }
.pk-subject-card:nth-child(2) { animation-delay: .07s; }
.pk-subject-card:nth-child(3) { animation-delay: .14s; }
.pk-subject-card:nth-child(4) { animation-delay: .21s; }
.pk-subject-card:nth-child(5) { animation-delay: .28s; }
.pk-subject-card:nth-child(6) { animation-delay: .35s; }

/* ══════════════════════════════════════════════════════════════════
   INTEGRACJA Z PLUGINEM POLA LEARNING
══════════════════════════════════════════════════════════════════ */
/* Lekkie dopasowanie stylów pluginu do motywu */
.pola-app {
    font-family: var(--font-main) !important;
}
.pola-question-card {
    border-radius: var(--radius-lg) !important;
    border-width: 3px !important;
    border-color: var(--border) !important;
}
.pola-btn--primary {
    font-family: var(--font-main) !important;
    font-weight: 800 !important;
    border-radius: var(--radius-full) !important;
    background: var(--grad-header) !important;
}
.pola-task-card {
    border-radius: var(--radius-md) !important;
    border-width: 3px !important;
    font-family: var(--font-main) !important;
}
.pola-results-emoji { animation: pkBounce 1.5s ease-in-out infinite; }
