/*
Theme Name: Marian Prieto Art
Theme URI: https://marianprieto.com
Author: Marian Prieto
Description: A custom art portfolio theme with an overlapping 2-column post grid.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: marian-prieto-art
Tags: art, portfolio, custom
*/

/* ─── Reset & Base ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg:       #f7f4f0;
  --color-surface:  #ffffff;
  --color-text:     #1a1a1a;
  --color-muted:    #6b6b6b;
  --color-accent:   #b5895a;
  --color-border:   #e0d8cf;
  --font-serif:     'Cormorant Garamond', 'Georgia', serif;
  --font-sans:      'Jost', 'Helvetica Neue', sans-serif;
  --overlap:        14px;
  --card-radius:    2px;
  --shadow:         0 6px 32px rgba(0,0,0,0.10);
  --shadow-hover:   0 12px 48px rgba(0,0,0,0.18);
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

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

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

/* ─── Site Layout ─── */
.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
}

/* ─── Site Header ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 0 48px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-branding {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.site-title a:hover {
  color: var(--color-accent);
  transition: color 0.2s;
}

.site-description {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ─── Nav ─── */
.nav-toggle {
  display: none;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 32px;
}

.main-navigation a {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  transition: color 0.2s;
}

.main-navigation a:hover {
  color: var(--color-text);
}

/* ─── Hero ─── */
.homepage-hero {
  padding: 80px 48px 56px;
  max-width: 640px;
}

.homepage-hero__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.homepage-hero__heading {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.homepage-hero__sub {
  font-size: 0.95rem;
  color: var(--color-muted);
  max-width: 440px;
  line-height: 1.7;
}

/* ─── Posts Grid ─── */
.posts-section {
  padding: 128px 32px 120px;
}

.posts-grid {
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 0 auto;
}

/* ─── Post Card ─── */
.post-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  cursor: pointer;
  margin-bottom: 0;
}

/* Image-right cards: image right, info left */
.post-card--image-right {
  flex-direction: row-reverse;
}


/* ─── Card Image ─── */
.post-card__image-wrap {
  position: relative;
  flex: 0 0 58%;
  width: 58%;
  border-radius: var(--card-radius);
  box-shadow:  0 4px 24px rgba(0,0,0,0.40);
  transform: translateY(var(--parallax-img-y, 0px));
  transition: box-shadow 0.35s ease;
  overflow: hidden;
  z-index: 1;
}

.post-card__image-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.post-card:hover .post-card__image-wrap {
  box-shadow:  0 8px 36px rgba(0,0,0,0.50);
}


/* Placeholder when no featured image */
.post-card__image-placeholder {
  width: 100%;
  aspect-ratio: 4/5;
  background: linear-gradient(135deg, #e8ddd4 0%, #d4c4b5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card__image-placeholder span {
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--color-accent);
  opacity: 0.5;
}

/* ─── Card Info Box ─── */
.post-card__info {
  position: relative;
  flex: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: 28px 28px 32px;
  max-width: 330px;
  /* Overlap onto the image horizontally */
  margin-left: -24px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  z-index: 2;
  transform: translateY(var(--parallax-y, 0px));
  transition: box-shadow 0.35s ease;
}

/* Image-right cards: info is on the left, so it overlaps to the right */
.post-card--image-right .post-card__info {
  margin-left: 0;
  margin-right: -24px;
}

.post-card:hover .post-card__info {
  box-shadow: 0 6px 28px rgba(0,0,0,0.13);
}

.post-card__category {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.post-card__title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.post-card:hover .post-card__title {
  color: var(--color-accent);
}

.post-card__excerpt {
  font-size: 0.82rem;
  color: var(--color-muted);
  line-height: 1.65;
  max-height: calc(0.82rem * 1.65 * 4);
  overflow: hidden;
}

.post-card__meta {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--color-muted);
  letter-spacing: 0.06em;
}

.post-card__meta::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* ─── No-image card — quote style ─── */
.post-card--no-image {
  justify-content: center;
  cursor: default;
  padding-top: 10px;
  padding-bottom: 10px;
  z-index: -1;
  /* margin-bottom: 14px;
  margin-top: 28px; */
}

.post-card--no-image .post-card__info {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  margin-left: 0;
  margin-right: 0;
  margin-top: 24px;
  margin-bottom: 24px;
  padding: 36px 28px 32px;
  text-align: center;
  max-width: 560px;
  position: relative;
}


.post-card--no-image .post-card__title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.4rem;
  font-weight: 500;
}

.post-card--no-image .post-card__excerpt {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.75;
  color: var(--color-text);
  max-height: calc(1.2rem * 1.75 * 4);
}


/* Card link overlay */
.post-card__link {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: var(--card-radius);
}

/* ─── Pagination ─── */
.posts-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-top: 80px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.posts-pagination__prev,
.posts-pagination__next {
  color: var(--color-muted);
  transition: color 0.2s;
}

.posts-pagination__prev:hover,
.posts-pagination__next:hover {
  color: var(--color-text);
}

.posts-pagination__info {
  color: var(--color-muted);
  font-size: 0.72rem;
}

/* ─── No Posts ─── */
.no-posts {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 0;
  color: var(--color-muted);
  font-family: var(--font-serif);
  font-size: 1.4rem;
}

/* ─── Single Post / Page ─── */
.singular-post {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 100px;
}

.singular-post .entry-header {
  margin-bottom: 40px;
}

.singular-post .entry-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.12;
}

.singular-post .entry-thumbnail {
  margin-bottom: 40px;
  border-radius: 2px;
  overflow: hidden;
}

.singular-post .entry-thumbnail img {
  width: 100%;
  height: auto;
}

.singular-post .entry-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text);
}

.singular-post .entry-content p {
  margin-bottom: 1.4em;
}

.singular-post .entry-content h2,
.singular-post .entry-content h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  margin: 2em 0 0.6em;
}

.singular-page {
  max-width: 1100px;
}

/* ─── Site Footer ─── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--color-muted);
  letter-spacing: 0.08em;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .site-header {
    padding: 0 24px;
    height: 60px;
    flex-wrap: nowrap;
  }

  /* Hamburger button */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    color: var(--color-text);
    flex-shrink: 0;
  }

  .nav-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: currentColor;
    transition: transform 0.25s ease, opacity 0.2s ease;
    transform-origin: center;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  /* Dropdown nav */
  .main-navigation {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }

  .main-navigation.is-open {
    max-height: 400px;
    padding: 20px 24px 24px;
  }

  .main-navigation ul {
    flex-direction: column;
    gap: 20px;
  }

  .main-navigation a {
    font-size: 0.9rem;
  }

  .homepage-hero {
    padding: 48px 24px 40px;
  }

  .posts-section {
    padding: 40px 16px 80px;
  }

  .post-card,
  .post-card--image-right {
    flex-direction: column;
  }

  /* Image-left: image flush left, gap on right, info box right-aligned */
  .post-card__image-wrap {
    flex: none;
    width: 100%;
    align-self: flex-start;
    z-index: auto;
  }

  .post-card__info {
    z-index: auto;
    margin-left: auto;
    margin-right: 8px;
    margin-top: -14px;
    max-width: 85%;
    min-width: 200px;
  }

  /* Image-right cards revert to same layout as image-left on mobile */
  .post-card--image-right .post-card__image-wrap {
    align-self: flex-start;
  }

  .post-card--image-right .post-card__info {
    margin-left: auto;
    margin-right: 8px;
  }

  .post-card--no-image .post-card__info {
    max-width: 90%;
    padding: 24px 20px;
  }

  .post-card--no-image .post-card__title {
    font-size: 1.3rem;
  }

  .post-card--no-image .post-card__excerpt {
    font-size: 1.1rem;
    max-height: calc(1.1rem * 1.75 * 4);
  }

  .site-footer {
    padding: 24px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}


@media (hover: none) {
  .post-card:hover .post-card__image-wrap {
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    transform: none;
  }

  .post-card:hover .post-card__info {
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    transform: none;
  }

  .post-card:hover .post-card__title {
    color: inherit;
  }
}
