/* =============================================
   AAABooks – Stylesheet
   ============================================= */

@font-face {
  font-family: "Times Small Text MT Std";
  src: url(../font/Times\ Small\ Text\ MT\ Std\ Regular.otf) format("opentype")
}

@font-face {
  font-family: "Times Small Text MT Std";
  src: url(../font/Times\ Small\ Text\ MT\ Std\ Bold.otf) format("opentype");
  font-weight: bold;
}

@font-face {
  font-family: "Times Small Text MT Std";
  src: url(../font/Times\ Small\ Text\ MT\ Std\ Italic.otf) format("opentype");
  font-style: italic;
}

/* --- Variables --- */


:root {
  --color-text: black;

  --font-size-base: 1.1rem;
  --line-height: 1.3;

  --margin-horizontal: 1.25rem;
  --margin-vertical: 1rem;

  --border: .09375rem solid black;
  overscroll-behavior: none;
}

/* --- Reset & Base --- */

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

html {
  color-scheme: light dark;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  hanging-punctuation: first allow-end last;
  scroll-behavior: smooth;
}

body {
  font-family: "Times Small Text MT Std", serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  font: inherit;
}

/* --- Utilities --- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}



.site-main {
  flex: 1;
}

/* =============================================
   Header / Navigation
   ============================================= */
  
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--margin-vertical) var(--margin-horizontal);
}

body:not(.page--home) .site-header {
  position: absolute;
}

.site-nav {
  display: flex;
  flex-direction: column;
}

.site-nav__links {
  display: flex;
  gap: var(--margin-horizontal);
  align-items: center;
}

.site-nav__links a {
  font-style: normal;
}

.site-nav__links a:hover,
a.is-active:not(.site-nav__logo) {
  font-style: italic;
}

.cart-link {
  display: flex;
  align-items: center;
  gap: calc(var(--font-size-base) * 0.5); 
}

.cart-count {
  &:before {
    content: '(';
  }
  &:after {
    content: ')';
  }
}

.site-main.placeholder {
  padding-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-main.placeholder h1 {
  font-size: clamp(2rem, 12.5vw, 7rem);
  text-align: center;
  color: var(--color-highlight);
  font-weight: normal;
}

/* =============================================
   Home – Scroll-Snap Stage
   ============================================= */

.page--home {
  /* background-color: var(--color-highlight); */
  color: var(--color-highlight);
}

.page--home .site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
}

.page--home .site-main {
  padding-top: 0;
}

.home-stage {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  margin-top: 0; /* header is fixed, overlaps */
}

.home-slide {
  scroll-snap-align: start;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.home-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}

.home-slide__inner {
  color: var(--color-highlight);
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
}

.home-slide__author {
  font-size: clamp(1.75rem, 5vw, 3.5rem);
}

.home-slide__title {
  font-size: clamp(1.75rem, 5vw, 3.5rem);
  font-weight: normal;
  font-style: italic;

}

/* =============================================
   Live Photo
   ============================================= */

.live-photo {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
}

.live-photo__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.live-photo__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

/* =============================================
   Catalog Grid
   ============================================= */

.site-main {
  padding-top: calc(var(--font-size-base) * var(--line-height) + var(--margin-vertical) * 2);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(463px, 1fr));
  padding: var(--margin-vertical) var(--margin-horizontal);
  gap: var(--margin-horizontal);
  margin: 0 auto;
}

.catalog-item {
  flex: 0 1 calc(33.333% - var(--margin-horizontal));
  min-width: 220px;
}

.catalog-item__link {
  display: block;
  text-decoration: none;
}

.catalog-item__cover {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #f0f0f0;
  margin-bottom: 0.75rem;
}

.catalog-item__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-item__cover-placeholder {
  width: 100%;
  height: 100%;
  background: #e0e0e0;
}

.catalog-item__info {
  display: flex;
  flex-direction: column;
  color: var(--color-highlight);
}

.catalog-item__title {
  font-style: italic;
  font-weight: normal;
  font-size: var(--font-size-base);
}

/* =============================================
   Publication
   ============================================= */

.publication {
  margin: 0 auto;
  padding: calc(var(--font-size-base) * var(--line-height)) var(--margin-horizontal);

}

.publication__header {
  display: flex;
  flex-direction: column;
  color: var(--color-highlight);
  margin-bottom: calc(var(--margin-vertical) * .5);
}

.publication__body {
  display: flex;
  flex-direction: column;
}

.publication__title {
  font-size: var(--font-size-base);
  font-weight: normal;
  font-style: italic;
}

.publication__purchase {
  margin-top: var(--margin-vertical)
}

.btn-add-to-cart {
  all: unset;
  color: var(--color-highlight);
  cursor: pointer;
  line-height: 1;
  padding: .25rem 0;
}

.btn-add-to-cart:hover {
  background: var(--color-highlight);
  color: #fff;
}

.btn-add-to-cart.is-added {
  background: var(--color-highlight);
  color: #fff;
}

.publication__body {
  display: flex;
  gap: calc(var(--font-size-base) * var(--line-height) * 2 - .25rem);
  max-width: 1440px;
}

.publication__text {
  flex: 1;
  display: flex;
  gap: var(--margin-horizontal);
  transform: translateY(calc(var(--font-size-base) * var(--line-height) * -1));
}

.publication__info {
  flex: 1 0 30%;
}

/* Galleries */

.publication__gallery {
  position: relative;
  overflow: hidden;
}

.gallery-counter {
  position: absolute;
  top: var(--margin-vertical);
  right: var(--margin-horizontal);
  z-index: 10;
  line-height: 1;
  padding: 0.4em 0;
  color: white;
}

.gallery-grid {
  position: relative;
  cursor: pointer;
}

.gallery-item {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.gallery-item img {
  width: 100%;
  height: auto;
}

/* Related */

.publication__related h3 {
  font-size: var(--font-size-base);
  font-weight: normal;
  margin-bottom: calc(var(--margin-vertical) * .5);
}

.catalog-grid--related {
  padding: 0;
}

/* =============================================
   Text Pages (About / Imprint)
   ============================================= */

.text-page {
  margin: 0 auto;
  padding: calc(var(--font-size-base) * var(--line-height)) var(--margin-horizontal);
  
  a {
    color: var(--color-highlight);
  }
}

/* =============================================
   Cart
   ============================================= */

.cart {
  padding: calc(var(--font-size-base) * var(--line-height)) var(--margin-horizontal);
}

.cart__empty a {
  color: var(--color-highlight);
}

/* =============================================
   Cart
   ============================================= */

.cart {
  padding: calc(var(--font-size-base) * var(--line-height)) var(--margin-horizontal);
}

.cart__empty a {
  color: var(--color-highlight);
}

.cart-list {
  list-style: none;
  padding: 0;
  border-top: var(--border);
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: var(--border);
  gap: 1rem;
  font-size: var(--font-size-base);
}

.cart-item__title {
  flex: 1;
}

.cart-item__right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  padding: .75rem 0;
  border-bottom: var(--border);
}

.cart-tax-row {
  display: flex;
  justify-content: space-between;
  padding: .75rem 0;
}

.qty-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  background: none;
  font-size: var(--font-size-base);
  line-height: 1;
  cursor: pointer;
  border: none;
}

.qty-btn:hover {
  color: var(--color-highlight);
}

.qty-value {
  min-width: 1.5rem;
  text-align: center;
  font-size: var(--font-size-base);
}

.btn-remove {
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0;
  transition: color 0.15s;
  width: 1rem;
}

#cart-total {
  padding-right: 1.75rem;
}

.btn-remove:hover {
  color: var(--color-highlight);
}

.cart-checkout {
  display: flex;
  justify-content: center;
}

.btn-checkout {
  padding: 0.75rem 2rem;
  background: #111;
  color: #fff;
  border: 1px solid #111;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-checkout:hover {
  background: #fff;
  color: #111;
}

.cart-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.cart-message--success { background: #f0faf0; color: #1a6b1a; }
.cart-message--error   { background: #fdf0f0; color: #9b1a1a; }
.cart-message--info    { background: #f5f5f5; color: #444; }
.cart-message--warn    { background: #fffbf0; color: #7a5c00; }

/* =============================================
   Footer
   ============================================= */

.site-footer {
  padding: var(--margin-vertical) var(--margin-horizontal);
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: var(--margin-horizontal);
  flex-wrap: wrap;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 600px) {
  .publication__text {
    flex-direction: column;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
  }

}
