/*
Theme Name: Nikon Passion v2
Description: Thème enfant basé sur GeneratePress pour Nikon Passion - Site de référence pour la photographie Nikon
Author: Nikon Passion
Author URI: https://www.nikonpassion.com
Template: generatepress
Version: 1.1.2
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: np
Tags: photographie, nikon, news, blog
*/

/* ==========================================================================
   IMPORTS CSS - VARIABLES NIKON PASSION
   ========================================================================== */

/* Import des variables CSS dans l'ordre de priorité */
@import url('css/variables-theme.css');

/* Import des styles pour les shortcodes */
@import url('css/components/components.css');

/* Habillage homepage */
@import url('css/habillage.css');

/* Import des styles pour les tableaux */
@import url('css/components/tables.css');

/* Import des styles pour les publicités */
@import url('css/components/ads.css');

/* Import des styles pour les tags */
@import url('css/components/tags.css');

/* Import des styles responsive (mobile & tablet) */
@import url('css/responsive.css');


/* ==========================================================================
   TYPOGRAPHIE - POLICES NIKON PASSION
   ========================================================================== */

/* Import des polices Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200;300;400;500;600;700&family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');


/* Application des polices */
body {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  line-height: 32px;
  color: var(--text-primary);
}

/* Titres avec Oswald */
h1, h2, h3, h4, h5, h6,
.site-title,
.entry-title,
.widget-title,
.page-title {
  font-family: "Oswald", Helvetica, Arial, sans-serif;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-primary);
}

/* Base typography scale (desktop-first) */

.h1 {
  font-size: 42px !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  margin-bottom: 0.8em !important;
}

.h2 {
  font-size: 35px !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  margin-bottom: 0.75em !important;
}

.h3 {
  font-size: 28px !important;
  line-height: 1.4 !important;
  font-weight: 600 !important;
  margin-bottom: 0.7em !important;
}

.h4 {
  font-size: 22px !important;
  line-height: 1.45 !important;
  font-weight: 600 !important;
  margin-bottom: 0.6em !important;
}

.h5 {
  font-size: 18px !important;
  line-height: 1.5 !important;
  font-weight: 600 !important;
  margin-bottom: 0.5em !important;
}

.h6 {
  font-size: 16px !important;
  line-height: 1.6 !important;
  font-weight: 600 !important;
  margin-bottom: 0.4em !important;
}

.p {
  font-size: 17px !important;
  line-height: 1.7 !important;
  font-weight: 400 !important;
  margin-bottom: 1.1em !important;
}

/* Optional small text and meta */
.small {
  font-size: 14px !important;
  line-height: 1.6 !important;
  font-weight: 400 !important;
  opacity: 0.85 !important;
}

/* Tablet (≤768px) */
@media (max-width: 768px) {
  body { font-size: 1rem; }              /* 16px */
  h1 { font-size: 2.25rem; }             /* 36px */
  h2 { font-size: 1.875rem; }            /* 30px */
  h3 { font-size: 1.5rem; }              /* 24px */
  h4 { font-size: 1.25rem; }             /* 20px */
  h5 { font-size: 1.125rem; }            /* 18px */
  h6 { font-size: 1rem; }                /* 16px */
}

/* Mobile (≤580px) */
@media (max-width: 580px) {
  body { font-size: 0.9375rem; }         /* 15px */
  h1 { font-size: 1.875rem; }            /* 30px */
  h2 { font-size: 1.5rem; }              /* 24px */
  h3 { font-size: 1.25rem; }             /* 20px */
  h4 { font-size: 1.125rem; }            /* 18px */
  h5 { font-size: 1rem; }                /* 16px */
  h6 { font-size: 0.875rem; }            /* 14px */
}

blockquote {
  border-color: color-mix(in srgb, var(--np-red-lighter) 80%, white) !important;
}

/* Navigation */
.main-navigation,
.mobile-menu-control-wrapper,
.menu-toggle {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 1em;
  text-transform: uppercase;
}
  
.main-navigation .main-nav ul li a {
  padding-left: 10px;
  padding-right: 10px;
  line-height: 40px;
}

/* Boutons */
.button,
.wp-block-button__link,
input[type="submit"],
button {
  font-family: "Oswald", Helvetica, Arial, sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wp-block-quote {
  font-size: 1.1rem !important;
  line-height: 2rem !important;
}

/* ==========================================================================
   COULEURS DE BASE
   ========================================================================== */

/* Liens */
a {
  color: var(--np-red);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover,
a:focus {
  color: var(--np-red);
  text-decoration: underline;
}

::selection {
  background: color-mix(in srgb, var(--np-red-lighter), transparent 50%);
  background: var(--np-red-lighter);
  color: var(--neutral-white);
}


/* Boutons primaires */
.button,
.wp-block-button__link,
input[type="submit"],
button {
  background-color: var(--np-red);
  color: var(--neutral-white);
  border: none;
  padding: 12px 24px;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.button:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover,
button:hover {
  background-color: var(--np-red-dark);
  color: var(--neutral-white);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Boutons secondaires */
.button.secondary {
  background-color: var(--np-yellow);
  color: var(--text-primary);
}

.button.secondary:hover {
  background-color: var(--np-yellow-dark);
  color: var(--neutral-white);
}

/* ==========================================================================
   MAIN MENU
   ========================================================================== */

/* header/menu white bg */
.site-header {
  background-color: var(--neutral-light) !important;
}

.site-header {
  background-color: var(--neutral-white);
  border-bottom: 1px solid var(--neutral-medium);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Shadow effect when scrolled */
.site-header.scrolled {
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--header-shadow);
}

/** links **/
.main-navigation a {
  font-weight: 500 !important;
  color: var(--text-primary-light) !important;
  line-height: 25px !important;
  text-decoration: none !important;
  transition: text-shadow .15s ease;
}

/** hover categorycolors **/
/* Ensure top-level menu links pick a category (or default) color unless their <li> is .highlight */
.main-navigation li:not(.highlight) > a:hover,
.main-navigation li:not(.highlight) > a:focus {
  color: var(--text-primary) !important;
}

/* Category-specific colors for top-level items (skip when .highlight is present) */
.main-navigation li.category-actualites:not(.highlight) > a:hover,
.main-navigation li.category-actualites:not(.highlight) > a:focus {
  color: var(--category-actualites) !important;
}

.main-navigation li.category-tests:not(.highlight) > a:hover,
.main-navigation li.category-tests:not(.highlight) > a:focus {
  color: var(--category-tests) !important;
}

.main-navigation li.category-guides-achat:not(.highlight) > a:hover,
.main-navigation li.category-guides-achat:not(.highlight) > a:focus {
  color: var(--category-guides-achat) !important;
}

.main-navigation li.category-tutoriels:not(.highlight) > a:hover,
.main-navigation li.category-tutoriels:not(.highlight) > a:focus {
  color: var(--category-tutoriels) !important;
}

/** flyout submenu shadow **/
.main-navigation ul.sub-menu {
  padding: 1rem 2rem 1rem calc(1rem + 22px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.075) !important;
  background-color: var(--neutral-light) !important;
  border: 1px solid var(--neutral-medium) !important;
  border-radius: 6px;
  overflow: hidden;
}

/* decorative left stripe: 1px wide, 10px tall, 10px from top */
.main-navigation ul.sub-menu::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 28px;
  width: 2px;
  height: 20px;
  border-radius: 1px;
  background: linear-gradient(180deg, var(--category-actualites, var(--np-red)) 0%, var(--np-red-light, var(--np-red)) 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: transform .25s ease, opacity .2s ease;
}

/* Category-specific stripe color overrides for submenu decorative bar */
.main-navigation li.category-actualites > .sub-menu::before {
  background: linear-gradient(180deg, var(--category-actualites, var(--np-red)) 0%, color-mix(in srgb, var(--category-actualites, var(--np-red)) 75%, white) 100%);
}

.main-navigation li.category-tests > .sub-menu::before {
  background: linear-gradient(180deg, var(--category-tests, var(--np-red)) 0%, color-mix(in srgb, var(--category-tests, var(--np-red)) 75%, white) 100%);
}

.main-navigation li.category-guides-achat > .sub-menu::before {
  background: linear-gradient(180deg, var(--category-guides-achat, var(--np-red)) 0%, color-mix(in srgb, var(--category-guides-achat, var(--np-red)) 75%, white) 100%);
}

.main-navigation li.category-tutoriels > .sub-menu::before {
  background: linear-gradient(180deg, var(--category-tutoriels, var(--np-red)) 0%, color-mix(in srgb, var(--category-tutoriels, var(--np-red)) 75%, white) 100%);
}

/* subtle hover emphasis for the stripe */
.sub-menu:hover::before {
  transform: scaleY(1.15);
  opacity: 0.95;
}

/** flyout submenu links **/
.main-navigation .sub-menu li a {
  line-height: 25px !important;
  font-size: 14px !important;
  display: block;
  padding: 0.5rem 0.75rem !important;
  background-color: transparent; /* ensure smooth bg transition */
  transform: translateX(0) !important; /* baseline so transform is animatable */
  transition: background-color 200ms cubic-bezier(.4,0,.2,1), transform 120ms cubic-bezier(.4,0,.2,1) !important; /* FORCE transition */
  will-change: transform, background-color;
}

/* submenu right shift on hover */
.main-navigation .sub-menu li a:hover {
  transform: translateX(var(--np-submenu-shift)) !important;
}

/* Force vertical align in menu */
.main-navigation > li.menu-item > a {
  display: flex;
  align-items: center;
}

.main-navigation > li.menu-item.highlight {
  margin-left: 0.2rem !important;
}

.main-navigation li.highlight > a {
  background: linear-gradient(135deg, var(--np-red) 0%, var(--np-red-light) 100%) !important;
  color: var(--neutral-white) !important;
  padding: 6px 12px !important;
  border-radius: 999px !important;
  line-height: 1.2 !important;
  display: inline-flex !important;
  align-items: center;
  font-weight: 600 !important;
  position: relative;
  transition: background .75s ease, transform .75s ease, box-shadow .75s ease;
  text-decoration: none !important;
  isolation: isolate;
  opacity: 0.8 !important;
  border: 1px solid var(--np-red) !important;
}

.main-navigation li.highlight:not(:first-of-type) > a {
  margin-left: 10px !important;
}

.main-navigation li.highlight:not(:last-of-type) > a {
  margin-right: 10px !important;
}

.main-navigation li.highlight > a:hover,
.main-navigation li.highlight > a:focus {
  background: linear-gradient(135deg, var(--np-red-light) 0%, var(--np-red) 100%) !important;
  box-shadow: 0 6px 16px rgba(196, 24, 7, 0.15);
  text-decoration: none !important;
}

/* Reduce caret padding */
.main-navigation .dropdown-menu-toggle {
    padding-right: 10px !important; /* default 20px */
    padding-left: 5px !important; /* default 10px */
}

/* Optional star icon */
/* #mega-menu-primary li.highlight > a.mega-menu-link::before, #mega-menu-primary li.mega-highlight > a.mega-menu-link::before { content: "★"; font-size: 14px; opacity: .9; } */
/* To add a star icon: uncomment below */
/* li.highlight > a.mega-menu-link::before, li.mega-highlight > a.mega-menu-link::before { content: "★"; font-size: 14px; opacity: .9; } */


/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background-color: var(--neutral-white);
  border-top: 1px solid var(--neutral-medium);
    box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--footer-shadow);
  padding: 2rem 0;
}

/* Make the 3 widgets layout properly */
.inside-footer-widgets {
  display: grid;
  grid-template-columns: 0.75fr 1fr 2fr 2fr;  /* col1 / col2 / col3 / col4 */
  line-height: 1.6;
}

/* Force font for headers */
.inside-footer-widgets > *{
  font-family: "Inter", sans-serif !important;
}


/* Footer headers with red underline (widgets 2 & 3) */
.footer-header {
  display: inline-block;
  color: var(--text-primary-lighter);
  position: relative;
  padding-bottom: 4px;
  background-image: linear-gradient(90deg, var(--np-red-lighter) 0%, var(--np-red-light) 100%);
  background-repeat: no-repeat;
  background-size: 60% 3px;
  background-position: left bottom;
  transition: background-size .35s cubic-bezier(.2,.8,.2,1);
}

.footer-header strong {
  font-weight: 500 !important;
  font-size: 22px !important;
}

/* Column 1 with logo */
.footer-col1 {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 4rem;
}

.footer-logo {
  max-width: 80px;
  height: auto;
  display: block;
}

/* Column 2 */
.footer-widget-3 ul.menu {
  column-count: 2;
  column-gap: 2rem;
  line-height: 1.4;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-widget-3 ul li ul.menu > li {
  break-inside: avoid; margin-bottom: .75rem;
}

/* submenu */
.footer-widget-3 ul li ul.sub-menu li a {
  font-size: 1rem;
  color: var(--text-primary-lighter) !important;
}
.footer-widget-3 ul.sub-menu li {
  margin: .25rem 0;
}

/* Links style (col1+2) */
.footer-widget-3 ul.menu li a,
.menu-menu-footer-container li a {
  font-weight: 400;
  font-size: 1rem;
  text-decoration: none;
  color: var(--text-primary-light) !important;
  transition: color .2s ease;
}
.footer-widget-3 ul.menu li a:hover,
.footer-links li a:hover {
  font-weight: 500;
  color: var(--np-red) !important;
}


/* ==========================================================================
   hr separators
   ========================================================================== */

hr.np-separator, hr.wp-block-separator {
  border: none;
  border-top: 1px solid var(--neutral-medium);
  margin: 48px auto;
  width: 50%;
}

hr.np-separator-large {
  width: 75% !important;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
/* Main flex layout */
.np-layout-container {
  display: flex;
  justify-content: center;
  gap: 6rem;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: visible;
}

/* Main content */
.np-layout-main,
.site-main {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

/* Sidebar */
.np-layout-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------
   Normalize article inner width
   Ensures all inner blocks (.inside-article, .entry-content, etc.)
   stay centered within the main column at a consistent width,
   regardless of WordPress container variations (816px, 948px, etc.)
--------------------------------------------- */
.np-layout-main > * {
  max-width: 948px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Gutenberg & WordPress content fixes --- */

/* prevent child blocks from escaping */
.np-layout-main .inside-article,
.np-layout-main .entry-content,
.np-layout-main .featured-image,
.np-layout-main .grid-container,
.np-layout-main .aligncenter,
.np-layout-main figure,
.np-layout-main img,
.np-layout-main iframe {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* images should scale inside */
.np-layout-main img {
  width: 100%;
  height: auto;
  display: block;
}



/* ==========================================================================
   RESPONSIVE - MOBILE FIRST
   ========================================================================== */

.site-logo img {
  width: 65%;
}

/* wp components overrides */
.components-datetime__time-field-day {
  margin-bottom: 0 !important;
}


/* GeneratePress overrides*/
.site-main .wp-block-group__inner-container {
  padding: 0 !important;
  width: 100% !important;
}

/* hotfix to match homepage inner-container set to 1280px by generate press */
/* .content-area {
  width: 1280px !important;
  margin: 0 auto;
} */

.nav-float-right #site-navigation {
  margin-left: unset !important;
}

:where(.wp-block-group.has-background) {
  /* padding: 1.25em 2.375em; */ /* default */
  padding: 0 !important;
}

/* ==========================================================================
   SEARCH BLOCK CUSTOMIZATION - JAVASCRIPT OVERLAY APPROACH
   ========================================================================== */

/* Hide the default WordPress search input completely */
.wp-block-search__input {
  display: none !important;
}

/* Style the search button only */
.wp-block-search__button {
  position: relative;
  background-color: #f8fafc !important;
  color: #64748b !important;
  border: 1px solid #e1e5e9 !important;
  border-radius: 12px !important;
  padding: 10px !important;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0 !important;
  text-indent: -9999px;
  overflow: hidden;
}

/* Add magnifying glass SVG */
.wp-block-search__button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2364748b' width='24' height='24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-4.35-4.35m1.75-5.4a7.5 7.5 0 11-15 0 7.5 7.5 0 0115 0z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Button hover state */
.wp-block-search__button:hover {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

/* Custom overlay search input created by JavaScript */
.np-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.np-search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.np-search-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 20px;
  width: 90%;
  max-width: 600px;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.np-search-overlay.active .np-search-container {
  transform: translateY(0);
}

.np-search-form {
  display: flex;
  gap: 0;
}

.np-search-input {
  flex: 1;
  padding: 16px 20px;
  border: 1px solid #e1e5e9;
  border-radius: 12px 0 0 12px;
  font-size: 16px;
  outline: none;
  border-right: none;
}

.np-search-input:focus {
  border-color: var(--np-red);
  box-shadow: 0 0 0 3px rgba(196, 24, 7, 0.1);
}

.np-search-submit {
  background: var(--np-red);
  color: white;
  border: 1px solid var(--np-red);
  border-radius: 0 12px 12px 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.np-search-submit .search-text {
  display: none;
}

.np-search-submit .search-icon {
  display: block;
  width: 20px;
  height: 20px;
}

@media (min-width: 581px) {
  .np-search-submit .search-text {
    display: block;
  }

  .np-search-submit .search-icon {
    display: none;
  }
}

.np-search-submit:hover {
  background: var(--np-red-dark);
}

.np-search-close {
  display: none; /* hide until eventually needed */

  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 5px;
  line-height: 1;
}

.np-search-close:hover {
  color: #333;
}


/* ==========================================================================
   GENERATEPRESS OVERRIDES
   ========================================================================== */
.comments-area {
  margin-top: 40px !important;
}

/* 
 * ForgetAboutShortcodes buttons overrides
 */
 
.fasc-button {
  display: inline-block !important;
  font-family: "Oswald", Helvetica, Arial, sans-serif !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  border-radius: 6px !important;
  transition: all 0.3s ease !important;
  border: 2px solid transparent !important;
  cursor: pointer !important;
  text-align: center !important;
  line-height: 1 !important;

  /* btn medium */
  padding: 0.75rem 1.5rem !important;
  font-size: 0.9rem !important;

  /* btn primary */
  background: var(--np-red-light) !important;
  color: var(--neutral-white) !important;
  border-color: var(--np-red-light) !important;
}

.fasc-button:hover {
  text-decoration: none !important;
  transform: translateY(-2px) !important;

  /* btn primary */
  background: var(--np-red) !important;
  border-color: var(--np-red) !important;
  color: white !important;
}


@media (max-width: 580px) {
  .fasc-button {
    padding: 0.625rem 1.25rem !important;
    font-size: 0.85rem !important;
  }
}

/* ==========================================================================
   Category buttons
   ========================================================================== */


/* Category buttons */
.np-button-category {
  background: color-mix(in srgb, var(--np-red) 75%, rgb(255, 255, 255));
  color: var(--neutral-white);
  border: 1px solid var(--np-red);
  display: inline-flex;
  align-items: center;
  color: var(--neutral-white);
  text-decoration: none;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease, opacity .25s ease;
  cursor: pointer;
}

.np-button-category-medium {
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.25rem;
}
.np-button-category-small {
  border-radius: 6px;
  padding: 0.3754rem 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.15rem;
}

.np-button-category:hover, .np-button-category:focus {
  color: var(--neutral-white);
  border-color: color-mix(in srgb, var(--np-red) 75%, rgb(255, 255, 255));
  background: color-mix(in srgb, var(--np-red) 70%, rgb(255, 255, 255));
  text-decoration: none;
}

/*
 * Stylish pages header underline
 */
.entry-title {
  margin-bottom: 1rem;
}

.entry-title,
.entry-title a,
.np-underline,
.np-underline a
 {
  display: inline-block;
  position: relative;
  padding-bottom: 6px;
  background-image: linear-gradient(90deg, var(--np-red-lighter) 0%, var(--np-red-light) 100%);
  background-repeat: no-repeat;
  background-size: 0% 3px;
  background-position: left bottom;
  transition: background-size .35s cubic-bezier(.2,.8,.2,1);
  text-decoration: none;
  color: inherit;
  background-size: 60% 3px;
}

.entry-title:hover,
.entry-title:focus,
.entry-title a:hover,
.entry-title a:focus,
.np-underline:hover,
.np-underline:focus,
.np-underline a:hover,
.np-underline a:focus {
  background-size: 40% 3px;
}

/* Enhanced animated underline (draw + slide) while keeping existing background effect */
.np-underline,
.np-underline a {
  background-image: none; /* neutralize gradient for ::after driven variant */
}

.np-underline,
.np-underline a {
  overflow: hidden; /* clip animated line */
}

.np-underline::after,
.np-underline a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-color, var(--np-red-lighter)) 0%, var(--accent-color, var(--np-red-light)) 100%);
  transform: scaleX(.55);
  transform-origin: left center;
  transition: transform .5s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

.np-underline:hover::after,
.np-underline:focus::after,
.np-underline a:hover::after,
.np-underline a:focus::after {
  transform: scaleX(1);
}

/* ==========================================================================
   Quote (articles excerpt & category description)
   ========================================================================== */


/* Post Excerpt Styling */
.np-excerpt {
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--neutral-medium);
  padding-left: 1rem;
  color: var(--text-primary-lighter) !important;
  margin-left: 12px;
}

.meta-excerpt {
  font-size: 19px;
  line-height: 1.5;
  color: #706b6b;
  margin: 8px 0;
}

/* ==========================================================================
   SINGLE POST (ARTICLES) IMAGES - STYLING
   ========================================================================== */
/* Styles pour toutes les images des articles (une seule règle générique) */
.single .inside-article img,
.page .featured-image img,
.page .inside-article img,
.single .featured-image img {
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform .6s cubic-bezier(.4,0,.2,1), box-shadow .3s ease;
}

.single .featured-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 512px;
  object-fit: cover;
}

.page .featured-image img {
  margin: 8px auto;
  display: flex;
  justify-content: center;
}

/* Effet hover (appliqué à toutes les images de l'article + featured) */
.single .inside-article img:hover,
.single .featured-image img:hover,
.page .inside-article img:hover,
.page .featured-image img:hover {
  transform: scale(1.035);
  border-radius: 8px;
}


/**
  * Special case for pages: 
  * - hide the featured image
  * - force content centered to 830px
  */
body.page:not(.home) .inside-article {
  max-width: 830px;
  margin: 0 auto;
}

body.page:not(.home) .inside-article p,
body.page:not(.home) .inside-article figure {
 display: block;
  width: 100%;
  height: auto;
}



 
/* Hide the very first inline image (and its direct wrapping p or figure) inside the article body */
/* @note trick to temporary hide duplicated images */
/* .single .inside-article .entry-content > p:first-of-type:has(img),
.single .inside-article .entry-content > figure:first-of-type:has(img),
.single .inside-article .entry-content > .wp-block-image:first-of-type,
.single .inside-article .entry-content > p:first-of-type img:first-of-type,
.single .inside-article .entry-content > figure:first-of-type img:first-of-type, */
/* Deep layout variant (e.g., #post-ID > ... > .np-article-body-layout ...) */
/* .single .inside-article .np-article-body-layout figure:first-of-type,
.single .inside-article .np-article-body-layout figure:first-of-type img,
.single .inside-article .np-article-body-layout img:first-of-type {
  display: none !important;
} */

/* Fallback: hide very first image inside .entry-content even if not wrapped in first element */
/* .single .inside-article .entry-content img:first-of-type { 
  display: none !important; 
} */
/* Also hide its direct wrapping paragraph if it only contains that image */
/* .single .inside-article .entry-content p:has(> img:first-of-type:only-child) { 
  display: none !important; 
} */

/* ==========================================================================
   CAPTIONS
   ========================================================================== */
.wp-caption-text,
.wp-block-image figcaption,
figure figcaption {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary-light);
  margin-top: 0.5rem;
  text-align: center;
}
/* --------------------------------------------------------------------------
   FORMS - SUBMIT ALIGNMENT OVERRIDES (ensure right alignment)
   Added later for higher specificity and to fix layout conflicts
--------------------------------------------------------------------------- */
form.contact-form .submit,
form.wpcf7-form .submit {
  width: 100%;
}
form.contact-form .submit p,
form.wpcf7-form .submit p {
  margin: 0 !important;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .5rem;
}
form.contact-form .submit input[type="submit"],
form.wpcf7-form .submit input[type="submit"] {
  margin-left: 0; /* alignment driven by flex container */
}
@media (max-width: 640px) {
  form.contact-form .submit p,
  form.wpcf7-form .submit p { justify-content: stretch !important; }
  form.contact-form .submit input[type="submit"],
  form.wpcf7-form .submit input[type="submit"] {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   FINAL SUBMIT ALIGN + STATE FIXES
   Fallback right alignment (text-align) + focus/active color consistency
--------------------------------------------------------------------------- */
form.contact-form .submit p,
form.wpcf7-form .submit p {
  text-align: right; /* fallback if flex fails */
}
form.contact-form .submit p input[type="submit"],
form.wpcf7-form .submit p input[type="submit"] {
  background: var(--np-red);
  border: 1px solid var(--np-red);
}
form.contact-form .submit p input[type="submit"]:hover,
form.wpcf7-form .submit p input[type="submit"]:hover {
  background: var(--np-red-dark);
  border-color: var(--np-red-dark);
  color: var(--neutral-white);
}
form.contact-form .submit p input[type="submit"]:focus,
form.wpcf7-form .submit p input[type="submit"]:focus,
form.contact-form .submit p input[type="submit"]:active,
form.wpcf7-form .submit p input[type="submit"]:active {
  background: var(--np-red) !important;
  border-color: var(--np-red) !important;
  color: var(--neutral-white) !important;
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--np-red) 30%, transparent);
}
@media (max-width: 640px) {
  form.contact-form .submit p,
  form.wpcf7-form .submit p { text-align: center; }
}

/* ==========================================================================
   FORMS - GENERIC & CONTACT FORM
   ========================================================================== */
/* Wrapper layout */
.form,
.contact-form {
  --form-bg: var(--neutral-light);
  --form-bg-alt: var(--neutral-white);
  --form-border: var(--neutral-medium);
  --form-border-focus: var(--np-red);
  --form-border-error: var(--np-red-dark);
  --form-border-success: var(--np-red-light);
  --form-radius: 8px;
  --form-shadow-focus: 0 0 0 3px color-mix(in srgb, var(--np-red) 30%, transparent);
  --form-shadow-error: 0 0 0 3px color-mix(in srgb, var(--np-red) 55%, transparent);
  --form-shadow-success: 0 0 0 3px color-mix(in srgb, var(--np-red-light) 55%, transparent);

  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 720px;
  margin: 2.5rem auto;
  padding: 2rem clamp(1rem, 3vw, 2.25rem);
  background: linear-gradient(180deg, var(--form-bg) 0%, color-mix(in srgb, var(--form-bg) 92%, white) 100%);
  border: 1px solid var(--form-border);
  border-radius: var(--form-radius);
  box-shadow: 0 4px 10px -2px rgba(0,0,0,.04), 0 2px 4px -2px rgba(0,0,0,.04);
}

/* Field grouping */
.form .field,
.contact-form .field {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  position: relative;
}

/* Inline variant */
.form .field-inline,
.contact-form .field-inline {
  flex-direction: row;
  align-items: flex-start;
  gap: 1.25rem;
}

/* Labels */
.form label,
.contact-form label {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: .25px;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.form label .required,
.contact-form label .required {
  color: var(--np-red);
  font-weight: 700;
}

/* Help / description text */
.form .field-help,
.contact-form .field-help {
  font-size: .8rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin-top: -.25rem;
}

/* Inputs */
.form input[type="text"],
.form input[type="email"],
.form input[type="url"],
.form input[type="tel"],
.form input[type="number"],
.form input[type="search"],
.form input[type="password"],
.form select,
.form textarea,
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="url"],
.contact-form input[type="tel"],
.contact-form input[type="number"],
.contact-form input[type="search"],
.contact-form input[type="password"],
.contact-form select,
.contact-form textarea {
  appearance: none;
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 0.875rem 1rem;
  border: 1px solid var(--form-border);
  border-radius: 6px;
  background: var(--form-bg-alt);
  color: var(--text-primary);
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease, color .25s ease;
}

.form textarea,
.contact-form textarea {
  min-height: 160px;
  resize: vertical;
}

/* Placeholder */
.form ::placeholder,
.contact-form ::placeholder {
  color: var(--text-primary-light);
  opacity: .65;
}

/* Focus */
.form input:focus,
.form textarea:focus,
.form select:focus,
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: var(--form-border-focus);
  background: var(--neutral-white);
  box-shadow: var(--form-shadow-focus);
}

/* Checkbox / radio wrapper alignment */
.form .options,
.contact-form .options {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .25rem;
}

.form .options label,
.contact-form .options label {
  font-weight: 500;
  font-size: .9rem;
  line-height: 1.3;
  cursor: pointer;
}

/* States: error */
.form .is-error input,
.form .is-error textarea,
.form .is-error select,
.contact-form .is-error input,
.contact-form .is-error textarea,
.contact-form .is-error select {
  border-color: var(--form-border-error) !important;
  box-shadow: var(--form-shadow-error) !important;
}

.form .error-message,
.contact-form .error-message {
  font-size: .75rem;
  font-weight: 600;
  color: var(--form-border-error);
  margin-top: .25rem;
}

/* States: success */
.form .is-success input,
.form .is-success textarea,
.form .is-success select,
.contact-form .is-success input,
.contact-form .is-success textarea,
.contact-form .is-success select {
  border-color: var(--form-border-success) !important;
  box-shadow: var(--form-shadow-success) !important;
}

.form .success-message,
.contact-form .success-message {
  font-size: .75rem;
  font-weight: 600;
  color: var(--np-red-light);
  margin-top: .25rem;
}

/* Actions (buttons) */
.form .actions,
.contact-form .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: .5rem;
  align-items: center;
}

.form .actions .button,
.form .actions button,
.contact-form .actions .button,
.contact-form .actions button {
  min-width: 180px;
  justify-content: center;
}

/* Compact variant */
.form.is-compact,
.contact-form.is-compact {
  padding: 1.25rem 1.25rem 1.5rem;
  gap: 1rem;
}

.form.is-compact input,
.form.is-compact textarea,
.contact-form.is-compact input,
.contact-form.is-compact textarea {
  padding: .65rem .85rem;
  font-size: .9rem;
}

/* Loading state */
.form.is-loading,
.contact-form.is-loading {
  opacity: .75;
  pointer-events: none;
}

/* Progress bar (optional) */
.form .progress,
.contact-form .progress {
  position: relative;
  height: 6px;
  background: var(--neutral-medium);
  border-radius: 3px;
  overflow: hidden;
  margin-top: .5rem;
}

.form .progress::after,
.contact-form .progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--np-red-lighter) 0%, var(--np-red) 100%);
  width: var(--progress, 0%);
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .form,
  .contact-form {
    padding: 1.25rem 1rem 1.75rem;
    margin: 2rem auto;
  }
  .form .field-inline,
  .contact-form .field-inline {
    flex-direction: column;
  }
  .form .actions,
  .contact-form .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .form .actions .button,
  .contact-form .actions .button {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   CONTACT FORM 7 (wpcf7) ADAPTATION
   Scoped enhancements for default CF7 markup inside our themed wrappers
--------------------------------------------------------------------------- */
.contact-form.wpcf7-form,
.form.wpcf7-form {
  gap: 1.5rem;
}

/* Remove default CF7 bottom spacing noise */
.contact-form.wpcf7-form p {
  margin: 0 0 1.25rem;
  line-height: 1.3;
}

/* Hide the CF7 forced <br> visual effect (cannot remove markup, so neutralize) */
.contact-form.wpcf7-form p br { display: none; }

/* Normalize labels (CF7 wraps label > inline content) */
.contact-form.wpcf7-form label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .45rem; /* space between label text/help and field */
}

/* Ensure the input wrapper spans full width and gets consistent top spacing */
.contact-form.wpcf7-form label > .wpcf7-form-control-wrap {
  width: 100%;
  margin-top: .1rem;
}

/* Checkbox label exception: keep input and text on same horizontal row */
.contact-form .privacy .wpcf7-list-item label {
  flex-direction: row !important; /* override generic column layout */
  align-items: center !important;
  gap: .6rem;
  width: 100%;
}
.contact-form .privacy .wpcf7-list-item label > input[type="checkbox"] {
  flex: 0 0 auto;
  margin: 0; /* ensure perfect vertical centering */
}
.contact-form .privacy .wpcf7-list-item-label {
  flex: 1 1 auto;
  line-height: 1.35;
  display: inline-block;
  margin: 0;
}

/* Inline help (the <small> element in message area) */
.contact-form.wpcf7-form small {
  font-size: .72rem;
  line-height: 1.2;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .25px;
  margin-top: .15rem;
}

/* CF7 controls inherit base inputs */
.contact-form .wpcf7-form-control:not([type="checkbox"]):not([type="radio"]) {
  border-radius: 6px;
}

/* Invalid state already has .wpcf7-not-valid; map to our error visuals */
.contact-form .wpcf7-not-valid {
  border-color: var(--form-border-error) !important;
  box-shadow: var(--form-shadow-error) !important;
  background: var(--neutral-white);
}

/* Tooltip / inline error text */
.contact-form .wpcf7-not-valid-tip {
  display: inline-block;
  margin-top: .35rem;
  background: color-mix(in srgb, var(--np-red) 8%, white);
  border: 1px solid color-mix(in srgb, var(--np-red) 35%, white);
  color: var(--form-border-error);
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.2;
  padding: .4rem .55rem .45rem;
  border-radius: 4px;
  position: relative;
}
.contact-form .wpcf7-not-valid-tip::before {
  content: "";
  position: absolute;
  top: -5px; left: 12px;
  width: 8px; height: 8px;
  transform: rotate(45deg);
  background: inherit;
  border-left: inherit; border-top: inherit;
}

/* Checkbox-specific error alignment: place tip under text, not under checkbox */
.contact-form .privacy .wpcf7-form-control-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.contact-form .privacy .wpcf7-list-item { width: 100%; }
.contact-form .privacy .wpcf7-list-item label { align-items: flex-start; }
.contact-form .privacy .wpcf7-not-valid-tip {
  margin-left: calc(18px + .6rem); /* checkbox width + gap */
  margin-top: .4rem;
  display: inline-block;
}
.contact-form .privacy .wpcf7-not-valid-tip::before {
  left: 6px; /* adjust arrow to align with start of text block */
}

/* If multiple checkboxes later: keep vertical rhythm */
.contact-form .privacy .wpcf7-list-item + .wpcf7-not-valid-tip {
  margin-top: .5rem;
}

/* Checkbox & privacy block */
.contact-form .privacy p {
  margin: 0 0 1rem;
}
.contact-form .privacy .wpcf7-list-item {
  display: flex;
  align-items: center; /* vertically center checkbox with first line of text */
  gap: .6rem;
}
.contact-form .privacy input[type="checkbox"] {
  width: 18px; height: 18px;
  margin: 0; /* remove top offset for better alignment */
  border: 1px solid var(--form-border);
  border-radius: 4px;
  appearance: none;
  display: inline-grid;
  place-content: center;
  background: var(--neutral-white);
  cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.contact-form .privacy input[type="checkbox"]:focus {
  outline: none;
  border-color: var(--form-border-focus);
  box-shadow: var(--form-shadow-focus);
}
.contact-form .privacy input[type="checkbox"]:checked {
  background: var(--np-red);
  border-color: var(--np-red);
  box-shadow: 0 0 0 1px var(--np-red) inset;
}
.contact-form .privacy input[type="checkbox"]:checked::after {
  content: "";
  width: 9px; height: 9px;
  border: 2px solid var(--neutral-white);
  border-top: 0; border-left: 0;
  transform: translateY(-1px) rotate(45deg);
}

/* File input refinement */
.contact-form input[type="file"] {
  font-size: .8rem;
  padding: .65rem .85rem;
  border: 1px dashed var(--form-border);
  background: color-mix(in srgb, var(--neutral-light) 60%, white);
  cursor: pointer;
  transition: border-color .25s ease, background-color .25s ease;
}
.contact-form input[type="file"]:hover {
  border-color: var(--np-red-light);
  background: color-mix(in srgb, var(--neutral-light) 75%, white);
}
.contact-form input[type="file"]:focus {
  outline: none;
  border-color: var(--form-border-focus);
  box-shadow: var(--form-shadow-focus);
}

/* Submit area */
.contact-form .submit {
  display: flex;
  justify-content: flex-end; /* push button to the right */
  width: 100%;
}
.contact-form .submit p { margin: 0; display: flex; }
.contact-form .submit input[type="submit"] {
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .5px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
}

/* Spinner (CF7) */
.contact-form .wpcf7-spinner {
  margin-left: .75rem;
  width: 22px; height: 22px;
  border: 3px solid color-mix(in srgb, var(--np-red) 40%, transparent);
  border-top-color: var(--np-red);
  border-radius: 50%;
  animation: cf7spin 1s linear infinite;
}
@keyframes cf7spin { to { transform: rotate(360deg); } }

/* Response output container */
.contact-form .wpcf7-response-output {
  margin: 1rem 0 0 !important;
  padding: 1rem 1.125rem !important;
  font-size: .85rem;
  line-height: 1.4;
  border-radius: 6px;
  border: 1px solid var(--neutral-medium);
  background: var(--neutral-light);
  color: var(--text-primary);
}
.contact-form .wpcf7-form.sent .wpcf7-response-output {
  border-color: var(--form-border-success);
  background: color-mix(in srgb, var(--np-red-light) 20%, white);
  color: var(--np-red-light);
}
.contact-form .wpcf7-form.invalid .wpcf7-response-output,
.contact-form .wpcf7-form.failed .wpcf7-response-output {
  border-color: var(--form-border-error);
  background: color-mix(in srgb, var(--np-red) 10%, white);
  color: var(--form-border-error);
}

/* Accessibility: invalid fields aria-invalid */
.contact-form [aria-invalid="true"] {
  border-color: var(--form-border-error) !important;
}
.contact-form [aria-invalid="true"]:focus {
  box-shadow: var(--form-shadow-error) !important;
}

/* Min width for text inputs to avoid ultra-shrink in flex contexts */
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="url"],
.contact-form input[type="tel"],
.contact-form input[type="number"],
.contact-form input[type="search"],
.contact-form input[type="password"],
.contact-form textarea { min-width: 0; }

/* Tighten last element spacing */
.contact-form .submit { margin-top: .5rem; }

@media (max-width: 640px) {
  .contact-form .submit { justify-content: stretch; }
  .contact-form .submit p { width: 100%; }
  .contact-form .submit input[type="submit"] { width: 100%; justify-content: center; }
  .contact-form .privacy .wpcf7-list-item { flex-direction: row; }
}

