/* =====================
   Alapértelmezett változók
   ===================== */
:root {
  --max-width: 1140px;
  --padding: 1rem;
  --bg: #f9f9f9;
  --text: #222;
  --footer-bg: #004080;
  --header-height: 56px;
  /*--nav-height: 60px;*/
  --footer-toggle-height: 28px;
}

/* =====================
   Alapbeállítások
   ===================== */
body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background: url('../assets/papir-background.webp') repeat center;
  overflow: hidden;
}

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

h1 {
  margin: 0 0 1rem 0;
}

/* =====================
   Fejléc (header)
   ===================== */
header {
  height: var(--header-height);
  background: var(--footer-bg);
  color: white;
  padding: 0.4rem 1rem;
}
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}
#header-logo { 
  display: flex; 
  align-items: center; 
  gap: 1rem; 
}
#header-logo img { 
  display: block; 
  width: 34px; 
  height: 34px; 
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
}

#svgSprite { 
  display: none; 
}

/* Auth icon */
.login-icon {
  cursor: pointer;
  color: white;
}

.login-icon svg.icon {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  fill: currentColor; /* örökli a szövegszínt – testre szabható */
}

/* =====================
   Navigációs sáv (nav)
   ===================== */

nav {
  height: auto;
}
nav .container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding);
  overflow: visible;
}

/* =====================
   Search bar
   ===================== */

.search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  /*height: 100%;*/
  padding: 0.5rem;
  background-color: rgba(0, 0, 0, 0.10);
}
/* INPUT BLOKK – EZ TÖLT KI MINDENT */
.search-input-wrapper {
  flex: 1 1 auto;
  position: relative;
  min-width: 0; /* nagyon fontos flexbox bug miatt */
}
/* maga az input */
.search-input-wrapper input {
  width: 100%;
}
/* jobb oldali gombok – fix szélesség */
.search-row {
  display: flex;
  gap: 0.5rem;
  flex: 0 0 auto;
}
/* Alap input stílus – search bar + formok */
input[type="text"] {
  flex: 1;
  padding: 0.5rem;
  font-size: 1rem;
  min-width: 0;
}

button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
}
/* bal gomb – fix */
#btnbar1 {
  flex: 0 0 auto;
}
#btnbar2 {
  display: none;
}


/* =====================
   Search suggest popup
   ===================== */

.search-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;

  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(27,27,32,.31);
  border-top: none;
  border-radius: 0 0 6px 6px;

  z-index: 100;
  max-height: 320px;
  overflow-y: auto;

  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  font-size: 0.95rem;
}
.search-suggest ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.search-suggest li {
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background-color 0.15s ease;
}
.search-suggest li:last-child {
  border-bottom: none;
}
.search-suggest li:hover {
  background-color: #eee;
}
/* billentyűzettel kijelölt elem */
.search-suggest li.active {
  background-color: #cfe3ff;
  /*border-left: none;*/
}

/* =====================
   popup és sidebar
   ===================== */

.bardata {
  background-color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
  border: solid 2px rgba(27,27,32,.31);
  border-radius: 10px;
  padding: 0.5rem;
}
.bardata h3 {
  margin-top: 0;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(0,0,0,0.15);
}

/* =====================
   Oldalsáv tartalom (sidebar)
   ===================== */

.sidebar {
  display: flex;
  flex-direction: column;
  width: 25%;
  background-color: rgba(0, 0, 0, 0.10);
  padding: 1rem;
  overflow: hidden;
}
#sidebar-results {
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 0;
}

#talalat {
  display: flex;
  flex-direction: column;
  max-height: 100%;
}
#talalat .result-list {
  max-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;                 
}

/* közös lista alap */
.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* li = struktúra */
.result-list li {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.result-list li:last-child {
  border-bottom: none;
}

/* gomb = valódi UI elem */
.result-list .result-item {
  all: unset;
  display: block;
  width: 100%;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

/* Kiválasztott elem – kiválasztott (Enter után) */
.result-item.selected {
  background-color: #cfe3ff;
  border-left: 4px solid #004080;
}

/* hover */
.result-list .result-item:hover {
  background-color: #ccc;
}

/* Aktív elem – billentyűzet */
.result-item.active {
  background-color: #ccc;
  /*background-color: #cfe3ff;*/
  /*border-left: 4px solid #004080;*/
}

/* Aktív elem – billentyű kurzor (Arrow / Pg) */
.result-list li.active .result-item { 
  background-color: #e6e6e6;
}

.sidebar-admin-actions {
  margin-top: 1.2rem;
}

/* Oldalsáv elrejtése (JS-vezérelt) */
.sidebar.collapsed {
  display: none !important;
}
.main-inner.sidebar-hidden .content {
  width: 100%;
}



/* =====================
   Fő tartalom (main)
   ===================== */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  /* NOTE: régi layout számítás – jelenleg JS kezeli */
  /* height: calc(100vh - var(--header-height) - var(--nav-height) - var(--footer-toggle-height)); */
  /*height: calc(100vh - var(--header-height) - var(--nav-height) - var(--footer-toggle-height));*/
}

.main-inner {
  flex: 1;
  display: flex;
  gap: 1%;
  width: 100%;
  align-items: stretch;
  overflow: hidden;
}

/* =====================
   Tartalom rész (content)
   ===================== */
.content {
  width: 74%;
  height: 100%;
  padding: 1rem;
  overflow-y: auto;  /* auto | scroll | visible */
  border-right: solid 1px rgba(27,27,32,.31);
}

.szocikk {
  display: flow-root;
  margin-bottom: 1rem;
  border: solid 1px rgba(27,27,32,.31);
  border-radius: 5px;
  padding: 0.5rem;
}
.szocikk-definicio {
  display: flow-root;
}
  
/* Új kép formázás */
/* ===== Wiki image (new renderer) ===== */

.wikimage-block {
  display: block;
  width: 100%;
  clear: both;
}

figure.wikimage {
  margin: 0.5rem 0.5rem 0.5rem 0;
}

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

/* float behaviour */
figure.wikimage.right {
  float: right;
  margin-left: 1rem;
}

figure.wikimage.left {
  float: left;
  margin-right: 1rem;
}

/* framed look (optional, régi rendszerhez hasonló) */
figure.wikimage.frame {
  border: 1px solid #ccc;
  padding: 4px;
  background: #fff;
}


/* =====================
   Lábléc (footer-toggle + footer-content)
   ===================== */
/* Footer toggle bar – always visible, controls footer collapse */
footer {
  background: var(--footer-bg);
  color: white;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}
.footer-content {
  font-size: 0.9rem;
}
.footer-content.collapsed {
  display: none;
}

.footer-content .container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-toggle {
  position: relative;
  height: var(--footer-toggle-height);
  background: var(--footer-bg);
  color: white;
}
.footer-toggle .container {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-toggle-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: #002d5c;
  border-radius: 0.5rem 0.5rem 0 0;
  padding: 0.1rem 0.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  user-select: none;
}

#copyright {
  padding-left: 0.5rem;
}

.legal-links {
  margin-bottom: 0.5rem;
}
.legal-links span {
  cursor: pointer;
  text-decoration: underline;
  margin: 0 0.25rem;
}
/* legacy / fallback if links rendered as span */
.legal-links span:hover {
  text-decoration: none;
}
/* Footer linkek (kék háttérhez) */
.legal-links a,
.legal-links a:visited {
  color: #fff;
  text-decoration: underline;
}
.legal-links a:hover,
.legal-links a:focus-visible {
  color: #fff;
  text-decoration: none;
  outline: 2px solid rgba(255,255,255,0.7);
  outline-offset: 2px;
}

.payment-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.payment-logo img {
  height: 32px;
}
.payment-caption {
  font-size: 0.8rem;
}

/* =====================
   Általános layout (container)
   ===================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding);
}

.hidden {
  display: none !important;
}

.drag-ghost {
  opacity: 0.5;
  background: #ddd;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

  
/* ===== Scrollbar (Chrome/Edge/Safari) ===== */
/*#main-content::-webkit-scrollbar {
  width: 12px;
}
#main-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.18);
}
#main-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
}
#main-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}*/

/* ===== Scrollbar (Firefox) ===== */
/*#main-content {*/
  /*scrollbar-width: auto; /* thin | auto */
  /*scrollbar-color: rgba(0, 0, 0, 0.45) rgba(0, 0, 0, 0.18); /* thumb track */
/*}*/



/* =====================
   WikiSzótár formázás
   ===================== */

.deftag {
  font-weight: bold;
}
.def {
  font-style: normal;
}
.pelda {
  font-style: italic;
}

.nyelvtani-adatok.collapsed {
  display: none;
}
.nyelvtanh3 {
	line-height: 48px;
  background-image: url("/static/assets/eye-open.png");
	background-repeat: no-repeat;
	background-position: left;
	padding-left: 3.5rem;
	color: blue;
	font-size: 1.6rem;
	text-decoration: none;
}

.egyeb {
  background-color:#e0e0e0;
}
.fonev {
  background-color:#b9d0e8;
}
.hatarozo {
  background-color:#e6e6fa;
}
.ige {
  background-color:#ffe4b5;
}
.igerag {
  background-color:#fffacd;
}
.kepzo {
  background-color:#eee8aa;
}
.kotoszo {
  background-color:#d5fed5;
}
.melleknev {
  background-color:#d6bfd4;
}
.nevelo {
  background-color:#ffe4e1;
}
.nfr {
  background-color:#e0ffff;
}


/* =====================
   Mobilnézet (768px alatt)
   ===================== */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    margin: 0 1rem;
    padding: 0.5rem;
    z-index: 10;
    background-color: #e6e6e6;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
  }

  .sidebar.collapsed {
    display: none !important;
  }

  .main-inner.sidebar-hidden .content,
  .content {
    width: 100%;
  }

  /* 1️⃣ body visszakapja a scrollt */
  /*body {
    overflow-y: auto;
    overflow-x: hidden;
    outline: 10px solid red !important;
  }*/
  /* 2️⃣ main NEM számol viewport magassággal */
  /*main {
    height: auto !important;
    min-height: auto;
  }
  .main-inner {
    height: auto;
  }*/
  /* 3️⃣ content NEM külön scrollozik */
  /*.content {
    height: auto;
    overflow-y: visible;
  }
  .sidebar,
  .content {
    height: 100%;
    overflow: hidden;
  }
  */
  /* 4️⃣ footer biztosan kifér */
  /*footer {
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
  }*/
  
  .search-suggest {
    max-height: 50vh;
  }
  .main-inner {
    flex-direction: column;
    position: relative;
    height: 100%;
  }

  .payment-logo img {
    height: 24px;
  }
  .payment-caption {
    font-size: 0.7rem;
  }

}

/* =====================
   Extra kis kijelzők (430px alatt)
   ===================== */
@media (max-width: 430px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }
    
  header {
    height: 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  #header-logo img {
    height: 24px;
  }
  header h1,
  .login-icon {
    font-size: 1.3rem;
  }
  .login-icon svg.icon {
    width: 1.5rem;
    height: 1.5rem;
  }
  
  nav {
    position: sticky;
    top: var(--header-height);
    z-index: 999;
  }
  .search-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
  }
  .search-bar input[type="text"] {
    width: 100%;
    padding: 0.25rem;
  }
  button {
    padding: 0.25rem 1rem;
  }
  #btnbar1 {
    display: none;
  }
  #btnbar2 {
    display: inline-block;
    width: 25%;
  }
  #search {
    width: 70%;
  }
  .search-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    justify-content: space-between;
  }    

  .payment-caption {
    display: none;
  }

  main {
    height: auto !important;
    min-height: auto;
  }

  .sidebar {
    width: 80%;
    height: 100vh;
    overflow-y: auto;
  }

  .content {
    overflow-y: visible;
    height: auto;
  }

  .container {
    padding: 0;
  }

  /* Wiki képek mobilon: blokk + közép  */ 
  figure.wikimage,      /*.imagecontainer  */
  figure.wikimage.right,
  figure.wikimage.left {
    float: none !important;
    display: block;
    float: none !important;
    clear: both;              /* ← EZ A KULCS */
    width: 50%;
    max-width: 260px;
    min-width: unset;              /* ← fontos */
    margin-left: auto !important;  /* ← EZ HIÁNYZOTT */
    margin-right: auto !important; /* ← EZ HIÁNYZOTT */
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
  }
  figure.wikimage img {    /*img.Wikimage*/
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
  }
  
  .nyelvtanh3 {
    font-size: 1.2rem;
  }
 
  footer {
    padding-bottom: calc(3rem + env(safe-area-inset-bottom));
  }
  
}
  
/* =====================
   Modal megjelenése
   ===================== */

.modal {
  display:none;
  padding-top: 2.8rem;
  position:fixed;
  inset: 0;
  overflow-y: auto;
  background-color:rgba(0,0,0,0.75);
  backdrop-filter: blur(2px);
  z-index:1000;
}
.modal.open {
  display: block;
}

.animate-zoom {animation:animatezoom 0.6s}@keyframes animatezoom{from{transform:scale(0)} to{transform:scale(1)}}

.modal-alap {
  display: flex;   /* flex*/
  background-color:rgba(255,255,255,0.9);
  min-width: 390px;
  max-width: 800px;
  max-height: 100%;
  position:relative;
  margin:auto;
  padding: 0.8rem;
  outline: 0;
  overflow-y: auto;
}


.modal_container {
  display: block;
  position: relative;
  width: 100%;
  min-width: 300px;
  max-width: 750px;
  max-height: calc(100% - 0.1rem);
  background: url('../assets/papir-background.webp') repeat center;
  margin: auto;
  padding: 1.5rem 0;
  text-align: center;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 1;
}

.modal_block {
  display: block;
  width: 90%;
  margin: 0.4rem auto 1rem auto;
  border-top: solid 2px rgba(27,27,32,.31);
  padding: 0.5rem 0 0 0;
  font-size: 1rem;
}

  /*align-items: center; /* Középre igazítás a függőleges irányban */
  /*justify-content: center;*/
  /*text-align: center;*/


