/**
 * HR:STAT — Blog, Aktualności, Centrum Pomocy, Mega Menu
 * @package hrstat
 */

/* ══════════════════════════════════════════
   BLOG
══════════════════════════════════════════ */
.blog-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    padding: 5rem 0 3.5rem;
    border-bottom: 1px solid var(--border);
}
.blog-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    color: var(--text-primary);
    margin: .75rem 0 .75rem;
    letter-spacing: -.03em;
    font-weight: 800;
}
.blog-hero__desc { font-size: 1.05rem; color: var(--text-secondary); margin: 0; max-width: 560px; line-height: 1.7; }

.blog-layout { padding: 3rem 0 5rem; }

/* Filters */
.blog-filters {
    display: flex; flex-wrap: wrap; gap: .5rem;
    margin-bottom: 2.5rem;
}
.blog-filter-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; border-radius: 50px;
    font-size: 13px; font-weight: 600;
    text-decoration: none;
    background: white; color: var(--text-secondary);
    border: 1.5px solid var(--border);
    transition: all .2s;
}
.blog-filter-btn:hover, .blog-filter-btn.is-active {
    background: var(--brand); color: white; border-color: var(--brand);
}
.blog-filter-count {
    background: rgba(0,0,0,.06); border-radius: 50px;
    font-size: 11px; padding: 1px 7px; font-weight: 700;
}
.blog-filter-btn.is-active .blog-filter-count { background: rgba(255,255,255,.2); color: white; }

/* Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.blog-card--featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
}
.blog-card--featured .blog-card__img { max-height: 400px; }

.blog-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: all .25s;
}
.blog-card:hover {
    border-color: var(--brand-xlight);
    box-shadow: 0 8px 30px rgba(71,85,105,.1);
    transform: translateY(-3px);
}
.blog-card__img { display: block; overflow: hidden; aspect-ratio: 16/9; }
.blog-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.blog-card:hover .blog-card__img img { transform: scale(1.04); }
.blog-card__img--placeholder {
    background: var(--brand-subtle);
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 16/9;
}
.blog-card__img--placeholder svg { width: 40px; height: 40px; stroke: var(--brand-xlight); fill: none; }

.blog-card__body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: .6rem; }
.blog-card--featured .blog-card__body { padding: 2.5rem; gap: .8rem; }

.blog-card__cat {
    display: inline-block; font-size: 11px; font-weight: 700;
    color: var(--brand); text-decoration: none; text-transform: uppercase;
    letter-spacing: .06em; background: var(--brand-xlight);
    padding: 3px 10px; border-radius: 50px;
}
.blog-card__title { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.blog-card__title a { color: var(--text-primary); text-decoration: none; }
.blog-card__title a:hover { color: var(--brand); }
.blog-card--featured .blog-card__title { font-size: clamp(1.3rem, 2vw, 1.8rem); }

.blog-card__excerpt { font-size: .9rem; color: var(--text-secondary); line-height: 1.6; margin: 0; }
.blog-card__meta { font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.blog-card__sep { opacity: .4; }
.blog-card__link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .85rem; font-weight: 700; color: var(--brand);
    text-decoration: none; margin-top: .25rem;
}
.blog-card__link svg { width: 14px; height: 14px; stroke: var(--brand); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.blog-card__link:hover svg { transform: translateX(4px); }

/* Pagination */
.blog-pagination { margin-top: 3rem; display: flex; justify-content: center; }
.blog-pagination ul { display: flex; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.blog-pagination ul li a,
.blog-pagination ul li span {
    display: flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 12px;
    border-radius: 8px; font-size: 14px; font-weight: 600;
    text-decoration: none; border: 1.5px solid var(--border);
    color: var(--text-secondary); background: white; transition: all .2s;
}
.blog-pagination ul li a:hover { border-color: var(--brand); color: var(--brand); }
.blog-pagination ul li .current { background: var(--brand); color: white; border-color: var(--brand); }

/* Empty */
.blog-empty {
    text-align: center; padding: 5rem 2rem;
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.blog-empty svg { width: 48px; height: 48px; stroke: var(--brand-xlight); fill: none; stroke-width: 1.5; }
.blog-empty h3 { font-size: 1.3rem; color: var(--text-primary); margin: 0; }
.blog-empty p { color: var(--text-secondary); margin: 0; }

/* ══════════════════════════════════════════
   AKTUALNOŚCI
══════════════════════════════════════════ */
.updates-hero {
    background: var(--brand);
    padding: 5rem 0 3.5rem;
    position: relative; overflow: hidden;
}
.updates-hero::before {
    content:''; position:absolute; top:-100px; right:-100px;
    width:400px; height:400px;
    background:radial-gradient(circle,rgba(255,255,255,.06) 0%,transparent 70%);
    border-radius:50%;
}
.updates-hero .section-label { background:rgba(255,255,255,.15); color:rgba(255,255,255,.85); }
.updates-hero__title {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.5vw, 2.8rem);
    color: white; margin: .75rem 0 .75rem;
    letter-spacing: -.03em; font-weight: 800;
}
.updates-hero__desc { font-size: 1.05rem; color: rgba(255,255,255,.75); margin: 0 0 1.75rem; max-width: 540px; line-height: 1.7; }
.updates-hero__badges { display: flex; gap: .75rem; flex-wrap: wrap; }

.updates-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 50px; white-space: nowrap; }
.updates-badge--new { background: #dcfce7; color: #15803d; }
.updates-badge--fix { background: #fef3c7; color: #b45309; }
.updates-badge--imp { background: #e0e7ff; color: #4338ca; }

.updates-layout { padding: 3rem 0 5rem; }
.updates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.updates-card {
    background: white; border: 1.5px solid var(--border); border-radius: 16px;
    padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem;
    transition: all .25s;
}
.updates-card:hover { border-color: var(--brand-xlight); box-shadow: 0 6px 24px rgba(71,85,105,.1); transform: translateY(-2px); }
.updates-card__top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.updates-card__date { font-size: 12px; color: var(--text-muted); }
.updates-card__title { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; }
.updates-card__title a { color: var(--text-primary); text-decoration: none; }
.updates-card__title a:hover { color: var(--brand); }
.updates-card__img { display: block; border-radius: 10px; overflow: hidden; }
.updates-card__img img { width: 100%; display: block; border-radius: 10px; }
.updates-card__excerpt { font-size: .875rem; color: var(--text-secondary); line-height: 1.6; margin: 0; }
.updates-card__module { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.updates-card__module svg { width: 12px; height: 12px; stroke: var(--text-muted); fill: none; }
.updates-card__link { display: inline-flex; align-items: center; gap: 5px; font-size: .83rem; font-weight: 700; color: var(--brand); text-decoration: none; margin-top: auto; }
.updates-card__link svg { width: 13px; height: 13px; stroke: var(--brand); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.updates-card__link:hover svg { transform: translateX(3px); }

/* ══════════════════════════════════════════
   CENTRUM POMOCY
══════════════════════════════════════════ */
.help-hero {
    background: var(--brand);
    padding: 5rem 0 4rem;
    text-align: center;
    position: relative; overflow: hidden;
}
.help-hero::before {
    content:''; position:absolute; top:-150px; left:50%; transform:translateX(-50%);
    width:600px; height:600px;
    background:radial-gradient(circle,rgba(255,255,255,.06) 0%,transparent 70%);
    border-radius:50%; pointer-events:none;
}
.help-hero .section-label { background:rgba(255,255,255,.15); color:rgba(255,255,255,.8); }
.help-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    color: white; margin: .75rem 0 .5rem;
    letter-spacing: -.03em; font-weight: 800;
}
.help-hero__sub { color: rgba(255,255,255,.75); font-size: 1.05rem; margin: 0 0 2.5rem; }

/* Search */
.help-search { max-width: 640px; margin: 0 auto; position: relative; z-index: 1; }
.help-search__wrap { display: flex; background: white; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.help-search__icon { width: 20px; height: 20px; stroke: var(--text-muted); fill: none; stroke-width: 2; flex-shrink: 0; margin: auto 0 auto 1.25rem; }
.help-search__input { flex: 1; border: none; outline: none; padding: 1rem .75rem; font-size: 1rem; font-family: inherit; color: var(--text-primary); background: transparent; }
.help-search__btn { background: var(--brand); color: white; border: none; padding: 0 1.5rem; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; transition: background .2s; }
.help-search__btn:hover { background: var(--brand-dark); }
.help-search__popular { margin-top: 1rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.help-search__popular span { font-size: 13px; color: rgba(255,255,255,.6); }
.help-search__popular a { font-size: 13px; color: rgba(255,255,255,.85); text-decoration: none; background: rgba(255,255,255,.12); border-radius: 50px; padding: 3px 12px; transition: background .2s; }
.help-search__popular a:hover { background: rgba(255,255,255,.25); }

.help-layout { padding: 3.5rem 0 5rem; }
.help-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--brand); text-decoration: none; margin-bottom: 1.5rem; }
.help-back:hover { text-decoration: underline; }

/* Categories grid */
.help-cats-header { margin-bottom: 1.5rem; }
.help-cats-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.help-cats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 3.5rem; }
.help-cat-card { background: white; border: 1.5px solid var(--border); border-radius: 16px; padding: 1.5rem; transition: all .25s; display: flex; flex-direction: column; gap: .75rem; }
.help-cat-card:hover { border-color: var(--brand); box-shadow: 0 6px 24px rgba(71,85,105,.1); transform: translateY(-2px); }
.help-cat-card__head { display: flex; align-items: center; gap: 12px; }
.help-cat-card__icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.help-cat-card__head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.help-cat-card__head h3 a { color: var(--text-primary); text-decoration: none; }
.help-cat-card__head h3 a:hover { color: var(--brand); }
.help-cat-card__count { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.help-cat-card__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.help-cat-card__list li a { font-size: .875rem; color: var(--text-secondary); text-decoration: none; line-height: 1.4; }
.help-cat-card__list li a:hover { color: var(--brand); }
.help-cat-card__more { font-size: .8rem; font-weight: 700; color: var(--brand); text-decoration: none; margin-top: auto; }
.help-cat-card__more:hover { text-decoration: underline; }

/* Results */
.help-search-results h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: .5rem; color: var(--text-primary); }
.help-results-list { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.5rem; }
.help-result-item { display: flex; align-items: center; gap: 14px; background: white; border: 1.5px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; text-decoration: none; transition: all .2s; }
.help-result-item:hover { border-color: var(--brand); box-shadow: 0 4px 16px rgba(71,85,105,.08); }
.help-result-item > svg { width: 18px; height: 18px; stroke: var(--brand); fill: none; flex-shrink: 0; }
.help-result-item__title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.help-result-item__excerpt { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.help-result-item__arrow { width: 16px; height: 16px; stroke: var(--text-muted); fill: none; margin-left: auto; flex-shrink: 0; }
.help-no-results { padding: 3rem; text-align: center; background: var(--bg); border-radius: 16px; }

/* Recent */
.help-recent { margin-bottom: 3rem; }
.help-recent h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--text-primary); }
.help-recent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.help-recent-item { display: flex; align-items: center; gap: 10px; background: white; border: 1.5px solid var(--border); border-radius: 10px; padding: .875rem 1rem; text-decoration: none; font-size: .875rem; font-weight: 500; color: var(--text-secondary); transition: all .2s; }
.help-recent-item:hover { border-color: var(--brand); color: var(--brand); }
.help-recent-item svg { width: 14px; height: 14px; stroke: currentColor; fill: none; flex-shrink: 0; }

/* Contact CTA */
.help-contact-cta { background: var(--brand-subtle); border: 1.5px solid var(--border); border-radius: 20px; padding: 2rem; }
.help-contact-cta__inner { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.help-contact-cta__icon { font-size: 40px; flex-shrink: 0; }
.help-contact-cta__inner h3 { margin: 0 0 .25rem; font-size: 1.1rem; font-weight: 700; }
.help-contact-cta__inner p { margin: 0; font-size: .9rem; color: var(--text-secondary); }
.help-contact-cta__inner .btn-primary { margin-left: auto; white-space: nowrap; }

/* Setup placeholder */
.help-setup { text-align: center; padding: 5rem 2rem; max-width: 560px; margin: 0 auto; }
.help-setup__icon { font-size: 56px; margin-bottom: 1rem; }
.help-setup h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .75rem; }
.help-setup p { color: var(--text-secondary); margin-bottom: 2rem; }
.help-setup__steps { display: flex; flex-direction: column; gap: .75rem; text-align: left; margin-bottom: 2rem; }
.help-setup__step { display: flex; align-items: flex-start; gap: 12px; font-size: .9rem; color: var(--text-secondary); background: white; border: 1px solid var(--border); border-radius: 10px; padding: .875rem 1rem; }
.help-setup__step span { background: var(--brand); color: white; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }

/* ══════════════════════════════════════════
   MEGA MENU (frontend)
══════════════════════════════════════════ */
/* Mega menu */
.site-header { position: sticky; top: 0; z-index: 200; }

/* has-megamenu musi być relative żeby dropdown był relative do niego */
.nav__item.has-megamenu {
    position: relative;
}

.megamenu-dropdown {
    position: absolute;
    top: 100%;      /* zaraz pod linkiem, bez gap */
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    min-width: 800px;
    background: white;
    border-top: 2px solid var(--brand);
    border-bottom: 1px solid var(--border);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 16px 48px rgba(71,85,105,.14);
    z-index: 999;
    padding: 2rem;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

/* Bridge — niewidoczny obszar między linkiem a dropdownem żeby hover nie znikał */
.nav__item.has-megamenu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    height: 12px; /* wypełnia gap między linkiem a menu */
    background: transparent;
    display: block;
}

/* Pokaż po hover na całym .nav__item (link + bridge + dropdown) */
.nav__item.has-megamenu:hover > .megamenu-dropdown,
.nav__item.has-megamenu:focus-within > .megamenu-dropdown {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.megamenu-inner {
    display: flex;
    gap: 2rem;
    width: 100%;
}

.megamenu-col { flex: 1; min-width: 0; }

.megamenu-col__title {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

.megamenu-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: .625rem .75rem;
    border-radius: 10px;
    text-decoration: none;
    margin-bottom: 2px;
    transition: background .15s;
}

.megamenu-item:hover { background: var(--brand-subtle); }
.megamenu-item:hover .megamenu-item__label { color: var(--brand); }

.megamenu-item__icon { font-size: 20px; line-height: 1.2; flex-shrink: 0; margin-top: 1px; }

.megamenu-item__label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 2px;
    transition: color .15s;
}

.megamenu-item__desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Trigger arrow */
.nav__link.has-megamenu-trigger::after {
    content: '';
    display: inline-block;
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 6px;
    vertical-align: middle;
    transition: transform .2s;
}
.nav__item.has-megamenu:hover .nav__link.has-megamenu-trigger::after { transform: rotate(180deg); }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-card--featured { grid-template-columns: 1fr; }
    .updates-grid { grid-template-columns: repeat(2, 1fr); }
    .help-cats-grid { grid-template-columns: repeat(2, 1fr); }
    .help-recent-grid { grid-template-columns: repeat(2, 1fr); }
    .megamenu-inner { gap: 1.5rem; }
}

@media (max-width: 768px) {
    .blog-grid { grid-template-columns: 1fr; }
    .blog-card--featured { grid-column: 1; }
    .updates-grid { grid-template-columns: 1fr; }
    .help-cats-grid { grid-template-columns: 1fr; }
    .help-recent-grid { grid-template-columns: 1fr; }
    .megamenu-dropdown { position: fixed; top: 68px; bottom: 0; overflow-y: auto; border-top: none; }
    .megamenu-inner { flex-direction: column; gap: 1.5rem; padding: 1rem; }
    .help-contact-cta__inner .btn-primary { margin-left: 0; }
}
