/**
 * Szablon retrokomputery.pl – arkusz stylów główny
 * Joomla 5 | Responsive (mobile/tablet/desktop)
 */

/* =============================================
   0. RESET I BAZOWE ZMIENNE
   ============================================= */
:root {
    --rk-bg-dark:        #1a1a1a;
    --rk-bg-darker:      #111111;
    --rk-bg-sidebar:     #1e1e1e;
    --rk-bg-content:     #2a2a2a;
    --rk-bg-header:      #111111;
    --rk-bg-footer:      #0d0d0d;

    --rk-color-accent:   #e8a000;
    --rk-color-accent2:  #cc0000;
    --rk-color-text:     #dddddd;
    --rk-color-text-dim: #999999;
    --rk-color-link:     #e8a000;
    --rk-color-link-hov: #ffbc00;
    --rk-color-white:    #ffffff;
    --rk-color-border:   #333333;

    --rk-sidebar-width:  220px;
    --rk-header-height:  80px;
    --rk-gap:            12px;
    --rk-radius:         4px;

    --rk-font-heading:   'Oswald', 'Arial Narrow', Arial, sans-serif;
    --rk-font-body:      'Open Sans', Arial, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body.rk-site {
    background-color: var(--rk-bg-dark);
    color: var(--rk-color-text);
    font-family: var(--rk-font-body);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--rk-color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover, a:focus {
    color: var(--rk-color-link-hov);
    text-decoration: underline;
}

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

/* =============================================
   1. WRAPPER GŁÓWNY
   ============================================= */
#rk-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    background-color: var(--rk-bg-dark);
    box-shadow: 0 0 30px rgba(0,0,0,0.7);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =============================================
   2. NAGŁÓWEK
   ============================================= */
#rk-header {
    background-color: var(--rk-bg-header);
    border-bottom: 2px solid var(--rk-color-accent);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.rk-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    min-height: var(--rk-header-height);
}

/* --- Logo (#1) --- */
#rk-logo {
    flex-shrink: 0;
}
#rk-logo a {
    display: block;
    line-height: 0;
}
#rk-logo img {
    height: 100px;
    width: auto;
    display: block;
}

/* --- Ikony w poziomie (#2) --- */
#rk-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rk-icons-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rk-icon-link {
    display: inline-block;
    position: relative;
    line-height: 0;
    border-radius: var(--rk-radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rk-icon-link img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    display: block;
}
.rk-icon-link .rk-icon-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.rk-icon-link:hover .rk-icon-normal,
.rk-icon-link:focus .rk-icon-normal {
    opacity: 0;
}
.rk-icon-link:hover .rk-icon-hover,
.rk-icon-link:focus .rk-icon-hover {
    opacity: 1;
}
.rk-icon-link:hover,
.rk-icon-link:focus {
    transform: scale(1.08);
    box-shadow: 0 0 8px rgba(232,160,0,0.5);
    outline: none;
}

/* --- Hamburger (mobile) --- */
.rk-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 34px;
    height: 26px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px 0;
    margin-left: 8px;
}
.rk-hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--rk-color-accent);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.rk-hamburger.is-active span:nth-child(1) {
    transform: translateY(11.5px) rotate(45deg);
}
.rk-hamburger.is-active span:nth-child(2) {
    opacity: 0;
}
.rk-hamburger.is-active span:nth-child(3) {
    transform: translateY(-11.5px) rotate(-45deg);
}

/* =============================================
   3. OBSZAR GŁÓWNY (sidebar + content)
   ============================================= */
#rk-main-area {
    display: flex;
    flex: 1;
    align-items: flex-start;
    gap: 0;
}

/* --- Sidebar (#3 infoboks) --- */
#rk-sidebar {
    width: var(--rk-sidebar-width);
    min-width: var(--rk-sidebar-width);
    background-color: var(--rk-bg-sidebar);
    border-right: 1px solid var(--rk-color-border);
    padding: 0;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

#rk-infoboks {
    padding: 10px 0;
}

/* Style dla modułu infoboks */
#rk-infoboks .moduletable {
    padding: 0;
}
#rk-infoboks h3.module-title,
#rk-infoboks .module-title {
    font-family: var(--rk-font-heading);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rk-color-accent);
    background-color: #161616;
    padding: 8px 12px;
    border-left: 3px solid var(--rk-color-accent);
    margin-bottom: 0;
}

#rk-infoboks ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#rk-infoboks ul li {
    border-bottom: 1px solid var(--rk-color-border);
}
#rk-infoboks ul li a {
    display: block;
    padding: 7px 12px 7px 16px;
    color: var(--rk-color-text);
    font-size: 13px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-left 0.2s;
    border-left: 3px solid transparent;
}
#rk-infoboks ul li a:hover,
#rk-infoboks ul li a:focus,
#rk-infoboks ul li.active > a,
#rk-infoboks ul li.current > a {
    background-color: #2a2a2a;
    color: var(--rk-color-accent);
    border-left-color: var(--rk-color-accent);
}

/* --- Obszar treści prawej --- */
#rk-content-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
#rk-content-area.rk-full-width {
    width: 100%;
}

/* =============================================
   4. SLIDER / TOPCONTENT (#4)
   ============================================= */
#rk-topcontent {
    background-color: var(--rk-bg-darker);
    border-bottom: 2px solid var(--rk-color-border);
    overflow: hidden;
    position: relative;
}

#rk-topcontent .moduletable {
    margin: 0;
    padding: 0;
}

/* Jeśli moduł slidera zawiera obrazy (ogólny fallback) */
#rk-topcontent img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 100%;
    object-fit: cover;
}

/* === DJ-ImageSlider – wymuś wypełnienie całego pola === */
/* Problem: inline "height:auto" + max-height:320px kurczy szerokość zdjęcia.
   Rozwiązanie: obraz wypełnia box slajdu, kadrowany przez object-fit: cover. */
#rk-topcontent .dj-image,
#rk-topcontent .djslider-in img,
#rk-topcontent .djslider li img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    display: block;
}
/* Link otaczający obraz ma wypełnić wysokość slajdu */
#rk-topcontent .djslider-in li a,
#rk-topcontent .djslider li a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Nakładka tytułu slidera */
#rk-topcontent .slider-caption,
#rk-topcontent figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.65);
    color: var(--rk-color-white);
    padding: 10px 14px;
    font-size: 13px;
    font-family: var(--rk-font-heading);
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* =============================================
   5. MODUŁ GŁÓWNY TREŚCI / COMPONENT (#5)
   ============================================= */
#rk-component {
    flex: 1;
    padding: 16px 18px;
    background-color: var(--rk-bg-content);
    min-height: 300px;
}

/* Nagłówki artykułów */
#rk-component h1,
#rk-component h2 {
    font-family: var(--rk-font-heading);
    font-size: 22px;
    font-weight: 600;
    color: var(--rk-color-white);
    border-left: 4px solid var(--rk-color-accent);
    padding-left: 10px;
    margin-bottom: 14px;
    margin-top: 20px;
    line-height: 1.3;
}
#rk-component h1:first-child,
#rk-component h2:first-child {
    margin-top: 0;
}
#rk-component h3 {
    font-family: var(--rk-font-heading);
    font-size: 17px;
    color: var(--rk-color-accent);
    margin-bottom: 10px;
    margin-top: 18px;
}
#rk-component h4, #rk-component h5, #rk-component h6 {
    font-family: var(--rk-font-heading);
    color: var(--rk-color-text);
    margin-bottom: 8px;
    margin-top: 14px;
}

#rk-component p {
    margin-bottom: 12px;
    line-height: 1.7;
    color: var(--rk-color-text);
}

#rk-component ul,
#rk-component ol {
    padding-left: 20px;
    margin-bottom: 12px;
}
#rk-component li {
    margin-bottom: 4px;
}

#rk-component table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 13px;
}
#rk-component th,
#rk-component td {
    border: 1px solid var(--rk-color-border);
    padding: 7px 10px;
    text-align: left;
}
#rk-component th {
    background-color: #1a1a1a;
    color: var(--rk-color-accent);
    font-family: var(--rk-font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.04em;
}
#rk-component tr:nth-child(even) td {
    background-color: rgba(255,255,255,0.03);
}

/* Breadcrumbs */
#rk-component .breadcrumb {
    list-style: none;
    padding: 0;
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 12px;
    color: var(--rk-color-text-dim);
}
#rk-component .breadcrumb li::after {
    content: ' »';
    margin-left: 4px;
}
#rk-component .breadcrumb li:last-child::after {
    content: '';
}

/* Artykuły w widoku kategorii */
#rk-component .items-leading,
#rk-component .items-row {
    margin-bottom: 16px;
}
#rk-component .article-info {
    font-size: 11px;
    color: var(--rk-color-text-dim);
    margin-bottom: 8px;
}
#rk-component .readmore a {
    display: inline-block;
    padding: 5px 12px;
    background-color: var(--rk-color-accent);
    color: #111;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--rk-font-heading);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--rk-radius);
    text-decoration: none;
    transition: background 0.2s;
}
#rk-component .readmore a:hover {
    background-color: var(--rk-color-link-hov);
    text-decoration: none;
}

/* Paginacja */
#rk-component .pagination {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 16px;
}
#rk-component .pagination .page-item .page-link {
    background-color: #1a1a1a;
    border: 1px solid var(--rk-color-border);
    color: var(--rk-color-link);
    padding: 5px 10px;
    font-size: 13px;
    border-radius: var(--rk-radius);
    transition: background 0.2s;
}
#rk-component .pagination .page-item.active .page-link,
#rk-component .pagination .page-item .page-link:hover {
    background-color: var(--rk-color-accent);
    color: #111;
    border-color: var(--rk-color-accent);
}

/* Formularze */
#rk-component .control-label {
    color: var(--rk-color-text);
    font-size: 13px;
    margin-bottom: 4px;
    display: block;
}
#rk-component input[type="text"],
#rk-component input[type="email"],
#rk-component input[type="password"],
#rk-component textarea,
#rk-component select {
    width: 100%;
    background-color: #1a1a1a;
    border: 1px solid var(--rk-color-border);
    color: var(--rk-color-text);
    padding: 7px 10px;
    border-radius: var(--rk-radius);
    font-family: var(--rk-font-body);
    font-size: 13px;
    transition: border-color 0.2s;
}
#rk-component input:focus,
#rk-component textarea:focus,
#rk-component select:focus {
    border-color: var(--rk-color-accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(232,160,0,0.2);
}
#rk-component .btn,
#rk-component button[type="submit"] {
    background-color: var(--rk-color-accent);
    color: #111;
    border: none;
    padding: 8px 18px;
    font-family: var(--rk-font-heading);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--rk-radius);
    cursor: pointer;
    transition: background 0.2s;
}
#rk-component .btn:hover,
#rk-component button[type="submit"]:hover {
    background-color: var(--rk-color-link-hov);
}

/* =============================================
   6. STOPKA (#6 footer)
   ============================================= */
#rk-footer {
    background-color: var(--rk-bg-footer);
    border-top: 2px solid var(--rk-color-accent);
    padding: 0;
    flex-shrink: 0;
}

.rk-footer-inner {
    padding: 12px 18px;
    text-align: center;
    font-size: 12px;
    color: var(--rk-color-text-dim);
}

.rk-footer-inner a {
    color: var(--rk-color-link);
}
.rk-footer-inner a:hover {
    color: var(--rk-color-link-hov);
}

#rk-footer .moduletable {
    padding: 12px 18px;
    text-align: center;
    font-size: 12px;
    color: var(--rk-color-text-dim);
}
#rk-footer .moduletable p {
    margin: 0;
}

/* =============================================
   7. KOMUNIKATY SYSTEMOWE JOOMLA
   ============================================= */
.alert {
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: var(--rk-radius);
    border: 1px solid transparent;
    font-size: 13px;
}
.alert-info    { background: rgba(23,162,184,0.15); border-color: #17a2b8; color: #7cd7e5; }
.alert-success { background: rgba(40,167,69,0.15);  border-color: #28a745; color: #7fd895; }
.alert-warning { background: rgba(255,193,7,0.15);  border-color: #ffc107; color: #ffe175; }
.alert-danger, .alert-error {
                 background: rgba(220,53,69,0.15);  border-color: #dc3545; color: #f08090; }

/* =============================================
   8. DOSTĘPNOŚĆ – SKIP TO CONTENT
   ============================================= */
.rk-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--rk-color-accent);
    color: #111;
    padding: 8px 14px;
    z-index: 9999;
    font-weight: 600;
    transition: top 0.2s;
}
.rk-skip-link:focus {
    top: 0;
}

/* =============================================
   9. RESPONSYWNOŚĆ – TABLET (≤ 900px)
   ============================================= */
@media (max-width: 900px) {
    #rk-wrapper {
        max-width: 100%;
    }
    #rk-sidebar {
        width: 190px;
        min-width: 190px;
    }
    :root {
        --rk-sidebar-width: 190px;
    }
    #rk-topcontent img {
        max-height: 240px;
    }
}

/* =============================================
   10. RESPONSYWNOŚĆ – MOBILE (≤ 640px)
   ============================================= */
@media (max-width: 640px) {

    /* Nagłówek */
    .rk-header-inner {
        padding: 8px 12px;
        min-height: 60px;
    }
    #rk-logo img {
        height: 44px;
    }
    .rk-hamburger {
        display: flex;
    }

    /* Ikony schowaj na małych ekranach, zostaw hamburger */
    .rk-icons-nav {
        display: none;
    }

    /* Główny układ – kolumna */
    #rk-main-area {
        flex-direction: column;
    }

    /* Sidebar – ukryty domyślnie, wysuwany po kliknięciu hamburgera */
    #rk-sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid var(--rk-color-border);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, padding 0.3s ease;
        position: relative;
    }
    #rk-sidebar.is-open {
        max-height: 600px;
    }

    /* Treść na pełną szerokość */
    #rk-content-area {
        width: 100%;
    }

    /* Slider mniejszy */
    #rk-topcontent img {
        max-height: 180px;
    }

    /* Padding treści */
    #rk-component {
        padding: 12px 14px;
    }

    /* Ikony widoczne po rozwinięciu (opcjonalnie) */
    #rk-icons {
        gap: 6px;
    }
}

/* =============================================
   11. DRUKOWANIE
   ============================================= */
@media print {
    #rk-header, #rk-sidebar, #rk-footer { display: none; }
    #rk-main-area { display: block; }
    #rk-content-area { width: 100%; }
    body { background: white; color: black; }
    a { color: black; }
}
