:root {
  --ink: #16241c;
  --paper: #f3f2ea;
  --paper-dark: #e8e6d9;
  --green: #3f6f21;
  --green-deep: #1f3d10;
  --red: #cd2122;
  --line: rgba(22, 36, 28, 0.14);
  --white: #ffffff;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --serif: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

.albums-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 24px 90px;
}

.albums-page__head {
  max-width: 640px;
  margin: 0 0 40px;
}

.albums-page__eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-deep);
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}

.albums-page__eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--red);
  margin-right: 10px;
  vertical-align: middle;
}

.albums-page__head h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--green-deep);
}

.albums-page__head p {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(22, 36, 28, 0.72);
  margin: 0;
}

/* --------------------------------------------------------------
	   Album grid — folder-style cards
	   -------------------------------------------------------------- */

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 28px 24px;
}

.album-card {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: block;
  width: 100%;
}

.album-card__cover {
  position: relative;
  border-radius: 10px 10px 3px 3px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--paper-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.album-card:hover .album-card__cover img {
  transform: scale(1.045);
}

.album-card__count {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(22, 36, 28, 0.72);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
}

.album-card__tab {
  background: var(--white);
  border-radius: 0 0 8px 8px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-top: none;
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.album-card:hover .album-card__tab {
  box-shadow: 0 10px 22px rgba(31, 61, 16, 0.12);
  transform: translateY(-2px);
}

.album-card__tab h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 6px;
  color: var(--green-deep);
}

.album-card__tab p {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(22, 36, 28, 0.65);
  margin: 0;
}

/* --------------------------------------------------------------
	   Album modal — grid of every photo in the album
	   -------------------------------------------------------------- */

.album-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  background: rgba(15, 23, 15, 0.6);
  padding: 24px;
  overflow-y: auto;
}

.album-modal.is-open {
  display: block;
}

.album-modal__panel {
  max-width: 980px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: 16px;
  padding: 32px 32px 40px;
  position: relative;
  animation: panelIn 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.album-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--white);
  color: var(--green-deep);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.album-modal__close:hover {
  background: var(--red);
  color: #fff;
  transform: rotate(90deg);
}

.album-modal__head {
  max-width: 640px;
  margin: 0 0 26px;
  padding-right: 50px;
}

.album-modal__head .eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--red);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.album-modal__head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 26px;
  margin: 6px 0 8px;
  color: var(--green-deep);
}

.album-modal__head p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(22, 36, 28, 0.7);
  margin: 0;
}

.album-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.album-modal__thumb {
  position: relative;
  border: none;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  background: var(--paper-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.35s ease;
}

.album-modal__thumb:hover img {
  transform: scale(1.08);
}

.album-modal__switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.album-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--green-deep);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
  max-width: 46%;
}

.album-switch-btn:hover {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: #fff;
}

.album-switch-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-switch-btn--next {
  flex-direction: row-reverse;
  margin-left: auto;
}

/* --------------------------------------------------------------
	   Single-image viewer — sits above the album modal
	   -------------------------------------------------------------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 8, 0.92);
  padding: 24px;
}

.viewer.is-open {
  display: flex;
}

.viewer__close {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.viewer__close:hover {
  background: var(--red);
  transform: rotate(90deg);
}

.viewer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.viewer__nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.viewer__nav--prev {
  left: 20px;
}
.viewer__nav--next {
  right: 20px;
}

.viewer__frame {
  max-width: min(900px, 90vw);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.viewer__frame img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 8px;
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.viewer__caption {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .album-modal__panel {
    padding: 24px 18px 30px;
  }
  .album-modal__head {
    padding-right: 44px;
  }
  .viewer__nav {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  .viewer__nav--prev {
    left: 8px;
  }
  .viewer__nav--next {
    right: 8px;
  }
  .album-switch-btn span {
    display: none;
  }
  .album-switch-btn {
    padding: 10px;
    border-radius: 50%;
  }
}
