@import url('header.css');
@import url('footer.css');

@font-face {
  font-family: 'Open Sans Condensed';
  src: local('Open Sans Condensed Regular'), local('OpenSansCondensed-Regular'),
      url('../fonts/OpenSans_Condensed-Regular.woff2') format('woff2'),
      url('../fonts/OpenSans_Condensed-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Open Sans Bold Condensed';
  src: local('Open Sans Condensed SemiBold'), local('OpenSansCondensed-SemiBold'),
      url('../fonts/OpenSans_Condensed-SemiBold.woff2') format('woff2'),
      url('../fonts/OpenSans_Condensed-SemiBold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Permanent Marker';
  src: local('Permanent Marker Regular'), local('PermanentMarker-Regular'),
      url('../fonts/PermanentMarker-Regular.woff2') format('woff2'),
      url('../fonts/PermanentMarker-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --title-font: 'Permanent Marker';
  --body-font: 'Open Sans Condensed';
  --black: #000000;
  --white: #ffffff;
  --title-size: 2.5em;
  --body-size: 1.2em;
  --button-size: 1.7em;
  --container-width: 80%;
  --margin-left: 140px;
}

body {
  background-color: var(--black);
  overflow-x: hidden;
}

.main-content section.portfolio {
  /* margin-block: 20px; */
  background-color: transparent;
}

.main-content .portfolio h1 {
  position: relative;
  margin-inline: auto;
  font-family: var(--title-font);
  font-size: var(--title-size);
  color: var(--black);
  background-image: url('../media/reviews-bg.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  text-align: center;
  width: 45vw;
  height: 75px;
  margin-bottom: 40px;
}

.main-content #portfolio-elements {
  margin-block: 4em;
  display: grid;
  grid-template-columns: 1fr repeat(2, auto) 1fr;
  grid-template-rows: auto auto;
  gap: 40px;
  width: var(--container-width);
  margin-inline: auto;
  position: relative;
  justify-items: center;
  align-items: start;
}

.main-content #portfolio-elements figure {
  position: relative;
  width: 300px;
  height: 300px;
  overflow: visible;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 0;
  transition: transform 0.3s ease;
}

.main-content #portfolio-elements figure:nth-child(2) {
  grid-column: 1 / -1;
  grid-row: 1;
  max-width: 300px;
  height: 300px;
  align-self: center;
  justify-self: center;
}

.main-content #portfolio-elements figure:nth-child(1) {
  grid-column: 2;
  grid-row: 2;
}

.main-content #portfolio-elements figure:nth-child(3) {
  grid-column: 3;
  grid-row: 2;
}

.main-content #portfolio-elements figure:nth-child(2) figcaption {
   transform: translateX(-50%) scale(1.1);
}

.main-content #portfolio-elements figure picture {
  width: 100%;
  height: 100%;
  display: block;
}

.main-content #portfolio-elements figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  transform-origin: center;
}

.main-content #portfolio-elements figure:hover img {
  transform: scale(1.05);
}

.main-content #portfolio-elements figcaption {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background-image: url('../media/buttons-bg.png');
  background-repeat: no-repeat;
  background-size: 95% 95%;
  background-position: center;
  padding: 15px 40px;
  text-align: center;
  transition: transform 0.3s ease;
  z-index: 2;
}

.main-content #portfolio-elements figcaption a {
  color: var(--black);
  text-decoration: none;
  font-family: var(--body-font);
  font-size: var(--body-size);
  position: relative;
  top: -7px;
  display: inline-block;
  white-space: nowrap;
}

.main-content #portfolio-elements figcaption:hover {
  transform: translateX(-50%) scale(1.1);
}

.main-content .reviews > img {
  position: relative;
  width: 100%;
  height: 100px;
  z-index: 0;
}

.main-content .reviews-slider {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  padding: 20px 0;
  z-index: 2;
}

.main-content .reviews-grid {
  display: flex;
  transition: transform 0.5s ease-in-out;
  width: 100%;
}

.main-content .reviews h1 {
  font-family: var(--title-font);
  font-size: var(--title-size);
  color: var(--white);
  display: flex;
  justify-content: center;
}

.main-content .review {
  flex: 0 0 100%;
  height: 500px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
}

.main-content .review img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 600px;
}

.main-content .slider-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.main-content .slider-button.prev {
  left: 10px;
}

.main-content .slider-button.next {
  right: 10px;
}

.main-content .no-photos, .main-content .error-message {
  text-align: center;
  color: var(--white);
  font-family: var(--body-font);
  font-size: var(--body-size);
  padding: 20px;
  width: 100%;
}

.main-content .loading {
  text-align: center;
  color: var(--white);
  font-family: var(--body-font);
  font-size: var(--body-size);
  padding: 20px;
  width: 100%;
}

/* Responsive Styles */
@media screen and (max-width: 1200px) {
  .portfolio-container {
    width: 90%;
  }
  
  .portfolio-grid {
    gap: 30px;
  }
  
  .portfolio-item {
    width: calc(50% - 15px);
  }
}

@media screen and (max-width: 1000px) {
  .main-content #portfolio-elements figure:nth-child(2) {
    grid-column: 2 / span 2;
    max-width: 300px;
  }
}

@media screen and (max-width: 767px) {
  .main-content .portfolio h1 {
    width: 80vw;
    height: 60px;
    font-size: 2em;
    background-size: 100%;
  }
  
  .main-content #portfolio-elements {
    grid-template-columns: 1fr;
    gap: 60px;
    width: 90%;
  }
  
  .main-content #portfolio-elements figure {
    width: 250px;
    height: 250px;
  }
  
  .main-content #portfolio-elements figure:nth-child(1),
  .main-content #portfolio-elements figure:nth-child(3) {
    grid-column: 1;
  }
  
  .main-content #portfolio-elements figure:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
  }
}

@media screen and (max-width: 680px) {
  .main-content #portfolio-elements figure {
    width: 220px;
    height: 220px;
  }
  
  .main-content #portfolio-elements figure:nth-child(2) {
    width: 220px;
    height: 220px;
  }
}

@media screen and (max-width: 480px) {
  .main-content .portfolio h1 {
    width: 90vw;
    height: 50px;
    font-size: 1.8em;
  }
  
  .main-content #portfolio-elements {
    gap: 40px;
  }
  
  .main-content #portfolio-elements figure {
    width: 200px;
    height: 200px;
  }
  
  .main-content #portfolio-elements figure:nth-child(2) {
    width: 200px;
    height: 200px;
  }
  
  .main-content #portfolio-elements figure:nth-child(1),
  .main-content #portfolio-elements figure:nth-child(3) {
    grid-column: auto;
    grid-row: auto;
  }
}

/* Print Styles */
@media print {
  .portfolio-container {
    width: 100%;
  }
  
  .portfolio-grid {
    display: block;
  }
  
  .portfolio-item {
    width: 100%;
    margin-bottom: 20px;
  }
  
  .overlay {
    display: none;
  }
  
  .portfolio-item img {
    filter: none;
  }
}

/* Universal spacing between main sections */
.main-content > section {
  margin-bottom: 60px;
  padding-top: 40px;
  padding-bottom: 40px;
}

