/* Hegyi Home – szerkesztőségi, fotóközpontú megjelenés. Paletta: mélykék, acélkék, arany, krém. */
:root {
  color-scheme: light dark;
  --bg: #f5f1e8; --surface: #fffdf8; --surface-2: #efe9dc; --ink: #14213a; --muted: #5f6676; --line: #e2dacb;
  --navy: #14213a; --steel: #4a6fa5; --gold: #c39a3a; --gold-soft: #ead9ad; --accent: #14213a; --accent-ink: #fff;
  --danger: #a33a2c; --radius: 22px; --radius-sm: 14px; --tap: 44px; --shadow: 0 10px 30px -18px rgba(20, 33, 58, .45);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  /* illusztrációk */
  --sky: #dfe6f0; --sun: #e9b85c; --l1: #7f93b4; --l2: #4a6fa5; --l3: #f1ead9;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1626; --surface: #15213a; --surface-2: #1b2945; --ink: #eef1f6; --muted: #a9b2c3; --line: #26365a;
    --accent: #e3c47a; --accent-ink: #14213a; --gold: #e3c47a; --gold-soft: #3a3320; --danger: #f08a7d; --shadow: 0 10px 30px -18px #000;
    --sky: #1b2a47; --sun: #e3c47a; --l1: #2c4269; --l2: #3d5f92; --l3: #111c31; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
main { max-width: 60rem; margin: 0 auto; padding: calc(env(safe-area-inset-top) + .75rem) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left)); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.012em; margin: .2rem 0 .5rem; line-height: 1.15; }
h1 { font-size: 2.2rem; } h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
p { margin: .3rem 0; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .7rem; color: var(--muted); margin: 0; font-weight: 600; }
.eyebrow.light { color: rgba(255,255,255,.85); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* űrlapok */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin: .8rem 0; box-shadow: var(--shadow); }
.stack { display: grid; gap: .7rem; }
.row, .toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; }
.row.tight { gap: .3rem; }
.grow { flex: 1 1 10rem; }
label { display: grid; gap: .3rem; font-size: .9rem; color: var(--muted); }
label.check { display: flex; align-items: center; gap: .55rem; color: var(--ink); min-height: var(--tap); }
input, select, textarea, button { font: inherit; color: var(--ink); }
input, select, textarea { min-height: var(--tap); padding: .55rem .8rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); width: 100%; }
input[type=checkbox], input[type=radio] { width: 1.25rem; min-height: 1.25rem; accent-color: var(--steel); flex: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
button { min-height: var(--tap); padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
button.danger { color: var(--danger); }
button.link { background: none; border: 0; color: var(--steel); text-decoration: underline; padding: .3rem .2rem; min-height: 32px; justify-self: start; }
button.danger-link { color: var(--danger); }
button:disabled { opacity: .55; cursor: default; }
.form-msg:empty { display: none; } .form-msg { color: var(--danger); margin: 0; } .form-msg.ok { color: var(--steel); }
.chip-btn { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); min-height: 44px; padding: .4rem 1rem; font-size: .88rem; }
.photo-card .chip-btn, .item-meta .chip-btn { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.notice { background: var(--gold-soft); border-radius: var(--radius-sm); padding: .8rem 1rem; margin: 1rem 0; font-size: .92rem; }
.pill { display: inline-block; font-size: .72rem; padding: .12rem .6rem; border-radius: 99px; background: var(--surface-2); color: var(--ink); margin-right: .35rem; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; } .chip { padding: .35rem .8rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* belépés */
.view.center { min-height: 60vh; display: grid; place-items: center; }
.auth { max-width: 26rem; margin: 0 auto; padding-top: 6vh; }
.brand { text-align: center; margin-bottom: 1rem; }
.brand .mark { width: 76px; fill: var(--steel); } .brand .mark circle { fill: var(--gold); }
.brand h1 { font-size: 2.7rem; }

/* alkalmazás váz */
.app { padding-bottom: calc(5.6rem + env(safe-area-inset-bottom)); }
.topbar { display: flex; justify-content: space-between; align-items: end; gap: 1rem; padding: .2rem 0 .4rem; }
body.immersive .topbar h1 { font-size: 1.1rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
.sync { text-align: right; min-height: 1.2em; font-size: .75rem; }

/* hős: teljes szélességű fotó */
.hero-photo, .person-hero { position: relative; border-radius: var(--radius); overflow: hidden; min-height: min(68vh, 30rem); display: flex; align-items: flex-end; margin: .4rem 0 1.4rem; box-shadow: var(--shadow); }
.person-hero { min-height: min(52vh, 24rem); }
.hero-media { position: absolute; inset: 0; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,18,32,0) 30%, rgba(10,18,32,.78) 100%); }
.hero-copy { position: relative; padding: 1.4rem 1.3rem 1.3rem; color: #fff; display: grid; gap: .5rem; width: 100%; }
.hero-copy h1 { font-size: clamp(2rem, 7vw, 3.1rem); color: #fff; margin: 0; }
.hero-lede { font-family: var(--serif); font-size: 1.08rem; line-height: 1.45; max-width: 36rem; color: rgba(255,255,255,.92); }
.hero-copy .row { margin-top: .3rem; }
.hero-copy .inline-form input { background: rgba(255,255,255,.92); }

/* média: illusztráció + feltöltött fotó felette */
.media, .hero-media { background: var(--sky); overflow: hidden; }
.media { position: relative; aspect-ratio: 16 / 10; }
.media svg, .hero-media svg, .media img, .hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.media img, .hero-media img { opacity: 0; transition: opacity .5s ease; }
.has-photo img { opacity: 1; }
.scene .sky { fill: var(--sky); } .scene .sun { fill: var(--sun); } .scene .l1 { fill: var(--l1); } .scene .l2 { fill: var(--l2); } .scene .l3 { fill: var(--l3); }

/* blokkok */
.block { margin: 1.8rem 0; }
.block-head { margin-bottom: .8rem; } .block-head p { margin: 0; }
.vision { margin: 0 0 1rem; padding: 1.2rem 1.3rem; border-left: 3px solid var(--gold); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.vision p:first-child { font-family: var(--serif); font-size: 1.25rem; line-height: 1.4; }
.soft-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.soft-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .9rem; }

/* családtagok */
.people-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(7.5rem, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: .3rem; scroll-snap-type: x mandatory; }
.person-tile { display: grid; justify-items: center; gap: .35rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem .6rem; min-height: auto; scroll-snap-align: start; text-align: center; }
.person-tile small { font-size: .78rem; line-height: 1.3; }
.avatar { position: relative; border-radius: 50%; overflow: hidden; display: grid; place-items: center; color: #fff; font-family: var(--serif); font-weight: 600; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; } .avatar.has-photo img { opacity: 1; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.6rem; } .avatar-md { width: 48px; height: 48px; }
.tone-0 { background: linear-gradient(135deg, var(--navy), var(--steel)); } .tone-1 { background: linear-gradient(135deg, #8d5a6a, #c98a7a); } .tone-2 { background: linear-gradient(135deg, #c39a3a, #e3c47a); }

/* kártyák */
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); }
.photo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.photo-card-body { padding: 1rem 1.1rem 1.1rem; display: grid; gap: .45rem; }
.photo-card h3 { margin: 0; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(13rem, 70%); gap: .9rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .4rem; }
@media (min-width: 700px) { .rail { grid-auto-columns: minmax(14rem, 32%); } }
.rail-card { position: relative; border-radius: var(--radius); overflow: hidden; scroll-snap-align: start; box-shadow: var(--shadow); }
.rail-card .media { aspect-ratio: 4 / 5; }
.rail-caption { position: absolute; inset: auto 0 0 0; padding: 2.5rem .9rem .8rem; color: #fff; background: linear-gradient(180deg, transparent, rgba(10,18,32,.8)); display: grid; }
.rail-caption strong { font-family: var(--serif); font-size: 1.1rem; line-height: 1.25; }
.rail-caption small { opacity: .85; }

/* előrehaladás – csak mérföldkő esetén jelenik meg */
.progress-wrap { display: grid; gap: .25rem; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--steel), var(--gold)); transition: width .4s ease; }
.steps { list-style: none; margin: .2rem 0; padding: 0; display: grid; gap: .1rem; }
.steps li.done { color: var(--muted); } .steps li.done label { text-decoration: line-through; }
.steps label.check { min-height: 36px; font-size: .92rem; }

/* személyes tér tételei */
.item-stack { display: grid; gap: .55rem; }
.item-row { display: flex; justify-content: space-between; gap: .8rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem .9rem; }
.item-row.done strong { text-decoration: line-through; color: var(--muted); }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; justify-content: flex-end; }
.vis-select { width: auto; min-height: 36px; padding: .25rem .6rem; font-size: .82rem; border-radius: 99px; background: var(--surface-2); }
.inline-form { display: flex; gap: .5rem; margin-top: .6rem; }
.inline-form input { flex: 1; }
.inline-form button { flex: none; }

/* Atlas */
fieldset.card { border: 1px solid var(--line); }
legend { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; padding: 0 .3rem; }
.choice { display: flex; gap: .7rem; align-items: flex-start; color: var(--ink); padding: .35rem 0; }
.choice span { display: grid; gap: .1rem; }
.field-list { display: grid; gap: .1rem; padding-top: .4rem; border-top: 1px dashed var(--line); }
.never { background: var(--surface-2); } .never ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.preview { border-left: 3px solid var(--steel); }

/* lista oldal */
.list article p { white-space: pre-wrap; overflow-wrap: anywhere; }
.list article small { color: var(--muted); }

/* párbeszédablak */
dialog { border: 0; border-radius: var(--radius); padding: 1.2rem; width: min(34rem, calc(100vw - 2rem)); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(10,18,32,.55); backdrop-filter: blur(3px); }

/* alsó navigáció */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; z-index: 5;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding: .35rem max(.5rem, env(safe-area-inset-right)) calc(.35rem + env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-left)); }
.tabbar button { border: 0; background: none; display: grid; justify-items: center; gap: .1rem; font-size: .7rem; color: var(--muted); padding: .3rem 0; min-height: 52px; border-radius: 12px; }
.tabbar svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar button[aria-current=page] { color: var(--ink); font-weight: 700; }
.tabbar button[aria-current=page] svg { fill: var(--gold); }
body.child .adult-only { display: none !important; }

.banner { position: sticky; top: 0; z-index: 10; padding: calc(env(safe-area-inset-top) + .5rem) 1rem .5rem; background: var(--navy); color: #fff; text-align: center; font-size: .9rem; }
.banner button { margin-left: .6rem; min-height: 32px; padding: .2rem .8rem; }

@media (min-width: 900px) {
  .app { padding-bottom: 2rem; display: flex; flex-direction: column; }
  .tabbar { position: sticky; top: .5rem; bottom: auto; margin: .4rem 0 .6rem; border: 1px solid var(--line); border-radius: 999px; order: -1; }
  .tabbar button { grid-auto-flow: column; gap: .4rem; font-size: .85rem; min-height: 44px; }
  .tabbar svg { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
body.immersive .topbar > div { visibility: hidden; height: 0; }
body.immersive .topbar { padding: 0; min-height: 1.2rem; }
