/*
Theme Name:        KADFRIR
Theme URI:         https://kadfrir.ma/
Author:            KADFRIR SERVICES
Author URI:        https://kadfrir.ma/
Description:       Thème sur mesure pour KADFRIR SERVICES (Zagora, Maroc) : développement d'applications, sites web, caméras de surveillance, téléphonie fixe et réseaux informatiques. Tout le contenu de la page d'accueil est modifiable depuis Apparence › Personnaliser.
Version:           1.0.0
Requires at least: 6.0
Tested up to:      6.8
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:       kadfrir
Tags:              one-column, custom-colors, custom-logo, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   Variables (les couleurs --accent et --ink sont surchargées par le Customizer)
   ========================================================================== */
:root {
	--paper: #F4F1EA;
	--white: #FFFFFF;
	--ink: #14202B;
	--ink-2: #1E2E3B;
	--ink-3: #0D161E;
	--text-2: #3E4954;
	--muted: #4A5560;
	--line: #DDD6C8;
	--field: #B9B1A2;
	--accent: #A94E0E;
	--accent-hover: #7E3A0A;
	--accent-light: #F0A868;
	--on-dark-2: #C9D1D8;
	--display: 'Bricolage Grotesque', sans-serif;
	--body: 'IBM Plex Sans', system-ui, sans-serif;
	--gutter: clamp(20px, 6.5vw, 96px);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); background: var(--paper); color: var(--ink); line-height: 1.5; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }

/* Accessibilité WordPress */
.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus, .skip-link:focus {
	background: var(--white); clip: auto !important; clip-path: none; color: var(--ink);
	display: block; font-weight: 600; height: auto; left: 8px; padding: 14px 22px;
	top: 8px; width: auto; z-index: 100000; border-radius: 10px;
}

.container { padding-inline: var(--gutter); }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 16px 28px; border-radius: 10px; font-weight: 600; font-size: 17px; text-decoration: none; border: none; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { border: 1.5px solid var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-light { background: var(--accent-light); color: var(--ink); }
.btn-light:hover { background: #F5BD8A; color: var(--ink); }

/* ==========================================================================
   En-tête
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.admin-bar .site-header { top: 32px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 22px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 44px; height: 44px; border-radius: 10px; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 22px; flex-shrink: 0; }
.brand-logo { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo img { display: block; width: auto; max-height: 44px; }
.brand-name { display: block; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: .04em; }
.brand-tag { display: block; font-size: 13px; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 36px; font-weight: 500; }
/* Les <ul>/<li> générés par wp_nav_menu() n'interfèrent pas avec la mise en page flex */
.nav-list, .nav-list li { display: contents; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; }
.nav a:not(.btn):hover { color: var(--accent); }
.nav .btn { font-size: 16px; padding: 12px 20px; }
.menu-toggle { display: none; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; align-items: center; padding-block: 96px 112px; }
.hero-copy { display: flex; flex-direction: column; gap: 28px; }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 5vw, 72px); line-height: 1.02; letter-spacing: -.02em; }
.hero p { max-width: 560px; font-size: 20px; line-height: 1.6; color: var(--text-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.hero-visual { min-height: 520px; border-radius: 24px; background: var(--ink); display: flex; align-items: center; justify-content: center; padding: 24px; }
.hero-visual--image { display: block; padding: 0; overflow: hidden; }
.hero-visual--image img { display: block; width: 100%; height: 100%; min-height: inherit; object-fit: cover; }
/* Couleurs du schéma SVG liées à la couleur d'accent */
.hv-stroke { stroke: var(--accent-light); }
.hv-fill { fill: var(--accent-light); }
.hv-panel { fill: var(--ink-2); }

/* ==========================================================================
   Services
   ========================================================================== */
.services { display: flex; flex-direction: column; gap: 48px; padding-block: 104px; background: var(--white); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; }
.section-head > div { display: flex; flex-direction: column; gap: 14px; }
.section-head h2 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 3.6vw, 52px); line-height: 1.08; letter-spacing: -.015em; }
.section-head p { max-width: 420px; font-size: 18px; line-height: 1.6; color: var(--text-2); }
.grid-services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card { display: flex; flex-direction: column; gap: 16px; padding: 36px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.card-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--ink); color: var(--accent-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card h3 { font-family: var(--display); font-size: 26px; font-weight: 700; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { font-size: 17px; line-height: 1.6; color: var(--text-2); }
.card-cta { justify-content: space-between; gap: 24px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card-cta h3 { font-size: 30px; line-height: 1.2; }
.card-cta p { color: var(--on-dark-2); }
.card-cta .btn { align-self: flex-start; }

/* ==========================================================================
   Approche
   ========================================================================== */
.approach { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; padding-block: 104px; }
.approach-title { display: flex; flex-direction: column; gap: 14px; }
.approach-title h2 { font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1.1; }
.step { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; border-top: 2px solid var(--ink); }
.step-num { font-family: var(--display); font-size: 40px; font-weight: 800; color: var(--accent); }
.step h3 { font-size: 21px; font-weight: 600; }
.step p { font-size: 17px; line-height: 1.6; color: var(--text-2); }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; padding-block: 104px; background: var(--ink); color: var(--paper); }
.contact-info { display: flex; flex-direction: column; gap: 32px; }
.contact-info .intro { display: flex; flex-direction: column; gap: 14px; }
.contact .eyebrow { color: var(--accent-light); }
.contact h2 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 3.6vw, 52px); line-height: 1.08; }
.contact .intro p { max-width: 480px; font-size: 18px; line-height: 1.6; color: var(--on-dark-2); }
.contact-list { display: flex; flex-direction: column; gap: 20px; font-size: 19px; list-style: none; margin: 0; padding: 0; }
.contact-list li, .contact-list a { display: flex; align-items: center; gap: 16px; color: var(--paper); text-decoration: none; }
.contact-list a:hover { color: var(--accent-light); }
.contact-list svg { color: var(--accent-light); flex-shrink: 0; }
.contact-form { display: flex; flex-direction: column; gap: 18px; padding: 40px; border-radius: 20px; background: var(--paper); color: var(--ink); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contact-form label { display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 600; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; padding: 14px 16px; border: 1px solid var(--field); border-radius: 10px; font: inherit; font-weight: 400; font-size: 16px; background: var(--white); color: var(--ink); }
.contact-form textarea { resize: vertical; min-height: 130px; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.form-note { font-size: 14px; color: var(--muted); min-height: 1em; }

/* Message affiché quand aucun shortcode de formulaire n'est défini */
.contact-fallback h3 { font-family: var(--display); font-size: 26px; font-weight: 700; }
.contact-fallback p { font-size: 17px; line-height: 1.6; color: var(--text-2); }
.contact-fallback .btn { align-self: flex-start; }

/* ---------- Contact Form 7 : même style que .contact-form ---------- */
.contact-form .wpcf7 { margin: 0; }
.contact-form .wpcf7-form { display: flex; flex-direction: column; gap: 18px; }
.contact-form .wpcf7-form > p { margin: 0; }
.contact-form .wpcf7-form-control-wrap { display: block; }
.contact-form input[type="submit"],
.contact-form button[type="submit"] {
	display: inline-flex; align-items: center; justify-content: center; width: 100%;
	min-height: 48px; padding: 16px 28px; border: none; border-radius: 10px;
	background: var(--accent); color: #fff; font-family: inherit; font-size: 17px; font-weight: 600; cursor: pointer;
}
.contact-form input[type="submit"]:hover,
.contact-form button[type="submit"]:hover { background: var(--accent-hover); }
.contact-form .wpcf7-spinner { margin: 12px auto 0; display: block; }
.contact-form .wpcf7-not-valid { border-color: #B42318; }
.contact-form .wpcf7-not-valid-tip { margin-top: 6px; font-size: 14px; font-weight: 500; color: #B42318; }
.contact-form .wpcf7 form .wpcf7-response-output { margin: 0; padding: 12px 16px; border-width: 1px; border-radius: 10px; font-size: 14px; color: var(--muted); }
.contact-form .wpcf7 form.sent .wpcf7-response-output { border-color: #2E7D4F; color: #1F5A38; }
.contact-form .wpcf7 form.invalid .wpcf7-response-output,
.contact-form .wpcf7 form.failed .wpcf7-response-output { border-color: #B42318; color: #B42318; }

/* ---------- WPForms : alignement de base ---------- */
.contact-form .wpforms-container { margin: 0 !important; }
.contact-form .wpforms-field-label { font-size: 15px !important; font-weight: 600 !important; color: var(--ink) !important; }

/* ==========================================================================
   Pied de page
   ========================================================================== */
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 28px; background: var(--ink-3); color: #9AA6B1; font-size: 15px; }
.site-footer a { color: #C9D1D8; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ==========================================================================
   Pages intérieures (pages, articles, services, 404, liste d'articles)
   ========================================================================== */
.page-header { display: flex; flex-direction: column; gap: 16px; padding-block: 88px 56px; border-bottom: 1px solid var(--line); }
.page-header h1 { max-width: 900px; font-family: var(--display); font-weight: 800; font-size: clamp(36px, 4.4vw, 60px); line-height: 1.05; letter-spacing: -.02em; }
.page-header .lead { max-width: 680px; font-size: 20px; line-height: 1.6; color: var(--text-2); }
.page-header .hero-actions { margin-top: 8px; }
.entry-meta { font-size: 15px; color: var(--muted); }
.entry-meta a { color: inherit; }
.page-body { padding-block: 64px 104px; }
.entry-thumb { margin: 0 0 40px; }
.entry-thumb img { display: block; width: 100%; max-height: 560px; object-fit: cover; border-radius: 18px; }

.entry-content { max-width: 760px; font-size: 18px; line-height: 1.7; color: var(--text-2); }
.entry-content > * + * { margin-top: 1.15em; }
.entry-content h2, .entry-content h3, .entry-content h4 { font-family: var(--display); color: var(--ink); line-height: 1.15; margin-top: 1.8em; }
.entry-content h2 { font-size: clamp(28px, 2.6vw, 36px); font-weight: 700; }
.entry-content h3 { font-size: 24px; font-weight: 700; }
.entry-content h4 { font-size: 20px; font-weight: 700; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: .4em; }
.entry-content blockquote { margin-inline: 0; padding: 8px 0 8px 24px; border-left: 3px solid var(--accent); color: var(--ink); }
.entry-content img { border-radius: 12px; }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.entry-content .wp-block-button__link { background: var(--accent); color: #fff; border-radius: 10px; font-weight: 600; }
.entry-content .wp-block-button__link:hover { background: var(--accent-hover); color: #fff; }
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, .gallery-caption { font-size: 14px; color: var(--muted); }
.sticky, .bypostauthor { }

/* Liste d'articles (titres h2 pour respecter la hiérarchie, avec le style des h3 de carte) */
.card .h3-like { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.2; }
.card .h3-like a { color: inherit; text-decoration: none; }
.card .h3-like a:hover { color: var(--accent); }
.post-card .card-thumb { display: block; margin: -36px -36px 4px; border-radius: 18px 18px 0 0; overflow: hidden; }
.post-card .card-thumb img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-link { font-weight: 600; text-decoration: none; margin-top: auto; }

/* Pagination et navigation entre articles */
.pagination, .post-navigation { margin-top: 56px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); text-decoration: none; font-weight: 600; }
.page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--paper); }
a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.post-navigation .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.post-navigation a { display: flex; flex-direction: column; gap: 6px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); color: var(--ink); text-decoration: none; font-weight: 600; }
.post-navigation a:hover { border-color: var(--accent); }
.post-navigation .nav-next { text-align: right; grid-column: 2; }
.post-navigation .nav-subtitle { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

/* Page d'un service */
.service-header { flex-direction: row; align-items: flex-start; gap: 28px; }
.service-header > div { display: flex; flex-direction: column; gap: 16px; }
.service-header .card-icon { width: 72px; height: 72px; border-radius: 18px; }
.service-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.service-aside { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 120px; }
.other-services { display: flex; flex-direction: column; gap: 14px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.other-services h2 { font-family: var(--display); font-size: 22px; font-weight: 700; }
.other-services ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.other-services li a { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500; }
.other-services li a:hover { color: var(--accent); }
.other-services .card-icon { width: 36px; height: 36px; border-radius: 9px; }
.other-services .card-icon svg { width: 18px; height: 18px; }

/* Commentaires */
.comments-area { max-width: 760px; margin-top: 72px; padding-top: 48px; border-top: 1px solid var(--line); }
.comments-title, .comment-reply-title { font-family: var(--display); font-size: 28px; font-weight: 700; margin-bottom: 24px; }
.comment-list { list-style: none; margin: 0 0 48px; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 20px 0; border-bottom: 1px solid var(--line); }
.comment-meta { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.comment-form { display: flex; flex-direction: column; gap: 16px; }
.comment-form p { margin: 0; display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 15px; }
.comment-form .comment-form-cookies-consent { flex-direction: row; align-items: center; font-weight: 400; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { padding: 14px 16px; border: 1px solid var(--field); border-radius: 10px; font: inherit; font-size: 16px; font-weight: 400; background: var(--white); color: var(--ink); }
.comment-form input[type="submit"] { align-self: flex-start; min-height: 48px; padding: 14px 28px; border: none; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.comment-form input[type="submit"]:hover { background: var(--accent-hover); }

/* Recherche */
.search-form { display: flex; gap: 12px; flex-wrap: wrap; max-width: 560px; }
.search-form label { flex: 1 1 260px; }
.search-form .search-field { width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid var(--field); border-radius: 10px; font: inherit; background: var(--white); color: var(--ink); }
.search-form .search-submit { min-height: 48px; padding: 12px 24px; border: none; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
	.grid-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.approach { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.approach-title { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
	.hero, .contact { grid-template-columns: 1fr; gap: 48px; }
	.hero { padding-block: 64px 80px; }
	.hero-visual { min-height: 0; }
	.section-head { flex-direction: column; align-items: flex-start; gap: 20px; }
	.menu-toggle { display: inline-flex; }
	.nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
	.nav.open { display: flex; }
	.nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
	.nav .btn { margin-top: 16px; }
	.services, .approach, .contact { padding-block: 72px; }
	.page-header { padding-block: 64px 40px; }
	.service-layout { grid-template-columns: 1fr; gap: 48px; }
	.service-aside { position: static; }
}
@media (max-width: 782px) {
	.admin-bar .site-header { top: 46px; }
}
@media (max-width: 600px) {
	.grid-services, .approach, .form-row { grid-template-columns: 1fr; }
	.card, .contact-form { padding: 24px; }
	.post-card .card-thumb { margin: -24px -24px 4px; }
	.hero p { font-size: 18px; }
	.hero-actions .btn { flex: 1 1 100%; }
	.brand-tag { display: none; }
	.admin-bar .site-header { top: 0; }
	.service-header { flex-direction: column; }
	.post-navigation .nav-links { grid-template-columns: 1fr; }
	.post-navigation .nav-next { grid-column: auto; }
}
