/*
Theme Name: Kadence Child RUL
Template: kadence
Version: 1.0.0
Description: Motyw potomny Kadence dla Rzeczny Uniwersytet Ludowy
Author: Kod_Krowa
*/

/* ============================================
   KOLORY I ZMIENNE
   ============================================ */
:root {
    /* === River — kolor główny (z fal logo) === */
    --rul-blue: #1A7DBF;
    /* akcent główny, CTA          */
    --rul-blue-dark: #0C3F72;
    /* nagłówki, sidebar            */
    --rul-blue-hover: #155A9A;
    /* hover linków i przycisków   */
    --rul-blue-light: #E6F4FB;
    /* tło hover, chip bg          */

    /* === Steel — neutralny (koło sterowe) === */
    --rul-bg: #F0F4F8;
    /* tło witryny — zachowane ✓   */
    --rul-bg-white: #ffffff;
    --rul-text: #2D3748;
    /* tekst — zachowane ✓         */
    --rul-text-muted: #8096A8;
    /* caption, meta               */
    --rul-border: #D0DCE8;
    /* obramowania — zachowane ✓   */
    --rul-widget-bg: none;
    --rul-widget-border: none;

    /* === Amber — akcent pomocniczy (bursztyn) === */
    --rul-amber: #E8A020;
    --rul-amber-bg: #FEF5E6;

    /* === Reed — akcent ekologiczny === */
    --rul-green: #3A8A24;
    --rul-green-bg: #EAF4E6;

    /* === Layout === */
    --rul-sidebar-w: 220px;
}

/* ============================================
   TYPOGRAFIA GLOBALNA

body {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--rul-text);
    background: var(--rul-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    color: var(--rul-text);
    line-height: 1.3;
}

h2 {
    margin: 42px 0 12px 0;
}
   ============================================ */
h1 {
    margin: 42px 0 12px 0;
}

a {
    color: var(--rul-blue);
    text-decoration: none;
}

a:hover {
    color: var(--rul-blue-hover);
    text-decoration: underline;
}

/* ============================================
   LAYOUT — fixed sidebar + wrapper margin
   ============================================ */
body {
    min-height: 100vh;
}

/* ============================================
   SIDEBAR NAWIGACJA (lewa kolumna)
   ============================================ */
.rul-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: var(--rul-sidebar-w);
    height: 100vh;
    background: var(--rul-bg-white);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0 0 30px 0;
}

.admin-bar .rul-sidebar {
    top: 32px;
    height: calc(100vh - 32px);
}

@media (max-width: 782px) {
    .admin-bar .rul-sidebar {
        top: 46px;
        height: calc(100vh - 46px);
    }
}

.rul-sidebar .site-logo {
    padding: 24px 20px 16px;
    margin-bottom: 8px;
}

.rul-sidebar .site-logo img {
    max-width: 160px;
    height: auto;
}

.rul-sidebar .site-logo .site-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rul-text);
    line-height: 1.3;
    margin-top: 8px;
}

/* Menu w sidebarze */
.rul-sidebar nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rul-sidebar nav ul li a {
    display: block;
    padding: 7px 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--rul-text);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.rul-sidebar nav ul li a:hover,
.rul-sidebar nav ul li.current-menu-item>a {
    color: var(--rul-blue);
    border-left-color: var(--rul-blue);
    background: rgba(30, 115, 190, 0.05);
}

/* Podmenu */
.rul-sidebar nav ul ul {
    display: none;
    background: var(--rul-bg);
}

.rul-sidebar nav ul li:hover>ul,
.rul-sidebar nav ul li.current-menu-item>ul,
.rul-sidebar nav ul li.current-menu-ancestor>ul {
    display: block;
}

.rul-sidebar nav ul ul li a {
    padding-left: 30px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--rul-text-muted);
}

/* CTA "Zostań słuchaczem" */
.rul-sidebar .sidebar-cta {
    margin: 16px 16px 0;
    padding: 12px 16px;
    background: var(--rul-blue);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: background 0.15s ease;
}

.rul-sidebar .sidebar-cta:hover {
    background: var(--rul-blue-hover);
    color: #fff;
    text-decoration: none;
}

/* #wrapper przesunięty o szerokość fixed sidebara.
 * !important wymagane — wygrywa z body .wp-site-blocks { margin-left: 0 !important } */
#wrapper {
    min-width: 0;
    margin-left: var(--rul-sidebar-w) !important;
}

/* Kadence — reset ewentualnych domyślnych marginesów */
body.kadence-sidebar-left .content-container,
body .site,
body .wp-site-blocks {
    margin-left: 0 !important;
}

/* ============================================
   MAIN GRID — 4 strefy (od lewej, za PANEL1=MENU):
   PASEK1 (1fr, #F1F4F8) | PANEL2 TEXT (max 860px, #FFF) |
   PASEK2 (4fr, #D4DCE6) | PANEL3 WIDGET (max-content, #D4DCE6)
   ============================================ */
@media (min-width: 769px) {

    /* App-shell: zdjąć max-width:1290px Kadence (global.min.css) z kontenera treści.
     * .rul-appshell (klasa body) daje wyższą specyficzność niż Kadence (3 klasy vs 2). */
    .rul-appshell #primary.content-area,
    .rul-appshell .content-container.site-container {
        max-width: none !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .rul-appshell #main.site-main {
        padding: 0;
    }
}

.rul-main-grid {
    display: grid;
    grid-template-columns: 0.5fr minmax(0, 860px) 1fr 4fr;
    width: 100%;
}

/* PASEK1 (kol.1) + PANEL2 TEXT (kol.2): tło #F1F4F8, subgrid dla hero+karty */
.rul-main-grid>.rul-content {
    grid-column: 1 / 3;
    display: grid;
    grid-template-columns: subgrid;
    min-width: 0;
    background: linear-gradient(to right, #F1F4F8 0%, #D4DCE6 100%);
}

/* PASEK2 (kol.3, 4fr) — realny element nośnik tła #D4DCE6; rośnie DUŻO */
.rul-pasek2 {
    grid-column: 3;
    background-color: #D4DCE6;
}

/* PANEL3 WIDGET (kol.4, max-content) — stały ~300px, tło #D4DCE6 do krawędzi */
.rul-aside {
    grid-column: 4;
    min-width: 0;
    padding: 24px 0;
    background-color: #D4DCE6;
}

@media (max-width: 1200px) {
    .rul-main-grid {
        grid-template-columns: 1fr;
    }

    .rul-hero__image {
        grid-column: auto;
        grid-row: auto;
    }

    .rul-main-grid>.rul-content {
        grid-column: auto;
        grid-row: auto;
        grid-template-columns: 1fr;
    }

    .rul-pasek2 {
        display: none;
    }

    .rul-aside {
        grid-column: auto;
        grid-row: auto;
        padding: 24px 16px;
    }

    .rul-content-card {
        grid-column: auto;
    }

    .rul-main-grid--hero .rul-content-card {
        margin-top: 0;
    }
}

/* Widgety prawej kolumny */
.rul-aside-section {
    background: var(--rul-widget-bg);
    border: 1px solid var(--rul-widget-border);
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 24px;
}

.rul-aside-section:last-child {
    margin-bottom: 0;
}

/* Kontener boksów PANEL3: stałe 300px przy lewej krawędzi, tło rośnie w prawo */
.rul-aside-widgets {
    width: min(300px, 100%);
    margin-right: auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.rul-aside-section-title {
    font-family: 'Lato', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rul-text);
    border-bottom: 2px solid var(--rul-blue);
    padding-bottom: 6px;
    margin: 0 0 14px;
}

/* ============================================
   NAGŁÓWKI SEKCJI (kategorie na stronie głównej)
   ============================================ */
.rul-section-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rul-text);
    border-bottom: 2px solid var(--rul-blue);
    padding-bottom: 6px;
    margin-bottom: 20px;
    display: inline-block;
}

.rul-section-title a {
    color: var(--rul-text);
    text-decoration: none;
}

.rul-section-title a:hover {
    color: var(--rul-blue);
}

/* ============================================
   KARTY WPISÓW (siatki postów)
   ============================================ */
.rul-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.rul-post-card {
    background: var(--rul-bg-white);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--rul-border);
    transition: box-shadow 0.15s ease;
}

.rul-post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rul-post-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}

.rul-post-card .card-content {
    padding: 12px 14px 16px;
}

.rul-post-card .card-meta {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rul-text-muted);
    margin-bottom: 6px;
}

.rul-post-card h3 {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px;
}

.rul-post-card h3 a {
    color: var(--rul-text);
    text-decoration: none;
}

.rul-post-card h3 a:hover {
    color: var(--rul-blue);
}

.rul-post-card .card-excerpt {
    font-size: 11px;
    line-height: 1.5;
    color: var(--rul-text-muted);
    margin: 0;
}

/* ============================================
   HERO (strona główna — zdjęcie z rokiem)
   ============================================ */
.rul-hero {
    position: relative;
    height: 380px;
    overflow: hidden;
    margin-bottom: 32px;
}

.rul-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rul-hero .hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 32px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}

.rul-hero .hero-year {
    font-size: 64px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    display: block;
}

.rul-hero .hero-cta {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 18px;
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.rul-hero .hero-cta:hover {
    background: #fff;
    color: var(--rul-text);
    text-decoration: none;
}

/* ============================================
   SEKCJA CTA (dołącz do nas — ciemna belka)
   ============================================ */
.rul-cta-band {
    background: var(--rul-text);
    color: #fff;
    padding: 40px 32px;
    margin: 20px 0;
}

.rul-cta-band h2 {
    color: #fff;
    font-size: 20px;
    margin: 0 0 12px;
}

.rul-cta-band p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin: 0 0 16px;
}

.rul-cta-band a.btn {
    display: inline-block;
    padding: 10px 22px;
    background: var(--rul-blue);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border-radius: 3px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.rul-cta-band a.btn:hover {
    background: var(--rul-blue-hover);
}

/* ============================================
   TREŚĆ ARTYKUŁU / PODSTRONY
   ============================================ */
.entry-content {
    max-width: 780px;
}

.entry-content p {
    margin-bottom: 1.2em;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
}

/* ============================================
   FOOTER
   ============================================ */
.foot-right {
    font-size: 0.9em;
    color: #666;
    padding: 30px 100px 100px 0;
    line-height: 1.4em;
}

.footer-navigation .footer-menu-container>ul li.current-menu-item>a:hover {
    color: #fff;
}

/* ============================================
   RESPONSIVE — ukryj sidebar na mobile
   ============================================ */
@media (max-width: 768px) {
    .rul-sidebar {
        display: none;
    }

    #wrapper {
        margin-left: 0 !important;
    }

    .rul-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rul-hero .hero-year {
        font-size: 40px;
    }

    #masthead .custom-logo,
    #masthead .site-branding img {
        max-height: 60px;
        width: auto;
    }
}

@media (max-width: 480px) {
    .rul-posts-grid {
        grid-template-columns: 1fr;
    }
}


/* Ukryj górny header Kadence — zastąpiony sidebarem */
@media (min-width: 769px) {
    #masthead {
        display: none !important;
    }
}

/* Fix alignfull: overflow:clip na #wrapper przycina bloki z ujemnymi marginesami.
 * margin-left:0 + width:100% = blok wypełnia #wrapper bez wychodzenia poza lewą krawędź.
 * Działa na desktop (sidebar zajmuje 220px) — na mobile WP formula działa poprawnie. */
@media (min-width: 769px) {

    #wrapper .alignfull,
    #wrapper .entry-related {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }
}

.rul-sidebar .site-logo .site-title {
    display: none;
}

/* ============================================
   BANER DOFINANSOWANIA (górny pasek)
   ============================================ */
.rul-grant-banner {
    background: #fff;
    line-height: 0;
    padding-right: 24px;
}

.rul-grant-banner a {
    display: block;
    line-height: 0;
}

.rul-grant-banner img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 72px;
    object-fit: contain;
    object-position: right center;
}

/* ============================================
   BANER DOFINANSOWANIA — STOPKA
   ============================================ */
.rul-grant-footer-banner {
    background: #fff;
    padding: 32px 40px;
    text-align: center;
}

.rul-grant-footer-banner a {
    display: inline-block;
    line-height: 0;
}

.rul-grant-footer-banner img {
    max-width: 816px;
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 768px) {
    .rul-grant-footer-banner {
        margin-left: 0;
        padding: 24px 20px;
    }
}

/* ============================================
   HERO — obraz wyróżniony (bezpośrednio przed kartą)
   ============================================ */
.rul-hero__image {
    grid-column: 1 / 4;
    grid-row: 1;
    width: 100%;
    aspect-ratio: 16 / 9;
    /* było 21/9 — grubsza proporcja = wyższe zdjęcie przy tej samej szerokości; też pełny kadr zdjęć 2560×1440 */
    max-height: 900px;
    /* było 520 — sufit tylko jako zabezpieczenie na skrajnie szerokich ekranach, nie codzienne ograniczenie */
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Hero grid wierszowy: row 1 = foto (kol.1-3), row 2 = tresc+pasek2, aside spans 1/3 */
.rul-main-grid--hero>.rul-content {
    grid-row: 2;
}

.rul-main-grid--hero>.rul-pasek2 {
    grid-row: 2;
}

.rul-main-grid--hero>.rul-aside {
    grid-row: 1 / 3;
}

/* Responsive resets — muszą być PO regułach grid-row powyżej (kolejność kaskady) */
@media (max-width: 1200px) {

    .rul-main-grid--hero>.rul-hero__image,
    .rul-main-grid--hero>.rul-content,
    .rul-main-grid--hero>.rul-pasek2,
    .rul-main-grid--hero>.rul-aside {
        grid-column: auto;
        grid-row: auto;
    }
}

@media (max-width: 768px) {

    .rul-main-grid,
    .rul-main-grid--hero {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .rul-main-grid--hero>.rul-hero__image,
    .rul-main-grid--hero>.rul-content,
    .rul-main-grid--hero>.rul-pasek2,
    .rul-main-grid--hero>.rul-aside {
        grid-column: 1;
        grid-row: auto;
    }

    .rul-content {
        grid-template-columns: 1fr;
    }

    .rul-pasek2 {
        display: none;
    }

    .rul-main-grid--hero .rul-content-card {
        margin-top: 0;
    }

    .rul-aside {
        background: transparent;
    }

    .rul-hero__image {
        height: 220px;
    }
}

/* ============================================
   KARTA TREŚCI — jeden ciągły biały blok
   (tytuł + meta + treść wpisu/strony)
   ============================================ */
.rul-content-card {
    grid-column: 2;
    background: var(--rul-bg-white);
    padding: 2px 32px 40px;
    margin: 24px 0px 32px;
    position: relative;
    z-index: 2;
}

/* Gdy jest zdjęcie hero — karta nachodzi na dół zdjęcia o ~36px */
.rul-main-grid--hero .rul-content-card {
    margin-top: -46px;
}

/* Kadence article.content-bg — reset duplikatu białego tła */
.rul-content-card article.content-bg {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
}

/* Cienka linia oddzielająca nagłówek (tytuł + meta) od treści */
.rul-content-card .entry-header {
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--rul-border);
}

@media (max-width: 768px) {
    .rul-content-card {
        margin: 0;
        padding: 20px 16px 32px;
    }
}

/* ============================================
   PANEL3 — WIDGETY: wspolne elementy list
   ============================================ */

/* Tytul wpisu — h2 w obu widgetach (lead i item) */
.rul-aside-title {
    font-weight: 400;
    line-height: 1.4;
    margin: 4px 0 0;
}

.rul-aside-title a {
    color: var(--rul-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.rul-aside-title a:hover {
    color: var(--rul-blue);
    text-decoration: none;
}

/* Meta wiersz daty (Aktualnosci): DD.MM po lewej, RRRR po prawej */
.rul-aside-datemeta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 10px;
    color: var(--rul-text-muted);
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--rul-text-muted);
    padding-top: 8px;
    margin-top: 0;
}

.rul-aside-datemeta__dm {
    font-weight: 600;
}

.rul-aside-datemeta__y {
    font-weight: 400;
}

/* Chipy kategorii + tagu (Polecane) */
.rul-aside-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--rul-text-muted);
    padding-bottom: 0px;
    margin-bottom: 0;
}

.rul-aside-chip {
    font-family: 'Lato', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rul-text-muted);
    text-decoration: none;
    border: 1px solid var(--rul-border);
    border-radius: 2px;
    padding: 2px 6px;
    background: transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
    line-height: 1.6;
}

.rul-aside-chip:hover {
    color: var(--rul-blue);
    border-color: var(--rul-blue);
    text-decoration: none;
}

/* Tag-chip — wizualnie identyczny, wyroznik semantyczny tylko przez klase */
.rul-aside-chip--tag {
    /* bez dodatkowych styli — ta sama forma co kategoria */
}

/* Wpis wiodacy (1. wynik): miniatura na gorze, meta + tytul ponizej */
.rul-aside-lead {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.rul-aside-lead__imgwrap {
    display: block;
    margin-bottom: 0;
    line-height: 0;
}

.rul-aside-lead__img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 3px;
    display: block;
    margin-bottom: 8px;
}

/* Wpisy 2-4: bez miniatury */
.rul-aside-item {
    display: flex;
    flex-direction: column;
    padding-bottom: 4px;
    margin-bottom: 14px;
}

/* ============================================
   PANEL3 — WIDGET POGODY
   ============================================ */
.rul-aside-weather__main {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}

.rul-aside-weather__icon {
    font-size: 28px;
    line-height: 1;
}

.rul-aside-weather__temp {
    font-size: 28px;
    font-weight: 700;
    color: var(--rul-text);
    line-height: 1;
}

.rul-aside-weather__desc {
    font-size: 12px;
    color: var(--rul-text-muted);
    margin: 0 0 8px;
}

.rul-aside-weather__details {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
}

.rul-aside-weather__details li {
    font-size: 11px;
    color: var(--rul-text-muted);
    padding: 2px 0;
}

.rul-aside-weather__src {
    font-size: 10px;
    color: var(--rul-text-muted);
    margin: 0;
    text-align: right;
}

.rul-aside-weather__src a {
    color: var(--rul-text-muted);
    text-decoration: none;
}

.rul-aside-weather__src a:hover {
    color: var(--rul-blue);
    text-decoration: underline;
}

.rul-aside-weather__error {
    font-size: 12px;
    color: var(--rul-text-muted);
    margin: 0;
}