/* =========================================
   1. ALAPBEÁLLÍTÁSOK ÉS VÁLTOZÓK
   ========================================= */
:root {
    --maroon: #85222b;          /* A hivatalos vörös */
    --maroon-faded: rgba(133, 34, 43, 0.05);
    --gold: #d4af37;            /* Arany kiemelések */
    --paper: #fdfbf7;           /* Papír háttérszín */
    --white: #ffffff;
    --ink: #2c2c2c;             /* Tinta fekete szöveg */
    --border-light: #eaddcf;    /* Halvány keret */
}

body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: 'Lato', sans-serif;
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden; /* Vízszintes görgetés tiltása */
    
    /* Papír textúra (zaj) */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
}

/* =========================================
   2. ELRENDEZÉS (LAYOUT)
   ========================================= */
.layout {
    display: grid;
    grid-template-columns: 260px 1fr; /* Bal sáv fix, jobb oldal rugalmas */
    min-height: 100vh;
}

main {
    padding: 0;
    display: grid;
    grid-template-rows: auto 1fr;
}

.content-body {
    padding: 60px 80px;
    display: grid;
    grid-template-columns: 2fr 1fr; /* Hírek szélesebb, Widgetek keskenyebb */
    gap: 60px;
}

/* =========================================
   3. OLDALSÁV (SIDEBAR)
   ========================================= */
aside.left-sidebar {
    background-color: var(--white);
    border-right: 1px solid var(--border-light);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.brand-logo {
    margin-bottom: 50px;
    text-align: center;
    border-bottom: 2px solid var(--maroon);
    padding-bottom: 20px;
}

.brand-logo img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.brand-caption {
    font-family: 'Courier Prime', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--maroon);
    margin-top: 10px;
    display: block;
}

/* Menüpontok */
.nav-menu { list-style: none; padding: 0; margin: 0; }
.nav-item { margin-bottom: 8px; }

.nav-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--ink);
    padding: 12px 0;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 500;
    transition: 0.3s;
    border-bottom: 1px solid transparent;
}

.nav-link i {
    font-size: 14px;
    margin-right: 15px;
    color: var(--maroon);
    width: 25px;
    text-align: center;
}

.nav-link:hover, .nav-link.active {
    color: var(--maroon);
    padding-left: 10px;
    font-style: italic;
    background: linear-gradient(90deg, var(--maroon-faded), transparent);
}

/* Felhasználói blokk (lenn) */
.user-block {
    /* KIVETTÜK: margin-top: auto; (Ez nyomta le alulra) */
    
    margin-bottom: 30px; /* Helyet hagyunk alatta a menünek */
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light); /* Vonal alulra kerül */
    border-top: none; /* Fenti vonal nem kell */
    
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 50px; height: 50px; /* Kicsit nagyobbra vettem, ha már fent van */
    background: var(--maroon);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 20px;
}

/* =========================================
   4. FEJLÉC (HEADER)
   ========================================= */
header {
    padding: 60px 80px;
    background-color: var(--white);
    border-bottom: 1px solid var(--maroon);
    position: relative;
    overflow: hidden;
}

.crest-watermark {
    position: absolute;
    right: -50px;
    top: -80px;
    width: 400px;
    height: 400px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.08;
    transform: rotate(10deg);
    pointer-events: none;
    mix-blend-mode: multiply;
}

.header-content { position: relative; z-index: 2; max-width: 800px; }

.issue-date {
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    color: var(--maroon);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: inline-block;
    border-bottom: 1px solid var(--maroon);
    padding-bottom: 5px;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 64px;
    line-height: 1.1;
    color: var(--maroon);
    margin: 0 0 20px 0;
    font-weight: 900;
}

.lead {
    font-size: 20px;
    color: #555;
    font-weight: 300;
    margin-bottom: 30px;
    font-style: italic;
}

/* Gombok */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    text-decoration: none;
    transition: 0.3s;
    cursor: pointer;
    border-radius: 2px;
}

.btn-primary {
    background-color: var(--maroon);
    color: white;
    border: 1px solid var(--maroon);
}
.btn-primary:hover {
    background-color: white;
    color: var(--maroon);
}

.btn-outline {
    border: 1px solid var(--maroon);
    color: var(--maroon);
    margin-left: 15px;
    background: transparent;
}
.btn-outline:hover {
    background-color: var(--maroon-faded);
}

/* =========================================
   5. TARTALOM (HÍREK & WIDGETEK)
   ========================================= */
.news-header {
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    text-transform: uppercase;
    border-bottom: 3px double var(--maroon);
    padding-bottom: 10px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
}

.article {
    margin-bottom: 60px;
    position: relative;
}

.article::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 5px;
    width: 1px;
    height: 100%;
    background: var(--border-light);
}

.article-meta {
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
    color: #888;
    margin-bottom: 10px;
}

.article-meta span {
    color: var(--maroon);
    font-weight: 700;
    margin-right: 10px;
}

.article h2 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    margin: 0 0 15px 0;
    color: var(--ink);
}

.article p {
    margin-bottom: 20px;
    text-align: justify;
}

.read-more {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    text-decoration: none;
    color: var(--maroon);
    border-bottom: 1px solid var(--maroon);
}

/* Widgetek (Jobb oldali dobozok) */
.widget {
    margin-bottom: 40px;
    background: var(--white);
    padding: 25px;
    border: 1px solid var(--border-light);
    box-shadow: 5px 5px 0px rgba(133, 34, 43, 0.05);
}

.widget-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: var(--maroon);
    margin: 0 0 20px 0;
    text-align: center;
    font-style: italic;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.quick-list { list-style: none; padding: 0; }
.quick-list li { border-bottom: 1px dashed var(--border-light); padding: 10px 0; }
.quick-list a {
    text-decoration: none;
    color: var(--ink);
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    transition: 0.2s;
}
.quick-list a:hover {
    color: var(--maroon);
    padding-left: 5px;
}

/* Vezetői lista */
.leader-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--paper);
}
.leader-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.leader-img {
    width: 55px; height: 55px;
    object-fit: cover;
    border: 1px solid var(--maroon);
    filter: grayscale(90%) contrast(1.2);
    border-radius: 50%;
}

.leader-info h4 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    color: var(--ink);
}

.leader-info span {
    font-family: 'Courier Prime', monospace;
    font-size: 10px;
    color: var(--maroon);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================================
   6. ŰRLAP ELEMEK (FORMS)
   ========================================= */
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 5px;
    border: 1px solid #ccc;
    background: var(--paper);
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    box-sizing: border-box; /* Hogy a padding ne nyomja szét */
    outline: none;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--maroon);
    background: #fff;
    box-shadow: 0 0 5px rgba(133, 34, 43, 0.2);
}

label {
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--maroon);
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

/* =========================================
   7. MODALOK (FELUGRÓ ABLAKOK)
   ========================================= */
.modal-overlay {
    display: none; /* Alapból rejtett */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(44, 44, 44, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #fff;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    border: 1px solid var(--maroon);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* A belső vékony keret a modalban */
.modal-box::before {
    content: '';
    position: absolute;
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border: 1px solid var(--border-light);
    pointer-events: none;
}

.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    font-size: 24px;
    color: var(--maroon);
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.modal-close:hover {
    color: #000;
}

/* =========================================
   8. LÁBLÉC ÉS RESZPONZIVITÁS
   ========================================= */
.page-footer {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    border-top: 1px solid var(--border-light);
    background-color: var(--white);
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
    color: #888;
}

@media (max-width: 1000px) {
    .layout { grid-template-columns: 1fr; }
    aside.left-sidebar { display: none; }
    .content-body { grid-template-columns: 1fr; padding: 40px 20px; }
    header { padding: 40px 20px; }
    h1 { font-size: 40px; }
}

/* =========================================
   9. TÉRKÉP STÍLUSOK (HOZZÁADVA)
   ========================================= */
/* --- TÉRKÉP STÍLUSOK (JAVÍTOTT - FIT TO SCREEN) --- */

.map-container {
    position: relative;
    width: 100%;
    height: 100%; /* A magasságot a benne lévő kép határozza meg */

    /* FONTOS: Maximális magasság korlát a konténeren.
       Ha a kép ennél magasabb lenne (mert nagyon szélesre húztuk),
       akkor a kilógó részeket levágjuk (overflow: hidden).
       75vh-ra vettem, hogy a fejléc és lábléc kényelmesen elférjen görgetés nélkül. */
    max-height: 120vh;
    overflow: hidden;

    background: #0b1e29;
    border: 2px solid var(--gold);
    /* Kivettem a flexbox centeringet, mert most a szélesség dominál */
    display: block;
}

.base-map {
    /* A KULCS: Mindig töltse ki a teljes szélességet! */
    width: 100%;
    height: 100%; /* Az arányok megtartása mellett */
    display: block;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* FONTOS: Az SVG magasságának követnie kell a képét, még ha le is van vágva */
    height: auto;
    min-height: 100%; 
    z-index: 10;
    pointer-events: none;
}

/* A kerületek formája */
.district-shape {
    fill: transparent;
    stroke: transparent;
    cursor: pointer;
    pointer-events: auto;
    transition: 0.2s ease;
}

/* Kiemelés (Highlight) */
.district-shape:hover {
    fill: rgba(212, 175, 55, 0.3);
    stroke: #d4af37;
    stroke-width: 4px;
}

.ck-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}