/* public/styles/global.css
   Place this file at: public/styles/global.css */

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

:root {
  --white: #ffffff;
  --black: #111110;
  --gray: #888884;
  --gray-light: #e8e8e4;
  --tag-bg: #f0efeb;
  --font-body: 'Georgia', serif;
  --font-ui: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --gap: 1px;
  --header-h: 52px;
}

html {
  background: var(--white);
  color: var(--black);
  font-family: var(--font-ui);
  font-size: 13px;
}

body {
  min-height: 100vh;
}

/* ── Header ── */

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.site-name {
  font-family: var(--font-body);
  font-size: 40px;
  letter-spacing: 0.02em;
  text-transform:uppercase;
}

.site-date {
  color: var(--black);
  font-size: 20px;
  letter-spacing: 0.04em;
}

/* ── Featured ── */

.featured {
  position: relative;
  width: 100%;
  background: #f5f4f0;
  overflow: hidden;
  padding: 24px;
  height: 650px;
  display: flex;
  align-items: center;
  justify-content: center;
}


.featured-image {
  width: 100%;
  max-width: 500px;
  max-height: 500px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.featured-label {
  position: absolute;
  top: 20px;
  left: 24px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--black);
  padding: 4px 8px;
  z-index: 2;
}

.featured-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  margin: 0;
  max-width: 160px;
}

.featured-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: normal;
  letter-spacing: 0.01em;
  text-align: right;
  margin-bottom: 8px;
}

.featured-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.featured-img-wrap {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
  margin: 0 auto
}

/* ── Tags ── */

.tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--gray);
  background: var(--tag-bg);
  padding: 3px 8px;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.tag:hover {
  background: var(--black);
  color: var(--white);
}

/* ── Grid ── */

main {
  padding: var(--gap);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* ── Card ── */

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  overflow: hidden;
}

.card-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--gray-light);
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.card:hover .card-img-wrap img {
  transform: scale(1.03);
}

.card-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 12px 14px;
  border-bottom: 1px solid var(--gray-light);
}

.card-title {
  font-size: 12px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 78%;
}

.card-year {
  font-size: 11px;
  color: var(--gray);
  flex-shrink: 0;
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
/* ── Item page ── */

.item-page {
  max-width: 900px;
  margin: 48px auto;
  padding: 0 24px;
}

.item-image {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: var(--gray-light);
  display: block;
}

.item-details {
  padding: 32px 0;
  border-top: 1px solid var(--gray-light);
}

.item-title {
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: normal;
  margin-bottom: 12px;
}

.item-date {
  color: var(--gray);
  font-size: 13px;
  margin-bottom: 8px;
}

.item-meta {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 4px;
}

.item-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.item-content {
  margin-top: 24px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--black);
}

.site-name {
  text-decoration: none;
  color: inherit;
}
/* ── Item navigation ── */

.item-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-top: 1px solid var(--gray-light);
  margin-top: 24px;
  gap: 12px;
}

.nav-btn {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--black);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--gray-light);
  border-radius: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 38%;
}

.nav-btn:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.nav-btn.center {
  max-width: none;
  color: var(--gray);
}

.nav-btn.disabled {
  color: var(--gray-light);
  border-color: var(--gray-light);
  cursor: default;
}
/* ── Tag page ── */

.tag-page {
  padding: 0 1px;
}

.tag-header {
  padding: 40px 24px 32px;
  border-bottom: 1px solid var(--gray-light);
}

.tag-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 8px;
}

.tag-title {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: normal;
  margin-bottom: 8px;
}

.tag-count {
  font-size: 12px;
  color: var(--gray);
}
/* ── Header dropdown ── */

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.dropdown {
  position: relative;
}

.dropdown-btn {
  background: var(--black);
  color: var(--white);
  border: none;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s;
}

.dropdown-btn:hover {
  background: var(--gray);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-light);
  min-width: 160px;
  z-index: 100;
  padding: 8px 0;
  max-height: 300px;
  overflow-y: auto;
}

.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -30px;
  left: 0;
  right: 30;
  height: 8px;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-link {
  display: block;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--black);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.dropdown-link:hover {
  background: var(--tag-bg);
}
/* ── Generate button ── */

.featured-generate {
  width: 100%;
  padding: 16px 24px 0;
  display: flex;
  justify-content: center;
  position: absolute;
  bottom: 24px;
  left: 0;
}
.generate-btn {
  background: var(--black);
  color: var(--white);
  border: none;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s;
}

.generate-btn:hover {
  background: var(--gray);
}

@media (max-width: 768px) {
  header {
    padding: 0 12px;
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-h);
    gap: 8px;
  }

  .site-name {
    font-size: 13px;
    letter-spacing: 0.02em;
  }

  .header-right {
    gap: 12px;
  }

  .site-date {
    display: none;
  }

  .featured-label {
    top: 12px;
    left: 12px;
  }
}