/*
Theme Name: Fazekas Műhely
Theme URI: http://fazekas-iskola.hu
Author: Sárosi Albert
Description: Szakmai tudástár sablon Italianno és Lora betűtípusokkal, tooltip menüvel és fade-in effekttel.
Version: 1.5
License: GNU General Public License v2 or later
Text Domain: fazekas-muhely
*/

/* =========================================
   1. VÁLTOZÓK ÉS ALAP BEÁLLÍTÁSOK
   ========================================= */
:root {
    --primary-color: #004080; /* Iskolai sötétkék */
    --accent-color: #eebb00;  /* Arany/Sárga kiemelés */
    --text-color: #333;       /* Alap szövegszín */
    --bg-light: #f9f9f9;      /* Világos háttér */
    --font-heading: 'Italianno', cursive; /* Kézírásos címek */
    --font-body: 'Lora', serif;           /* Szövegtörzs */
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    margin: 0;
    color: var(--text-color);
    background-color: var(--bg-light);
    font-size: 18px;
}

/* =========================================
   2. ANIMÁCIÓK (FADE IN)
   ========================================= */
/* Alapállapot: az oldal tartalma áttetsző és kicsit lejjebb van */
body {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1.8s ease-out, transform 1.8s ease-out; /* 1.8s lassú animáció */
}

/* Amikor betöltődött (a JS ráteszi ezt az osztályt) */
body.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   3. FEJLÉC (HEADER)
   ========================================= */
.site-header {
    background: transparent;
    padding-top: 20px;
}

/* A fejléc doboza (kép + tartalom) */
.header-container {
    background-image: url('images/header-bg.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    color: #fff;
    text-align: center;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.header-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 64, 128, 0.85); /* Sötétkék áttetsző réteg */
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
    /* Fent: 40px, Oldalt: 20px, LENT: 10px (ez volt 40), Balra: 20px */
    padding: 40px 20px 10px 20px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Logó */
.site-logo {
    position: relative;
    z-index: 100;
    margin-bottom: 15px;
    text-align: center;
}

.my-custom-logo {
    width: 140px;
    height: auto;
    border-radius: 50%; /* Kör alakú kivágás */
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: inline-block;
}

/* Címek */
.main-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 5.5rem;
    line-height: 1;
    font-weight: 400;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.main-title a {
    color: #fff;
    text-decoration: none;
}

.sub-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    line-height: 1.2;
    color: var(--accent-color);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    opacity: 1;
    max-width: 800px;
}

/* =========================================
   4. MENÜ ÉS NAVIGÁCIÓ
   ========================================= */
.nav-container {
    background: var(--primary-color);
    border-bottom: 4px solid var(--accent-color);
    border-radius: 0 0 8px 8px;
    margin-bottom: 0px;
}

.main-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.main-menu li {
    position: relative; /* Fontos a tooltip pozicionálásához */
}

.main-menu li a {
    display: block;
    padding: 15px 18px; /* Kicsit csökkentettem a 25-ről, hogy elférjenek */
    color: #fff;
    text-decoration: none;
    font-weight: 400; /* Visszaállítva normál vastagságra (nem bold) */
    /* text-transform: uppercase; <--- EZT TELJESEN KIVETTEM */
    font-size: 1rem; /* Visszaállítva az eredeti méretre */
    font-family: var(--font-body);
    letter-spacing: normal; /* Nem kell ritkítás a kisbetűkhöz */
    transition: all 0.3s;
}

.main-menu li a:hover {
    background: var(--accent-color);
    color: #004080;
}

/* --- LEGÖRDÜLŐ MENÜ (SUB-MENU) --- */

/* Az almenü alapállapota: rejtve */
.main-menu .sub-menu {
    position: absolute;
    top: 100%; /* Pontosan a szülő aljához igazítva */
    left: 0;
    background: #fff; /* Fehér háttér */
    min-width: 220px; /* Hogy szélesebb legyen, mint a fő gomb */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Kis árnyék */
    border-radius: 0 0 4px 4px;
    border-top: 3px solid var(--accent-color); /* Sárga csík a tetején dísznek */
    
    /* Animáció előkészítése */
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 999; /* Hogy minden felett legyen */
    
    /* Lista stílus nullázása */
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Amikor ráviszed az egeret a szülőre (li), jelenjen meg az almenü */
.main-menu li:hover > .sub-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Az almenü linkjeinek stílusa (ezek sötétek lesznek fehér alapon) */
.main-menu .sub-menu li a {
    color: #333 !important; /* Sötét szöveg */
    font-size: 0.9rem;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    text-transform: none; /* Normál betűk */
}

.main-menu .sub-menu li a:hover {
    background: #f4f4f4; /* Világosszürke háttér hoverkor */
    color: var(--primary-color) !important; /* Kék szöveg */
    padding-left: 25px; /* Kis mozgás jobbra */
}

/* Utolsó elemnél ne legyen alsó vonal */
.main-menu .sub-menu li:last-child a {
    border-bottom: none;
}

/* --- Tooltip (Buborék magyarázat) - FELÜLRE HELYEZVE --- */
.main-menu li a::after {
    content: attr(data-desc);
    position: absolute;
    
    /* VÁLTOZÁS: Nem top: 100%, hanem bottom: 100% (hogy fölötte legyen) */
    bottom: 100%; 
    left: 50%;
    transform: translateX(-50%) translateY(-10px); /* Kicsit feljebb indul */
    
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'Segoe UI', sans-serif;
    text-transform: none;
    white-space: nowrap;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    pointer-events: none;
    z-index: 1000;
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    
    /* Hogy ne érjen hozzá a gombhoz (kis rés) */
    margin-bottom: 10px; 
}

/* Kis nyíl a buborék ALJÁRA (mivel a buborék felül van) */
.main-menu li a::before {
    content: '';
    position: absolute;
    
    /* VÁLTOZÁS: A nyíl is felülre kerül, a buborék aljához */
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px); /* Pozicionálás */
    
    border: 6px solid transparent;
    border-top-color: #333; /* Most a FELSŐ oldala színes, lefelé mutat */
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Megjelenítés hover esetén */
.main-menu li a[data-desc]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0); /* Beúszik a helyére */
}

.main-menu li a[data-desc]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* =========================================
   5. FŐ TARTALOM (LAYOUT)
   ========================================= */
.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

.site-content {
    padding: 15px 0;
    display: block; /* Teljes szélesség */
}

/* =========================================
   6. CIKKEK LISTÁZÁSA (FŐOLDAL / ARCHÍVUM)
   ========================================= */
article {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 5px solid var(--primary-color);
}

/* Főoldali cikkcímek */
h2 a {
    color: var(--primary-color);
    text-decoration: none;
    font-family: var(--font-heading); /* Italianno */
    font-size: 3.5rem;
    line-height: 1.2;
    font-weight: 400;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
    transition: color 0.3s;
}

h2 a:hover {
    color: var(--accent-color);
}

.meta {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 15px;
    font-style: italic;
}

/* Lapozó */
.pagination {
    text-align: center;
    margin-top: 30px;
}

/* --- CIKK LISTA FORMÁZÁSA (ARCHÍVUM) --- */

.archive-post-card {
    background: #fff;
    padding: 30px; /* Belső margó */
    margin-bottom: 40px; /* Kártyák közötti távolság */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Finom árnyék */
    border-left: 5px solid var(--primary-color); /* Kék csík bal oldalon */
    display: flex; /* Flexbox a kép és szöveg elrendezéséhez */
    flex-direction: column; /* Egymás alá kerüljenek mobilon */
    gap: 20px;
}

/* Ha van kép, és van elég hely (desktop), akkor legyen egymás mellett a kép és a szöveg */
@media (min-width: 768px) {
    .archive-post-card {
        flex-direction: row; /* Egymás mellé */
        align-items: flex-start;
    }
    
    .post-thumbnail {
        flex: 0 0 300px; /* Fix szélesség a képnek */
        max-width: 300px;
    }
    
    .post-content-wrapper {
        flex: 1; /* A szöveg töltse ki a maradékot */
    }
}

/* Kép stílusa */
.post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Bevezető szöveg formázása */
.excerpt-content {
    font-family: var(--font-body); /* Lora */
    font-size: 1rem;
    line-height: 1.8; /* Szellős sorköz */
    color: #555; /* Kicsit szürkébb, hogy a cím domináljon */
    margin-bottom: 20px;
    text-align: justify; /* Sorkizárt, ha szereted, vagy left */
}

.excerpt-content p {
    margin-bottom: 10px;
}

/* "Tovább olvasom" gomb */
.read-more-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color); /* Kék háttér */
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: background 0.3s, transform 0.2s;
}

.read-more-btn:hover {
    background-color: var(--accent-color); /* Sárgára vált */
    color: #004080; /* Kék szöveg */
    transform: translateY(-2px); /* Picit megemelkedik */
}

/* =========================================
   7. EGYEDI BEJEGYZÉS (SINGLE POST)
   ========================================= */
.single-post-card {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.entry-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 30px;
}

.meta-category {
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.meta-category a {
    color: var(--accent-color);
    text-decoration: none;
}

.entry-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1.1;
    color: var(--primary-color);
    margin: 10px 0 20px 0;
}

.entry-meta {
    font-size: 0.95rem;
    color: #888;
    font-style: italic;
}

/* Tartalom formázása */
.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 950px;
    margin: 0 auto;
}

.entry-content h2, 
.entry-content h3 {
    color: var(--primary-color);
    margin-top: 40px;
}

.entry-content a {
    color: var(--primary-color);
    font-weight: bold;
}

/* WP Fájl blokk (Letöltés) */
.wp-block-file {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 5px;
    border-left: 5px solid var(--accent-color);
    margin: 30px 0;
}

.wp-block-file a.wp-block-file__button {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Cikk lábléc (Címkék és Vissza gomb) */
.entry-footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.back-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #002a55;
}

/* =========================================
   8. LÁBLÉC (FOOTER)
   ========================================= */
body > footer {
    background: #222;
    color: #bbb;
    text-align: center;
    padding: 20px 0;
    margin-top: 60px;
    font-size: 0.85rem;
    line-height: 1.4;
    border-top: 4px solid var(--accent-color);
}

body > footer p {
    margin: 3px 0;
}

body > footer a {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
}

body > footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* --- KERESŐ MODAL (KISEBB, MAGÁZÓDÓ VERZIÓ) --- */
.search-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(5px); 
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    padding-top: 15vh; 
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    text-align: center;
    width: 90%;
    max-width: 550px; /* CSÖKKENTVE: 700px -> 550px */
    background: transparent; 
    position: relative;
}

.search-container h3 {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 2.8rem; /* CSÖKKENTVE: 3.5rem -> 2.8rem */
    margin-bottom: 20px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* Keresőmező */
.search-form {
    display: flex;
    gap: 0;
    background: #fff;
    border-radius: 50px;
    padding: 4px; /* CSÖKKENTVE: Kisebb belső keret */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.search-field {
    width: 100%;
    padding: 10px 20px; /* CSÖKKENTVE */
    font-size: 1.1rem; /* CSÖKKENTVE */
    border: none;
    background: transparent;
    font-family: var(--font-body);
    outline: none;
}

.search-submit {
    padding: 10px 30px; /* CSÖKKENTVE */
    background: var(--primary-color);
    border: none;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    border-radius: 50px;
    font-size: 0.9rem; /* CSÖKKENTVE */
    transition: background 0.3s, transform 0.2s;
    text-transform: uppercase;
}

.search-submit:hover {
    background: var(--accent-color);
    color: #004080;
    transform: scale(1.05);
}

/* Bezárás gomb (X) - Képernyő jobb felső sarka */
.search-close {
    position: absolute;
    top: 30px; 
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    z-index: 10001; /* Biztosan mindennek felette legyen */
    transition: opacity 0.3s, transform 0.3s;
}

.search-close:hover {
    opacity: 1;
    color: var(--accent-color);
    transform: rotate(90deg);
}
/* --- JELSZÓVÉDETT TARTALOM ŰRLAP --- */

/* Az űrlap kerete (ha nincs, a p tag-et formázzuk, mert a WP abba teszi) */
.post-password-form {
    text-align: center;
    max-width: 500px;
    margin: 30px auto;
    padding: 30px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.post-password-form p {
    margin-bottom: 20px;
    font-size: 1rem;
    color: #555;
}

/* A jelszó beviteli mező */
.post-password-form input[type="password"] {
    display: block;
    width: 100%;
    max-width: 300px; /* Ne legyen túl széles */
    margin: 10px auto; /* Középre igazítva */
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-body);
}

.post-password-form input[type="password"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(0, 64, 128, 0.2);
}

/* A küldés gomb */
.post-password-form input[type="submit"] {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.post-password-form input[type="submit"]:hover {
    background-color: var(--accent-color);
    color: #004080;
}