/*
Theme Name: Oxtilo Portfolio
Theme URI: https://oxtilo.com
Author: Sławomir Klimek
Description: Motyw z systemem edycji Portfolio i Usług (Custom Post Types).
Version: 2.0
License: GNU General Public License v2 or later
*/

/* Reset i poprawki dla paska admina */
html {
    margin-top: 0 !important;
}

/* --- STYLE APLIKACJI --- */

body {
    font-family: 'Inter', sans-serif;
    background-color: #fafaf9;
    /* Stone-50 */
    color: #1c1917;
    /* Stone-900 */
}

h1,
h2,
h3,
.serif {
    font-family: 'Merriweather', serif;
}

/* Kontener Wykresu */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    height: 350px;
    max-height: 400px;
}

/* Filtry Portfolio */
.active-filter {
    background-color: #ea580c;
    /* Orange-600 */
    color: white;
    border-color: #ea580c;
}

/* Oś czasu */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #d6d3d1;
    /* Stone-300 */
    transform: translateX(-50%);
}

@media (max-width: 768px) {

    /* 1. Ustawienie pionowej linii po lewej stronie */
    .timeline-line {
        left: 24px !important;
        /* Wycentrowanie względem markera */
        transform: translateX(-50%);
    }

    /* 2. Kontener wpisu - wymuszamy układ poziomy (Flex) */
    .timeline-item {
        display: flex !important;
        flex-direction: row !important;
        /* Kółko obok tekstu */
        align-items: flex-start !important;
        /* Wyrównanie do góry */
        margin-bottom: 3rem !important;
        /* Większy odstęp między wpisami */
        position: relative;
    }

    /* 3. Marker (Kółko z numerem) - KLUCZOWA ZMIANA */
    .timeline-marker {
        /* Wymuszamy, aby marker był ZAWSZE pierwszy wizualnie (order -1) */
        order: -1 !important;

        position: relative !important;
        /* Zdejmujemy absolute z desktopu */
        left: auto !important;
        top: 0 !important;
        transform: none !important;
        /* Usuwamy przesunięcia */

        margin-right: 20px !important;
        /* Odstęp kółka od tekstu */
        margin-left: 8px !important;
        /* Margines, żeby trafić w linię */
        flex-shrink: 0;
        /* Zapobiega zgniataniu kółka */
        margin-top: 0px;
        /* Wyrównanie z pierwszą linią tekstu */
    }

    /* 4. Treść wpisu */
    .timeline-content {
        order: 1 !important;
        /* Treść zawsze druga wizualnie */

        width: auto !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
        text-align: left !important;
        /* Zawsze tekst do lewej */
        flex-grow: 1;
    }

    /* Ukrywamy puste kontenery, które generuje PHP dla naprzemiennego układu */
    .timeline-content.hidden {
        display: none !important;
    }
}

/* Animacje */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ikona cytatu */
.quote-icon {
    font-size: 4rem;
    line-height: 1;
    color: #fed7aa;
    /* Orange-200 */
    position: absolute;
    top: -1rem;
    left: 1rem;
    z-index: 0;
}

/* --- TOOLTIP (Wyjaśnianie trudnych słów) --- */
.tooltip {
    border-bottom: 2px dotted #a8a29e;
    /* Kolor kropkowania (stone-400) */
    cursor: help;
    /* Kursor znaku zapytania */
    position: relative;
    transition: all 0.2s;
}

.tooltip:hover {
    color: #ea580c;
    /* Zmiana koloru tekstu na pomarańczowy po najechaniu */
    border-bottom-color: #ea580c;
}

/* Wygląd dymka z tekstem */
.tooltip::before {
    content: attr(data-text);
    /* Pobiera treść z atrybutu data-text */
    position: absolute;
    bottom: 100%;
    /* Wyświetl nad tekstem */
    left: 50%;
    transform: translateX(-50%) translateY(-8px);

    background-color: #1c1917;
    /* Ciemne tło (stone-900) */
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
    font-weight: 400;
    text-align: center;
    white-space: normal;
    width: max-content;
    max-width: 250px;
    /* Maksymalna szerokość dymka */

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    /* Żeby dymek nie przeszkadzał w klikaniu */
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Mały trójkącik pod dymkiem */
.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    border-width: 6px;
    border-style: solid;
    border-color: #1c1917 transparent transparent transparent;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s;
}

/* Pokazywanie dymka po najechaniu */
.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* --- STREFA TREŚCI (Content Area) --- */

.content-area {
    width: 100%;
    max-width: 100%;
}

/* Typografia w content-area */
.content-area p {
    margin-bottom: 1.25rem;
    line-height: 1.75;
}

.content-area h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-area h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.content-area ul,
.content-area ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.content-area li {
    margin-bottom: 0.5rem;
}

.content-area a {
    color: #ea580c;
    text-decoration: underline;
}

.content-area a:hover {
    color: #c2410c;
}

/* --- BLOKI GUTENBERGA (WordPress Block Editor) --- */

/* Resetowanie ograniczeń WordPress dla wszystkich bloków */
.content-area .is-layout-flex,
.content-area .is-layout-flow,
.content-area .is-layout-constrained,
.content-area [class*="wp-container-"] {
    max-width: none !important;
    width: 100% !important;
}

/* Bloki kolumn */
.content-area .wp-block-columns {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1.5rem;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 1.5rem;
}

.content-area .wp-block-column {
    flex-grow: 1;
    min-width: 0;
}

/* Responsywność kolumn */
@media (max-width: 768px) {
    .content-area .wp-block-columns {
        flex-direction: column;
    }

    .content-area .wp-block-column {
        flex-basis: 100% !important;
        width: 100% !important;
    }
}

/* Bloki grupowe */
.content-area .wp-block-group {
    width: 100%;
    max-width: 100%;
}

/* Obrazy */
.content-area img {
    max-width: 100%;
    height: auto;
}

/* Separator */
.content-area .wp-block-separator,
.content-area hr {
    border: none;
    border-top: 1px solid #d6d3d1;
    margin: 2rem 0;
}

/* Cytat */
.content-area .wp-block-quote,
.content-area blockquote {
    border-left: 4px solid #ea580c;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
}

/* Kod */
.content-area .wp-block-code,
.content-area pre {
    background-color: #1c1917;
    color: #fafaf9;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

/* Tabele */
.content-area table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.content-area td,
.content-area th {
    border: 1px solid #d6d3d1;
    padding: 0.75rem;
}

.content-area th {
    background-color: #f5f5f4;
    font-weight: 600;
}