/*
Theme Name: Valentine Guirao
Theme URI: https://lepinbyzantin.fr
Author: Valentine Guirao
Description: Thème portfolio pour illustratrice : barre latérale fixe, grille d'images carrées, lightbox.
Version: 1.5.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: valentine
*/

:root {
  --vg-ink: #4a1d2e;          /* bordeaux du logo et du texte */
  --vg-ink-soft: #6d3a4c;
  --vg-side-bg: #fdf4f2;      /* fond de la barre latérale */
  --vg-main-bg: #fffaf8;      /* fond de la grille */
  --vg-side-w: 310px;
  --vg-gap: 12px;
  --vg-font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html, body { margin: 0; }

body {
  overflow-x: hidden;
  font-family: var(--vg-font);
  font-weight: 300;
  color: var(--vg-ink);
  background: var(--vg-main-bg);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--vg-ink);
  outline-offset: 3px;
}
img { max-width: 100%; height: auto; display: block; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* ---------- Barre latérale ---------- */
.vg-sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--vg-side-w);
  background: var(--vg-side-bg);
  border-right: 1px solid rgba(74, 29, 46, .06);
  display: flex; flex-direction: column; align-items: center;
  padding: 36px 24px 40px;
  text-align: center;
  overflow-y: auto;
}

.vg-logo img, .vg-logo .custom-logo { width: 175px; height: auto; margin: 0 auto; }

.vg-name {
  font-size: 1.25rem; font-weight: 400;
  margin: 18px 0 0; letter-spacing: .01em;
}
.vg-tagline { font-size: .85rem; margin: 2px 0 0; }

.vg-rule {
  width: 190px; height: 0; border: 0;
  border-top: 2px solid var(--vg-ink);
  margin: 14px auto 0;
}
.vg-rule--wide { width: 252px; }

.vg-menu { list-style: none; margin: 34px 0 0; padding: 0; }
.vg-menu li { margin: 0 0 14px; }
.vg-menu a {
  font-size: 1.3rem; font-weight: 300;
  text-transform: uppercase; letter-spacing: .02em;
  transition: color .2s;
}
.vg-menu a:hover,
.vg-menu .current-menu-item > a,
.vg-menu .current_page_item > a { color: var(--vg-ink-soft); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

.vg-sidebar-bottom { margin-top: auto; padding-top: 40px; }

.vg-socials { display: flex; justify-content: center; gap: 12px; }
.vg-socials a { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; }
.vg-socials svg, .vg-socials img { width: 46px; height: 46px; fill: var(--vg-ink); }
.vg-socials .vg-social-img { object-fit: contain; }
.vg-socials .dashicons { font-size: 46px; width: 46px; height: 46px; }
.vg-socials .vg-social-text { font-size: .8rem; text-decoration: underline; }
.vg-handle { font-size: 1.2rem; font-weight: 400; margin: 0; }

.vg-email { display: inline-block; margin-top: 22px; font-size: 1rem; }
.vg-email:hover { text-decoration: underline; }

/* ---------- Contenu ---------- */
.vg-main {
  margin-left: var(--vg-side-w);
  padding: 30px 18px 40px 26px;
  min-height: 100vh;
}

.vg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--vg-gap) 12px;
}

.vg-grid-item { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #f3e9e7; }
.vg-grid-item a { display: block; width: 100%; height: 100%; }
.vg-grid-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease, filter .4s ease;
}
.vg-grid-item a:hover img { transform: scale(1.03); filter: brightness(.92); }

.vg-grid-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(74, 29, 46, .75));
  color: #fff; font-size: .85rem;
  opacity: 0; transition: opacity .25s;
  pointer-events: none;
}
.vg-grid-item a:hover figcaption,
.vg-grid-item a:focus-visible figcaption { opacity: 1; }

/* Filtres de catégories (optionnels) */
.vg-filters { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 18px; padding: 0; list-style: none; }
.vg-filters a { font-size: .95rem; }
.vg-filters a.is-active, .vg-filters a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Pagination */
.vg-pagination { margin-top: 30px; text-align: center; }
.vg-pagination .page-numbers { padding: 4px 10px; }
.vg-pagination .current { text-decoration: underline; }

/* ---------- Pages & projet ---------- */
.vg-content { max-width: 780px; padding: 10px 10px 40px; }
.vg-content h1 { font-weight: 400; font-size: 1.8rem; margin: 0 0 24px; }
.vg-content h2, .vg-content h3 { font-weight: 400; }
.vg-content p { margin: 0 0 1.1em; }
.vg-content a { text-decoration: underline; text-underline-offset: 3px; }
.vg-content figure { margin: 0 0 24px; }

.vg-project-images { display: grid; gap: 18px; margin-bottom: 30px; }
.vg-project-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 40px; }

/* ---------- Page À propos ---------- */
.vg-about {
  --vg-photo-bg: #c4879d;
  display: grid;
  grid-template-columns: minmax(0, 330px) minmax(0, 1fr);
  gap: 30px;
  max-width: 1040px;
  padding: 0 20px 170px 20px; /* place pour le personnage qui déborde */
}

.vg-about-text { font-size: .9rem; line-height: 1.3; padding-top: 22px; }
.vg-about-text p { margin: 0 0 .25em; }
/* Neutralise les tailles de police choisies dans l'éditeur (ex. « Moyenne ») */
.vg-about-text p[class*="-font-size"] { font-size: inherit !important; line-height: inherit; }
.vg-about-text a { text-decoration: underline; text-underline-offset: 3px; }

.vg-about-visual {
  position: relative;
  width: min(100%, 410px);
  margin-left: auto;
  align-self: start;
}

.vg-about-photo {
  aspect-ratio: 41 / 46;
  border-radius: 14px;
  background: var(--vg-photo-bg);
  overflow: hidden;
}
.vg-about-photo img { width: 100%; height: 100%; object-fit: cover; }

.vg-about-character {
  position: absolute;
  width: 70%;
  left: -37%;
  bottom: -33%;
  height: auto;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .vg-about { grid-template-columns: 1fr; padding-bottom: 130px; }
  .vg-about-text { padding-top: 0; max-width: 560px; }
  .vg-about-visual { width: min(78%, 410px); margin: 10px 0 0 auto; }
  .vg-about-character { width: 62%; left: -28%; bottom: -26%; }
}

@media (max-width: 900px) {
  .vg-about { padding: 8px 8px 110px; }
  .vg-about-text { font-size: .95rem; line-height: 1.45; }
}

/* ---------- Page d'une œuvre ---------- */
.vg-work {
  display: grid;
  grid-template-columns: minmax(0, 315px) minmax(0, 1fr);
  grid-template-areas: "side main" "nav nav";
  gap: 10px 12px;
  align-items: start;
  max-width: 1200px;
}
.vg-work-side { grid-area: side; font-size: .9rem; line-height: 1.25; }
.vg-work-side > p,
.vg-work-side > .wp-block-paragraph { padding: 38px 14px 0; margin: 0 0 .2em; }
.vg-work-side > p + p { padding-top: 0; }
.vg-work-side p[class*="-font-size"] { font-size: inherit !important; line-height: inherit; }
.vg-work-side a { text-decoration: underline; text-underline-offset: 3px; }
.vg-work-side figure,
.vg-work-side .wp-block-image,
.vg-work-side .wp-block-gallery { margin: 26px 0 0; }
.vg-work-side .wp-block-gallery { gap: 10px; }
.vg-work-side img { width: 100%; height: auto; cursor: zoom-in; }
.vg-work-side figcaption { font-size: .8rem; margin-top: 6px; }

.vg-work-main { grid-area: main; margin: 0 0 0 10px; }
.vg-work-main a { display: inline-block; cursor: zoom-in; }
.vg-work-main img {
  width: auto; max-width: 100%;
  max-height: calc(100vh - 50px);
  object-fit: contain;
}

.vg-work-nav {
  grid-area: nav;
  display: flex; justify-content: space-between; gap: 20px;
  margin-top: 36px; padding: 0 14px; font-size: .9rem;
}
.vg-work-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 900px) {
  .vg-work { grid-template-columns: 1fr; grid-template-areas: "main" "side" "nav"; }
  .vg-work-main { margin: 0; }
  .vg-work-main img { max-height: none; }
  .vg-work-side { font-size: .95rem; line-height: 1.45; }
  .vg-work-side > p { padding: 18px 4px 0; }
}

/* ---------- Lightbox ---------- */
.vg-lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(40, 14, 24, .92);
  display: none; align-items: center; justify-content: center;
  padding: 50px 70px;
}
.vg-lightbox.is-open { display: flex; }
.vg-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.vg-lightbox-caption {
  position: absolute; bottom: 14px; left: 0; right: 0;
  text-align: center; color: #fdf4f2; font-size: .95rem;
}
.vg-lightbox button {
  position: absolute; background: none; border: 0; cursor: pointer;
  color: #fdf4f2; font-size: 2.4rem; line-height: 1; padding: 10px; font-family: var(--vg-font);
}
.vg-lb-close { top: 10px; right: 16px; }
.vg-lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.vg-lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .vg-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .vg-sidebar {
    position: static; width: auto; border-right: 0;
    border-bottom: 1px solid rgba(74, 29, 46, .08);
    padding: 26px 20px 22px;
  }
  .vg-logo img, .vg-logo .custom-logo { width: 120px; }
  .vg-sidebar { overflow: visible; }
  .vg-menu {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 10px 22px; margin-top: 18px; max-width: 100%;
  }
  .vg-menu li { margin: 0; }
  .vg-menu a { font-size: 1rem; white-space: nowrap; display: inline-block; padding: 4px 0; }
  .vg-sidebar-bottom { padding-top: 18px; }
  .vg-socials svg, .vg-socials img { width: 34px; height: 34px; }
  .vg-socials .dashicons { font-size: 34px; width: 34px; height: 34px; }
  .vg-main { margin-left: 0; padding: 16px 12px 32px; min-height: 0; }
  .vg-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .vg-lightbox { padding: 50px 12px; }
}

@media (max-width: 420px) {
  .vg-menu { gap: 8px 16px; }
  .vg-menu a { font-size: .92rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
