/* ===============================
   PORTAIL TANGRAM - CSS autonome
   Aligné sur la charte graphique tangram-ia.fr
   =============================== */

/* -------- Design tokens -------- */
:root {
    --tg-blue: #44499C;
    --tg-blue-dark: #2F2951;
    --tg-yellow: #F6B700;
    --tg-orange: #FF9E1B;
    --tg-purple: #6E2383;

    --tg-primary: var(--tg-blue);
    --tg-accent: var(--tg-orange);
    --tg-light-accent: var(--tg-yellow);
    --tg-bg-dark: var(--tg-blue-dark);
    --tg-bg-soft: #F4F3EE;
    --tg-bg-white: #ffffff;

    --tg-text-dark: #1a1a2e;
    --tg-text-body: #3a3a4a;
    --tg-text-muted: #6b6b7a;
    --tg-text-light: #ffffff;
    --tg-text-soft: #d9e1e5;

    --tg-border: #E5E8EB;

    --tg-shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.05);
    --tg-shadow-card: 0 18px 45px rgba(0, 0, 0, 0.08);
    --tg-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.12);

    --tg-radius-sm: 5px;
    --tg-radius-md: 10px;
    --tg-radius-lg: 16px;

    --tg-max-width: 1200px;
}

/* -------- Reset léger -------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--tg-text-body);
    background: var(--tg-bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--tg-blue);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

a:focus-visible {
    outline: 2px solid var(--tg-orange);
    outline-offset: 2px;
    border-radius: 2px;
}

h1, h2, h3, h4 {
    font-family: 'Manrope', system-ui, sans-serif;
    color: var(--tg-blue-dark);
    line-height: 1.25;
    margin-top: 0;
}

h1 {
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    margin-bottom: 1rem;
}

h2 {
    font-weight: 700;
    font-size: clamp(1.4rem, 2.2vw, 1.8rem);
    margin-bottom: 1.2rem;
}

h3 {
    font-weight: 600;
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* -------- Layout -------- */
.tg-container {
    max-width: var(--tg-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.tg-section {
    padding: 4rem 0;
}

.tg-section--tight {
    padding: 2.5rem 0;
}

.tg-bg-soft {
    background: var(--tg-bg-soft);
}

.tg-bg-dark {
    background: var(--tg-bg-dark);
    color: var(--tg-text-light);
}

.tg-bg-dark h1,
.tg-bg-dark h2,
.tg-bg-dark h3,
.tg-bg-dark p {
    color: var(--tg-text-light);
}

/* -------- Header -------- */
.tg-header {
    position: sticky;
    top: 0;
    background: var(--tg-bg-white);
    border-bottom: 1px solid var(--tg-border);
    z-index: 100;
}

.tg-header-inner {
    max-width: var(--tg-max-width);
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.tg-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--tg-blue-dark);
}

.tg-brand:hover {
    text-decoration: none;
    color: var(--tg-blue-dark);
}

.tg-brand img {
    height: 38px;
    width: auto;
}

.tg-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.tg-brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--tg-blue-dark);
}

.tg-brand-portal {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--tg-orange);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.tg-header-nav {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.tg-header-nav a {
    color: var(--tg-text-body);
}

.tg-header-nav a:hover {
    color: var(--tg-orange);
    text-decoration: none;
}

/* -------- Hero -------- */
.tg-hero {
    background: linear-gradient(135deg, var(--tg-blue-dark) 0%, var(--tg-blue) 100%);
    color: var(--tg-text-light);
    padding: 4rem 0 4.5rem;
    position: relative;
    overflow: hidden;
}

.tg-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(246, 183, 0, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.tg-hero-inner {
    position: relative;
    z-index: 1;
    max-width: var(--tg-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.tg-hero-kicker {
    display: inline-block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
    color: var(--tg-yellow);
    margin-bottom: 1rem;
}

.tg-hero h1 {
    color: var(--tg-text-light);
    font-size: clamp(2rem, 3.8vw, 3rem);
    font-weight: 700;
    margin: 0.5rem auto 1.2rem;
    max-width: 820px;
}

.tg-hero p {
    color: var(--tg-text-soft);
    font-size: 1.05rem;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Accent souligné (trait dégradé orange) */
.accent {
    position: relative;
    display: inline-block;
    padding-bottom: 0.15em;
}

.accent::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0.06em;
    height: 3px;
    width: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg,
            rgba(255, 158, 27, 0.9) 0%,
            rgba(255, 158, 27, 0.55) 55%,
            rgba(255, 158, 27, 0) 100%);
}

/* -------- Introduction -------- */
.tg-intro {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
    padding: 0 1rem;
}

.tg-intro p {
    font-size: 1rem;
    color: var(--tg-text-body);
    line-height: 1.7;
}

/* -------- Section headers -------- */
.tg-section-header {
    max-width: 760px;
    margin: 0 auto 2.5rem;
    text-align: center;
}

.tg-section-header h2 {
    margin-bottom: 0.6rem;
}

.tg-section-header p {
    color: var(--tg-text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* -------- Grille de cartes -------- */
.tg-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tg-card {
    background: var(--tg-bg-white);
    border-radius: var(--tg-radius-md);
    padding: 1.8rem 1.6rem;
    box-shadow: var(--tg-shadow-card);
    border-left: 6px solid var(--tg-yellow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-left-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.tg-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tg-shadow-hover);
    border-left-color: var(--tg-orange);
}

.tg-card h3 {
    color: var(--tg-blue-dark);
    margin-bottom: 0.5rem;
}

.tg-card-desc {
    color: var(--tg-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.1rem;
    flex-grow: 1;
}

.tg-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tg-card-list li {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--tg-border);
    font-size: 0.92rem;
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.tg-card-list li:last-child {
    border-bottom: none;
}

.tg-card-list a {
    color: var(--tg-text-body);
    font-weight: 500;
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tg-card-list a:hover {
    color: var(--tg-orange);
    text-decoration: none;
}

/* Icône lien externe */
.tg-ext-icon {
    font-size: 0.75em;
    opacity: 0.55;
    flex-shrink: 0;
}

/* Chevron lien interne */
.tg-card-list a::before {
    content: "›";
    color: var(--tg-orange);
    font-weight: 700;
    font-size: 1.1em;
    line-height: 1;
    flex-shrink: 0;
}

/* -------- Boutons -------- */
.tg-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.6rem;
    background: transparent;
    color: var(--tg-blue-dark);
    border: 2px solid var(--tg-blue-dark);
    border-radius: var(--tg-radius-sm);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tg-button:hover {
    background: var(--tg-blue-dark);
    color: var(--tg-text-light);
    text-decoration: none;
}

.tg-button--primary {
    background: var(--tg-orange);
    border-color: var(--tg-orange);
    color: var(--tg-text-light);
}

.tg-button--primary:hover {
    background: var(--tg-blue-dark);
    border-color: var(--tg-blue-dark);
    color: var(--tg-text-light);
}

.tg-button--light {
    background: transparent;
    color: var(--tg-text-light);
    border-color: var(--tg-yellow);
}

.tg-button--light:hover {
    background: var(--tg-yellow);
    color: var(--tg-blue-dark);
    border-color: var(--tg-yellow);
}

/* -------- Bloc info / CTA -------- */
.tg-info-box {
    background: var(--tg-bg-white);
    border-left: 4px solid var(--tg-orange);
    padding: 1.4rem 1.6rem;
    border-radius: var(--tg-radius-sm);
    box-shadow: var(--tg-shadow-soft);
    margin: 1.5rem 0;
}

.tg-info-box h3 {
    color: var(--tg-blue-dark);
    margin-top: 0;
    font-size: 1.05rem;
}

.tg-info-box p:last-child {
    margin-bottom: 0;
}

/* -------- Contenu d'une page rédactionnelle -------- */
.tg-content {
    max-width: 820px;
    margin: 0 auto;
}

.tg-content h2 {
    margin-top: 2.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--tg-bg-soft);
}

.tg-content h3 {
    margin-top: 1.8rem;
    color: var(--tg-blue);
}

.tg-content ul,
.tg-content ol {
    padding-left: 1.4rem;
    margin-bottom: 1rem;
}

.tg-content li {
    margin-bottom: 0.4rem;
}

.tg-content strong {
    color: var(--tg-blue-dark);
}

.tg-page-meta {
    color: var(--tg-text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 2rem;
}

/* -------- Footer -------- */
.tg-footer {
    background: var(--tg-bg-dark);
    color: var(--tg-text-soft);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.tg-footer-inner {
    max-width: var(--tg-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2.5rem;
}

.tg-footer-brand img {
    height: 44px;
    margin-bottom: 0.9rem;
    filter: brightness(0) invert(1);
}

.tg-footer-brand p {
    color: var(--tg-text-soft);
    font-size: 0.88rem;
    max-width: 320px;
    line-height: 1.6;
}

.tg-footer-col h4 {
    color: var(--tg-text-light);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 1rem;
}

.tg-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tg-footer-col li {
    margin-bottom: 0.55rem;
}

.tg-footer-col a {
    color: var(--tg-text-soft);
    font-size: 0.88rem;
}

.tg-footer-col a:hover {
    color: var(--tg-yellow);
    text-decoration: none;
}

.tg-footer-bottom {
    max-width: var(--tg-max-width);
    margin: 2.5rem auto 0;
    padding: 1.2rem 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--tg-text-soft);
    opacity: 0.8;
}

/* -------- Accessibilité : lien de saut -------- */
.tg-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--tg-blue-dark);
    color: var(--tg-text-light);
    padding: 0.8rem 1.2rem;
    text-decoration: none;
    z-index: 9999;
    font-weight: 600;
}

.tg-skip-link:focus {
    left: 1rem;
    top: 1rem;
}

/* -------- Responsive -------- */
@media (max-width: 768px) {
    .tg-hero {
        padding: 3rem 0 3.5rem;
    }

    .tg-section {
        padding: 2.8rem 0;
    }

    .tg-header-inner {
        padding: 0.75rem 1rem;
    }

    .tg-brand img {
        height: 32px;
    }

    .tg-brand-name {
        font-size: 0.95rem;
    }

    .tg-header-nav {
        gap: 0.8rem;
        font-size: 0.85rem;
    }

    .tg-card-grid {
        grid-template-columns: 1fr;
    }

    .tg-footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .tg-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .tg-header-nav a:not(.tg-nav-home) {
        display: none;
    }
}
