/* BudgetKite – használati útmutató. A színek a weboldaléval egyeznek (a logóból). */
:root {
    --bordo: #8a2326;
    --sotet: #372c26;
    --halvany: #7d6a5e;
    --hatter: #fbfbfb;
    --hatter-meleg: #f5efe8;
    --kartya: #ffffff;
    --keret: #e8ddd2;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; }
body {
    margin: 0;
    background: var(--hatter);
    color: var(--sotet);
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
}
a { color: var(--bordo); }
code, kbd {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9em;
    background: var(--hatter-meleg);
    border-radius: 4px;
    padding: 1px 5px;
    overflow-wrap: anywhere;
}
kbd { border: 1px solid var(--keret); border-bottom-width: 2px; }

/* ---- fejléc (weboldalon) ---- */
.s-fejlec {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 16px;
    padding: 0 16px; height: 60px;
    background: rgba(251, 251, 251, 0.96);
    border-bottom: 1px solid var(--keret);
}
.s-nev {
    display: flex; align-items: center; gap: 8px;
    font-weight: 800; letter-spacing: 0.03em; color: var(--sotet); text-decoration: none;
}
.s-nev img { width: 28px; height: 28px; }
.s-fejlec-cim { color: var(--halvany); flex: 1; }
.s-pdf {
    padding: 7px 14px; border-radius: 8px; border: 2px solid var(--bordo);
    font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.s-pdf:hover { background: var(--bordo); color: #fff; }

/* ---- elrendezés ---- */
.s-keret {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 40px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}
.s-tartalom {
    position: sticky; top: 116px;
    align-self: start;
    max-height: calc(100vh - 116px);
    overflow-y: auto;
    padding: 24px 0;
    font-size: 15px;
}
.s-tartalom-cim { font-weight: 700; margin: 0 0 8px; }
.s-tartalom ol { list-style: none; margin: 0; padding: 0; }
.s-tartalom ol ol { padding-left: 14px; }
.s-tartalom li { margin: 2px 0; }
.s-tartalom a {
    display: block; padding: 3px 10px; border-radius: 6px;
    color: var(--sotet); text-decoration: none;
}
.s-tartalom a:hover { background: var(--hatter-meleg); }
.s-tartalom a.aktiv { background: var(--hatter-meleg); color: var(--bordo); font-weight: 600; }
.s-csoport { color: var(--halvany); padding: 8px 10px 2px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
.s-csoport > ol { text-transform: none; letter-spacing: 0; font-size: 15px; }

.s-tartalom-fo { padding: 24px 0 64px; min-width: 0; max-width: 820px; }
h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.2; margin: 8px 0 12px; }
h2 {
    font-size: 25px; line-height: 1.25;
    margin: 0 0 14px; padding-top: 8px;
    color: var(--bordo);
}
h3 { font-size: 18px; margin: 22px 0 6px; }
section { padding: 28px 0; border-top: 1px solid var(--keret); }
.s-lead { font-size: 17px; color: var(--halvany); }

figure { margin: 16px 0 20px; }
figure img {
    display: block; width: 100%; height: auto;
    border: 1px solid var(--keret); border-radius: 10px;
    box-shadow: 0 4px 18px rgba(55, 44, 38, 0.08);
}
figcaption { font-size: 14px; color: var(--halvany); margin-top: 6px; text-align: center; }

ul, ol { padding-left: 22px; }
li { margin: 4px 0; }
.s-lepesek li { margin: 7px 0; }
.s-tipp, .s-figyelem, .s-keplet {
    border-radius: 10px; padding: 12px 16px; margin: 16px 0;
}
.s-tipp { background: var(--hatter-meleg); }
.s-tipp::before { content: "💡 "; }
.s-figyelem { background: #fff4e5; border: 1px solid #f3d0a0; }
.s-figyelem p { margin: 6px 0; }
.s-keplet { background: var(--kartya); border: 1px solid var(--keret); text-align: center; }
.s-lab { color: var(--halvany); font-size: 14px; text-align: center; margin-top: 40px; }

/* ---- eszközsáv: kereső + (a panelben) fejezetválasztó ---- */
.s-sav {
    position: sticky; top: 60px; z-index: 9;
    display: flex; align-items: center; gap: 12px;
    padding: 8px 16px;
    background: var(--hatter);
    border-bottom: 1px solid var(--keret);
}
.s-kereso { position: relative; flex: 1; max-width: 620px; margin: 0 auto; }
#s-kereses {
    width: 100%;
    font: inherit; font-size: 15px;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--keret); border-radius: 8px;
    background: var(--kartya) no-repeat 10px center / 16px
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d6a5e' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E");
}
#s-kereses:focus { outline: 2px solid var(--bordo); outline-offset: 1px; }
.s-talalatok {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px);
    max-height: min(60vh, 520px); overflow-y: auto;
    background: var(--kartya);
    border: 1px solid var(--keret); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(55, 44, 38, 0.16);
}
.s-talalatok[hidden] { display: none; }
.s-talalat-fej { padding: 8px 14px; font-size: 13px; color: var(--halvany); border-bottom: 1px solid var(--keret); }
.s-talalat {
    display: block; width: 100%; text-align: left;
    padding: 9px 14px; border: 0; border-bottom: 1px solid var(--keret);
    background: none; font: inherit; font-size: 14px; color: var(--sotet); cursor: pointer;
}
.s-talalat:last-child { border-bottom: 0; }
.s-talalat:hover, .s-talalat.kijelolt { background: var(--hatter-meleg); }
.s-talalat b { display: block; color: var(--bordo); font-size: 13px; }
mark { background: #ffe08a; color: inherit; border-radius: 2px; padding: 0 1px; }
.s-villan { animation: s-villan 2.2s ease-out; border-radius: 6px; }
@keyframes s-villan { 0%, 40% { background: #ffe08a; } 100% { background: transparent; } }

/* a fejezetválasztó csak a programon belüli panelben látszik */
.s-ugro { display: none; white-space: nowrap; font-size: 14px; }

/* ---- témakör-kártyák (a weboldalon, a tartalom elején) ---- */
.s-kartyak {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px; margin: 22px 0 28px;
}
.s-kartya {
    background: var(--kartya); border: 1px solid var(--keret); border-radius: 12px;
    padding: 14px 16px;
}
h2.s-kartya-cim {
    display: flex; align-items: center; gap: 8px;
    font-size: 16px; color: var(--sotet); margin: 0 0 6px; padding: 0;
}
.s-darab {
    margin-left: auto; font-size: 12px; font-weight: 600; color: var(--halvany);
    background: var(--hatter-meleg); border-radius: 10px; padding: 1px 8px;
}
.s-kartya ul { list-style: none; padding: 0; margin: 0; }
.s-kartya li { margin: 0; }
.s-kartya a { display: block; padding: 3px 0; text-decoration: none; }
.s-kartya a::after { content: " ›"; color: var(--halvany); }
.s-kartya a:hover { text-decoration: underline; }

/* ---- a programon belüli panel (iframe) ----
   A sugo.js teszi a "beagyazott" osztályt a <html>-re: nincs fejléc és
   oldalsó tartalomjegyzék (keskeny a panel), helyettük egy legördülő. */
html.beagyazott { scroll-padding-top: 64px; }
html.beagyazott .s-fejlec,
html.beagyazott .s-tartalom,
html.beagyazott .s-kartyak,
html.beagyazott h1,
html.beagyazott .s-lead { display: none; }
html.beagyazott .s-sav { top: 0; padding: 8px 14px; gap: 8px; }
html.beagyazott .s-kereso { margin: 0; }
html.beagyazott #s-kereses { font-size: 14px; padding-top: 6px; padding-bottom: 6px; }
html.beagyazott .s-ugro { display: block; }
html.beagyazott .s-ugro select {
    font: inherit; padding: 5px 6px; margin-left: 4px; max-width: 150px;
    border: 1px solid var(--keret); border-radius: 6px; background: var(--kartya);
}
html.beagyazott .s-keret { display: block; padding: 0 18px; }
html.beagyazott .s-tartalom-fo { padding-top: 0; }
html.beagyazott section { padding: 20px 0; }
html.beagyazott section:first-of-type { border-top: 0; }
html.beagyazott h2 { font-size: 21px; }

/* ---- keskeny képernyő (telefon) ---- */
@media (max-width: 820px) {
    html { scroll-padding-top: 120px; }
    .s-keret { display: block; }
    .s-tartalom { position: static; max-height: none; padding: 16px 0 0; }
    .s-fejlec-cim { display: none; }
}

/* ---- nyomtatás / PDF ---- */
@media print {
    @page { size: A4; margin: 16mm 14mm; }
    html { scroll-behavior: auto; }
    body { background: #fff; font-size: 11pt; }
    .s-fejlec, .s-sav, .s-kartyak { display: none; }
    .s-keret { display: block; padding: 0; max-width: none; }
    .s-tartalom { position: static; max-height: none; break-after: page; padding: 0; }
    .s-tartalom a { padding: 1px 0; }
    .s-tartalom-fo { max-width: none; padding: 0; }
    section { border-top: 0; padding: 0; break-before: page; }
    figure { break-inside: avoid; }
    figure img { box-shadow: none; }
    h2, h3 { break-after: avoid; }
    a { color: inherit; text-decoration: none; }
}
