/*
Theme Name: ATGBM Pulse
Theme URI: https://www.facebook.com/ATGBM/
Author: ATGBM
Description: Thème officiel de l'Association Tunisienne de Génie Biomédical. Design system « Pulse » : la clarté de Google, le contraste affirmé d'EY, l'or du logo et le tracé ECG. Fonctionne seul ; prend tout son sens avec l'extension « ATGBM Core » (événements, profils membres, annuaire, contact).
Version: 1.1.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: atgbm
Tags: blog, one-column, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ---------- Tokens ---------- */
:root {
	--atg-gold: #F5B400;
	--atg-gold-50: #FFF4D1;
	--atg-gold-700: #8A5A00;
	--atg-ink: #1F1F24;
	--atg-ink-2: #2B2B33;
	--atg-ink-3: #3A3A42;
	--atg-on-dark: #C9CAD1;
	--atg-text: #2D2D33;
	--atg-muted: #5F6368;
	--atg-blue: #1558B0;
	--atg-blue-700: #0B3D82;
	--atg-blue-50: #E8F0FE;
	--atg-green: #188038;
	--atg-green-50: #E6F4EA;
	--atg-red: #C5221F;
	--atg-red-50: #FCE8E6;
	--atg-bg: #F8F9FA;
	--atg-surface: #FFFFFF;
	--atg-chip: #F1F3F4;
	--atg-line: #E3E5E8;
	--atg-line-2: #DADCE0;
	--atg-field: #80868B;
	--atg-font-display: "Outfit", "Segoe UI", system-ui, sans-serif;
	--atg-font: "Roboto", "Segoe UI", system-ui, sans-serif;
	--atg-r-sm: 8px;
	--atg-r: 16px;
	--atg-r-lg: 24px;
	--atg-shadow-1: 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
	--atg-shadow-2: 0 1px 3px rgba(60, 64, 67, .3), 0 6px 16px rgba(60, 64, 67, .15);
	--atg-wrap: 1200px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--atg-bg);
	color: var(--atg-ink);
	font: 400 16px/1.6 var(--atg-font);
	-webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--atg-blue); }
a:hover { color: var(--atg-blue-700); }
h1, h2, h3, h4, h5, h6 { font-family: var(--atg-font-display); color: var(--atg-ink); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 700; letter-spacing: -1px; }
h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; letter-spacing: -.6px; }
h3 { font-size: 20px; font-weight: 600; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--atg-blue); outline-offset: 2px; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
	clip: auto; width: auto; height: auto; margin: 0; z-index: 100000;
	top: 8px; left: 8px; padding: 12px 18px; background: #fff; color: var(--atg-ink); border-radius: 999px; box-shadow: var(--atg-shadow-2);
}
.atg-wrap { max-width: var(--atg-wrap); margin: 0 auto; padding: 0 24px; }
.atg-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.atg-section { padding: 72px 0; }
.atg-section--tight { padding: 40px 0; }
.atg-kicker {
	display: inline-block; font: 500 13px/1.4 var(--atg-font); letter-spacing: 1.2px;
	text-transform: uppercase; color: var(--atg-gold-700); margin-bottom: 10px;
}
.atg-dark .atg-kicker, .atg-kicker--gold { color: var(--atg-gold); }
.atg-lead { font-size: 19px; line-height: 1.6; color: var(--atg-muted); }
.atg-muted { color: var(--atg-muted); }
.atg-dark { background: var(--atg-ink); color: #fff; }
.atg-dark h1, .atg-dark h2, .atg-dark h3 { color: #fff; }
.atg-dark .atg-lead, .atg-dark .atg-muted { color: var(--atg-on-dark); }
.atg-hl { color: var(--atg-gold); }

/* ---------- Buttons & chips ---------- */
.atg-btn, .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
	font: 500 15px/1 var(--atg-font); text-decoration: none; cursor: pointer;
	background: var(--atg-gold); color: var(--atg-ink); transition: filter .15s, box-shadow .15s;
}
.atg-btn:hover { filter: brightness(.96); box-shadow: var(--atg-shadow-1); color: var(--atg-ink); }
.atg-btn.atg-btn--dark { background: var(--atg-ink); color: #fff; }
.atg-btn.atg-btn--dark:hover { color: #fff; }
.atg-btn.atg-btn--outline { background: var(--atg-surface); color: var(--atg-blue); border-color: var(--atg-line-2); }
.atg-btn.atg-btn--outline:hover { color: var(--atg-blue-700); }
.atg-btn.atg-btn--ghost-light { background: transparent; color: #fff; border-color: #5F6068; }
.atg-btn--ghost-light:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.atg-btn.atg-btn--white { background: #fff; color: var(--atg-ink); }
.atg-btn--lg { min-height: 52px; padding: 0 28px; font-size: 16px; }
.atg-chip {
	display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px;
	border: 1px solid var(--atg-line-2); background: var(--atg-surface); color: var(--atg-ink);
	font: 500 14px/1 var(--atg-font); text-decoration: none;
}
.atg-chip:hover { color: var(--atg-ink); border-color: var(--atg-ink); }
.atg-chip.is-active { background: var(--atg-ink); border-color: var(--atg-ink); color: #fff; }
.atg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.atg-tag {
	display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--atg-blue-50);
	color: var(--atg-blue); font: 500 12px/1.4 var(--atg-font); text-decoration: none;
}
.atg-tag--gold { background: var(--atg-gold); color: var(--atg-ink); }
.atg-tag--grey { background: var(--atg-chip); color: var(--atg-ink); }

/* ---------- Header ---------- */
.atg-header { background: var(--atg-surface); border-bottom: 1px solid var(--atg-line); position: relative; z-index: 50; }
.atg-header__inner { display: flex; align-items: center; gap: 16px 32px; padding-top: 8px; padding-bottom: 8px; min-height: 76px; }
.atg-logo { display: flex; align-items: center; flex: none; }
.atg-logo img, .atg-logo .custom-logo { height: 60px; width: auto; display: block; }
.atg-nav { flex: 1 1 auto; }
.atg-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 28px; }
.atg-nav a { display: block; padding: 14px 0; color: var(--atg-ink); text-decoration: none; font: 500 15px/1.2 var(--atg-font); }
.atg-nav a:hover { color: var(--atg-blue); }
.atg-nav .current-menu-item > a, .atg-nav .current_page_item > a, .atg-nav .current-menu-ancestor > a, .atg-nav .current_page_parent > a {
	color: var(--atg-blue); box-shadow: inset 0 -3px 0 var(--atg-gold);
}
.atg-nav .sub-menu { display: none; }
.atg-header__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.atg-avatar-link img { width: 44px; height: 44px; border-radius: 50%; display: block; object-fit: cover; }
.atg-menu-toggle {
	display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 50%;
	border: 1px solid var(--atg-line-2); background: #fff; color: var(--atg-ink); cursor: pointer;
	align-items: center; justify-content: center;
}
@media (max-width: 900px) {
	.atg-menu-toggle { display: inline-flex; }
	.atg-header__inner { flex-wrap: wrap; }
	.atg-nav, .atg-header__actions { display: none; flex-basis: 100%; }
	.atg-header.is-open .atg-nav, .atg-header.is-open .atg-header__actions { display: flex; }
	.atg-nav ul { flex-direction: column; gap: 0; width: 100%; }
	.atg-nav a { padding: 12px 0; border-bottom: 1px solid var(--atg-line); }
	.atg-header__actions { padding-bottom: 12px; }
}

/* ---------- Hero ---------- */
.atg-hero { background: var(--atg-ink); color: #fff; overflow: hidden; }
.atg-hero__inner { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding-top: 88px; padding-bottom: 96px; }
.atg-hero__text { flex: 999 1 520px; min-width: 0; }
.atg-hero h1 { color: #fff; font-size: clamp(38px, 6vw, 60px); line-height: 1.05; letter-spacing: -1.5px; margin-bottom: 24px; }
.atg-hero .atg-lead { color: var(--atg-on-dark); max-width: 560px; margin-bottom: 28px; }
.atg-hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.atg-hero__card { flex: 1 1 340px; min-width: 0; background: var(--atg-ink-2); border-radius: var(--atg-r-lg); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.atg-hero__card strong { font: 600 24px/1.25 var(--atg-font-display); }
.atg-hero__card .atg-meta { color: var(--atg-on-dark); font-size: 15px; display: flex; flex-direction: column; gap: 6px; }
.atg-page-hero { padding: 56px 0; }
.atg-page-hero h1 { margin: 0; }
.atg-page-hero p { margin: 12px 0 0; max-width: 680px; }

/* ---------- Cards & grids ---------- */
.atg-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.atg-grid--4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.atg-card {
	background: var(--atg-surface); border: 1px solid var(--atg-line); border-radius: var(--atg-r);
	overflow: hidden; display: flex; flex-direction: column; color: var(--atg-ink); text-decoration: none;
	transition: box-shadow .2s, transform .2s;
}
a.atg-card:hover, .atg-card--hover:hover { box-shadow: var(--atg-shadow-2); transform: translateY(-2px); color: var(--atg-ink); }
.atg-card__media { height: 180px; display: flex; align-items: flex-end; padding: 16px; background: var(--atg-ink); overflow: hidden; }
.atg-card__media img { width: 100%; height: 100%; object-fit: cover; margin: -16px; width: calc(100% + 32px); height: calc(100% + 32px); max-width: none; }
.atg-card__body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.atg-card__body h3 { margin: 0; font-size: 20px; line-height: 1.3; }
.atg-card__meta { font-size: 13px; color: var(--atg-muted); margin-top: auto; display: flex; align-items: center; gap: 10px; }
.atg-card__meta img { width: 32px; height: 32px; border-radius: 50%; }
.atg-pillar { padding: 28px; gap: 14px; }
.atg-pillar__num {
	width: 48px; height: 48px; border-radius: 12px; background: var(--atg-gold-50); color: var(--atg-gold-700);
	display: flex; align-items: center; justify-content: center; font: 700 18px var(--atg-font-display);
}
.atg-pillar p { margin: 0; color: var(--atg-muted); font-size: 15px; }
.atg-stats { background: var(--atg-surface); border: 1px solid var(--atg-line); border-radius: var(--atg-r); display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.atg-stat { padding: 28px 32px; border-right: 1px solid var(--atg-line); }
.atg-stat:last-child { border-right: 0; }
.atg-stat strong { display: block; font: 700 36px/1.1 var(--atg-font-display); }
.atg-stat span { font-size: 14px; color: var(--atg-muted); }
.atg-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 32px; }
.atg-section-head h2 { margin: 0; }
.atg-section-head a { font-weight: 500; text-decoration: none; }
.atg-featured {
	display: flex; flex-wrap: wrap; background: var(--atg-ink); color: #fff; border-radius: var(--atg-r-lg);
	overflow: hidden; text-decoration: none; margin-bottom: 28px;
}
.atg-featured:hover { color: #fff; box-shadow: var(--atg-shadow-2); }
.atg-featured__media { flex: 1 1 300px; min-height: 260px; background: var(--atg-ink-2); display: flex; align-items: center; padding: 24px; }
.atg-featured__media img { width: calc(100% + 48px); height: calc(100% + 48px); margin: -24px; object-fit: cover; max-width: none; }
.atg-featured__body { flex: 1 1 320px; padding: 32px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.atg-featured__body h2 { color: #fff; font-size: 30px; margin: 0; }
.atg-featured__body p { color: var(--atg-on-dark); margin: 0; }
.atg-cta-band { background: var(--atg-gold); border-radius: var(--atg-r-lg); padding: 48px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.atg-cta-band h2 { margin: 0 0 6px; }
.atg-cta-band p { margin: 0; color: var(--atg-ink-3); }
@media (max-width: 600px) { .atg-cta-band { padding: 28px; } }

/* ---------- Layout with sidebar ---------- */
.atg-layout { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; padding-top: 40px; padding-bottom: 80px; }
.atg-layout__main { flex: 999 1 600px; min-width: 0; }
.atg-layout__side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.atg-box { background: var(--atg-surface); border: 1px solid var(--atg-line); border-radius: var(--atg-r); padding: 24px; }
.atg-box h2, .atg-box .widget-title { font-size: 18px; font-weight: 600; letter-spacing: 0; margin: 0 0 12px; }
.atg-box ul { margin: 0; padding-left: 18px; }
.atg-box--dark { background: var(--atg-ink); border-color: var(--atg-ink); color: #fff; }
.atg-box--dark h2 { color: #fff; }
.atg-box--dark p { color: var(--atg-on-dark); }

/* ---------- Article ---------- */
.atg-article { padding: 48px 0 32px; }
.atg-breadcrumb { font-size: 14px; color: var(--atg-muted); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.atg-article h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.12; }
.atg-article__excerpt { font-size: 21px; line-height: 1.55; color: var(--atg-muted); }
.atg-byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--atg-line); border-bottom: 1px solid var(--atg-line); margin: 24px 0 28px; }
.atg-byline a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--atg-ink); }
.atg-byline img { width: 48px; height: 48px; border-radius: 50%; }
.atg-byline strong { display: block; font-size: 15px; }
.atg-byline span { font-size: 14px; color: var(--atg-muted); }
.atg-cover { border-radius: var(--atg-r-lg); overflow: hidden; margin-bottom: 32px; background: var(--atg-ink); }
.atg-cover img { display: block; width: 100%; height: auto; }
.atg-prose { font-size: 18px; line-height: 1.7; color: var(--atg-text); }
.atg-prose > * + * { margin-top: 1.1em; }
.atg-prose p { margin: 0; }
.atg-prose h2 { font-size: 28px; font-weight: 600; letter-spacing: 0; margin-top: 1.6em; }
.atg-prose h3 { font-size: 22px; margin-top: 1.4em; }
.atg-prose ul, .atg-prose ol { padding-left: 24px; }
.atg-prose blockquote, .wp-block-quote { margin: 1.4em 0; padding: 20px 24px; background: var(--atg-gold-50); border: 0; border-radius: var(--atg-r); font: 500 20px/1.5 var(--atg-font-display); color: var(--atg-ink); }
.atg-prose blockquote p { margin: 0; }
.atg-prose img { border-radius: var(--atg-r); }
.atg-prose figure { margin: 1.4em 0; }
.atg-prose figcaption { font-size: 14px; color: var(--atg-muted); margin-top: 8px; }
.atg-prose pre { background: var(--atg-ink); color: #fff; padding: 20px; border-radius: var(--atg-r); overflow-x: auto; font-size: 15px; }
.atg-prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.atg-prose th, .atg-prose td { border-bottom: 1px solid var(--atg-line); padding: 10px 8px; text-align: left; }
.atg-prose .has-small-font-size { font-size: 14px; color: var(--atg-muted); border-top: 1px solid var(--atg-line); padding-top: 16px; margin-top: 2em; }
.atg-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0; }
.atg-tags a { padding: 6px 14px; border-radius: 999px; background: var(--atg-chip); color: var(--atg-ink); font-size: 14px; text-decoration: none; }
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.wp-caption-text { font-size: 14px; color: var(--atg-muted); }
.sticky .atg-card { border-color: var(--atg-gold); }
.bypostauthor { display: block; }
.gallery-caption { font-size: 14px; }

/* ---------- Forms (theme-wide) ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="tel"], input[type="password"], input[type="search"], input[type="number"], input[type="date"], select, textarea {
	width: 100%; min-height: 48px; border: 1px solid var(--atg-field); border-radius: var(--atg-r-sm);
	padding: 0 14px; font: 400 16px var(--atg-font); color: var(--atg-ink); background: #fff;
}
textarea { padding: 12px 14px; min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border: 2px solid var(--atg-blue); padding-left: 13px; }
label { font: 500 14px/1.4 var(--atg-font); }
input[type="submit"]:not([class]), button[type="submit"]:not([class]), .search-submit, .form-submit .submit {
	min-height: 44px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--atg-ink); color: #fff;
	font: 500 15px var(--atg-font); cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--atg-blue); }
.search-form { display: flex; gap: 8px; }
.search-form label { flex: 1; }

/* ---------- Comments ---------- */
.atg-comments { border-top: 1px solid var(--atg-line); padding-top: 32px; margin-top: 16px; }
.atg-comments ol { list-style: none; padding: 0; margin: 0 0 24px; }
.atg-comments ol ol { padding-left: 48px; }
.atg-comment { display: flex; gap: 12px; margin-bottom: 16px; }
.atg-comment img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.atg-comment__bubble { background: var(--atg-bg); border-radius: var(--atg-r); padding: 14px 18px; flex: 1; }
.atg-comment__bubble strong { font-size: 14px; }
.atg-comment__bubble .atg-comment__date { font-size: 12px; color: var(--atg-muted); margin-left: 8px; }
.atg-comment__bubble p { margin: 6px 0 0; font-size: 15px; }
.atg-comment__bubble .reply a { font-size: 13px; }
.comment-form { display: flex; flex-direction: column; gap: 12px; }
.comment-form p { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.comment-form .form-submit { align-items: flex-start; }
.comment-form .comment-form-cookies-consent { flex-direction: row; align-items: center; gap: 10px; }

/* ---------- Pagination ---------- */
.atg-pagination { margin-top: 40px; }
.atg-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.atg-pagination .page-numbers { min-width: 44px; height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--atg-line-2); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--atg-ink); background: #fff; }
.atg-pagination .page-numbers.current { background: var(--atg-ink); color: #fff; border-color: var(--atg-ink); }

/* ---------- Footer ---------- */
.atg-footer { background: var(--atg-ink); color: var(--atg-on-dark); margin-top: 0; }
.atg-footer a { color: var(--atg-on-dark); }
.atg-footer a:hover { color: #fff; }
.atg-footer__top { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; padding-top: 56px; padding-bottom: 32px; }
.atg-footer__brand { flex: 1 1 280px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.6; }
.atg-footer__brand .atg-footer__logo { background: #fff; border-radius: 14px; padding: 10px 14px; align-self: flex-start; }
.atg-footer__brand .atg-footer__logo img { height: 44px; width: auto; display: block; }
.atg-footer__col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.atg-footer__col strong { color: #fff; }
.atg-footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.atg-footer__bottom { border-top: 1px solid var(--atg-ink-3); padding-top: 20px; padding-bottom: 20px; font-size: 13px; }

/* ---------- Misc ---------- */
.atg-empty { padding: 32px; text-align: center; background: #fff; border: 1px dashed var(--atg-line-2); border-radius: var(--atg-r); color: var(--atg-muted); }
.atg-ecg { display: block; width: 100%; }
.atg-404 { text-align: center; padding: 96px 0; }
.atg-404 .atg-ecg { max-width: 420px; margin: 0 auto 24px; }
