/* General Styles */

:root {
  --main-bg: #eee;
  --main-text: #333;
  --accent: #C43D33;
  --white: #fff;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  line-height: 1.6;
  color: var(--main-text);
  background-color: var(--main-bg);
}

main {
  max-width: 1200px;
  margin: auto;
  padding: 0 1rem;
}

main img {
  border: 10px solid var(--white); /* Add a white border */
  box-sizing: border-box; /* Include padding and border in total width/height */
}

/* Intro Section (logo) */
.intro {
  text-align: center;
}

.intro .logo {
  max-width: 280px;
  transition: transform 0.3s ease;
  margin: 0.5rem auto;
}

h1 {
  font-weight: bolder;
  text-align: left;
  line-height: 1.1;
}

h5 {
  font-weight: normal;
  text-align: center;
}

p {
  margin-bottom: 20px;
}

footer {
  text-align: center;
  padding: 6rem 0;
  width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .gallery {
    columns: 2 200px;
  }

  /* Stack project blocks vertically on mobile */
  .project-block {
    flex-direction: column; /* image on top, text below */
    gap: 1rem; /* spacing between image and text */
  }

  .project-block img {
    width: 100%;       /* full width inside white block */
    max-width: 100%;   /* prevent overflow */
    height: auto;      /* maintain aspect ratio */
  }

  .button-group {
    flex-direction: column;
  }

  .portfolio-links {
    grid-template-columns: repeat(3, 1fr);
  }

  .edition-project {
    padding: 2rem 1rem; /* ensure padding scales on mobile */
  }
}

.edition-project {
  padding: 2rem 1rem;
}

.edition-content {
  max-width: 100%;
}

@media (max-width: 500px) {
  .gallery {
    columns: 1 100%;
  }
}

@media (min-width: 768px) {
  .portfolio-links {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Buttons */
.button-group {
  display: flex;
  gap: 10px;
}

.btn-main, .btn-ghost {
  padding: 10px 20px;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}

.btn-main {
  border: 2px solid var(--main-text);
  background-color: var(--main-text);
  color: var(--white);
}

.btn-ghost {
  border: 2px solid var(--main-text);
  color: var(--main-text);
}

.btn-main:hover {
  background-color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-ghost:hover {
  background-color: var(--accent);
  border: 2px solid var(--accent);
  color: var(--white);
}

/* Galleries Cascade, Masonry */
.gallery, .gallery2 {
  column-gap: 1rem;
  max-width: 1200px;
  margin: auto;
}

.gallery {
  columns: 3 300px;
}

.gallery2 {
  columns: 2 300px;
}

.gallery img, .gallery2 img {
  width: 100%;
  break-inside: avoid;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
  display: block;
}

/* Portfolio Grid (Home, logos) */
.portfolio-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
  justify-items: center;
  margin: 0 auto;
}

.portfolio-item, .portfolio-item-other {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.portfolio-item img, .portfolio-item-other img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.portfolio-item img {
  filter: grayscale(100);
}

.portfolio-item img:hover {
  filter: grayscale(0);
}

/* Project Blocks */
.project-block {
  background-color: var(--white);
  display: flex;
  align-items: center;
  justify-content: left;
  gap: 4rem;
  padding: 4rem;
  margin-bottom: 1rem;
  min-height: 22rem;
}

.project-block img {
  width: 50%;
  min-width: 280px;
  max-width: 420px;
  flex-shrink: 0;
}

.project-block video {
  width: 50%;
  min-width: 280px;
  max-width: 420px;
  flex-shrink: 0;
}

/* Desktop alternating layout for specific blocks */
@media (min-width: 769px) {
  .project-block.row-reverse {
    flex-direction: row-reverse;
  }
}

/* Edition Project - White Container */
.edition-project {
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: auto;
  text-align: left;
  max-width: 1200px;
  margin: 0rem auto 1rem;
  padding: 2rem;
}

/* Full-Width Image Inside White Box */
.edition-project img {
  width: 100%;
  max-height: auto;
  object-fit: cover;
}

/* Text and Buttons */
.edition-content {
  padding: 1rem;
}

.edition-content h1 {
  font-size: 1.8rem;
  margin: 0;
}

.edition-content p {
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Social Icons */
.footer-links {
  text-align: center;
  margin-bottom: 1.5rem;
}

.footer-links a {
  margin: 0 8px;
  font-size: medium;
  text-decoration: none;
  color: var(--main-text);
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

.social-icons {
  text-align: center;
}

.social-icons a {
  margin: 0 12px;
  font-size: 24px;
  color: var(--main-text);
  transition: color 0.3s ease;
}

.social-icons a:hover {
  color: var(--accent);
}
