/* ================================================================
   Tadeusz Hanusiak — galeria
   Nowoczesny design: szklane panele, fluid, płynne animacje
   ================================================================ */

:root {
  --bg:        #f6f3ee;
  --bg-soft:   #efe9e0;
  --ink:       #1a1612;
  --ink-soft:  #4a4239;
  --ink-mute:  #8a7f70;
  --line:      #e0d8cc;
  --gold:      #b58a3a;
  --gold-deep: #8c6a24;
  --gold-soft: #f0e6d2;
  --accent:    #3d5a46;
  --card:      #ffffff;
  --card-hover:#faf6ef;
  --shadow-sm: 0 1px 2px rgba(26,22,18,.05), 0 2px 8px rgba(26,22,18,.06);
  --shadow-md: 0 6px 24px rgba(26,22,18,.10);
  --shadow-lg: 0 24px 60px rgba(26,22,18,.18);
  --radius:    18px;
  --radius-sm: 12px;
  --ease:      cubic-bezier(.22,.61,.36,1);
  --max:       1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
em { font-style: italic; color: var(--gold-deep); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }
.section { padding: clamp(60px, 10vw, 120px) 0; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .22em; color: var(--gold-deep);
  margin-bottom: 14px;
}
.only-wide { display: inline; }
@media (max-width: 700px) { .only-wide { display: none; } }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 56px);
  background: rgba(246,243,238,.82);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2a211a, #1a1410);
  color: var(--gold); font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1.15rem;
  letter-spacing: .04em; box-shadow: var(--shadow-sm);
}
.brand-mark.light { background: transparent; border: 1.5px solid rgba(255,255,255,.25); color: #fff; }
.brand-text { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.18rem; line-height: 1.1; display: flex; flex-direction: column; }
.brand-text small { font-family: 'Inter', sans-serif; font-size: .68rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }

.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a {
  font-size: .9rem; font-weight: 500; color: var(--ink-soft);
  padding: 8px 14px; border-radius: 999px; transition: color .2s var(--ease), background .2s var(--ease);
}
.topnav a:hover { color: var(--ink); background: var(--bg-soft); }
.nav-cta { background: var(--ink) !important; color: #fff !important; margin-left: 8px; }
.nav-cta:hover { background: var(--gold-deep) !important; }
@media (max-width: 720px) { .topnav a:not(.nav-cta) { display: none; } }

/* ---------------- hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(70px, 14vw, 150px) 0 clamp(60px, 10vw, 110px);
  background:
    radial-gradient(1200px 500px at 78% -10%, rgba(181,138,58,.18), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(61,90,70,.14), transparent 60%),
    linear-gradient(180deg, #faf7f2, #f1ece3);
}
.hero-inner { max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px,5vw,56px); max-width: 1100px; }
.hero-title { margin-bottom: .3em; }
.hero-title em { display: block; }
.hero-sub { font-size: clamp(1rem, 2.2vw, 1.22rem); color: var(--ink-soft); max-width: 560px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  font-size: 1.3rem; color: var(--ink-mute); animation: bob 2.4s var(--ease) infinite;
}
@keyframes bob { 0%,100%{transform:translate(-50%,0)} 50%{transform:translate(-50%,8px)} }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #fff; box-shadow: var(--shadow-md); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { transform: translateY(-2px); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* ---------------- section head ---------------- */
.section-head { text-align: center; margin-bottom: 36px; }

/* ---------------- toolbar ---------------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter {
  padding: 8px 16px; border-radius: 999px; font-size: .86rem; font-weight: 500;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-soft);
  cursor: pointer; transition: all .2s var(--ease);
}
.filter:hover { border-color: var(--gold); color: var(--ink); }
.filter.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter .cnt { opacity: .6; margin-left: 5px; font-size: .78rem; }
.toolbar-right { display: flex; gap: 10px; align-items: center; }
.sortwrap, .searchwrap { display: flex; align-items: center; gap: 8px; }
.sortwrap label { font-size: .82rem; color: var(--ink-mute); }
select, input[type="search"], input[type="text"], input[type="number"], textarea {
  font: inherit; font-size: .9rem; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
input[type="search"] { width: 180px; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(181,138,58,.18); }

/* ---------------- grid + cards ---------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: clamp(16px, 2.4vw, 28px); }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
  opacity: 0; transform: translateY(18px);
  animation: rise .6s var(--ease) forwards;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.card-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.card-badge {
  position: absolute; top: 12px; left: 12px; padding: 4px 11px; border-radius: 999px;
  font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px); color: var(--ink); box-shadow: var(--shadow-sm);
}
.card-badge.sold { background: rgba(26,22,18,.85); color: #fff; }
.card-body { padding: 18px 18px 20px; }
.card-title { font-size: 1.3rem; margin: 0 0 6px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--ink-mute); }
.card-meta .dot { color: var(--line); }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.card-price { font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; font-weight: 700; color: var(--gold-deep); }
.card-price .sold-tag { font-family: 'Inter'; font-size: .72rem; font-weight: 600; color: #fff; background: var(--ink); padding: 3px 9px; border-radius: 999px; margin-left: 8px; }
.card-arrow { font-size: 1.1rem; color: var(--ink-mute); transition: transform .2s var(--ease), color .2s; }
.card:hover .card-arrow { transform: translateX(4px); color: var(--ink); }

.skeleton { height: 420px; border-radius: var(--radius); background: linear-gradient(100deg, var(--bg-soft) 30%, #fff 50%, var(--bg-soft) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty-note { text-align: center; color: var(--ink-mute); padding: 60px 0; font-size: 1rem; }

/* ---------------- about ---------------- */
.about { background: linear-gradient(180deg, var(--bg), var(--bg-soft)); }
.about-grid { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: clamp(30px, 5vw, 70px); align-items: center; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } .about-portrait { order: -1; } }
.about-portrait { display: flex; justify-content: center; }
.frame {
  aspect-ratio: 3 / 4; border-radius: var(--radius); padding: 14px;
  background: linear-gradient(160deg, #2a211a, #14100c);
  box-shadow: var(--shadow-lg);
}
.frame-inner {
  width: 100%; height: 100%; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: radial-gradient(circle at 50% 30%, rgba(181,138,58,.25), transparent 60%), #1a1410;
  border: 1px solid rgba(181,138,58,.3);
}
.monogram { font-family: 'Cormorant Garamond', serif; font-size: clamp(4rem, 10vw, 6rem); font-weight: 700; color: var(--gold); }
.portrait-caption { font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.about-text p { color: var(--ink-soft); }
.about-awards { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.award { display: flex; gap: 14px; align-items: baseline; font-size: .92rem; color: var(--ink-soft); }
.award-year { flex: 0 0 64px; font-family: 'Cormorant Garamond', serif; font-weight: 700; color: var(--gold-deep); font-size: 1.05rem; text-transform: capitalize; }

/* ---------------- footer ---------------- */
.footer { background: #1a1612; color: #e8e0d4; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1.5fr 1fr; gap: 40px; padding: clamp(40px,7vw,72px) 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-name { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; margin-top: 16px; }
.footer-name small { font-family: 'Inter'; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.4); }
.footer h3 { color: #fff; font-size: 1.1rem; }
.footer p, .footer a { color: rgba(255,255,255,.7); }
.mail-link { display: inline-block; margin-top: 8px; color: var(--gold); font-weight: 600; }
.mail-link:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; font-size: .82rem; color: rgba(255,255,255,.5); }
.footer-bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-link a:hover { color: var(--gold); }

/* ---------------- lightbox ---------------- */
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: clamp(10px, 3vw, 40px); }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(15,12,9,.86); backdrop-filter: blur(10px); animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.lightbox-panel { position: relative; display: grid; grid-template-columns: 1fr auto; max-width: min(1200px, 94vw); width: 100%; animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.lightbox-body { display: grid; grid-template-columns: 1.5fr 1fr; gap: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); max-height: 88vh; }
@media (max-width: 860px) { .lightbox-body { grid-template-columns: 1fr; } .lightbox-panel { grid-template-columns: 1fr; } }
.lightbox-image { position: relative; background: #0e0b08; display: grid; place-items: center; overflow: hidden; min-height: 0; }
.lightbox-image img { width: 100%; height: 100%; max-height: 88vh; object-fit: contain; }
.lightbox-caption { padding: clamp(20px, 3vw, 36px); overflow: auto; }
.lightbox-caption h2 { margin-bottom: 16px; }
.lightbox-caption .cap-row { display: flex; gap: 10px; margin-bottom: 10px; font-size: .9rem; }
.lightbox-caption .cap-row span:first-child { color: var(--ink-mute); min-width: 76px; }
.lightbox-caption .desc { color: var(--ink-soft); margin-top: 16px; }
.lightbox-price { font-family: 'Cormorant Garamond', serif; font-size: 1.7rem; font-weight: 700; color: var(--gold-deep); margin: 18px 0; }
.lightbox-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.lightbox-close, .lightbox-nav {
  position: absolute; z-index: 5; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.94); color: var(--ink); border: none; cursor: pointer;
  font-size: 1.5rem; display: grid; place-items: center; box-shadow: var(--shadow-md); transition: all .2s var(--ease);
}
.lightbox-close { top: -14px; right: -14px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-nav[data-nav="-1"] { left: -60px; }
.lightbox-nav[data-nav="1"] { right: -60px; }
.lightbox-nav:hover, .lightbox-close:hover { background: var(--ink); color: #fff; transform: translateY(-50%) scale(1.06); }
.lightbox-close:hover { transform: scale(1.06); }
.lightbox-zoom { position: absolute; top: 14px; left: 14px; width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.9); display: grid; place-items: center; font-size: 1.2rem; box-shadow: var(--shadow-sm); }
.lightbox-zoom:hover { background: #fff; }
@media (max-width: 900px) { .lightbox-nav[data-nav="-1"] { left: 8px; } .lightbox-nav[data-nav="1"] { right: 8px; } }

/* ---------------- toast ---------------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 999px;
  font-size: .9rem; box-shadow: var(--shadow-lg); z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #c0392b; }

/* ---------------- reveal on scroll ---------------- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ================ ADMIN ================ */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.admin-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 40px); background: rgba(246,243,238,.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50;
}
.admin-main { flex: 1; max-width: 1200px; margin: 0 auto; width: 100%; padding: clamp(24px, 4vw, 44px) clamp(20px, 5vw, 40px); }
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow-sm); }
.panel h2 { margin-top: 0; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; letter-spacing: .02em; }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.field .hint { font-size: .76rem; color: var(--ink-mute); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

/* admin table */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-mute); font-weight: 600; }
.admin-table tr:hover td { background: var(--bg-soft); }
.thumb { width: 44px; height: 54px; object-fit: cover; border-radius: 6px; box-shadow: var(--shadow-sm); }
.sold-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.sold-pill.yes { background: var(--ink); color: #fff; }
.sold-pill.no { background: var(--gold-soft); color: var(--gold-deep); }
.row-actions { display: flex; gap: 6px; }
.mini-btn { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: .78rem; font-weight: 500; cursor: pointer; transition: all .15s; }
.mini-btn:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.mini-btn.danger:hover { border-color: #c0392b; background: #c0392b; }
.mini-btn:disabled { opacity: .5; pointer-events: none; }

/* dropzone */
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 36px; text-align: center;
  background: var(--bg-soft); cursor: pointer; transition: all .2s var(--ease); color: var(--ink-mute);
}
.dropzone:hover, .dropzone.drag { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-deep); }
.dropzone .dz-icon { font-size: 2.4rem; margin-bottom: 10px; }
.dz-preview { margin-top: 16px; }
.dz-preview img { max-height: 220px; border-radius: 10px; box-shadow: var(--shadow-md); margin: 0 auto; }
.dz-name { font-size: .84rem; color: var(--ink-soft); margin-top: 8px; word-break: break-all; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 80% 0%, rgba(181,138,58,.16), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(61,90,70,.12), transparent 60%),
    var(--bg); }
.login-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 24px; padding: clamp(28px, 5vw, 48px); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.login-card .brand { justify-content: center; margin-bottom: 26px; }
.login-card h1 { text-align: center; font-size: 2rem; }
.login-card .lead { text-align: center; color: var(--ink-soft); margin-bottom: 28px; }
.login-card .form-actions { justify-content: center; }
.login-card .form-actions .btn { flex: 1; justify-content: center; }
.err { color: #c0392b; font-size: .88rem; text-align: center; min-height: 20px; margin-top: 12px; }
.back-link { display: block; text-align: center; margin-top: 22px; font-size: .84rem; color: var(--ink-mute); }
.back-link:hover { color: var(--ink); }

/* util */
.hidden { display: none !important; }
.muted { color: var(--ink-mute); }
.mt { margin-top: 16px; }
