/*
Theme Name: RCM Control Theme
Description: Dedykowany motyw dla RCM Control
Author: AP2Media - Adam Piersa
Version: 1.0
*/

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f8fafc;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.glass-dark {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.bg-grid-pattern {
  background-size: 40px 40px;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}
.bg-grid-pattern-dark {
  background-size: 40px 40px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

/* =========================================
   ROZWIJANE MENU (DROPDOWN) - DESKTOP
   ========================================= */

/* Kontener rodzica (np. Moduły) */
.hidden.md\:flex .menu-item-has-children {
    position: relative;
    padding-bottom: 1.5rem; /* Zabezpiecza "dziurę" między menu a okienkiem, żeby nie znikało po zjechaniu myszką */
    margin-bottom: -1.5rem;
}

/* Dodanie małej strzałki w dół do rodzica (wymaga FontAwesome) */
.hidden.md\:flex .menu-item-has-children > a::after {
    content: '\f078'; 
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    margin-left: 0.4rem;
    color: #94a3b8; /* text-slate-400 */
    transition: transform 0.3s ease;
    display: inline-block;
}

/* Odwrócenie strzałki po najechaniu */
.hidden.md\:flex .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
    color: #009fe3; /* text-brand-600 */
}

/* Główne okienko z podstronami (ukryte domyślnie) */
.hidden.md\:flex .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background-color: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8); /* border-slate-200 */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

/* Pokaż okienko po najechaniu na rodzica */
.hidden.md\:flex .menu-item-has-children:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Pojedynczy element w rozwiniętym okienku */
.hidden.md\:flex .sub-menu li {
    display: block;
    margin: 0;
}

/* Wygląd linków wewnątrz okienka */
.hidden.md\:flex .sub-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: #475569; /* text-slate-600 */
    font-size: 0.875rem; /* text-sm */
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

/* Efekt najechania na link w sub-menu (lekkie przesunięcie w prawo i zmiana koloru) */
.hidden.md\:flex .sub-menu li a:hover {
    background-color: #f0f9ff; /* bg-brand-50 */
    color: #009fe3; /* text-brand-600 */
    transform: translateX(4px);
}

/* =========================================
   ROZWIJANE MENU - MOBILNE
   ========================================= */

/* Wcięcie dla elementów sub-menu w menu hamburgerowym */
#mobile-menu .sub-menu {
    margin-top: 0.5rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #e2e8f0; /* Lewa kreska nawigacyjna */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#mobile-menu .sub-menu li a {
    display: block;
    padding: 0.5rem;
    font-size: 0.95rem;
    color: #475569;
    font-weight: 500;
    transition: color 0.2s;
}

#mobile-menu .sub-menu li a:hover {
    color: #009fe3; /* text-brand-600 */
}

/* =========================================
   WIDŻETY W PANELU BOCZNYM (Gutenberg)
   ========================================= */

/* --- Wyszukiwarka --- */
.wp-block-search__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.wp-block-search__inside-wrapper {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.wp-block-search__input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    color: #475569;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.wp-block-search__input:focus {
    border-color: #009fe3; /* brand-600 */
    box-shadow: 0 0 0 3px rgba(0, 159, 227, 0.1);
}

.wp-block-search__button {
    background-color: #009fe3; /* brand-600 */
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.wp-block-search__button:hover {
    background-color: #0284c7; /* brand-700 */
    transform: translateY(-1px);
}

/* --- Ostatnie wpisy --- */
.wp-block-latest-posts {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Wymuszamy układ flex, żeby obrazek i tekst były obok siebie */
.wp-block-latest-posts li {
    display: flex !important; 
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
    margin: 0 !important;
}

.wp-block-latest-posts li:first-child {
    padding-top: 0;
}

.wp-block-latest-posts li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Resetujemy marginesy obrazka dodawane przez WP (klasa alignleft) */
.wp-block-latest-posts__featured-image {
    margin: 0 !important; 
    flex-shrink: 0;
}

/* Tniemy obrazek na idealny kwadrat 64x64px */
.wp-block-latest-posts__featured-image img {
    width: 64px !important;
    height: 64px !important;
    object-fit: cover;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Stylizujemy tytuł wpisu */
.wp-block-latest-posts__post-title {
    font-size: 0.875rem; /* text-sm */
    font-weight: 600; /* font-semibold */
    color: #0f172a; /* text-slate-900 */
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.2s;
    
    /* Zabezpieczenie na wypadek bardzo długich tytułów - obcina do 3 linijek z "..." */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wp-block-latest-posts__post-title:hover {
    color: #009fe3; /* text-brand-600 */
}