/* נעמה מנשרי — quiet, editorial look: warm paper, ink, lots of air. */

:root {
  --bg: #f8f5f0;
  --paper: #fffdfa;
  --ink: #24211d;
  --muted: #7b736a;
  --line: #e5dfd6;
  --accent: #9c8468;
  --danger: #a4493d;
  --serif: "Frank Ruhl Libre", Georgia, serif;
  --latin: "Cormorant Garamond", Georgia, serif;
  --sans: "Assistant", system-ui, sans-serif;
  --wrap: 1180px;
  --gap: clamp(20px, 4vw, 48px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  font-family: var(--latin);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 10px;
}

/* ------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-family: var(--latin);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
}

.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--ink);
}

/* --------------------------------------------------------------- hero */

.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) var(--gap);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--gap);
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 300;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  color: var(--muted);
  margin: 14px 0 36px;
}

.text-link {
  display: inline-block;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--ink);
  transition: color 0.2s, border-color 0.2s;
}

.text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.hero-image {
  margin: 0;
  aspect-ratio: var(--ratio, 4 / 5);
  justify-self: end;
  /* Shrink the width (not just the height) so tall photos keep their shape on wide screens. */
  width: min(100%, calc(78vh * var(--ratio-n, 0.8)));
  background: var(--line);
  overflow: hidden;
  position: relative;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder {
  display: none;
}

.hero-image.is-empty .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--muted);
}

/* ---------------------------------------------------------- sections */

.section-head {
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 56px);
}

.section-head h2,
.about h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 300;
}

.section-intro {
  color: var(--muted);
  margin: 14px auto 0;
  max-width: 520px;
}

.work,
.contact {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 120px) var(--gap);
}

/* ------------------------------------------------------- filter tabs */

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 26px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.tab-btn {
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.98rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn.active {
  color: var(--ink);
  border-color: var(--ink);
}

/* ----------------------------------------------------------- folders */

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.folder-card {
  background: none;
  border: 0;
  padding: 0;
  text-align: inherit;
  cursor: pointer;
}

.folder-cover {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--line);
}

.folder-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease, opacity 0.4s;
}

.folder-card:hover .folder-cover img,
.folder-card:focus-visible .folder-cover img {
  transform: scale(1.035);
}

.folder-name {
  display: block;
  font-family: var(--serif);
  font-size: 1.2rem;
  margin-top: 14px;
}

.folder-meta {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.skeleton {
  aspect-ratio: 4 / 5;
  background: linear-gradient(100deg, var(--line) 40%, var(--paper) 50%, var(--line) 60%) 0 0 / 300% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -150% 0;
  }
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

/* ------------------------------------------------------- folder view */

.folder-view-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.folder-view-head h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 300;
}

.folder-view-head .crumb {
  color: var(--muted);
  font-size: 0.9rem;
}

.back-btn {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0;
}

.back-btn:hover {
  color: var(--ink);
}

.photo-grid {
  columns: 3 280px;
  column-gap: 16px;
}

.photo {
  margin: 0 0 16px;
  break-inside: avoid;
  cursor: zoom-in;
  background: var(--line);
}

.photo img {
  width: 100%;
  height: auto;
}

.photo figcaption {
  background: var(--bg);
  font-size: 0.88rem;
  color: var(--muted);
  padding-top: 8px;
}

/* ------------------------------------------------------------- about */

.about {
  background: var(--paper);
  border-block: 1px solid var(--line);
  padding: clamp(56px, 9vw, 120px) max(var(--gap), calc((100% - var(--wrap)) / 2 + var(--gap)));
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--gap);
  align-items: center;
}

.about.no-image {
  grid-template-columns: 1fr;
  max-width: 100%;
}

.about.no-image .about-text {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.about-image {
  margin: 0;
  aspect-ratio: var(--ratio, 4 / 5);
  overflow: hidden;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-image.is-empty {
  display: none;
}

.bio {
  margin-top: 22px;
  color: #4a443d;
}

.bio p {
  margin: 0 0 1em;
}

/* ----------------------------------------------------------- contact */

.contact-form {
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #cfc7bb;
  border-radius: 0;
  padding: 8px 0;
  outline: none;
  transition: border-color 0.2s;
}

.field select {
  appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237b736a'/%3E%3C/svg%3E") no-repeat left 2px center;
  padding-left: 18px;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink);
}

.btn {
  justify-self: start;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: 12px 34px;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn:hover {
  background: transparent;
  color: var(--ink);
}

.btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn.ghost:hover {
  border-color: var(--ink);
}

.btn.small {
  padding: 6px 16px;
  font-size: 0.85rem;
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

.btn.danger:hover {
  background: var(--danger);
  color: #fff;
}

.form-status {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.form-status.success {
  color: #4f6b4a;
}

.form-status.error {
  color: var(--danger);
}

.honeypot {
  position: absolute;
  left: -9999px;
}

.contact-direct {
  text-align: center;
  margin-top: 48px;
  color: var(--muted);
  font-size: 0.95rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.contact-direct a {
  text-decoration: none;
}

.contact-direct a:hover {
  color: var(--ink);
}

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

.site-footer {
  text-align: center;
  padding: 48px var(--gap) 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0 0 6px;
}

.footer-logo {
  font-family: var(--latin);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.admin-link {
  margin-top: 26px;
  background: none;
  border: 0;
  padding: 4px;
  font-size: 0.7rem;
  color: #bdb5aa;
  cursor: pointer;
  opacity: 0.7;
}

.admin-link:hover {
  opacity: 1;
  color: var(--muted);
}

/* ---------------------------------------------------------- lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(22, 20, 18, 0.96);
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
}

.lightbox figure {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.lightbox img {
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
}

.lightbox figcaption {
  color: #cfc7bb;
  font-size: 0.9rem;
  min-height: 1.4em;
}

.lightbox-btn {
  background: none;
  border: 0;
  color: #e9e3da;
  font-size: 2.4rem;
  font-weight: 200;
  cursor: pointer;
  opacity: 0.7;
}

.lightbox-btn:hover {
  opacity: 1;
}

.lightbox-btn.close {
  position: absolute;
  top: 12px;
  left: 20px;
}

/* ------------------------------------------------------ login dialog */

.login-dialog {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 36px;
  width: min(380px, 92vw);
}

.login-dialog::backdrop {
  background: rgba(36, 33, 29, 0.45);
}

.login-dialog form {
  display: grid;
  gap: 20px;
}

.login-dialog h2 {
  font-size: 1.5rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* -------------------------------------------------------- admin area */

.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
}

.admin-top {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.admin-top-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px var(--gap) 0;
}

.admin-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.admin-title h2 {
  font-size: 1.4rem;
}

.admin-tabs {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  margin-top: 10px;
}

.admin-tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 0;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
}

.admin-tab.active {
  color: var(--ink);
  border-color: var(--ink);
}

.count {
  display: inline-block;
  min-width: 20px;
  margin-inline-start: 6px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  line-height: 20px;
  text-align: center;
}

.admin-body {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px var(--gap) 80px;
  display: grid;
  gap: 24px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(18px, 3vw, 28px);
  display: grid;
  gap: 18px;
}

.card h3 {
  font-size: 1.2rem;
}

.hint {
  margin: -8px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.orientation-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.orientation-picker label {
  border: 1px solid var(--line);
  padding: 14px 10px;
  display: grid;
  justify-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: center;
  font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s;
}

.orientation-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.orientation-picker label:has(input:checked) {
  border-color: var(--ink);
  background: var(--bg);
}

.orientation-picker label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
}

.frame {
  border: 1.5px solid var(--ink);
  background: var(--line);
}

.frame.landscape {
  width: 48px;
  height: 32px;
}

.frame.portrait {
  width: 32px;
  height: 48px;
}

.frame.square {
  width: 40px;
  height: 40px;
}

.orientation-picker small {
  color: var(--muted);
  direction: ltr;
}

.previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.previews canvas,
.previews img {
  height: 96px;
  width: auto;
  border: 1px solid var(--line);
}

.list {
  display: grid;
}

.list-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.list-row:first-child {
  border-top: 0;
}

.list-row .grow {
  flex: 1 1 200px;
}

.list-row .meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.inline-input {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 6px 10px;
}

.inline-input:focus {
  outline: none;
  border-color: var(--ink);
}

.category-block {
  border: 1px solid var(--line);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.category-block > .list-row:first-child {
  padding-top: 0;
}

.folders-list {
  margin-inline-start: 18px;
  padding-inline-start: 16px;
  border-inline-start: 1px solid var(--line);
}

.admin-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.admin-photo {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
}

.admin-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--line);
}

.admin-photo .inline-input {
  width: 100%;
  font-size: 0.85rem;
}

.admin-photo .row {
  gap: 6px;
}

.thumb {
  width: 140px;
  border: 1px solid var(--line);
}

.lead {
  border-top: 1px solid var(--line);
  padding: 16px 0;
  display: grid;
  gap: 6px;
}

.lead:first-of-type {
  border-top: 0;
}

.lead-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.lead-name {
  font-family: var(--serif);
  font-size: 1.15rem;
}

.pill {
  font-size: 0.75rem;
  padding: 1px 10px;
  border-radius: 20px;
  background: #f1e6d4;
  color: #7a5c2e;
}

.pill.done {
  background: #e2eadf;
  color: #4f6b4a;
}

.lead-time {
  font-size: 0.8rem;
  color: var(--muted);
}

.lead-body {
  white-space: pre-line;
  font-size: 0.93rem;
  color: #4a443d;
}

.lead.done .lead-name {
  color: var(--muted);
}

.sub-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sub-tabs button {
  border: 1px solid var(--line);
  background: transparent;
  padding: 4px 14px;
  cursor: pointer;
  font-size: 0.88rem;
}

.sub-tabs button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* -------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .hero,
  .about {
    grid-template-columns: 1fr;
  }

  .hero-image {
    width: 100%;
    order: -1;
  }

  .hero-text {
    text-align: center;
  }
}

@media (max-width: 620px) {
  .header-inner {
    flex-direction: column;
    gap: 6px;
    padding-block: 12px;
  }

  .logo {
    font-size: 1.15rem;
  }

  .field-row,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .orientation-picker {
    gap: 8px;
  }

  .lightbox {
    grid-template-columns: 40px 1fr 40px;
  }
}
