/* fai.dog styles - Every Layout patterns */

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

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  color: #222;
}

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

a {
  color: inherit;
}

/* === Layout primitives === */

/* Stack: vertical flow with consistent spacing */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space, 1rem);
}

/* === Navbar === */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.navbar .logo img {
  height: 60px;
  width: auto;
}

.navbar nav {
  display: flex;
  gap: 2rem;
}

.navbar nav a {
  text-decoration: none;
  text-transform: lowercase;
}

.navbar nav a:hover {
  text-decoration: underline;
}

/* === Artwork: Portrait/Landscape - sidebar layout === */

.artwork-viewport {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Image takes only the width it needs at 100vh height */
.artwork-viewport > .artwork-image {
  height: 100%;
  width: auto;
  flex-shrink: 0;
}

/* Sidebar takes remaining space */
.artwork-aside {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
}

.aside-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
}

.aside-logo img {
  height: 60px;
  width: auto;
}

.aside-menu {
  text-transform: lowercase;
  cursor: pointer;
}

.aside-menu:hover {
  text-decoration: underline;
}

.aside-meta {
  text-align: left;
  align-self: flex-start;
}

/* Mobile/Tablet: stack vertically */
@media (max-width: 1280px) {
  .artwork-viewport {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding-top: 70px; /* Space for fixed header */
  }

  .artwork-viewport > .artwork-image {
    height: auto;
    width: 100%;
    object-fit: contain;
  }

  .artwork-aside {
    flex: 0 0 auto;
    padding: 1rem;
  }

  .aside-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: #fff;
    z-index: 10;
  }

  .aside-logo img {
    height: 40px;
  }

  .aside-meta {
    padding-top: 1rem;
  }
}

/* Tablet (iPad-sized): cap portrait/square image so metadata fits */
@media (min-width: 768px) and (max-width: 1280px) {
  .artwork-viewport > .artwork-image {
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 200px);
    margin: 0 auto;
  }
}

/* === Artwork: Landscape - top navbar layout === */

.artwork-landscape {
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.artwork-landscape__content {
  display: flex;
  flex-direction: column;
}

.artwork-landscape .artwork-image {
  max-width: 100%;
  max-height: 70vh;
}

.artwork-landscape .artwork-meta {
  text-align: left;
  padding: 1rem 0;
}

/* Mobile/Tablet: horizontal artworks go edge-to-edge, take more height */
@media (max-width: 1280px) {
  .artwork-landscape {
    padding: 0;
  }

  .artwork-landscape__content {
    width: 100%;
  }

  .artwork-landscape .artwork-image {
    max-height: 85vh;
    width: 100%;
  }

  .artwork-landscape .artwork-meta {
    padding: 1rem;
  }
}

/* === Artwork metadata === */

.artwork-meta p {
  margin: 0;
  color: #666;
  font-size: 0.875rem;
  line-height: 1.4;
}

.aside-meta p {
  margin: 0;
  color: #222;
  font-size: 0.875rem;
  line-height: 1.4;
}

/* === Artwork grid === */
.grid-page {
  padding: 1rem;
}

.artwork-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .artwork-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.artwork-thumb {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
}

.artwork-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === Pages === */
main {
  padding: 2rem;
}

main h1 {
  margin-top: 0;
}

/* === Art Navigation Panel === */

.art-nav {
  background: #fff;
  border-top: 1px solid #eee;
  font-size: 0.875rem;
}

.art-nav__bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
}

.art-nav__chevron {
  font-size: 1.5rem;
  line-height: 1;
  color: #222;
  text-decoration: none;
  padding: 0.25rem;
  cursor: pointer;
}

.art-nav__chevron:hover {
  color: #000;
}

.art-nav__chevron--disabled {
  color: #ccc;
  cursor: default;
  pointer-events: none;
}

.art-nav__toggle {
  border: none;
  background: transparent;
  color: #222;
  font-size: inherit;
  text-transform: lowercase;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.art-nav__toggle:hover {
  text-decoration: underline;
}

.art-nav__toggle--active {
  font-weight: 500;
}

.art-nav__content {
  display: flex;
  align-items: center;
}

.art-nav__menu,
.art-nav__links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.art-nav__item {
  border: none;
  background: transparent;
  color: #666;
  font-size: inherit;
  text-transform: lowercase;
  cursor: pointer;
  padding: 0.25rem 0;
}

.art-nav__item:hover {
  color: #222;
}

.art-nav__item--copied {
  color: #2e7d32;
}

.art-nav__icon {
  font-size: 0.75em;
  margin-left: 0.125rem;
}

.art-nav__link {
  font-size: inherit;
  text-transform: lowercase;
  color: #666;
  text-decoration: none;
}

.art-nav__link:hover {
  color: #222;
  text-decoration: underline;
}

.art-nav__item--active {
  color: #222;
  text-decoration: underline;
}

.art-nav__sub {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid #eee;
}

[x-cloak] {
  display: none !important;
}

/* Chevrons fixed at bottom-right */
.art-nav__arrows {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  gap: 0.5rem;
  z-index: 100;
}

/* Landscape artwork header */
.artwork-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.artwork-header .art-nav {
  background: transparent;
  border: none;
}

.artwork-header .art-nav__bar {
  padding: 0;
}

.artwork-header__logo img {
  height: 60px;
  width: auto;
}

/* === Page Navigation (grid pages) === */

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.page-nav {
  display: flex;
  align-items: center;
}

.page-nav__toggle {
  border: none;
  background: transparent;
  color: #222;
  font-size: 0.875rem;
  text-transform: lowercase;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.page-nav__toggle:hover {
  text-decoration: underline;
}

.page-nav__toggle--active {
  font-weight: 500;
}

.page-nav__menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-nav__item {
  border: none;
  background: transparent;
  color: #666;
  font-size: 0.875rem;
  text-transform: lowercase;
  text-decoration: none;
  cursor: pointer;
  padding: 0.25rem 0;
}

.page-nav__item:hover {
  color: #222;
}

.page-nav__item--active {
  color: #222;
  text-decoration: underline;
}

.page-nav__item--copied {
  color: #2e7d32;
}

.page-nav__icon {
  font-size: 0.75em;
  margin-left: 0.125rem;
}

.page-header__logo img {
  height: 60px;
  width: auto;
}

.page-nav__sub {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  padding: 0.5rem 0;
}

.page-nav__link {
  font-size: 0.75rem;
  text-transform: lowercase;
  color: #666;
  text-decoration: none;
}

.page-nav__link:hover {
  color: #222;
  text-decoration: underline;
}

/* Sidebar layout: nav inline at top left */
.aside-top .art-nav {
  background: transparent;
  border: none;
}

.aside-top .art-nav__bar {
  justify-content: flex-start;
  padding: 0;
  gap: 0.5rem;
}


/* Mobile: sidebar nav stays inline at top */
@media (max-width: 1280px) {
  .artwork-landscape ~ .art-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }
}

