/* ==================================================
   1. FONTS AND WEBSITE VARIABLES
   ================================================== */

@font-face {
  font-family: "Elegant Typewriter";
  src: url("fonts/ELEGANT TYPEWRITER Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Elegant Typewriter";
  src: url("fonts/ELEGANT TYPEWRITER Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-main: "Elegant Typewriter", "Courier New", monospace;

  --color-text: #000;
  --color-accent: darkred;

  --focus-width: 2px;
  --focus-offset: 4px;

  --page-width: min(90vw, 1100px);
}


/* ==================================================
   2. BASIC RESET AND GLOBAL STYLES
   ================================================== */

* {
  box-sizing: border-box;
}

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

body {
  color: var(--color-text);

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  font-family: var(--font-main);
  font-weight: 400;
}

/* ==================================================
   3. HOMEPAGE
   ================================================== */

/* Homepage background and fixed desktop layout */

body.home-page {
  height: 100vh;
  height: 100dvh;

  overflow: hidden;

  background-image: url("imgs/bg-img.jpg");
}


/* Centres the homepage title and navigation images */

.home-layout {
  position: fixed;
  inset: 0;

  width: 100%;
  height: 100vh;
  height: 100dvh;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: clamp(1rem, 4vh, 3rem);
  padding: clamp(1rem, 3vw, 3rem);

  overflow: hidden;
}


/* Homepage title */

.site-title {
  width: fit-content;
  max-width: 80vw;
  margin: 0;

  font-family: var(--font-main);
  font-size: clamp(1.5rem, 5vw, 6rem);
  font-weight: 400;
  line-height: 1;
  text-align: center;

  white-space: normal;
  overflow-wrap: break-word;
}


/* Three-column homepage menu on larger screens */

.image-menu {
  width: min(92vw, 1100px);
  min-width: 0;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: clamp(0.5rem, 2.5vw, 2.5rem);
}


/* Individual homepage image link */

.menu-item {
  position: relative;

  width: 100%;
  min-width: 0;

  overflow: hidden;

  color: var(--color-text);
  text-decoration: none;

  -webkit-tap-highlight-color: rgba(139, 0, 0, 0.35);
}


/* Homepage menu images */

.menu-item img {
  display: block;

  width: 100%;
  height: auto;

  aspect-ratio: 1000 / 726;
  object-fit: cover;

  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}


/* Homepage image interaction */

.menu-item:hover img,
.menu-item:focus-visible img {
  transform: scale(1.04);
  opacity: 0.85;
}

.menu-item:focus-visible {
  outline: var(--focus-width) solid var(--color-accent);
  outline-offset: var(--focus-offset);
}

.menu-item:active {
  outline: var(--focus-width) solid var(--color-accent);
}

/* ==================================================
   4. SHARED INNER-PAGE LAYOUT
   About, Exhibition, and Testimonies
   ================================================== */

/* Default inner-page background */

body.inner-page {
  width: 100%;
  height: 100vh;
  height: 100dvh;

  overflow: hidden;

  background-image: url("imgs/bg-img2.jpg");
  background-position: center bottom;
}


/*
  Four rows:
  1. Header and top line
  2. Main scrollable content
  3. Bottom line
  4. Metal object
*/

.inner-layout {
  width: var(--page-width);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;

  display: grid;
  grid-template-rows:
    auto
    minmax(0, 1fr)
    auto
    auto;

  padding:
    clamp(1.25rem, 3vw, 2.5rem)
    0
    clamp(0.75rem, 2vh, 1.5rem);
}


/* ==================================================
   5. INNER-PAGE HEADER
   ================================================== */

.inner-top {
  width: 100%;
  min-width: 0;
}

.inner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 2rem;
}


/* Page title: About, Exhibition, or Testimonies */

.inner-header h1 {
  margin: 0;

  font-family: var(--font-main);
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
}


/* Home link in the upper-right corner */

.home-button {
  font-family: var(--font-main);
  font-size: clamp(1rem, 4vw, 1.4rem);
  font-weight: 700;

  color: var(--color-text);
  text-decoration: none;

  -webkit-tap-highlight-color: rgba(139, 0, 0, 0.35);
}

.home-button:hover,
.home-button:focus-visible {
  color: var(--color-accent);
}

.home-button:focus-visible {
  outline: var(--focus-width) solid var(--color-accent);
  outline-offset: var(--focus-offset);
}


/* ==================================================
   6. TOP AND BOTTOM DIVIDING LINES
   ================================================== */

.inner-divider {
  width: 100%;
  margin: 0;

  border: 0;
  border-top: 2px solid #000;
}

.inner-divider-top {
  margin-top: clamp(0.75rem, 2vw, 1.5rem);
}

.inner-divider-bottom {
  margin: 0;
}


/* ==================================================
   7. ABOUT AND EXHIBITION TEXT CONTENT
   ================================================== */

/*
  Only this centre section scrolls.
  Header, lines, and metal object stay fixed.
*/

.exhibition-content {
  min-height: 0;
  margin: 0 auto;

  padding:
    clamp(1.5rem, 4vh, 3rem)
    clamp(0.25rem, 1vw, 0.75rem);

  overflow-x: hidden;
  overflow-y: auto;

  scrollbar-gutter: stable;
  overscroll-behavior: contain;

  font-family: var(--font-main);
  font-size: clamp(1.3rem, 2.3vw, 1.6rem);
  font-weight: 400;
  line-height: 1.65;
}

.exhibition-content section {
  width: 100%;
  margin: 0 auto;
}

.exhibition-content section + section {
  margin-top: clamp(4rem, 8vw, 7rem);
}


/* Section headings inside About and Exhibition */

.exhibition-content h2 {
  margin: 0 0 1.5rem;

  font-family: var(--font-main);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 400;
  line-height: 1.2;
}

.exhibition-content h3 {
  margin: 0 0 1rem;

  font-family: var(--font-main);
  font-weight: 400;
  line-height: 1.3;
}

.exhibition-content h4 {
  margin: 0 0 1.5rem;

  font-family: var(--font-main);
  font-weight: 400;
  line-height: 1.3;
}


/* Paragraphs and numbered lists */

.exhibition-content p {
  margin: 0 0 1.5rem;
}

.exhibition-content ol {
  margin: 2rem 0 0;
  padding-left: clamp(1.5rem, 4vw, 3rem);
}

.exhibition-content li {
  margin-bottom: 1.75rem;
  padding-left: 0.5rem;
}

.exhibition-content li::marker,
.exhibition-content strong {
  font-family: var(--font-main);
  font-weight: 700;
}


/* ==================================================
   8. IMAGES INSIDE ABOUT OR EXHIBITION TEXT
   ================================================== */

.content-image {
  width: 100%;
  margin: clamp(2rem, 5vh, 4rem) auto;
}

.content-image img {
  display: block;

  width: 100%;
  height: auto;
  max-height: 65vh;

  object-fit: contain;
}

.content-image figcaption {
  margin-top: 0.75rem;

  color: var(--color-accent);

  font-family: var(--font-main);
  font-size: clamp(0.8rem, 1.1vw, 1rem);
  line-height: 1.4;
  text-align: center;
}


/* Optional smaller image variation */

.content-image-small {
  width: min(100%, 800px);
}


/* ==================================================
   9. LINKS INSIDE THE ABOUT PAGE
   ================================================== */

.about-content a,
.about-content a:visited {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

.about-content a:hover,
.about-content a:focus-visible {
  color: var(--color-accent);
  text-decoration-thickness: 2px;
}

.about-content a:focus-visible {
  outline: var(--focus-width) solid var(--color-accent);
  outline-offset: var(--focus-offset);
}


/* ==================================================
   10. METAL OBJECT AT THE BOTTOM
   ================================================== */

.metal-object-container {
  width: 100%;
  height: clamp(60px, 10dvh, 120px);

  display: flex;
  align-items: flex-end;
  justify-content: center;

  padding-top: clamp(0.5rem, 1.5vh, 1rem);

  overflow: hidden;
  pointer-events: none;
}

.metal-object {
  display: block;

  width: auto;
  height: auto;

  max-width: 100%;
  max-height: 100%;

  object-fit: contain;
}


/* ==================================================
   11. TESTIMONIES PAGE
   ================================================== */

/* Different background for the Testimonies page */

body.testimonies-page {
  background-image: url("imgs/bg-img3.jpg");
}

/* Scrollable centre area containing the six buttons */

.testimonies-content {
  width: min(88vw, 1000px);
  min-height: 0;
  margin: 0 auto;

  display: flex;
  align-items: flex-start;
  justify-content: center;

  padding:
    clamp(1rem, 2.5vh, 2rem)
    clamp(0.25rem, 1vw, 0.75rem);

  overflow-x: hidden;
  overflow-y: auto;

  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}


/* Two rows of three buttons on larger screens */

.testimonies-grid {
  width: 100%;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto);

  gap:
    clamp(0.75rem, 2vh, 1.5rem)
    clamp(0.75rem, 2vw, 2rem);
}


/* Individual testimony button */

.testimony-item {
  position: relative;

  display: block;

  width: 100%;
  min-width: 0;

  overflow: hidden;

  color: var(--color-text);
  text-decoration: none;

  -webkit-tap-highlight-color: rgba(139, 0, 0, 0.35);
}


/* Testimony button image */

.testimony-item img {
  display: block;

  width: 100%;
  height: auto;

  aspect-ratio: 1000 / 726;
  object-fit: cover;

  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}


/* Text displayed over each testimony image */

.testimony-label {
  position: absolute;
  top: clamp(0.4rem, 1vw, 1rem);
  left: 50%;
  z-index: 2;

  transform: translateX(-50%);

  max-width: 90%;

  color: var(--color-text);

  font-family: var(--font-main);
  font-size: clamp(0.75rem, 1.6vw, 1.3rem);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;

  text-shadow: 0 1px 5px rgba(255, 255, 255, 0.9);
}


/* Testimony button interaction */

.testimony-item:hover img,
.testimony-item:focus-visible img {
  transform: scale(1.04);
  opacity: 0.85;
}

.testimony-item:hover .testimony-label,
.testimony-item:focus-visible .testimony-label {
  color: var(--color-accent);
}

.testimony-item:focus-visible {
  outline: var(--focus-width) solid var(--color-accent);
  outline-offset: var(--focus-offset);
}

.testimony-item:active {
  outline: var(--focus-width) solid var(--color-accent);
}


/* ==================================================
   12. RESPONSIVE HOMEPAGE
   ================================================== */

/* Taller and narrower screens */

@media (max-aspect-ratio: 3 / 4) {
  .site-title {
    max-width: 90vw;
    font-size: clamp(1.5rem, 8vw, 3rem);
  }

  .image-menu {
    width: 94vw;
    gap: clamp(0.4rem, 2vw, 1rem);
  }

  .menu-label {
    font-size: clamp(0.65rem, 3vw, 1rem);
  }
}


/* ==================================================
   13. TABLET AND PHONE LAYOUT
   ================================================== */

@media (max-width: 600px) {
  .inner-layout {
    width: 90vw;
    padding: 1rem 0;
  }

  /* Homepage becomes one column */

  body.home-page {
    height: auto;
    min-height: 100dvh;

    overflow-y: auto;
  }

  .home-layout {
    position: relative;
    inset: auto;

    width: 100%;
    height: auto;
    min-height: 100dvh;

    justify-content: flex-start;

    padding:
      clamp(1.5rem, 5vh, 3rem)
      clamp(1rem, 4vw, 2rem);

    overflow: visible;
  }

  .image-menu {
    width: min(90vw, 420px);

    grid-template-columns: 1fr;

    gap: 1rem;
  }

  .site-title {
    font-size: clamp(1.5rem, 8vw, 3rem);
  }

  .inner-header {
    gap: 1rem;
  }

  .inner-header h1 {
    font-size: clamp(1.8rem, 10vw, 3rem);
  }

  .home-button {
    font-size: 1rem;
  }

  .exhibition-content {
    width: 100%;
    padding: 1.25rem 0.25rem;
    line-height: 1.55;
  }

  .testimonies-content {
    width: 100%;
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  /* Six images become three rows of two */

  .testimonies-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }

  .testimony-label {
    font-size: clamp(0.8rem, 4vw, 1.2rem);
  }
}


/* ==================================================
   14. VERY SMALL PHONE LAYOUT
   ================================================== */

@media (max-width: 400px) {
  /* Testimony images become one column */

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

/* ==================================================
   15. INDIVIDUAL TESTIMONY PAGES 
   uno.html, dos.html, tres.html, etc.
   ================================================== */

/* Uses the same background as the Testimonies menu */

body.testimony-page {
  background-image: url("imgs/bg-img3.jpg");
}


/* White page title and return button */

body.testimony-page .inner-header h1 {
  color: black;
}

body.testimony-page .home-button,
body.testimony-page .home-button:visited {
  color: black;
}

body.testimony-page .home-button:hover,
body.testimony-page .home-button:focus-visible {
  color: var(--color-accent);
}


/* White top dividing line */

body.testimony-page .inner-divider-top {
  border-top-color: black;
}


/*
  Main scrollable area.
  The title, lines, and metal object remain fixed.
*/

.testimony-content {
  width: min(86vw, 950px);
  min-height: 0;
  margin: 0 auto;

  padding:
    clamp(1.5rem, 4vh, 3rem)
    clamp(0.25rem, 1vw, 0.75rem);

  overflow-x: hidden;
  overflow-y: auto;

  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

/* Titles above testimony videos and images */

.testimony-section-title {
  margin: 0 0 clamp(1rem, 2vh, 1.5rem);

  color: black;

  font-family: var(--font-main);
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-weight: 400;
  line-height: 1.2;
}


/* ------------------------------
   Testimony video
   ------------------------------ */

.testimony-video-section {
  width: 100%;
  margin: 0 auto clamp(2rem, 5vh, 4rem);
}

.testimony-video {
  display: block;

  width: 100%;
  height: auto;
  max-height: 70vh;

  background-color: black;
  object-fit: contain;
}


/* ------------------------------
   Typed testimony images
   Keeps each image's original proportions
   ------------------------------ */

.testimony-gallery {
  width: 100%;

  display: flex;
  flex-direction: column;

  gap: clamp(1rem, 3vh, 2rem);
}

.testimony-gallery-item {
  width: 100%;
  margin: 0;
}

.testimony-gallery-item img {
  display: block;

  width: 100%;
  height: auto;

  max-width: 100%;

  object-fit: contain;
}

/* ------------------------------
   Individual testimony pages on phones
   ------------------------------ */

@media (max-width: 600px) {
  .testimony-content {
    width: 100%;
    padding: 1.25rem 0.25rem;
  }

  .testimony-gallery-item img {
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }
}


/* ------------------------------
   Testimony credits
   ------------------------------ */

.testimony-credits {
  margin-top: clamp(2rem, 5vh, 4rem);
  padding-bottom: clamp(1rem, 3vh, 2rem);

  font-family: var(--font-main);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 400;
  line-height: 1.5;

  color: black;
}

.testimony-credits p {
  margin: 0 0 1rem;
}