/**
 * Nowoczesne Narożniki — base.css
 * Core styles: reset, typography, layout, cards, sidebar, responsive.
 * Foxiz.io/news/ design — border-radius 8px, box-shadow, colored badges.
 *
 * @author Damian Zięba <biuro@semtak.pl>
 */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-text); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--color-accent); }
ul, ol { list-style: none; }

/* === ACCESSIBILITY === */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.stb-skip-link {
    position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
    z-index: 9999; padding: 12px 24px; background: var(--color-accent); color: #fff;
    font-weight: 700; border-radius: var(--radius);
}
.stb-skip-link:focus { left: 16px; top: 16px; width: auto; height: auto; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.3; color: var(--color-text); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

/* === CONTAINER === */
.stb-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* === LAYOUT (main + sidebar) === */
.nn-layout {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--gap);
    align-items: start;
}
.nn-main-col { min-width: 0; }
.nn-sidebar {
    position: static;
    min-width: 0;
}

/* === GRIDS === */
.nn-posts-grid { display: grid; gap: 24px; }
.nn-cols-2 { grid-template-columns: repeat(2, 1fr); }
.nn-cols-3 { grid-template-columns: repeat(3, 1fr); }
.nn-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* === CARDS (foxiz news style) === */
.nn-card {
    background: var(--color-card-bg);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.nn-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}
.nn-card__img {
    display: block;
    overflow: hidden;
    aspect-ratio: 370/250;
}
.nn-card__img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.nn-card:hover .nn-card__img img { transform: scale(1.05); }
.nn-card__body { padding: 16px; }
/* nn-cat-text is now used for category badges (text color, no background — foxiz news style) */
.nn-card__author {
    font-weight: 600;
    color: var(--color-text);
}
.nn-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 8px 0 6px;
}
.nn-card__title a { color: var(--color-text); }
.nn-card__title a:hover { color: var(--color-accent); }
.nn-card__meta {
    font-size: 0.8rem;
    color: var(--color-meta);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.nn-meta-sep { color: var(--color-border); }

/* === OVERLAY CARDS (hero) === */
.nn-overlay-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
}
.nn-overlay-card__link {
    display: block;
    position: relative;
    width: 100%; height: 100%;
}
.nn-overlay-card__img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.nn-overlay-card:hover .nn-overlay-card__img { transform: scale(1.03); }
.nn-overlay-card__content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 24px;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 100%);
    color: #fff;
}
.nn-overlay-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    margin: 8px 0 6px;
}
.nn-overlay-card--large .nn-overlay-card__title { font-size: 1.65rem; }
.nn-overlay-card__meta {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    gap: 6px;
}
.nn-overlay-card__meta time { color: rgba(255,255,255,0.85); }

/* === SECTION HEADERS === */
.nn-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--color-accent);
    display: inline-block;
}

/* === SECTION VIEW MORE === */
.nn-view-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-top: 16px;
    transition: gap 0.2s;
}
.nn-view-more:hover { gap: 10px; color: var(--color-accent-hover); }

/* === SIDEBAR === */
.stb-widget { margin-bottom: 32px; }
.stb-widget-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--color-accent);
    margin-bottom: 16px;
}

/* Sidebar popular posts */
.nn-sidebar-popular { list-style: none; }
.nn-sidebar-popular li {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
    align-items: flex-start;
}
.nn-sidebar-popular li:last-child { border-bottom: none; }
.nn-sidebar-popular .nn-pop-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-border);
    line-height: 1;
    min-width: 32px;
    font-family: var(--font-heading);
}
.nn-sidebar-popular .nn-pop-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}
.nn-sidebar-popular .nn-pop-title a { color: var(--color-text); }
.nn-sidebar-popular .nn-pop-title a:hover { color: var(--color-accent); }
.nn-sidebar-popular .nn-pop-date {
    font-size: 0.75rem;
    color: var(--color-meta);
    margin-top: 4px;
}

/* Sidebar categories */
.nn-sidebar-cats { list-style: none; }
.nn-sidebar-cats li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.92rem;
}
.nn-sidebar-cats li:last-child { border-bottom: none; }
.nn-sidebar-cats .nn-cat-count {
    background: var(--color-surface);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-meta);
}

/* === BREADCRUMBS === */
.stb-breadcrumbs {
    font-size: 0.82rem;
    color: var(--color-meta);
    margin-bottom: 12px;
}
.stb-breadcrumbs a { color: var(--color-meta); }
.stb-breadcrumbs a:hover { color: var(--color-accent); }
.stb-breadcrumbs-sep { margin: 0 6px; }
.stb-breadcrumbs-current { color: var(--color-text); }

/* === SINGLE ARTICLE === */
.nn-single-header { margin-bottom: 24px; }
.stb-post-title { font-size: 2rem; font-weight: 800; line-height: 1.25; margin: 12px 0; }
.nn-single-meta {
    font-size: 0.88rem;
    color: var(--color-meta);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.nn-featured-image {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}
.nn-featured-image img { width: 100%; }

/* Article content */
.stb-post-content { font-size: 1.05rem; line-height: 1.8; }
.stb-post-content p { margin-bottom: 1.2em; }
.stb-post-content h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.stb-post-content h3 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }
.stb-post-content ul, .stb-post-content ol { margin: 1rem 0 1rem 1.5rem; }
.stb-post-content ul { list-style: disc; }
.stb-post-content ol { list-style: decimal; }
.stb-post-content li { margin-bottom: 0.4em; }
.stb-post-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding: 16px 24px;
    margin: 1.5rem 0;
    background: var(--color-surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}
.stb-post-content img {
    border-radius: var(--radius);
    margin: 1rem 0;
}
.stb-post-content a { color: var(--color-accent); text-decoration: underline; }
.stb-post-content a:hover { color: var(--color-accent-hover); }

/* Tags */
.nn-post-tags { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.stb-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--color-surface);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--color-meta);
    transition: background 0.2s;
}
.stb-tag:hover { background: var(--color-border); }
.stb-tag a { color: var(--color-meta); }

/* === TOC === */
.stb-toc {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--color-accent);
}
.stb-toc-title { font-size: 1.1rem; margin-bottom: 12px; }
.stb-toc-list { list-style: decimal; padding-left: 1.2rem; }
.stb-toc-list li { margin-bottom: 6px; font-size: 0.92rem; }
.stb-toc-list a { color: var(--color-text); }
.stb-toc-list a:hover { color: var(--color-accent); }
.stb-toc-sub { padding-left: 1rem; }

/* === PAGINATION === */
.nn-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 40px 0;
    flex-wrap: wrap;
}
.nn-pagination a, .nn-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px; height: 40px;
    padding: 4px 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--color-border);
    transition: all 0.2s;
}
.nn-pagination a:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
.nn-pagination .current {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

/* === RELATED POSTS === */
.nn-related { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--color-border); }

/* === SEARCH RESULTS === */
.nn-no-results { text-align: center; padding: 64px 24px; }
.nn-no-results h2 { margin-bottom: 16px; }
.nn-no-results p { color: var(--color-meta); margin-bottom: 24px; }

/* === 404 === */
.nn-404 { text-align: center; padding: 80px 24px; }
.nn-404-number { font-size: 8rem; font-weight: 800; color: var(--color-accent); line-height: 1; font-family: var(--font-heading); }
.nn-404 h1 { margin: 16px 0 12px; font-size: 1.5rem; }
.nn-404 p { color: var(--color-meta); margin-bottom: 24px; }
.nn-404-btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
    transition: background 0.2s;
}
.nn-404-btn:hover { background: var(--color-accent-hover); color: #fff; }

/* === CONTACT FORM === */
.nn-contact-form { max-width: 600px; }
.nn-form-group { margin-bottom: 20px; }
.nn-form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.nn-form-group input, .nn-form-group textarea, .nn-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s;
}
.nn-form-group input:focus-visible, .nn-form-group textarea:focus-visible {
    border-color: var(--color-accent);
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
}
.nn-form-group textarea { min-height: 150px; resize: vertical; }
.nn-form-submit {
    display: inline-block;
    padding: 14px 40px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-body);
}
.nn-form-submit:hover { background: var(--color-accent-hover); }
.nn-form-status { padding: 12px 16px; border-radius: var(--radius); margin-top: 16px; font-weight: 600; }
.nn-form-success { background: var(--color-success-bg); color: var(--color-success); }
.nn-form-error { background: var(--color-error-bg); color: var(--color-error); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .nn-layout { grid-template-columns: 1fr; }
    .nn-sidebar { margin-top: 40px; }
    .nn-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    .stb-post-title { font-size: 1.5rem; }
    .nn-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .nn-cols-4 { grid-template-columns: 1fr; }
    .stb-container { padding: 0 16px; }
}

@media (max-width: 480px) {
    .nn-cols-2, .nn-cols-3 { grid-template-columns: 1fr; }
    .nn-card__body { padding: 12px; }
    .nn-overlay-card__content { padding: 16px; }
    .nn-overlay-card--large .nn-overlay-card__title { font-size: 1.2rem; }
}
