/* Custom properties/variables  */
:root {
  --main-white: #f0f0f0;
  --main-text: #BDAE9B;
  --main-text-dark: #2F383E;
  --main-red: #6F7083;
  --main-blue: #2F383E;
  --main-gray: #49555D;
  --main-gray-light: #5A6770;
  --main-beige: #BDAE9B;
  --main-beige-light: #D4C4B0;
}

/* Base reset */
* {
  margin: 0;
  padding: 0;
}

/* box-sizing and font sizing */
*,
*::before,
*::after {
  box-sizing: inherit;
}

html {
  box-sizing: border-box;

  /* Set font size for easy rem calculations
   * default document font size = 16px, 1rem = 16px, 100% = 16px
   * (100% / 16px) * 10 = 62.5%, 1rem = 10px, 62.5% = 10px
  */
  font-size: 62.5%;
  scroll-behavior: smooth;
}


/* A few media query to set some font sizes at different screen sizes.
 * This helps automate a bit of responsiveness.
 * The trick is to use the rem unit for size values, margin and padding.
 * Because rem is relative to the document font size
 * when we scale up or down the font size on the document
 * it will affect all properties using rem units for the values.
*/

/* I am using the em unit for breakpoints
 * The calculation is the following
 * screen size divided by browser base font size
 * As an example: a breakpoint at 980px
 * 980px / 16px = 61.25em
*/

/* 1200px / 16px = 75em */
@media (max-width: 75em) {
  html {
    font-size: 60%;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    gap: 2rem;
    padding: 0 2rem;
  }

  .nav-list {
    margin-right: 1rem;
  }

  .nav-list a {
    padding: 1.5rem;
    font-size: 2rem;
  }
}

/* 980px / 16px = 61.25em */
@media (max-width: 61.25em) {
  html {
    font-size: 58%;
  }

  h1 {
    font-size: 6rem;
    margin-top: 80px;
  }

  h2 {
    font-size: 3.6rem;
  }

  .projects-section {
    height: auto;
    min-height: auto;
    padding: 4rem 0;
  }

  .projects-section-header {
    margin-bottom: 4rem;
  }

  .projects-grid {
    margin-bottom: 4rem;
  }

  .gallery-description {
    padding: 0 2rem;
  }

  .lightbox-window {
    width: 90%;
    max-height: 90vh;
  }
}

/* 460px / 16px = 28.75em */
@media (max-width: 28.75em) {
  html {
    font-size: 50%;
  }

  h1 {
    font-size: 4.8rem;
    margin-top: 60px;
  }

  h2 {
    font-size: 3rem;
  }

  .nav {
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0;
  }

  .nav-list {
    flex-direction: column;
    align-items: center;
    margin: 0;
  }

  .nav-list a {
    padding: 0.8rem;
    font-size: 2.2rem;
  }

  .inits {
    margin: 0 0 0.5rem 0;
  }

  .projects-section {
    height: auto;
    min-height: auto;
    padding: 4rem 0;
  }
  
  .projects-section-header {
    margin-bottom: 3rem;
    padding-top: 1rem;
  }

  .projects-grid {
    margin-bottom: 3rem;
  }

  .gallery-description {
    padding: 0 1rem;
  }

  .gallery-description p {
    font-size: 1.4rem;
  }

  .lightbox-window {
    width: 95%;
    padding: 0.5rem;
  }

  .lightbox-content img {
    max-height: 80vh;
  }

  .caption {
    font-size: 1.4rem;
    padding: 0.5rem;
  }

  .close-btn {
    font-size: 2.4rem;
    padding: 0.5rem;
  }
}

/* Base styles */

body {
  font-family: 'Poppins', sans-serif;
  font-size: 1.8rem; /* 18px */
  font-weight: 400;
  line-height: 1.6; /* Increased line height for better readability */
  color: var(--main-text);
  background-image: linear-gradient(180deg, #2F383E 30%, #BDAE9B 90%);
  min-height: 100vh;
}

h1,
h2 {
  font-weight: 700;
  text-align: center;
}

h1 {
  font-family: 'Londrina Shadow', sans-serif;
  font-size: 8rem;
  font-weight: normal;
  margin-top: 100px;
  text-align: center;
}

h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 4.2rem;
}

.inits {
  margin-right: auto;
  margin-left: 30px;
  margin-top: .5rem;
  font-family: 'Londrina Shadow', sans-serif;
  font-size: 40px;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: var(--main-text);
}

a.footer {
  text-decoration: underline;
}

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

/* nav */

.nav {
  display: flex;
  justify-content: flex-end;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--main-blue);
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.nav-list {
  display: flex;
  margin-right: 2rem;
}

.inits {
  margin-right: auto;
  margin-left: 30px;
  margin-top: .5rem;
  font-family: 'Londrina Shadow', sans-serif;
  font-size: 40px;
  z-index: 101; /* Ensure inits stays above the mobile menu */
}

.hamburger {
  display: none;
  cursor: pointer;
  padding: 1rem;
  z-index: 100;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background-color: var(--main-text);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Mobile Navigation */
@media (max-width: 61.25em) {
  .nav {
    justify-content: space-between;
    padding: 0.5rem 1rem;
  }

  .hamburger {
    display: block;
    position: relative; /* Changed from absolute to relative */
    margin-left: auto;
  }

  .nav-list {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: var(--main-blue);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: right 0.3s ease;
    margin: 0;
    padding: 0;
  }

  .nav-list.active {
    right: 0;
  }

  .nav-list a {
    padding: 1.5rem;
    font-size: 2.4rem;
    width: 100%;
    text-align: center;
  }

  /* Hamburger Animation */
  .hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .inits {
    margin: 0;
    font-size: 32px;
  }
}

.inits a:hover {
  color: var(--main-red)
}

.nav-list a {
  display: block;
  font-size: 2.4rem;
  padding: 2rem;
}

.nav-list a:hover {
  background: var(--main-red);
}

/* Landing */

.landing {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  background-color: #000;
  background-image: linear-gradient(180deg, #3a3d40 50%, #181719 100%);
}

.landing > p {
  font-size: 3rem;
  font-weight: 200;
  font-style: italic;
  color: var(--main-text);
}

/* Projects section */
.projects-section {
  text-align: center;
  padding: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.projects-section > * {
  position: relative;
  z-index: 1;
}

.projects-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#watercolors::before {
  background-image: linear-gradient(180deg, #181719 50%, #2F383E 100%);
}

#crafts::before {
  background-image: linear-gradient(180deg, #2F383E 0%, #49555D 50%, #BDAE9B 100%);
}

#photography::before {
  background-image: linear-gradient(180deg, #BDAE9B 0%, #D4C4B0 100%);
}

#textiles::before {
  background-image: linear-gradient(180deg, #BDAE9B 0%, #D4C4B0 100%);
}

.projects-section-header {
  max-width: 400px;
  margin: 0 auto 8rem auto;
  border-bottom: 0.1rem solid var(--main-text);
  padding-top: 2rem;
}

#photography .projects-section-header,
#textiles .projects-section-header {
  color: var(--main-blue);
  border-bottom: 0.1rem solid var(--main-blue);
}

@media (max-width: 28.75em) {
  .projects-section {
    height: auto;
    min-height: 100vh;
  }
  
  .projects-section-header {
    margin-bottom: 6rem;
    padding-top: 1rem;
  }
}

/* "Automagic" image grid using no media queries */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 4rem;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  margin-bottom: 6rem;
  padding: 0 2rem;
}

#textiles .projects-grid {
  max-width: 720px; /* This will center two tiles */
  grid-template-columns: repeat(2, 1fr);
}

/* Single column layout for smaller screens */
@media (max-width: 75em) {
  .projects-section {
    height: auto;
    min-height: auto;
    padding: 4rem 0;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    gap: 2rem;
    padding: 0 2rem;
    margin-bottom: 4rem;
  }

  #textiles .projects-grid {
    max-width: 320px;
  }

  .nav-list {
    margin-right: 1rem;
  }

  .nav-list a {
    padding: 1.5rem;
    font-size: 2.4rem;
  }
}

.project {
  background: var(--main-gray-light);
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow 0.3s ease;
}

.project:hover {
  box-shadow: 4px 8px 16px rgba(0, 0, 0, 0.4);
}

.project-tile {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: var(--main-text);
  transition: transform 0.3s ease;
}

.project-tile:hover {
  transform: translateY(-5px);
}

.project-image {
  height: calc(100% - 6.8rem);
  width: 100%;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}

.project-title {
  font-size: 2rem;
  font-weight: 400;
  padding: 2rem 0.5rem;
  text-align: center;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 6.8rem;
  color: var(--main-text);
  background: var(--main-gray-light);
  border-radius: 0 0 8px 8px;
}

#photography .project-title,
#textiles .project-title {
  color: var(--main-text-dark);
  background: var(--main-beige-light);
}

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 8px;
}

.btn-show-all {
  font-size: 2rem;
  background: var(--main-gray);
  transition: background 0.4s ease-out;
  margin: 2rem auto;
  display: block;
  width: fit-content;
}

.btn-show-all:hover {
  background: var(--main-red);
}

.btn-show-all > i {
  margin-left: 10px;
  transition: transform 0.4s ease-out;
}

.btn-show-all:hover > i {
  transform: translateX(2px);
}

/* Contact section */

.contact-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #2F383E;
  width: 100%;
  height: 80vh;
  padding: 0 2rem;
  background-image: linear-gradient(180deg, #D4C4B0 0%, #E8DCC8 50%, #FFFFFF 100%);
}

.contact-section-header > h2 {
  font-size: 6rem;
  font-family: 'Londrina Shadow', sans serif;
}

@media (max-width: 28.75em) {
  .contact-section-header > h2 {
    font-size: 4rem;
  }
}

.contact-section-header > p {
  font-style: italic;
}

.contact-links {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 980px;
  margin-top: 4rem;
  flex-wrap: wrap;
}

.contact-details {
  font-size: 2.4rem;
  text-shadow: 2px 2px 1px #1f1f1f;
  transition: transform 0.3s ease-out;
}

.contact-details:hover {
  transform: translateY(8px);
}

/* Footer */

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 2rem;
  background: var(--main-blue);
  color: var(--main-text);
  text-align: center;
}

.footer-content {
  max-width: 3000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.disclaimer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  line-height: 1.6;
}

.copyright {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 28.75em) {
  .projects-section {
    padding: 8rem 1rem;
  }
  
  .projects-section-header {
    margin-bottom: 6rem;
  }
  
  footer {
    padding: 3rem 1rem;
  }
  
  .footer-content {
    gap: 1.5rem;
  }
  
  .disclaimer {
    padding: 0 1rem;
    max-width: 90%;
  }
  
  .copyright {
    padding: 0 1rem;
    max-width: 90%;
  }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-item {
  background-color: rgba(255, 255, 255, 0.1);
  min-height: 200px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.02);
}

/* Tablet viewport */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile viewport */
@media (max-width: 480px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

.gallery-description {
    max-width: 1600px;
    margin: 0 auto 40px;
    padding: 0 20px;
    text-align: justify;
    color: var(--main-text);
}

.gallery-description p {
    margin-bottom: 20px;
    line-height: 1.6;
    text-align: justify;
}

@media (max-width: 28.75em) {
    .gallery-description {
        max-width: 90%;
        padding: 0 10px;
    }
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 999999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.lightbox-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--main-blue);
    border: 2px solid var(--main-text);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lightbox-header {
    background-color: var(--main-gray);
    padding: 10px;
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid var(--main-text);
    z-index: 1000000;
}

.lightbox-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    overflow: auto;
    max-height: calc(90vh - 60px);
}

.lightbox-content img {
    max-width: 100%;
    max-height: calc(90vh - 100px);
    object-fit: contain;
}

.caption {
    color: var(--main-text);
    text-align: center;
    font-size: 1.6rem;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    width: 100%;
}

.close-btn {
    color: var(--main-text);
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: var(--main-red);
    background-color: rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
/* Large phones */
@media (max-width: 48em) {
  html {
    font-size: 55%;
  }

  .nav {
    padding: 0.5rem 0;
  }

  .nav-list {
    margin-right: 0.5rem;
  }

  .nav-list a {
    padding: 1rem;
    font-size: 1.8rem;
  }

  .inits {
    font-size: 32px;
    margin-left: 1rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .project-tile {
    margin-bottom: 2rem;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .masonry-gallery {
    columns: 1;
    padding: 1rem;
  }
}
