/* Leafpic — galerie luminoasă.
   Paletă: fundal #FAFAF9, text #1C1C1A, accent #2E5339, hairline #E3E2DE, dim #6B6A66.
   Tipografie: Archivo (variabil) pentru interfață, IBM Plex Mono pentru date. */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/archivo-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/archivo-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/plexmono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/plexmono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/plexmono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/plexmono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #FAFAF9;
  --ink: #1C1C1A;
  --accent: #2E5339;
  --line: #E3E2DE;
  --dim: #6B6A66;
  --danger: #8A2D22;
  --sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mono { font-family: var(--mono); font-size: 0.8125rem; }
.dim { color: var(--dim); }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 0.5rem; }
h2 { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin: 2rem 0 0.75rem; }

/* ---------- Header / footer ---------- */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}
.wordmark:hover { color: var(--accent); }

.site-nav { display: flex; align-items: baseline; gap: 1.25rem; flex-wrap: wrap; }
.site-nav a { text-decoration: none; font-weight: 500; font-size: 0.9375rem; }

.site-main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem clamp(1rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.875rem;
}

.flash {
  max-width: 1400px;
  margin: 1rem auto 0;
  padding: 0.7rem clamp(1rem, 3vw, 2.5rem);
  border-left: 3px solid var(--accent);
  background: #F0F3EF;
  font-weight: 500;
}

/* ---------- Butoane și formulare ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ink);
  padding: 0.45rem 1rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-small { font-size: 0.8125rem; padding: 0.25rem 0.6rem; }

.link-btn {
  font: inherit; font-weight: 500; font-size: 0.9375rem;
  background: none; border: none; cursor: pointer;
  color: var(--ink); text-decoration: underline;
  text-decoration-color: var(--line); text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accent); }

.inline-form { display: inline; }

.stack-form { display: flex; flex-direction: column; gap: 1rem; max-width: 30rem; margin: 0.75rem 0; }
.stack-form label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.9375rem; }
.stack-form label .dim { font-weight: 400; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }

.check { display: flex !important; flex-direction: row !important; align-items: baseline; gap: 0.5rem !important; font-weight: 400 !important; }
.check input { width: auto; }

.radio-set { border: 1px solid var(--line); padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.radio-set legend { font-weight: 600; font-size: 0.9375rem; padding: 0 0.35rem; }

.form-error {
  border-left: 3px solid var(--danger);
  padding: 0.5rem 0.75rem;
  background: #F7EFEE;
  color: var(--danger);
  font-weight: 500;
  margin: 0.75rem 0;
}

.select-label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.9375rem; max-width: 30rem; }

/* Honeypot: invizibil pentru oameni, prezent pentru boți. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Hero + uploader ---------- */

.hero { margin: 1rem 0 2rem; max-width: 44rem; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 850; }
.hero-sub { color: var(--dim); font-size: 1.05rem; }

.dropzone {
  border: 1px dashed var(--dim);
  padding: clamp(2rem, 6vw, 4rem) 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover {
  border-color: var(--accent);
  background: #F0F3EF;
}
.dz-title { font-size: 1.25rem; font-weight: 700; }
.dz-alt { color: var(--dim); }
.dz-browse { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.dz-hint { color: var(--dim); margin-top: 0.75rem; }

.upload-opts { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.9rem 0; }
.upload-note { color: var(--dim); font-size: 0.9375rem; max-width: 44rem; }

.upload-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.upload-item { border: 1px solid var(--line); padding: 0.7rem 0.9rem; }
.upload-item-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.upload-item-name { font-weight: 600; overflow-wrap: anywhere; }
.upload-item-status { white-space: nowrap; color: var(--dim); }
.upload-item-status.err { color: var(--danger); }
.upload-item-status.done { color: var(--accent); font-weight: 500; }

.progress { height: 3px; background: var(--line); margin-top: 0.55rem; }
.progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width 150ms linear; }

.upload-links { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.35rem; }

.share-row { display: flex; gap: 0.5rem; align-items: center; margin: 0.4rem 0; }
.share-label { flex: 0 0 8.5rem; font-size: 0.875rem; font-weight: 600; }
.share-input { flex: 1; min-width: 0; background: #fff; }
.copy-btn { flex-shrink: 0; }
.copy-btn.copied { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Grila justified rows ---------- */

.grid { display: flex; flex-wrap: wrap; gap: 6px; }
.cell {
  position: relative;
  flex-grow: calc(var(--r) * 100);
  flex-basis: calc(var(--r) * 13rem);
  aspect-ratio: var(--r);
  min-width: 0;
  overflow: hidden;
  display: block;
  background: var(--line);
}
.cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid-pad { flex-grow: 1000000; flex-basis: 0; }

.cell-exif {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.4rem 0.6rem;
  color: #fff;
  background: rgba(20, 20, 18, 0.78);
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell:hover .cell-exif, .cell:focus-visible .cell-exif { opacity: 1; }

.recent h2, .dash-images h2 { margin-top: 2.5rem; }
.more-link { margin-top: 1rem; }
.empty { color: var(--dim); margin: 1rem 0; }
.pager { display: flex; justify-content: space-between; margin: 1.5rem 0; }

/* ---------- Pagina imaginii ---------- */

.image-stage { text-align: center; margin-bottom: 1.25rem; }
.image-stage img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  background: var(--line);
}

/* Linia de contact — elementul-semnătură. */
.contact-line {
  display: inline-block;
  margin-top: 0.6rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--ink);
  letter-spacing: 0.04em;
  color: var(--ink);
  font-weight: 500;
}

.image-head { margin-bottom: 1rem; }
.image-head h1 { font-size: 1.35rem; }
.image-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.author-line { font-size: 0.9375rem; margin-bottom: 0.15rem; }

/* ---------- Aprecieri ---------- */

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}
.like-btn:hover { border-color: var(--accent); color: var(--accent); }
.like-leaf { fill: none; stroke: currentColor; stroke-width: 2.5; }
.like-btn.liked { border-color: var(--accent); color: var(--accent); }
.like-btn.liked .like-leaf { fill: var(--accent); stroke: var(--accent); }
.like-count { font-weight: 500; }

.cell-likes {
  position: absolute;
  top: 0; right: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.45rem;
  color: #fff;
  background: rgba(20, 20, 18, 0.78);
  font-size: 0.75rem;
}

.top-columns { display: flex; gap: 4rem; flex-wrap: wrap; }
.top-list { list-style: none; counter-reset: top; display: flex; flex-direction: column; gap: 0.5rem; min-width: 18rem; }
.top-list li { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }
.top-list li::before {
  counter-increment: top;
  content: counter(top, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--dim);
}
.profile-head { margin-bottom: 1.5rem; }

.exif-block, .share-block, .manage-block { border-top: 1px solid var(--line); padding-top: 0.25rem; margin-top: 1.5rem; }

.exif-table { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1.5rem; max-width: 34rem; }
.exif-table dt { color: var(--dim); }
.exif-table dd { font-weight: 500; }

.report-block { margin-top: 2rem; color: var(--dim); }
.report-block summary { cursor: pointer; font-size: 0.9375rem; }
.report-block form { color: var(--ink); }

details.manage-block summary { cursor: pointer; font-weight: 700; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 0.75rem 0; }

/* ---------- Dashboard, galerii ---------- */

.dash-head { margin-bottom: 1rem; }
.quota-bar { height: 3px; background: var(--line); max-width: 22rem; margin-top: 0.5rem; }
.quota-bar span { display: block; height: 100%; background: var(--accent); }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.gallery-list { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.gallery-list li { display: flex; gap: 0.9rem; align-items: baseline; flex-wrap: wrap; }
.gallery-head { margin-bottom: 1rem; }
.gallery-strip { margin-bottom: 1.5rem; }

.auth-box { max-width: 30rem; margin: 2rem auto; }
.auth-sub { color: var(--dim); margin-bottom: 1rem; }
.auth-alt { margin-top: 1.25rem; color: var(--dim); }
.anon-preview img { max-width: 100%; max-height: 300px; }

/* ---------- Admin ---------- */

.stat-row { display: flex; gap: 2.5rem; flex-wrap: wrap; margin: 1.25rem 0; }
.stat-row dt { color: var(--dim); font-size: 0.8125rem; }
.stat-row dd { font-size: 1.5rem; font-weight: 500; }
.admin-nav { display: flex; gap: 1.5rem; margin: 1rem 0 2rem; }

.admin-table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
.admin-table th { text-align: left; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dim); font-weight: 600; }
.admin-table th, .admin-table td { padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-thumb { width: 64px; height: 48px; object-fit: cover; display: block; background: var(--line); }
.quota-form { display: flex; gap: 0.4rem; align-items: center; }
.quota-form input { width: 6rem; }
.settings-form { border: 1px solid var(--line); padding: 1rem; }

/* ---------- Eroare ---------- */

.error-page { max-width: 30rem; margin: 3rem auto; }
.error-code { font-size: 3rem; color: var(--line); font-weight: 500; }

/* ---------- Responsive & accesibilitate ---------- */

@media (max-width: 640px) {
  .share-row { flex-wrap: wrap; }
  .share-label { flex-basis: 100%; }
  .cell { flex-basis: calc(var(--r) * 9rem); }
  .admin-table { display: block; overflow-x: auto; }
  .stat-row { gap: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
