/**
 * Nowoczesne Narożniki — custom.css
 * Foxiz.io/news/ 1:1 replica: topbar, logo bar, nav, trending cards,
 * hero 3-column, categories bar, footer 4-col, archive header.
 *
 * @author Damian Zięba <biuro@semtak.pl>
 */

/* === LOGO BAR (logo centered) === */
.nn-logo-bar {
    background: var(--color-header-bg);
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
}
.nn-logo-bar-inner {
    display: flex;
    justify-content: center;
    align-items: center;
}
.nn-logo-bar .custom-logo { max-height: 60px; width: auto; }
.nn-site-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* === HEADER / NAV BAR (row 3 — nav centered) === */
.nn-header {
    background: var(--color-header-bg);
    border-bottom: 1px solid var(--color-border);
    position: relative;
    z-index: 100;
}
.nn-header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    position: relative;
}
.stb-menu-toggle { display: none; }
.nn-menu {
    display: flex;
    gap: 0;
    list-style: none;
    justify-content: center;
}
.nn-menu .menu-item > a {
    display: block;
    padding: 12px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text);
    transition: color 0.2s;
    position: relative;
}
.nn-menu .menu-item > a:hover,
.nn-menu .current-menu-item > a { color: var(--color-accent); }

/* Hover underline on menu (foxiz style) */
.nn-menu .menu-item > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}
.nn-menu .menu-item > a:hover::after,
.nn-menu .current-menu-item > a::after { transform: scaleX(1); }

/* Sub-menu */
.nn-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 200;
    padding: 8px 0;
}
.nn-menu .menu-item:hover > .sub-menu,
.nn-menu .menu-item:focus-within > .sub-menu { display: block; }
.nn-menu .sub-menu a {
    padding: 8px 20px;
    font-size: 0.82rem;
    text-transform: none;
    font-weight: 500;
}
.nn-menu .sub-menu a::after { display: none; }
.nn-menu .menu-item { position: relative; }

/* Header actions (search icon right) */
.nn-header-actions {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}
.nn-search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
.nn-search-toggle:hover { color: var(--color-accent); }

/* Category badge — colored background + white text */
.nn-cat-text {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    display: inline-block;
    line-height: 1.6;
}
.nn-cat-text--light { opacity: 0.95; }

/* === HERO 3-COLUMN LAYOUT === */
.nn-hero { padding: 24px 0 0; }
.nn-hero-3col {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    min-height: 408px;
}

/* Hero side columns (left & right) — image top, meta row, title */
.nn-hero-side { display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.nn-hero-side:first-child { border-right: 1px solid var(--color-border); padding-right: 20px; }
.nn-hero-side-list { display: flex; flex-direction: column; gap: 0; height: 100%; }
.nn-hero-side-item {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}
.nn-hero-side-item:last-child { border-bottom: none; }
.nn-hero-side-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
    max-height: 110px;
}
.nn-hero-side-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.nn-hero-side-item:hover .nn-hero-side-thumb img { transform: scale(1.05); }
.nn-hero-side-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.nn-hero-side-meta-row time { font-size: 0.72rem; color: var(--color-meta); }
.nn-hero-side-title { font-size: 0.82rem; font-weight: 700; line-height: 1.35; }
.nn-hero-side-title a { color: var(--color-text); }
.nn-hero-side-title a:hover { color: var(--color-accent); }

/* Hero center: 2 overlay posts stacked */
.nn-hero-main { display: flex; flex-direction: column; gap: 8px; }
.nn-hero-overlay { position: relative; border-radius: var(--radius); overflow: hidden; flex: 1; min-height: 0; max-height: 300px; }
.nn-hero-overlay__link { display: block; position: relative; width: 100%; height: 100%; }
.nn-hero-overlay__img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.nn-hero-overlay:hover .nn-hero-overlay__img { transform: scale(1.03); }
.nn-hero-overlay__content {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 32px;
    background: linear-gradient(0deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 100%);
    color: #fff;
}
.nn-hero-overlay__title { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1.3; margin: 10px 0 8px; }
.nn-hero-overlay__excerpt { font-size: 0.9rem; color: rgba(255,255,255,0.85); line-height: 1.5; margin-bottom: 10px; }
.nn-hero-overlay__meta { font-size: 0.8rem; color: rgba(255,255,255,0.75); display: flex; align-items: center; gap: 12px; }
.nn-author { font-weight: 600; color: rgba(255,255,255,0.9); }

/* Hero right side column */
.nn-hero-side:last-child { border-left: 1px solid var(--color-border); padding-left: 20px; }

/* === CB ADS — self-centering container (wzorzec POM) === */
.nn-cb-ad {
    max-width: var(--container-width);
    margin: 24px auto;
    padding: 0 24px;
    overflow: hidden;
}

.nn-inline-ad { margin: 24px 0; overflow: hidden; }

/* Section overlay row */
.nn-section-overlay-row { margin-bottom: 12px; }
.nn-section-overlay-row .nn-overlay-card { min-height: 300px; }
.nn-section-small-row { margin-top: 0; }

/* === HOMEPAGE SECTIONS === */
.nn-category-section { margin-bottom: 40px; }
.nn-section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.nn-section-footer { margin-top: 16px; }
.nn-home-main { padding: 40px 0; }

/* === CATEGORIES BAR (above footer) === */
.nn-categories-bar { background: var(--color-accent); padding: 14px 0; }
.nn-categories-bar-inner { display: flex; align-items: center; gap: 24px; }
.nn-categories-bar-label {
    font-family: var(--font-heading); font-size: 0.85rem; font-weight: 800;
    color: #fff; text-transform: uppercase; flex-shrink: 0;
    display: flex; align-items: center; gap: 8px;
}
.nn-categories-bar-label::before { content: ''; display: inline-block; width: 10px; height: 10px; background: #fff; border-radius: 2px; }
.nn-categories-bar-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.nn-categories-bar-links a { color: rgba(255,255,255,0.9); font-size: 0.82rem; font-weight: 500; transition: color 0.2s; }
.nn-categories-bar-links a:hover { color: #fff; text-decoration: underline; }

/* === ARCHIVE HEADER (title left, breadcrumbs right) === */
.nn-archive-header { background: var(--color-dark); padding: 20px 0; margin-bottom: 32px; }
.nn-archive-header-inner { display: flex; justify-content: space-between; align-items: center; }
.nn-archive-header h1 { color: #fff; font-size: 1.3rem; font-weight: 800; margin: 0; white-space: nowrap; }
.nn-archive-breadcrumbs { flex-shrink: 0; }
.nn-archive-header .stb-breadcrumbs { color: rgba(255,255,255,0.7); margin: 0; }
.nn-archive-header .stb-breadcrumbs a { color: rgba(255,255,255,0.7); }
.nn-archive-header .stb-breadcrumbs a:hover { color: var(--color-accent); }
.nn-archive-header .stb-breadcrumbs-current { color: #fff; }

/* === FOOTER (minimal: categories bar + copyright) === */
.nn-footer { background: var(--color-footer-bg); color: var(--color-footer-text); padding: 10px 0 0; }
.nn-footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 20px 0; margin-top: 0; }
.nn-footer-bottom-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.nn-footer-bottom p { font-size: 0.78rem; color: var(--color-footer-text); }
.nn-footer-legal { display: flex; gap: 8px; align-items: center; }
.nn-footer-legal a { color: var(--color-footer-text); font-size: 0.78rem; transition: color 0.2s; }
.nn-footer-legal a:hover { color: var(--color-accent); }
.nn-footer-legal span { color: rgba(255,255,255,0.3); }

/* === SEARCH OVERLAY === */
.nn-search-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.85); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.nn-search-overlay[hidden] { display: none; }
.nn-search-overlay-inner { width: 90%; max-width: 600px; position: relative; }
.nn-search-form { display: flex; gap: 0; }
.nn-search-input { flex: 1; padding: 16px 20px; border: none; border-radius: var(--radius) 0 0 var(--radius); font-size: 1.1rem; font-family: var(--font-body); outline: none; }
.nn-search-submit { padding: 16px 20px; background: var(--color-accent); color: #fff; border: none; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; display: flex; align-items: center; transition: background 0.2s; }
.nn-search-submit:hover { background: var(--color-accent-hover); }
.nn-search-close { position: absolute; top: -48px; right: 0; background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; padding: 8px; line-height: 1; }

/* === BACK TO TOP === */
.nn-back-to-top { position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; background: var(--color-accent); color: #fff; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 999; opacity: 0; transform: translateY(16px); transition: opacity 0.3s, transform 0.3s, background 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.nn-back-to-top.is-visible { opacity: 1; transform: translateY(0); }
.nn-back-to-top:hover { background: var(--color-accent-hover); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .nn-hero-3col { grid-template-columns: 1fr; min-height: auto; }
    .nn-hero-side:first-child { border-right: none; padding-right: 0; border-bottom: 1px solid var(--color-border); padding-bottom: 16px; }
    .nn-hero-side:last-child { border-left: none; padding-left: 0; border-top: 1px solid var(--color-border); padding-top: 16px; }
}

@media (max-width: 768px) {
    .nn-logo-bar { padding: 12px 0; }
    .nn-site-title { font-size: 1.4rem; }
    .nn-header-inner { height: 48px; justify-content: flex-start; }
    .stb-menu-toggle { display: flex; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; z-index: 201; }
    .stb-menu-toggle span { display: block; width: 22px; height: 2px; background: var(--color-text); transition: transform 0.3s, opacity 0.3s; }
    .stb-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .stb-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .stb-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .nn-nav { position: fixed; top: 0; left: -100%; width: 280px; height: 100vh; background: #fff; z-index: 200; padding: 80px 24px 24px; transition: left 0.3s ease; overflow-y: auto; box-shadow: 4px 0 20px rgba(0,0,0,0.1); }
    .nn-nav.is-open { left: 0; }
    .nn-menu { flex-direction: column; gap: 0; }
    .nn-menu .menu-item > a { padding: 12px 0; border-bottom: 1px solid var(--color-border); font-size: 0.95rem; }
    .nn-menu .sub-menu { position: static; box-shadow: none; padding: 0 0 0 16px; display: block; }
    body.menu-open { overflow: hidden; }
    .nn-menu .menu-item > a::after { display: none; }
    .nn-section-overlay-row .nn-overlay-card { min-height: 200px; }
    .nn-categories-bar-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .nn-footer-bottom-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .nn-hero-overlay__title { font-size: 1.2rem; }
    .nn-hero-overlay__content { padding: 20px; }
}
