/*
Theme Name: Daniel Missud
Description: Blog personnel sobre, 2 colonnes, avec bannière personnelle
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: daniel-missud
*/

/* === Layout === */
:root {
  --content-size: 780px;
  --wide-size: 1200px;
}

body {
  background-color: #f9f9f9;
  color: #222;
}

/* === Header / Bannière === */
.site-banner {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
}

.site-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.site-banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  padding: 0 2rem;
}

.site-banner-text h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.25rem 0;
  letter-spacing: 0.01em;
}

.site-banner-text p {
  font-family: 'DM Sans', sans-serif;
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  margin: 0;
}

/* === Navigation === */
.site-nav {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

.site-nav .wp-block-navigation {
  padding: 0.75rem 2rem;
}

/* === Layout principal 2 colonnes === */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  max-width: var(--wide-size);
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

/* === Cards articles === */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.post-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.post-card-body {
  padding: 1.25rem;
}

.post-card-body .post-date {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.4rem;
  font-family: 'DM Sans', sans-serif;
}

.post-card-body h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
  line-height: 1.3;
}

.post-card-body h2 a {
  color: #222;
  text-decoration: none;
}

.post-card-body h2 a:hover {
  color: #555;
}

.post-card-body p {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.6;
  margin: 0;
}

/* === Sidebar === */
.sidebar {
  position: sticky;
  top: 1.5rem;
  align-self: start;
}

.sidebar-widget {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sidebar-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 1rem;
}

.sidebar-bio-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 0.5rem;
}

.sidebar-bio-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
  text-align: center;
  margin: 0;
}

.sidebar-widget h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  color: #222;
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 0.6rem;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}

.sidebar-widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-widget ul li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
}

.sidebar-widget ul li:last-child {
  border-bottom: none;
}

.sidebar-widget ul li a {
  color: #444;
  text-decoration: none;
}

.sidebar-widget ul li a:hover {
  color: #222;
}

/* === Footer === */
.wp-site-blocks > footer {
  margin-block-start: 0;
}

.site-footer {
  background: #fff;
  border-top: 1px solid #e8e8e8;
  text-align: center;
  padding: 1.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: #888;
  margin-top: 2rem;
}

/* === Animations === */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

.editor-styles-wrapper .animate-on-scroll {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* === Blocs de code style IDE === */
.wp-block-code {
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  border-radius: 6px;
  padding: 1.5rem 1.75rem;
  overflow-x: auto;
  border: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  position: relative;
}

.wp-block-code::before {
  content: '';
  display: block;
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f38ba8;
  box-shadow: 16px 0 0 #a6e3a1, 32px 0 0 #f9e2af;
}

.wp-block-code code {
  background: none;
  color: inherit;
  font-size: inherit;
  padding: 0;
  border: none;
}

/* Inline code */
:not(.wp-block-code) > code {
  background: #efefef;
  color: #c0392b;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid #e0e0e0;
}

/* === Bio accordéon === */
.bio-details summary {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: #888;
  cursor: pointer;
  text-align: center;
  list-style: none;
  padding: 0.3rem 0;
  border-top: 1px solid #f0f0f0;
  margin-top: 0.5rem;
}
.bio-details summary::-webkit-details-marker { display: none; }
.bio-details summary::after {
  content: ' ▾';
  font-size: 0.7rem;
}
.bio-details[open] summary::after {
  content: ' ▴';
}
.bio-details summary:hover { color: #555; }
.bio-details p {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.6;
  margin: 0.6rem 0 0;
}

/* === Responsive === */
@media (max-width: 768px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}

/* Cards égales */
.equal-cards > .wp-block-column {
  display: flex;
  flex-direction: column;
  flex-grow: 0;
}
.equal-cards > .wp-block-column > .wp-block-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
