/*
Theme Name: Sergij Farini Archive Match
Theme URI: https://sergijfarini.com/
Author: 24web
Description: Clean-room WordPress recreation of the original Sergij Farini portfolio design.
Version: 1.0.0
Text Domain: sergij-farini
*/

:root {
  --sf-red: #e50a0a;
  --sf-black: #212121;
  --sf-grey: #bebebe;
  --sf-panel: 315px;
  --sf-gap: 30px;
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--sf-grey);
  font-family: "Questrial", sans-serif;
  font-size: 16px;
  line-height: 24px;
}

body.sf-home { background: var(--sf-black); }

a {
  color: #000;
  text-decoration: none;
  transition: .5s all ease;
}

a:hover,
a:focus { color: var(--sf-grey); }

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

button,
input,
textarea { font: inherit; }

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

/* Original fixed left navigation. */
#fixed-sidebar-left {
  position: fixed;
  inset: 0 auto 0 calc(-1 * var(--sf-panel));
  z-index: 1008;
  width: 100%;
  max-width: var(--sf-panel);
  background: #fff;
  color: var(--sf-black);
  transition: left .2s linear;
}

#fixed-sidebar-left.active { left: 0; }

.fixed-sidebar-left-wrapper {
  position: relative;
  width: var(--sf-panel);
  max-height: 100%;
  overflow: auto;
  padding: 34px 30px;
}

.sidebar-menu {
  position: absolute;
  top: 43px;
  right: -54px;
  width: 30px;
  height: 30px;
  padding: 4px 3px;
  border: 0;
  background: transparent;
  color: #000;
  cursor: pointer;
}

.sidebar-menu span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 4px 0;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}

.sidebar-menu:hover { color: var(--sf-red); }
.active .sidebar-menu span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.active .sidebar-menu span:nth-child(2) { opacity: 0; }
.active .sidebar-menu span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-logo {
  display: inline-block;
  position: relative;
  margin-bottom: 91px;
  padding: 8px 14px;
  color: #434345 !important;
  font-size: 27px;
  line-height: 30px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.site-logo::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 7px;
  height: 7px;
  border-top: 3px solid var(--sf-red);
  border-left: 3px solid var(--sf-red);
}

.sf-menu {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.sf-menu li { margin-bottom: 5px; }

.sf-menu a {
  display: block;
  padding: 8px 14px;
  color: #434345;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sf-menu a:hover,
.sf-menu .current-menu-item a {
  background: var(--sf-red);
  color: #fff;
}

/* Homepage slider, recreated as the original single static slide. */
.sf-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  min-height: 420px;
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: #fff;
}

.sf-hero-caption {
  width: 100%;
  padding: 0 6%;
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: sf-fade-in .8s ease both;
}

.sf-hero-title {
  margin: 0 0 42px;
  color: #fff;
  font: 700 100px/120px "Playfair Display", serif;
  letter-spacing: 6px;
  text-transform: uppercase;
}

.sf-hero-caption p {
  margin: 0;
  padding: 0 0 24px;
  font-size: 22px;
  line-height: 27px;
}

.sf-hero-button {
  display: inline-block;
  margin-top: 24px;
  padding: 19px 44px;
  border: 2px solid #fff;
  color: #fff;
  font-size: 17px;
  line-height: 24px;
  letter-spacing: 3px;
}

.sf-hero-button:hover,
.sf-hero-button:focus {
  border-color: #d72323;
  background: #d72323;
  color: #fff;
}

@keyframes sf-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Interior pages and galleries. */
.sf-page { min-height: 100vh; background: #fff; }

.sf-container {
  position: relative;
  width: 100%;
  padding: 0 25px;
}

.sf-breadcrumbs {
  margin: 48px -5px;
  color: var(--sf-grey);
  font-size: 17px;
  text-align: center;
  text-transform: uppercase;
}

.sf-breadcrumbs a { color: #000; }
.sf-breadcrumbs a:hover { color: var(--sf-grey); }
.sf-breadcrumbs .divider { padding: 0 5px; color: #ccc; }

.sf-page-title {
  margin: 0 0 30px;
  padding-top: 5px;
  color: #000;
  font: 700 45px/60px "Playfair Display", serif;
  letter-spacing: 3px;
}

.sf-category-grid,
.sf-gallery-grid {
  display: grid;
  gap: var(--sf-gap);
  margin: 0 0 48px;
}

.sf-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sf-gallery-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.sf-category-card,
.sf-gallery-item {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #eee;
  aspect-ratio: 768 / 640;
}

.sf-category-card img,
.sf-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.sf-category-card:hover img,
.sf-gallery-item:hover img { transform: scale(1.1); }

.sf-category-overlay,
.sf-gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  opacity: 0;
  text-align: center;
  transition: opacity .5s ease;
}

.sf-category-card:hover .sf-category-overlay,
.sf-category-card:focus-within .sf-category-overlay,
.sf-gallery-item:hover .sf-gallery-overlay,
.sf-gallery-item:focus-within .sf-gallery-overlay { opacity: 1; }

.sf-category-link,
.sf-gallery-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.sf-gallery-overlay::before {
  content: "+";
  font: 300 36px/1 "Questrial", sans-serif;
}

.sf-article {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto 72px;
  color: #434345;
}

.sf-article h1,
.sf-article h2,
.sf-article h3 { color: #000; font-family: "Questrial", sans-serif; }
.sf-article a { text-decoration: underline; }

/* Lightweight replacement for the old Fancybox. */
.sf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 34px;
  background: rgba(0, 0, 0, .94);
}

.sf-lightbox.is-open { display: flex; }
.sf-lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; }
.sf-lightbox-close {
  position: absolute;
  top: 12px;
  right: 18px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
}

body.sf-lightbox-open { overflow: hidden; }

@media (max-width: 767px) {
  .sf-hero-title {
    font-size: 80px;
    line-height: 100px;
    letter-spacing: 0;
  }

  .sf-category-grid,
  .sf-gallery-grid { grid-template-columns: 1fr; }

  .sf-category-overlay,
  .sf-gallery-overlay { opacity: 1; background: rgba(0, 0, 0, .28); }
}

@media (max-width: 639px) {
  .sf-hero-title {
    margin-bottom: 0;
    font-size: 50px;
    line-height: 70px;
  }

  .sf-hero-button { margin-top: 0; padding: 11px 28px; }
  .sf-breadcrumbs { margin: 32px 0; }
}

@media (max-width: 360px) {
  .sf-hero-title { font-size: 42px; line-height: 58px; }
  .sf-hero-caption { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
