/*
Theme Name: Itsas Etxea — Blocs
Theme URI: https://example.invalid/
Author: Itsas Etxea
Description: Thème WordPress conçu pour que la page d’accueil d’Itsas Etxea soit entièrement modifiable avec les blocs Gutenberg, sans toucher au PHP ou au HTML.
Version: 1.2.0
Text Domain: itsas-etxea-blocs
*/

:root {
  --paper: #efe3c9;
  --paper-light: #f6edd9;
  --ink: #2b2b22;
  --muted: #6f6757;
  --red: #8f2e28;
  --green: #38553a;
  --line: rgba(76, 67, 49, .32);
  --shadow: 0 30px 80px rgba(48, 40, 25, .13);
  --serif: "Cormorant Garamond", Georgia, serif;
  --body: "Libre Caslon Text", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.3), transparent 35%),
    repeating-linear-gradient(0deg, rgba(85,64,33,.018) 0 1px, transparent 1px 4px),
    var(--paper);
  font-family: var(--body);
}
img { max-width: 100%; height: auto; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(239, 227, 201, .94);
  backdrop-filter: blur(14px);
}
.site-brand { text-decoration: none; display: grid; line-height: 1; }
.site-brand-main { font: 600 clamp(1.05rem, 2vw, 1.35rem)/1 var(--serif); letter-spacing: .17em; }
.site-brand-sub { color: var(--red); font: 500 .72rem/1.4 var(--serif); text-transform: uppercase; letter-spacing: .12em; margin-top: 5px; }
.primary-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: clamp(.85rem, 2vw, 2.2rem); margin: 0; padding: 0; }
.primary-nav a { text-decoration: none; text-transform: uppercase; letter-spacing: .09em; font-size: .8rem; }
.primary-nav a:hover { color: var(--red); }

.site-main { min-height: 70vh; }
.visual-section {
  position: relative;
  padding: clamp(54px, 7vw, 110px) clamp(18px, 4vw, 64px);
  border-top: 1px solid rgba(76,67,49,.14);
}
.visual-section:first-child { border-top: 0; }
.hero-section { padding-top: clamp(24px, 4vw, 62px); }

.itsas-section-heading { max-width: 820px; margin: 0 auto 32px; text-align: center; }
.itsas-section-heading h2 {
  font: 500 clamp(2.2rem, 4.4vw, 4.3rem)/.98 var(--serif);
  letter-spacing: -.015em;
  margin: .3rem 0 1rem;
}
.itsas-section-heading p:not(.eyebrow) { margin-inline: auto; max-width: 680px; color: var(--muted); line-height: 1.7; }
.eyebrow { margin: 0 0 .45rem; color: var(--red); text-transform: uppercase; letter-spacing: .16em; font: 600 .78rem/1.4 var(--serif); }

.paper-frame {
  position: relative;
  margin-inline: auto;
  background: var(--paper-light);
  border: 1px solid rgba(77,66,45,.24);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.paper-frame img { display: block; width: 100%; }
.portrait-frame { width: min(100%, 1040px); }
.landscape-frame { width: min(100%, 1280px); }

.wp-block-buttons.itsas-actions { justify-content: center; gap: 14px; margin-top: 28px; }
.wp-block-button .wp-block-button__link {
  border: 1px solid rgba(51,48,37,.48);
  border-radius: 0;
  background: rgba(246,237,217,.66);
  color: var(--ink);
  padding: .9rem 1.15rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  font: 600 .83rem/1 var(--serif);
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.wp-block-button .wp-block-button__link:hover { transform: translateY(-2px); background: var(--ink); color: var(--paper-light); border-color: var(--ink); }
.wp-block-button.is-style-itsas-red .wp-block-button__link { border-color: var(--red); color: var(--red); }
.wp-block-button.is-style-itsas-red .wp-block-button__link:hover { background: var(--red); color: #fff7ea; }
.wp-block-button.is-style-itsas-green .wp-block-button__link { border-color: var(--green); color: var(--green); }
.wp-block-button.is-style-itsas-green .wp-block-button__link:hover { background: var(--green); color: #fff7ea; }

.archive-grid { width: min(100%, 1050px); margin: 32px auto 0; gap: 14px; }
.archive-card { border-top: 1px solid var(--line); padding: 18px 10px 8px; }
.archive-card .archive-date { color: var(--red); font: 600 1.05rem/1 var(--serif); margin-bottom: .4rem; }
.archive-card h3 { font: 500 1.35rem/1.1 var(--serif); margin: 0 0 .45rem; }
.archive-card p:last-child { color: var(--muted); font-size: .86rem; margin-top: 0; }
.archive-card.locked { opacity: .58; }

.book-layout { width: min(100%, 1280px); margin: 0 auto; align-items: center !important; gap: clamp(26px, 5vw, 80px); }
.book-visual figure { margin: 0; box-shadow: var(--shadow); }
.book-copy { text-align: center; }
.book-copy .eyebrow { margin-bottom: 2rem; }
.book-summary { color: var(--ink); font-size: clamp(1rem, 1.25vw, 1.2rem); line-height: 1.65; max-width: 620px; margin: 0 auto; }
.book-copy .wp-block-separator { width: 160px; margin: 2rem auto; border: 0; border-top: 1px solid rgba(143,46,40,.5); }

.closing-layout { width: min(100%, 1120px); margin: 0 auto; align-items: center !important; gap: clamp(28px, 5vw, 72px); }
.newsletter-card { padding: clamp(22px, 4vw, 48px); border: 1px solid var(--line); background: rgba(246,237,217,.58); }
.newsletter-card h2 { font: 500 clamp(2.2rem, 4.4vw, 4.3rem)/.98 var(--serif); margin: .3rem 0 1rem; }
.newsletter-card p:not(.eyebrow) { color: var(--muted); line-height: 1.65; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px clamp(18px, 4vw, 64px) 36px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--muted);
}
.site-footer strong { color: var(--ink); }

.page-shell { width: min(100% - 36px, 880px); margin: 0 auto; padding: clamp(64px, 8vw, 120px) 0; }
.page-shell > h1 { font-family: var(--serif); font-weight: 500; margin: 0 0 2.5rem; }

/*
 * IMPORTANT : sur les pages WordPress ordinaires, la mise en forme des blocs
 * vient désormais de Gutenberg / theme.json. Le thème n'impose plus une
 * seconde taille, un second interligne ou des marges différentes en aperçu.
 */
.page-content { width: 100%; }

@media (max-width: 900px) {
  .site-header { position: relative; align-items: flex-start; flex-direction: column; gap: 1rem; }
  .primary-nav ul { gap: .8rem 1.2rem; }
  .book-layout, .closing-layout { display: block !important; }
  .book-layout > .wp-block-column, .closing-layout > .wp-block-column { margin-bottom: 2rem; }
}

@media (max-width: 620px) {
  .site-brand-sub { display: none; }
  .visual-section { padding-inline: 12px; }
  .portrait-frame, .landscape-frame { width: 100%; border-left: 0; border-right: 0; }
  .wp-block-buttons.itsas-actions { display: grid; }
  .wp-block-buttons.itsas-actions .wp-block-button { width: 100%; }
  .wp-block-buttons.itsas-actions .wp-block-button__link { display: block; width: 100%; text-align: center; }
}


/* Les blocs restent simples dans Gutenberg : Titre, Paragraphe, Image, Bouton. */
.editable-section > .wp-block-heading {
  text-align: center;
  font: 500 clamp(2.2rem, 4.4vw, 4.3rem)/.98 var(--serif);
  margin: 0 auto 1rem;
}
.editable-section > p {
  max-width: 720px;
  margin: 0 auto 2rem;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
}
.book-copy > .wp-block-heading {
  font: 500 clamp(2.2rem, 4.4vw, 4.3rem)/.98 var(--serif);
  margin: 0 0 1.4rem;
}
