@import url("https://fonts.googleapis.com/css2?family=Alegreya+SC:ital,wght@0,400;0,700;1,700&family=Alegreya:wght@400;700;900&family=Oswald:wght@400;500&display=swap");

:root {
  --font-heading: "Alegreya SC", Georgia, serif;
  --font-body: "Alegreya", Georgia, serif;
  --font-nav: "Oswald", "League Gothic", sans-serif;
  --text-dark: #1a1a1a;
  --text-light: #ffffff;
  /* Darkened overlays */
  --overlay: rgba(20, 16, 12, 0.82);
  --overlay-heavy: rgba(20, 16, 12, 0.92);
  --parchment: #f4efe4;
  --accent: #8b4513;
  --accent-hover: #6d3410;
  --line: rgba(255, 255, 255, 0.35);
  --nav-width: 140px;
  --header-height: 72px;
  --transition: 0.35s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-dark);
  background: var(--parchment);
}

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

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  opacity: 0.85;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  margin: 0 0 1rem;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: var(--nav-width);
  z-index: 200;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  pointer-events: none;
}

.social-links {
  display: flex;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
  pointer-events: auto;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid currentColor;
  border-radius: 50%;
  text-decoration: none;
  font-family: var(--font-nav);
  font-size: 11px;
  letter-spacing: 0.04em;
  transition: background var(--transition), color var(--transition);
}

.social-links a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

.section-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--nav-width);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 10, 8, 0.92);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.section-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 12px 8px;
}

.section-nav a {
  display: block;
  padding: 6px 10px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-nav);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: right;
  border-right: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.section-nav a:hover,
.section-nav a.active {
  color: #fff;
  border-right-color: var(--accent);
}

.section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.section--light {
  background: var(--parchment);
  color: var(--text-dark);
}

.section--dark .section-content {
  color: var(--text-light);
}

.section-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.section-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.section-overlay--heavy {
  background: var(--overlay-heavy);
}

.section-content {
  position: relative;
  z-index: 2;
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: calc(var(--header-height) + 48px) 32px 64px;
  padding-right: calc(32px + var(--nav-width));
}

.section-grid {
  display: grid;
  gap: 32px;
  align-items: start;
}

.section-grid--2 {
  grid-template-columns: 1fr 1fr;
}

.section-grid--sidebar {
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 40px;
}

.section-grid--gallery {
  grid-template-columns: repeat(auto-fit, 200px); /* Adjust 200px to your preferred size */
  justify-content: center;
  gap: 16px;
}

.gallery img,
.product-card img {
  border: none;
  background: transparent;
}

.gallery img,
.gallery--screenshots img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  max-height: none;
}

.feature-link img {
  max-width: 280px;
  margin-bottom: 1rem;
  border: none;
  transition: transform var(--transition);
}

.feature-link:hover img {
  transform: scale(1.02);
}

.feature-link {
  text-decoration: none;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  margin-top: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-family: var(--font-nav);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition);
}

.btn:hover {
  background: var(--accent-hover);
  color: #fff;
  opacity: 1;
}

.btn--light {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn--light:hover {
  background: rgba(255, 255, 255, 0.25);
}

.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1rem;
}

.product-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card img {
  width: auto;
  max-width: 100%;
  height: 260px; /* Increases image size */
  margin: 0 auto 16px;
  object-fit: contain;
}

.product-card .btn {
  margin-top: auto; /* Forces the button to the bottom of the container */
  align-self: center;
}

.product-card img {
  width: 100%;
  max-width: 200px;
  margin: 0 auto 12px;
  aspect-ratio: 1.6;
  object-fit: contain;
}

.product-card h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.product-card p {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.product-card em {
  font-style: italic;
}

.hero {
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin: 0 0 24px;
  letter-spacing: 0.04em;
}

.hero-logo {
  width: min(520px, 85vw);
  margin: 0 auto;
}

.bio-photo {
  width: 100%;
  max-width: 280px;
  border-radius: 4px;
  border: 3px solid rgba(0, 0, 0, 0.08);
}

.contact-form {
  max-width: 560px;
  margin: 24px auto 0;
}

.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-nav);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font: inherit;
  border-radius: 2px;
}

.form-row input::placeholder,
.form-row textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-row textarea {
  min-height: 140px;
  resize: vertical;
}

.form-status {
  margin-top: 12px;
  font-size: 0.95rem;
}

.form-status.success {
  color: #b8e6b8;
}

.form-status.error {
  color: #ffb4b4;
}

.site-footer {
  position: relative;
  z-index: 2;
  padding: 24px calc(32px + var(--nav-width)) 24px 32px;
  text-align: center;
  font-size: 13px;
  background: #1a1612;
  color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 900px) {
  :root {
    --nav-width: 0px;
  }

  .site-header {
    right: 0;
    background: rgba(12, 10, 8, 0.85);
    pointer-events: auto;
  }

  .section-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .section-nav-inner {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-height: none;
    padding: 8px;
  }

  .section-nav a {
    text-align: center;
    border-right: none;
    border-bottom: 2px solid transparent;
    font-size: 10px;
    padding: 6px 8px;
  }

  .section-nav a:hover,
  .section-nav a.active {
    border-right-color: transparent;
    border-bottom-color: var(--accent);
  }

  .section-content {
    padding-right: 32px;
    padding-bottom: 100px;
  }

  .section-grid--2,
  .section-grid--sidebar {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding-right: 32px;
    padding-bottom: 100px;
  }
}

/* Published Fiction specific layout */
#published .product-grid {
  grid-template-columns: repeat(4, 1fr);
}

#published .product-card img {
  background: transparent;
  border: none;
  object-fit: contain;
}

/* --- New Item Descriptions Gallery Styles --- */
.item-gallery-container {
  width: 100%;
  background: #2a2a2a;
  border-radius: 12px;
  padding: 24px;
  box-sizing: border-box;
}

.item-gallery-main {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 24px;
}

.item-gallery-main img {
  max-height: 55vh;
  width: auto;
  max-width: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.gallery-btn {
  background: rgba(0,0,0,0.6);
  border: none;
  color: white;
  font-size: 2rem;
  padding: 12px 18px;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 4px;
  transition: 0.3s;
}

.gallery-btn:hover { background: rgba(0,0,0,0.9); }
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

.item-gallery-thumbnails {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.item-gallery-thumbnails img {
  height: 90px;
  width: 90px;
  object-fit: cover;
  cursor: pointer;
  border: 3px solid transparent;
  border-radius: 6px;
  opacity: 0.5;
  transition: 0.2s;
}

.item-gallery-thumbnails img.active,
.item-gallery-thumbnails img:hover {
  opacity: 1;
  border-color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  margin-top: 32px;
}

#published .product-grid {
  grid-template-columns: repeat(4, 1fr);
}

#short-stories .product-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* --- Lightbox Styles --- */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.lightbox.active { display: flex; }
.lightbox-content {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.lightbox-close:hover { color: #bbb; }

@media (max-width: 900px) {
  #published .product-grid, #short-stories .product-grid { 
    grid-template-columns: repeat(2, 1fr); 
  }
}

@media (max-width: 600px) {
  #published .product-grid, #short-stories .product-grid { 
    grid-template-columns: 1fr; 
  }
}