@font-face {
  font-family: "Montserrat";
  src: url("/public/fonts/Montserrat-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("/public/fonts/Montserrat-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f3fa;
  --text: #0f0804;
  --muted: rgba(15, 8, 4, 0.75);
  --line: rgba(15, 8, 4, 0.2);
  --card-bg: rgba(242, 243, 250, 0.72);
  --font-body: "Helvetica Neue", Helvetica, Arial, Tahoma, system-ui, sans-serif;
  --font-heading: "Montserrat", "Helvetica Neue", Helvetica, Arial, Tahoma, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 15% 10%, #ffffff 0%, #f2f3fa 55%, #eceff8 100%);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100%;
  scrollbar-gutter: stable;
}

h1,
h2,
h3 {
  font-family: var(--font-heading) !important;
  font-weight: 700;
}

.wysiwyg h1,
.wysiwyg h2,
.wysiwyg h3,
.page h1,
.admin-content h1,
.admin-aside h2 {
  font-family: var(--font-heading) !important;
}

a {
  color: inherit;
  overflow-wrap: anywhere;
}

.universal-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  color: var(--text);
  background: transparent;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  text-decoration: none;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: clamp(1.45rem, 5vw, 2.5rem);
  display: inline-flex;
  flex-direction: column;
  line-height: 0.96;
  gap: 0.07em;
  text-shadow: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding-top: 0.35rem;
}

.nav a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}

.nav a:hover {
  text-decoration: underline;
}

.nav a.active {
  text-decoration: underline;
}

.lang-switch {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
}
.lang-switch a {
  padding: 0 0.5rem;
}

.burger {
  display: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  padding: 0.15rem 0.5rem;
  background-color: transparent;
}

.home-route .universal-header {
  color: #f2f3fa;
}

.home-route .brand {
  text-shadow: 0 3px 16px rgba(15, 8, 4, 0.42);
}

.home-route .lang-switch {
  border-color: rgba(242, 243, 250, 0.45);
}

.home-route .burger {
  color: #f2f3fa;
}

.site-main {
  padding-top: 110px;
}

.home-route .site-main {
  padding-top: 0;
}

.hero {
  min-height: calc(100vh - 110px);
  width: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: end;
}

.home-route .hero {
  min-height: 100vh;
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 8, 4, 0.56), rgba(15, 8, 4, 0.08) 42%);
}

.hero-content {
  position: relative;
  max-width: 1250px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.2rem 3rem;
  color: #f2f3fa;
  text-shadow: 0 2px 14px rgba(15, 8, 4, 0.5);
}

.hero p {
  max-width: 560px;
  line-height: 1.7;
  font-size: 1.06rem;
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.2rem 1.2rem 5rem;
}
h1 {
  font-size: 1.6rem;
}
.page h1 {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 500;
  margin-bottom: 1.6rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 0.5rem;
}

.project-card {
  height: 260px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 0.45s ease, filter 0.45s ease;
}

.project-card-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #eceff8, #dfe3f2);
}

.project-card span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.9rem;
  background: linear-gradient(transparent, rgba(15, 8, 4, 0.8));
  opacity: 0;
  transition: opacity 0.35s ease;
  text-align: center;
  padding: 1rem;
}

.project-card:hover img {
  transform: scale(1.07);
  filter: brightness(0.72);
}

.project-card:hover span {
  opacity: 1;
}

.project-detail {
  position: relative;
}

.scroll-link {
  position: fixed;
  right: 0.9rem;
  bottom: 1.1rem;
  z-index: 90;
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(242, 243, 250, 0.9);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.scroll-link.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.project-images {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  margin: 0 auto 1.7rem;
}

.project-image {
  width: 100%;
  height: auto;
}

.project-lightbox-trigger {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  display: block;
}

.project-image-item {
  margin: 0;
  contain: layout paint;
}

.project-image-caption {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
}

.project-pagination {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.project-pagination-link {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.1rem;
  font-size: 0.83rem;
}
.project-pagination-link.next {
  margin-left: auto;
}

.edition-grid {
  column-count: 4;
  column-width: auto;
  column-gap: 0.9rem;
}

.edition-card {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  width: 100%;
  margin: 0 0 0.9rem;
}

.edition-card img {
  width: 100%;
  height: auto;
  min-height: 120px;
}

.edition-card-placeholder {
  width: 100%;
  min-height: 220px;
  background: linear-gradient(135deg, #eceff8, #dfe3f2);
}

.edition-lightbox-trigger {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: zoom-in;
  width: 100%;
  display: block;
}

.edition-card p {
  margin-top: 0.6rem;
  line-height: 1.5;
}

.edition-card > div {
  line-height: 1.5;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 8, 4, 0.88);
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.lightbox-overlay[hidden] {
  display: none;
}

.lightbox-image {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(15, 8, 4, 0.45);
  color: #f2f3fa;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 2rem;
  line-height: 1;
  padding: 0;
}
.lightbox-close span {
  display: block;
  margin-top: -6px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(242, 243, 250, 0.45);
  background: rgba(15, 8, 4, 0.45);
  color: #f2f3fa;
  border-radius: 8px;
  width: 44px;
  height: 44px;
  font-size: 2rem;
  line-height: 1;
  padding: 0;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

body.lightbox-open {
  overflow: hidden;
}

.wysiwyg {
  max-width: 820px;
  line-height: 1.7;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 460px);
  gap: 1.6rem;
  align-items: start;
}

.contact-image {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1rem 1.2rem;
  text-align: center;
  letter-spacing: 0.1em;
  font-size: 0.82rem;
  color: var(--muted);
}

.admin-body {
  background: var(--bg);
}

.admin-login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.admin-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.admin-aside {
  border-right: 1px solid var(--line);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.admin-aside a {
  text-decoration: none;
}

.admin-aside hr {
  width: 100%;
  border: none;
  border-top: 1px solid var(--line);
}

.admin-content {
  padding: 1.5rem;
}

.admin-form,
.admin-grid {
  display: grid;
  gap: 0.8rem;
}

.admin-grid {
  max-width: 980px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 24px rgba(15, 8, 4, 0.04);
}

.drag-handle {
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  cursor: grab;
  user-select: none;
}

.collapse-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(15, 8, 4, 0.08);
  background: rgba(255, 255, 255, 0.55);
}

.collapse-summary::-webkit-details-marker {
  display: none;
}

.collapse-title {
  font-weight: 600;
}

.reorder-list {
  display: grid;
  gap: 0.8rem;
}

.reorder-item {
  cursor: default;
  overflow: hidden;
}

.reorder-item.dragging {
  opacity: 0.5;
  border-style: dashed;
}

.admin-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.92rem;
  color: rgba(15, 8, 4, 0.92);
}
.admin-wrap label {
  padding: 0.5rem;
}

.remove {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem;
  width: fit-content;
  color: #7b1515;
  font-size: 0.88rem;
  line-height: 1;
}

.field-label {
  margin: 0 0 0.25rem 0;
}

.wysiwyg-field {
  display: grid;
  gap: 0.35rem;
}

.wysiwyg-editor {
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.55rem 0.6rem;
  line-height: 1.55;
  cursor: text;
  user-select: text;
}

.wysiwyg-editor:focus {
  outline: 2px solid rgba(15, 8, 4, 0.28);
  outline-offset: 1px;
}

.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.wysiwyg-toolbar button {
  padding: 0.28rem 0.5rem;
  font-size: 0.84rem;
}

.upload-list {
  display: grid;
  gap: 0.35rem;
}

.secondary {
  background: transparent;
}

.image-manager {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.62);
}

.image-manager h3 {
  margin: 0;
  font-size: 0.95rem;
}

.admin-image-preview-wrap {
  display: grid;
  gap: 0.65rem;
  justify-items: start;
}

.admin-image-preview {
  max-width: 180px;
  width: 100%;
  height: auto;
}

.admin-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.admin-image-thumb {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  padding: 0.65rem;
  border: 1px solid rgba(15, 8, 4, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.pending-upload-previews {
  display: grid;
  gap: 0.65rem;
}

.pending-upload-thumb {
  padding: 0.35rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
}

.upload-file-name {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--muted);
  word-break: break-word;
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
button {
  font: inherit;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-body input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  padding: 0;
  border: 1.6px solid rgba(123, 21, 21, 0.55);
  border-radius: 4px;
  background: #fff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}

.admin-body input[type="checkbox"]::before {
  content: "";
  width: 0.58rem;
  height: 0.58rem;
  transform: scale(0);
  transition: transform 120ms ease-in-out;
  box-shadow: inset 1em 1em #a31212;
  border-radius: 2px;
}

.admin-body input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.3rem;
  background: #fff;
}

input[type="file"]::file-selector-button {
  border: 1px solid var(--line);
  background: #f7f7fb;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  margin-right: 0.65rem;
  cursor: pointer;
}

button {
  width: fit-content;
  cursor: pointer;
}

.success {
  color: #145e18;
}

.error {
  color: #a31212;
}

@media (max-width: 820px) {
  .edition-grid {
    column-count: 2;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .admin-wrap {
    grid-template-columns: 1fr;
  }

  .admin-aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  .edition-grid {
    column-count: 1;
  }

  .burger {
    display: inline-block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(242, 243, 250, 0.98);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 0.9rem 1.2rem;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
  }

  .nav.open {
    display: flex;
  }

  .brand {
    font-size: clamp(1.15rem, 9vw, 2.2rem);
    letter-spacing: 0.16em;
  }

  .site-main {
    padding-top: 94px;
  }

  .home-route .site-main {
    padding-top: 0;
  }

  .hero {
    min-height: calc(100vh - 94px);
  }

  .home-route .hero {
    min-height: 100vh;
  }

  .home-route .nav {
    background: rgba(15, 8, 4, 0.86);
    border-top: 1px solid rgba(242, 243, 250, 0.3);
    border-bottom: 1px solid rgba(242, 243, 250, 0.3);
  }

  .project-pagination {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (hover: none) and (pointer: coarse) {
  .project-card {
    height: auto;
    display: block;
    border-radius: 0;
  }

  .project-card img {
    width: 100%;
    height: auto;
    transform: none;
    filter: none;
  }

  .project-card span {
    position: static;
    display: block;
    opacity: 1;
    background: transparent;
    color: var(--text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.82rem;
    padding: 0.45rem 0 0;
    word-break: break-word;
  }

  .project-card:hover img {
    transform: none;
    filter: none;
  }
}
