/*
Theme Name: Plante Méditerranéenne v2
Theme URI: https://www.plante-mediterraneenne.fr
Description: Thème botanique moderne pour Plante Méditerranéenne - flore du bassin méditerranéen
Author: Arnaud Bruckler
Version: 1.0
Text Domain: mediterrane-v2
*/

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

:root {
  --blue-900: #0d2137;
  --blue-800: #163859;
  --blue-700: #1e5080;
  --blue-600: #2775b6;
  --blue-500: #3d8fc8;
  --blue-400: #6db3e0;
  --blue-100: #ddeefb;
  --blue-50:  #f0f7fd;

  --terra-900: #6b2813;
  --terra-700: #a83d1c;
  --terra-500: #d46030;
  --terra-300: #f0a878;
  --terra-100: #fdf0e8;

  --sand-700: #8b6914;
  --sand-500: #c9a84b;
  --sand-300: #e8d5a0;
  --sand-100: #fdf8ea;
  --sand-50:  #fffdf5;

  --gray-900: #1a1a2e;
  --gray-700: #4a4a5a;
  --gray-500: #717185;
  --gray-300: #c4c4d0;
  --gray-100: #f4f4f7;
  --gray-50:  #fafafa;

  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  --content-width: 1200px;
  --content-narrow: 780px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--gray-900); background: var(--gray-50); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--blue-700); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--blue-500); }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--gray-900); line-height: 1.3; }
.species-hero h1, .page-hero h1, .home-hero h1 { color: var(--white); }
h1 { font-size: 2.4rem; font-weight: 700; }
h2 { font-size: 1.7rem; font-weight: 600; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.25rem; font-weight: 600; margin: 2rem 0 0.75rem; }
p { margin-bottom: 1.2rem; }
ul, ol { margin: 0 0 1.2rem 1.5rem; }
li { margin-bottom: 0.4rem; }

.site-container { min-height: 100vh; display: flex; flex-direction: column; }
.content-wrap { flex: 1; }
.container { max-width: var(--content-width); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: var(--content-narrow); margin: 0 auto; padding: 0 24px; }

/* -- Header ----------------------------------------------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--gray-100); position: sticky; top: 0; z-index: 100; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.site-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-size: 1.4rem; font-weight: 700; color: var(--blue-800); }
.site-logo img { height: 40px; width: auto; }
.site-logo span { color: var(--terra-500); }
.site-nav > ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.site-nav > ul > li { position: relative; }
.site-nav a { font-size: 0.9rem; font-weight: 500; color: var(--gray-700); padding: 8px 0; border-bottom: 2px solid transparent; transition: all 0.2s; display: block; }
.site-nav > ul > li > a:hover { color: var(--blue-700); border-bottom-color: var(--terra-500); }
.site-nav .sub-menu { display: none; position: absolute; top: 100%; left: -12px; background: var(--white); min-width: 220px; padding: 8px 0; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); border: 1px solid var(--gray-100); z-index: 200; list-style: none; }
.site-nav > ul > li:hover > .sub-menu { display: block; }
.site-nav .sub-menu li { margin: 0; }
.site-nav .sub-menu a { padding: 8px 20px; font-size: 0.85rem; color: var(--gray-700); border-bottom: none; }
.site-nav .sub-menu a:hover { background: var(--blue-50); color: var(--blue-700); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--gray-700); margin: 5px 0; transition: 0.3s; }

/* -- Buttons ---------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 12px 24px; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 600; transition: all 0.2s; cursor: pointer; border: none; }
.btn--primary { background: var(--blue-700); color: var(--white); }
.btn--primary:hover { background: var(--blue-800); color: var(--white); }
.btn--outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.7); }
.btn--outline:hover { background: rgba(255,255,255,0.15); color: var(--white); }
.btn--secondary { background: var(--blue-100); color: var(--blue-900); }
.btn--secondary:hover { background: var(--blue-400); color: var(--white); }

/* -- Tags ------------------------------------------------- */
.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; background: var(--gray-100); color: var(--gray-700); }
.tag--easy   { background: #d1f0fa; color: #0d4f6f; }
.tag--medium { background: #fef3c7; color: #92400e; }
.tag--hard   { background: #ffe8d8; color: #8b3500; }

/* -- Hero sections ---------------------------------------- */
.home-hero { position: relative; background: var(--blue-900); color: var(--white); overflow: hidden; min-height: 520px; display: flex; align-items: center; }
.home-hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.35; }
.home-hero__content { position: relative; z-index: 2; padding: 80px 0; }
.home-hero__title { font-size: 3.2rem; font-family: var(--font-serif); color: var(--white); margin-bottom: 16px; }
.home-hero__title em { color: var(--terra-300); font-style: normal; }
.home-hero__subtitle { font-size: 1.15rem; opacity: 0.85; max-width: 600px; margin-bottom: 32px; }
.home-hero__cta { display: flex; gap: 16px; flex-wrap: wrap; }

.page-hero { position: relative; background: var(--blue-900); overflow: hidden; }
.page-hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.25; }
.page-hero__content { position: relative; z-index: 2; padding: 60px 0 50px; }

.species-hero { position: relative; background: var(--blue-900); color: var(--white); overflow: hidden; }
.species-hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.4; }
.species-hero__content { position: relative; z-index: 2; padding: 80px 0 60px; }
.species-hero__breadcrumb { font-size: 0.85rem; opacity: 0.8; margin-bottom: 16px; }
.species-hero__breadcrumb a { color: var(--blue-400); }
.species-hero__title { font-size: 3rem; font-family: var(--font-serif); margin-bottom: 8px; }
.species-hero__latin { font-style: italic; font-size: 1.3rem; opacity: 0.7; font-family: var(--font-serif); }

/* -- Sections communes ------------------------------------ */
.section-title { font-family: var(--font-serif); font-size: 2rem; text-align: center; margin-bottom: 8px; }
.section-subtitle { text-align: center; color: var(--gray-500); margin-bottom: 40px; font-size: 1.05rem; }

.home-guides { padding: 72px 0; background: var(--white); }

.guides-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.guide-card { display: flex; align-items: flex-start; gap: 16px; padding: 24px; background: var(--gray-50); border-radius: var(--radius-md); border: 1px solid var(--gray-100); transition: all 0.2s; }
.guide-card:hover { border-color: var(--blue-400); background: var(--blue-50); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.guide-card--dark { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.12); }
.guide-card--dark:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.25); }
.guide-card--dark .guide-card__title { color: var(--white); }
.guide-card--dark .guide-card__desc { color: rgba(255,255,255,0.7); }
.guide-card__icon { font-size: 2rem; flex-shrink: 0; }
.guide-card__title { font-weight: 600; font-size: 0.95rem; color: var(--gray-900); margin-bottom: 4px; }
.guide-card__desc { font-size: 0.85rem; color: var(--gray-500); line-height: 1.5; }

/* -- Species grid ----------------------------------------- */
.home-species { padding: 72px 0; background: var(--sand-50); }
.species-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.species-grid--home { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.species-card { background: var(--white); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--gray-100); transition: all 0.2s; }
.species-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-400); }
.species-card__img { width: 100%; height: 160px; object-fit: cover; background: var(--blue-100); }
.species-card__body { padding: 14px 16px; }
.species-card__name { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.species-card__meta { font-style: italic; font-size: 0.8rem; color: var(--gray-500); margin-bottom: 8px; }
.species-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* -- Species Quick Facts ---------------------------------- */
.species-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--gray-100); border-radius: var(--radius-md); overflow: hidden; margin: -30px 24px 0; position: relative; z-index: 3; box-shadow: var(--shadow-lg); }
.species-fact { background: var(--white); padding: 20px; text-align: center; }
.species-fact__icon { font-size: 1.5rem; margin-bottom: 6px; }
.species-fact__label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-500); margin-bottom: 4px; }
.species-fact__value { font-size: 0.95rem; font-weight: 600; color: var(--gray-900); }

/* -- Species content layout ------------------------------- */
.species-content { display: grid; grid-template-columns: 1fr 320px; gap: 48px; padding: 48px 0 80px; }
.species-main h2 { padding-bottom: 8px; border-bottom: 2px solid var(--blue-100); }
.species-main h3 { color: var(--blue-800); }
.species-main ul { padding-left: 1.5rem; }
.species-main li { margin-bottom: 0.5rem; }

/* -- Sidebar ---------------------------------------------- */
.species-sidebar { position: sticky; top: 90px; align-self: start; }
.sidebar-card { background: var(--white); border-radius: var(--radius-md); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); }
.sidebar-card__title { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--blue-100); }
.origin-card { background: linear-gradient(135deg, var(--blue-100), var(--sand-100)); border: 1px solid var(--blue-400); }
.origin-card__map { width: 100%; height: 150px; border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--gray-100); overflow: hidden; }
.origin-card__link { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--blue-700); color: var(--white); border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; margin-top: 10px; transition: background 0.2s; }
.origin-card__link:hover { background: var(--blue-600); color: var(--white); }
.tp-card-sidebar__link { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--blue-700); color: var(--white); border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; margin-top: 10px; transition: background 0.2s; }
.tp-card-sidebar__link:hover { background: var(--blue-600); color: var(--white); }

/* -- Network section -------------------------------------- */
.home-network { background: var(--blue-900); padding: 64px 0; }
.network-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 40px; }
.network-card { background: rgba(255,255,255,0.08); border-radius: var(--radius-md); padding: 20px; display: flex; flex-direction: column; gap: 6px; border: 1px solid rgba(255,255,255,0.12); transition: all 0.2s; }
.network-card:hover { background: rgba(255,255,255,0.15); transform: translateY(-2px); }
.network-card__icon { font-size: 1.8rem; }
.network-card__name { font-weight: 700; color: var(--white); font-size: 0.95rem; }
.network-card__desc { font-size: 0.8rem; color: var(--sand-300); line-height: 1.4; }

/* -- Footer ----------------------------------------------- */
.site-footer { background: var(--blue-900); color: var(--sand-300); padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-col__title { font-family: var(--font-serif); color: var(--white); font-size: 1.1rem; margin-bottom: 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: var(--sand-300); font-size: 0.9rem; }
.footer-col a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; font-size: 0.85rem; color: var(--gray-500); }

/* -- About section ---------------------------------------- */
.home-about { padding: 72px 0; background: var(--white); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-text h2 { margin-top: 0; }
.about-image { text-align: center; }

/* -- Related species -------------------------------------- */
.related-species { background: var(--sand-50); padding: 64px 0; }
.related-species__title { font-family: var(--font-serif); font-size: 1.8rem; margin-bottom: 32px; }

/* -- Child pages listing ---------------------------------- */
.child-pages { margin-top: 48px; padding-top: 32px; border-top: 2px solid var(--gray-100); }
.child-pages h2 { margin-top: 0; }
.child-pages__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.child-page-card { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: var(--radius-md); transition: all 0.2s; }
.child-page-card:hover { background: var(--blue-50); border-color: var(--blue-400); }
.child-page-card__img { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.child-page-card__img--empty { background: var(--blue-100); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; border-radius: var(--radius-sm); width: 44px; height: 44px; }
.child-page-card__title { font-size: 0.9rem; font-weight: 600; color: var(--gray-900); }

/* -- Post/Blog content ------------------------------------ */
.post-entry h2 { font-size: 1.5rem; }
.post-entry h3 { font-size: 1.2rem; }
.post-entry img { border-radius: var(--radius-sm); margin: 20px 0; }
.post-entry a { color: var(--blue-700); text-decoration: underline; }
.post-entry table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.post-entry th, .post-entry td { padding: 10px 14px; border: 1px solid var(--gray-100); text-align: left; }
.post-entry th { background: var(--blue-50); font-weight: 600; }

/* -- Blog listing ----------------------------------------- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; margin-top: 32px; }
.blog-card { background: var(--white); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--gray-100); transition: all 0.2s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-400); }
.blog-card__img { width: 100%; height: 200px; object-fit: cover; }
.blog-card__body { padding: 20px; }
.blog-card__title { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; color: var(--gray-900); }
.blog-card__meta { font-size: 0.8rem; color: var(--gray-500); margin-bottom: 10px; }
.blog-card__excerpt { font-size: 0.9rem; color: var(--gray-700); line-height: 1.6; }

/* -- Affi cards ------------------------------------------- */
.affi-card { display: flex; gap: 20px; align-items: flex-start; padding: 20px; background: linear-gradient(135deg, var(--sand-100), var(--blue-50)); border-radius: var(--radius-md); border: 1px solid var(--blue-100); margin: 24px 0; }
.affi-card img { width: 100px; height: 100px; object-fit: contain; flex-shrink: 0; border-radius: var(--radius-sm); background: var(--white); padding: 8px; }
.affi-card__body { flex: 1; }
.affi-card__title { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.affi-card__desc { font-size: 0.9rem; color: var(--gray-700); margin-bottom: 12px; }
.affi-card__btn { display: inline-block; padding: 8px 18px; background: #ff9900; color: var(--white); border-radius: 20px; font-size: 0.85rem; font-weight: 700; }
.affi-card__btn:hover { background: #e88a00; color: var(--white); }

/* -- Responsive ------------------------------------------- */
@media (max-width: 900px) {
  .species-content { grid-template-columns: 1fr; }
  .species-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .about-image { display: none; }
}
@media (max-width: 680px) {
  .site-nav { display: none; position: fixed; inset: 0; top: 70px; background: var(--white); padding: 24px; overflow-y: auto; z-index: 99; }
  .site-nav.active { display: block; }
  .site-nav > ul { flex-direction: column; gap: 4px; }
  .site-nav .sub-menu { display: block; position: static; box-shadow: none; border: none; padding: 0 0 0 16px; }
  .nav-toggle { display: block; }
  .home-hero__title { font-size: 2.2rem; }
  .species-hero__title { font-size: 2.2rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .species-facts { grid-template-columns: repeat(2, 1fr); margin: -20px 12px 0; }
  .affi-card { flex-direction: column; }
  .affi-card img { width: 100%; height: 160px; }
}
