/* ═══════════════════════════════
   BIANKI.SK — Design System
   ═══════════════════════════════ */

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Theme Variables --- */
.theme-light {
  --bg: #ffffff;
  --text: #111111;
  --text-muted: #888888;
  --border: #e8e8e8;
  --accent: #111111;
  --overlay: rgba(0, 0, 0, 0.85);
}

/* White border for homepage and item pages */
body.page-home,
body.page-item {
  --border: #ffffff;
}

.theme-dark {
  --bg: #0f0f0f;
  --text: #f0f0f0;
  --text-muted: #666666;
  --border: #2a2a2a;
  --accent: #f0f0f0;
  --overlay: rgba(0, 0, 0, 0.92);
}

/* --- Base --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.7;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text);
}

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

input, textarea {
  font-family: inherit;
  font-size: inherit;
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 1px;
  transition: border-color 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 112px;
  z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.header-left,
.header-center,
.header-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.header-left {
  justify-content: flex-start;
}

.header-center {
  justify-content: center;
  flex: 1;
}

.header-right {
  justify-content: flex-end;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-image {
  max-height: 34px !important;
  max-width: 200px !important;
  height: auto !important;
  width: auto !important;
  object-fit: contain;
  display: block;
}

.logo-text {
  font-size: 11px;
  line-height: 24px;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text);
}

.header-right a {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 24px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.header-right a:hover {
  color: var(--accent);
}

.nav-active {
  opacity: 0.5;
}

/* --- Main Content --- */
.main-content {
  padding-top: 112px;
}

/* --- Homepage Grid --- */
.rug-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--border);
  padding: 0;
}

.rug-grid-item {
  background: var(--bg);
  display: block;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.rug-grid-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.rug-grid-item__image-wrap {
  position: relative;
  padding-top: 75%; /* 4:3 ratio */
  overflow: hidden;
}

.rug-grid-item__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.rug-grid-item:hover .rug-grid-item__image {
  transform: scale(1.03);
}

.rug-grid-item__info {
  padding: 14px 16px 18px;
}

.rug-grid-item__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 400;
  margin-bottom: 4px;
}

.rug-grid-item__meta {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
}

/* --- Detail Page --- */
.detail-layout {
  display: grid;
  grid-template-columns: 10% 60% 30%;
  min-height: calc(100vh - 112px);
}

.detail-title-col {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-right: 1px solid var(--border);
}

.detail-title-rotated {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 400;
  white-space: nowrap;
}

.detail-gallery-col {
  position: relative;
  border-right: 1px solid var(--border);
}

.detail-info-col {
  padding: 40px 5vw 40px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Gallery */
.gallery {
  position: relative;
  width: 100%;
  height: calc(100vh - 112px);
  overflow: hidden;
  background: #ffffff;
}

.gallery-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-slide.active {
  opacity: 1;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  cursor: default;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.gallery:hover .gallery-arrow {
  opacity: 1;
}

.gallery-arrow:hover {
  opacity: 0.6 !important;
  background: none;
}

.gallery-arrow:active {
  opacity: 0.4 !important;
}

.gallery-arrow svg {
  width: 24px;
  height: 24px;
  stroke: var(--text);
  stroke-width: 1.5;
  fill: none;
}

.gallery-arrow--prev {
  left: 16px;
}

.gallery-arrow--next {
  right: 16px;
}

.gallery-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--text);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease;
  padding: 0;
}

.gallery-dot.active {
  background: var(--text);
}

/* Detail Info */
.detail-description {
  margin-bottom: 30px;
  line-height: 1.8;
}

.detail-description p {
  margin-bottom: 12px;
}

.detail-meta-list {
  list-style: none;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.detail-meta-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.detail-meta-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  color: var(--text-muted);
}

.detail-meta-value {
  font-weight: 400;
}

/* --- About Page --- */
.about-page {
  width: 80%;
  margin: 0 auto;
  padding: 60px 0;
}

.about-page h1 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 400;
  margin-bottom: 40px;
}

.about-page img {
  width: 100%;
  margin-bottom: 30px;
}

.about-body {
  line-height: 1.8;
}

.about-body p {
  margin-bottom: 14px;
}

/* --- Contact Page --- */
.contact-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 80px 5vw;
}

.contact-page h1 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 400;
  margin-bottom: 40px;
}

.contact-intro {
  margin-bottom: 30px;
  line-height: 1.8;
}

.contact-form .form-group {
  margin-bottom: 20px;
}

.contact-form label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  display: block;
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form .honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

.form-message {
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  display: none;
}

.form-message.success {
  display: block;
  color: #2d7d46;
  border-color: #2d7d46;
}

.form-message.error {
  display: block;
  color: #c0392b;
  border-color: #c0392b;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 400;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
  transition: opacity 0.2s ease;
  border-radius: 1px;
}

.btn:hover {
  opacity: 0.8;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
}

/* --- 404 Page --- */
.page-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 112px);
  text-align: center;
  padding: 40px 5vw;
}

.page-404__number {
  font-size: 120px;
  font-weight: 300;
  letter-spacing: 0.1em;
  line-height: 1;
  margin-bottom: 16px;
}

.page-404__text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
  .rug-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 768px) {
  .site-header {
    height: 56px;
  }

  .main-content {
    padding-top: 56px;
  }

  .rug-grid {
    grid-template-columns: 1fr;
  }

  .about-page {
    width: 100%;
    padding: 40px 5vw;
  }

  .detail-layout {
    display: block;
    min-height: calc(100vh - 56px);
  }

  .detail-title-col {
    display: none;
  }

  .detail-gallery-col {
    border-right: none;
  }

  .gallery {
    height: 60vh;
  }

  .gallery-arrow {
    opacity: 1;
  }

  .gallery-arrow svg {
    width: 28px;
    height: 28px;
  }

  .detail-info-col {
    padding: 30px 5vw;
  }

  .header-left .logo-image {
    max-height: 32px;
  }

  .header-right {
    gap: 12px;
  }

  .site-logo,
  .logo-text {
    font-size: 16px;
  }

  footer {
    padding: 24px 5vw;
    font-size: 10px;
  }

}

/* --- About Blocks --- */
.about-content {
  width: 100%;
}

.about-text {
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-text p {
  margin-bottom: 14px;
}

.about-image {
  margin-bottom: 20px;
}

.about-image img {
  width: 100%;
}

.about-image figcaption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.about-spacer.spacer-s { height: 20px; }
.about-spacer.spacer-m { height: 40px; }
.about-spacer.spacer-l { height: 80px; }

/* --- Sortable List (settings) --- */
.sortable-list {
  list-style: none;
}

.sortable-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  margin-bottom: 4px;
  cursor: grab;
  font-size: 13px;
}

.sortable-list li:active {
  cursor: grabbing;
}

.sortable-list li.dragging {
  opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════════
   JOY SECTION
   ═══════════════════════════════════════════════════════════════ */

/* Joy grid — 3 columns, square cells, Instagram-like */
.joy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: #ffffff;
  max-width: 935px;
  margin: 0 auto;
  padding: 0;
}

.theme-dark .joy-grid {
  background: #262626;
}

.joy-grid-item {
  background: var(--bg);
  display: block;
  cursor: pointer;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.joy-grid-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.joy-grid-item__image-wrap {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  position: relative;
}

.joy-grid-item__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.joy-grid-item:hover .joy-grid-item__image {
  transform: scale(1.03);
}

/* Joy modal overlay */
.joy-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 2000;
}

.joy-modal-overlay.active {
  display: flex;
}

.joy-modal-content {
  background: #fff;
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.joy-modal-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 44px;
  padding: 0 8px;
  flex-shrink: 0;
  background: #fff;
}

.joy-modal-close {
  font-size: 28px;
  line-height: 1;
  color: #000;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  padding: 4px 8px;
}

.joy-modal-close:hover {
  opacity: 1;
}

.joy-modal-gallery {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #fff;
}

.joy-modal-gallery .gallery-slide img {
  object-fit: contain;
  background: #fff !important;
}

.joy-modal-gallery .gallery-slide {
  background: #fff;
}

.joy-modal-description {
  padding: 10px 24px;
  background: var(--bg);
  line-height: 1.8;
  font-size: 14px;
  min-height: 44px;
  max-height: 20vh;
  overflow-y: auto;
  flex-shrink: 0;
  text-align: center;
}

.joy-modal-description p {
  margin-bottom: 10px;
}

/* Joy grid stays 3 columns on all screen sizes (Instagram-like) */
@media (max-width: 480px) {
  .joy-grid {
    gap: 1px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

footer {
  margin-top: 80px;
  padding: 30px 5vw;
  text-align: center;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-copyright {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 300;
}

