/* ============================================================
   ART&Signatures — homepage.css
   Loaded only on the front page. Composes all 7 visible acts:
   hero, latest, banner, masonry, conversation, paintings, newsletter.
   Design tokens come from style.css.

   Plugin-rendered tag/meta/price classes (`.artsgn-tag*`,
   `.artsgn-meta*`, `.artsgn-painting__price*`) are styled here too,
   since the helpers in artsgn-core/template-tags.php emit those names
   and the homepage cards are where they appear.
   ============================================================ */

.homepage { display: block; }

/* ============================================================
   HERO (62/38 asymmetric grid)
   ============================================================ */

.hero {
  padding: 48px var(--container-padding) 32px;
  max-width: var(--container-max);
  margin-inline: auto;
}
.hero__container {
  display: grid;
  grid-template-columns: 62fr 38fr;
  gap: 24px;
  align-items: start;
}

.card--hero-main .card__image  { aspect-ratio: 4 / 3; }
.card--hero-main .card__title {
  font-size: var(--fs-4xl);
  line-height: var(--lh-tight);
  letter-spacing: -1px;
  margin-top: 8px;
}
.card--hero-main .card__lead {
  display: block;
  font-size: var(--fs-base);
  color: var(--color-text-muted);
  margin-top: 12px;
  line-height: 1.6;
}

.card--hero-secondary .card__image  { aspect-ratio: 1 / 1; }
.card--hero-secondary .card__title {
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
  margin-top: 8px;
}

/* ============================================================
   SECTION wrapper (numbered header + right-aligned "View all")
   ============================================================ */

.section {
  padding: 48px var(--container-padding) 24px;
  max-width: var(--container-max);
  margin-inline: auto;
  border-top: 1px solid var(--color-border);
}
.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.section__title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}
.section__number {
  background: var(--color-accent);
  color: var(--color-text);
  padding: 4px 10px;
  border-radius: 2px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.section__title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
.section__link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.arrow-right {
  font-family: var(--font-sans);
  display: inline-block;
  transition: transform var(--transition-fast);
}
a:hover .arrow-right,
.section__link:hover .arrow-right,
.banner__link:hover .arrow-right { transform: translateX(2px); }

/* ============================================================
   Universal CARD (hero & latest)
   ============================================================ */

.card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.card:hover { opacity: 1; }
.card__image {
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--color-bg-alt);
  aspect-ratio: 4 / 3;
}
.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--transition-base);
  display: block;
}
.card:hover .card__image img { opacity: 0.88; }
.card__image-placeholder,
.masonry__image-placeholder,
.conv-card__image-placeholder,
.painting-card__image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #FAFAF7, #E5E5E0);
}
.card__title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  margin: 6px 0;
}
.card__body { padding: 0; }
.card__lead { display: none; }

/* ============================================================
   Plugin tag (.artsgn-tag) — category chip + featured star
   Rendered by artsgn_render_category_tag().
   The category chip contains an <a> link; styles must hit the
   inner <a> so the text is actually readable against the bg.
   ============================================================ */

.artsgn-tag,
.card__category {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-block;
  box-sizing: border-box;
  min-width: 68px;
  height: 17px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  z-index: 2;
  text-decoration: none;
}

.artsgn-tag a,
.card__category a {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}
.artsgn-tag a:hover,
.card__category a:hover { opacity: 1; }

.artsgn-tag--black,
.card__category--black { background: #0A0A0A; color: #FFFFFF; }
.artsgn-tag--black a,
.card__category--black a { color: #FFFFFF; }

.artsgn-tag--yellow,
.card__category--yellow { background: #F2D900; color: #0A0A0A; }
.artsgn-tag--yellow a,
.card__category--yellow a { color: #0A0A0A; }

.artsgn-tag--white,
.card__category--white {
  background: #FFFFFF;
  color: #0A0A0A;
  border: 1px solid #0A0A0A;
}
.artsgn-tag--white a,
.card__category--white a { color: #0A0A0A; }

/* ★ Featured — rendered as <span class="artsgn-tag artsgn-tag--featured"> */
.artsgn-tag--featured,
.artsgn-featured,
.card__featured-star {
  position: absolute;
  top: 10px;
  left: auto;
  right: 10px;
  display: inline-block;
  box-sizing: border-box;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: #F2D900;
  color: #0A0A0A;
  font-size: 10px;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
  border-radius: 2px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 2;
}

/* ============================================================
   Plugin meta (.artsgn-meta) — date · reading-time
   Rendered by artsgn_render_post_meta()
   ============================================================ */

.artsgn-meta {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-loose);
  display: inline-block;
  margin-bottom: 6px;
}
.artsgn-meta time + .artsgn-meta__reading-time::before {
  content: "·";
  margin: 0 6px;
  color: var(--color-text-light);
}

/* ============================================================
   MASONRY (act 4)
   ============================================================ */

.masonry {
  column-count: 3;
  column-gap: 20px;
}
.masonry__item {
  break-inside: avoid;
  margin-bottom: 20px;
  display: block;
  text-decoration: none;
  color: inherit;
}
.masonry__item:hover { opacity: 1; }
.masonry__image {
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
  background: var(--color-bg-alt);
}
.masonry__image img {
  width: 100%;
  display: block;
  transition: opacity var(--transition-base);
}
.masonry__image-placeholder { aspect-ratio: 4 / 3; }
.masonry__item:hover .masonry__image img { opacity: 0.88; }
.masonry__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}

/* ============================================================
   CONVERSATION (act 5)
   ============================================================ */

.conversation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.conv-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: start;
  text-decoration: none;
  color: inherit;
}
.conv-card:hover { opacity: 1; }
.conv-card__image {
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.conv-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--transition-base);
}
.conv-card:hover .conv-card__image img { opacity: 0.88; }
.conv-card__meta {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-loose);
  margin: 0 0 6px;
}
.conv-card__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: -0.3px;
  margin: 0 0 10px;
}
.conv-card__quote {
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--color-text-muted);
  border-left: 2px solid var(--color-accent);
  padding-left: 10px;
  margin: 0;
}

/* ============================================================
   PAINTING (act 6)
   ============================================================ */

.painting-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.painting-card:hover { opacity: 1; }
.painting-card__image {
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
  background: var(--color-bg-alt);
  aspect-ratio: 4 / 5;
}
.painting-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--transition-base);
}
.painting-card:hover .painting-card__image img { opacity: 0.88; }

.painting-card__status {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: var(--fw-semibold);
  padding: 3px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-loose);
}
.painting-card__status--reserved {
  background: var(--color-text);
  color: var(--color-accent);
}
.painting-card__status--sold {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-text);
  text-decoration: line-through;
}
.painting-card--sold .painting-card__image img {
  filter: grayscale(40%);
  opacity: 0.7;
}
.painting-card__artist {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 2px;
}
.painting-card__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  margin: 0 0 1px;
}
.painting-card__details {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin: 0;
}

/* Plugin-rendered price element */
.artsgn-painting__price {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  display: block;
  margin-top: 5px;
}
.artsgn-painting__price--sold {
  color: var(--color-text-light);
  text-decoration: line-through;
}
.artsgn-painting__price--inquire {
  font-style: italic;
  font-weight: var(--fw-medium);
}

/* ============================================================
   BANNER (act 3) — 50/50 yellow block, content + image
   ============================================================ */

.banner {
  margin: 32px var(--container-padding);
  background: var(--color-accent);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  align-items: stretch;
}
.banner__content {
  padding: 36px 36px 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.banner__eyebrow {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  color: var(--color-text);
  margin: 0 0 14px;
  letter-spacing: var(--tracking-wide);
}
.banner__title {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  line-height: 1.05;
  letter-spacing: -1px;
  margin: 0 0 14px;
  color: var(--color-text);
}
.banner__desc {
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 20px;
  max-width: 340px;
  font-weight: var(--fw-regular);
}
.banner__link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--color-text);
  padding-bottom: 3px;
  width: fit-content;
}
.banner__image {
  background: var(--color-bg-alt);
  min-height: 240px;
}
.banner__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================================
   NEWSLETTER (act 7) — dark stripe, headline + form
   ============================================================ */

.newsletter {
  background: var(--color-bg-dark);
  color: var(--color-bg);
  padding: 36px var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-top: 32px;
}
.newsletter__title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 6px;
  color: var(--color-bg);
}
.newsletter__desc {
  font-size: var(--fs-sm);
  color: var(--color-text-light);
  margin: 0;
}
.newsletter-form {
  display: flex;
  gap: 0;
  align-items: stretch;
}
.newsletter-form input {
  background: transparent;
  border: 1px solid #444;
  border-right: none;
  color: var(--color-bg);
  padding: 10px 14px;
  font-size: var(--fs-sm);
  width: 240px;
  font-family: inherit;
}
.newsletter-form input::placeholder { color: #999; }
.newsletter-form button {
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  color: var(--color-text);
  padding: 10px 22px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.newsletter-form button:hover { background: var(--color-accent-dark); }

/* ============================================================
   ADAPTIVE
   ============================================================ */

@media (max-width: 900px) {
  .hero__container { grid-template-columns: 1fr; gap: 32px; }
  .masonry { column-count: 2; }
}

@media (max-width: 768px) {
  .hero { padding: 32px var(--container-padding-mobile) 24px; }
  .section { padding: 32px var(--container-padding-mobile) 16px; }
  .banner {
    margin: 24px var(--container-padding-mobile);
    grid-template-columns: 1fr;
  }
  .banner__image { order: -1; min-height: 200px; }
  .conversation-grid { grid-template-columns: 1fr; }
  .newsletter {
    padding: 32px var(--container-padding-mobile);
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }
  .newsletter-form input { width: 100%; flex: 1; }
}

@media (max-width: 640px) {
  .masonry { column-count: 1; }
  .section__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .conv-card { grid-template-columns: 100px 1fr; gap: 14px; }
}

/* ============================================================
   Stretched link pattern для карточек.
   Внешний контейнер карточки — <article>, ссылка на posts — <a class="card__link">
   на заголовке. Псевдоэлемент ::before растягивается на всю карточку,
   делая клик в любом месте — переходом на пост. Метка категории и прочие
   внутренние ссылки получают z-index выше ::before, чтобы быть кликабельными.
   ============================================================ */

.card,
.conv-card,
.painting-card,
.masonry__item {
  position: relative;
}

.card__link {
  color: inherit;
  text-decoration: none;
}
.card__link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card__link:hover { opacity: 1; }

/* .artsgn-tag и его внутренний <a> остаются кликабельными поверх ::before */
.artsgn-tag,
.card__category {
  z-index: 3;
}
.artsgn-tag a,
.card__category a {
  position: relative;
  z-index: 1;
}

/* Текстовые элементы карточек — поверх stretched ::before, чтобы был корректный select */
.card__title,
.card__lead,
.card__body,
.conv-card__title,
.conv-card__meta,
.conv-card__quote,
.conv-card__content,
.painting-card__title,
.painting-card__artist,
.painting-card__details,
.masonry__title,
.artsgn-meta,
.artsgn-painting__price {
  position: relative;
  z-index: 2;
}
