/* ============================================
   GNDM – Global Styles
   Typographie, layout, composants communs
   ============================================ */

/* --- Base --- */
body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    color: var(--color-text);
    background-color: var(--color-bg-primary);
    line-height: var(--lh-normal);
}

/* --- Typographie --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-heading);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
}

h1 {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
}

h2 {
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
}

h3 {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
}

h4 {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
}

@media (min-width: 768px) {
    h1 { font-size: var(--fs-3xl); }
    h2 { font-size: var(--fs-2xl); }
    h3 { font-size: var(--fs-xl); }
}

@media (min-width: 1024px) {
    h1 { font-size: var(--fs-display); }
    h2 { font-size: var(--fs-3xl); }
}

p + p {
    margin-top: var(--space-md);
}

.text-secondary {
    color: var(--color-text-secondary);
}

.text-small {
    font-size: var(--fs-sm);
}

.text-gold {
    color: var(--color-gold);
}

strong, b {
    font-weight: var(--fw-semibold);
}

/* --- Liens --- */
.content-area a:not(.btn):not(.card-link) {
    color: var(--color-gold);
    text-decoration: underline;
    text-decoration-color: rgba(197, 153, 42, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--transition-fast);
}

.content-area a:not(.btn):not(.card-link):hover {
    text-decoration-color: var(--color-gold);
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.container--wide {
    max-width: var(--container-wide);
}

.section {
    padding-block: var(--space-3xl);
}

.section--alt {
    background-color: var(--color-bg-alt);
}

.section--white {
    background-color: var(--color-bg-white);
}

.section--dark {
    background-color: var(--color-bg-dark);
    color: var(--color-text-on-dark);
}

@media (min-width: 768px) {
    .section {
        padding-block: var(--space-4xl);
    }
}

/* --- Section Header --- */
.section-header {
    text-align: center;
    max-width: 700px;
    margin-inline: auto;
    margin-bottom: var(--space-2xl);
}

.section-header h2 {
    margin-bottom: var(--space-md);
}

.section-header p {
    color: var(--color-text-secondary);
    font-size: var(--fs-md);
    line-height: var(--lh-relaxed);
}

/* Filet dore decoratif sous les titres de section */
.section-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
    margin: var(--space-md) auto 0;
    border-radius: var(--radius-full);
}

.section-header--left {
    text-align: left;
    margin-inline: 0;
}

.section-header--left h2::after {
    margin-left: 0;
}

/* --- Boutons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-xl);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    line-height: 1;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    min-height: 52px;
    text-decoration: none;
}

.btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn--primary {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
    color: var(--color-text-on-gold);
    border-color: var(--color-gold);
}

.btn--primary:hover {
    background: linear-gradient(135deg, var(--color-gold-hover), var(--color-gold));
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.btn--outline {
    background: transparent;
    color: var(--color-gold);
    border-color: var(--color-gold);
}

.btn--outline:hover {
    background: var(--color-gold-muted);
    border-color: var(--color-gold-light);
}

.btn--dark {
    background: var(--color-bg-dark);
    color: var(--color-text-on-dark);
    border-color: var(--color-bg-dark);
}

.btn--dark:hover {
    background: var(--color-bg-dark-alt);
    transform: translateY(-1px);
}

.btn--white {
    background: var(--color-bg-white);
    color: var(--color-heading);
    border-color: var(--color-border);
}

.btn--white:hover {
    border-color: var(--color-gold);
    box-shadow: var(--shadow-sm);
}

.btn--lg {
    padding: var(--space-md) var(--space-2xl);
    font-size: var(--fs-md);
    min-height: 58px;
    border-radius: var(--radius-lg);
}

.btn--sm {
    padding: var(--space-xs) var(--space-lg);
    font-size: var(--fs-sm);
    min-height: 42px;
}

.btn--full {
    width: 100%;
}

.btn:active {
    transform: translateY(0);
}

/* --- Cards --- */
.card {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card__body {
    padding: var(--space-lg);
}

.card__img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.card__tag {
    display: inline-block;
    padding: var(--space-2xs) var(--space-sm);
    background: var(--color-gold-muted);
    color: var(--color-gold);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

.card__title {
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    color: var(--color-heading);
    margin-top: var(--space-sm);
    line-height: var(--lh-snug);
}

.card__text {
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
    line-height: var(--lh-normal);
}

/* --- Grilles --- */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid--2 {
    grid-template-columns: 1fr;
}

.grid--3 {
    grid-template-columns: 1fr;
}

.grid--4 {
    grid-template-columns: 1fr 1fr;
}

@media (min-width: 768px) {
    .grid--2 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
    .grid--4 { grid-template-columns: repeat(4, 1fr); }
    .grid { gap: var(--space-xl); }
}

/* --- Formulaires --- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-weight: var(--fw-semibold);
    margin-bottom: var(--space-xs);
    color: var(--color-heading);
    font-size: var(--fs-base);
}

.form-label .required {
    color: var(--color-error);
    margin-left: 2px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--fs-base);
    color: var(--color-text);
    background: var(--color-bg-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    min-height: 52px;
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px var(--color-gold-muted);
    outline: none;
}

.form-input.error,
.form-textarea.error {
    border-color: var(--color-error);
}

.form-error {
    color: var(--color-error);
    font-size: var(--fs-sm);
    margin-top: var(--space-2xs);
    display: none;
}

.form-error.visible {
    display: block;
}

.form-hint {
    color: var(--color-text-secondary);
    font-size: var(--fs-sm);
    margin-top: var(--space-2xs);
}

/* Checkbox custom */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-white);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    margin-top: 2px;
}

.form-checkbox input[type="checkbox"]:checked {
    background: var(--color-gold);
    border-color: var(--color-gold);
}

.form-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 8px;
    height: 13px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.form-checkbox .form-checkbox__label {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    line-height: var(--lh-normal);
}

/* --- Separateur dore --- */
.divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
    border-radius: var(--radius-full);
    border: none;
}

.divider--center {
    margin-inline: auto;
}

/* --- Badge --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    padding: var(--space-2xs) var(--space-sm);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    border-radius: var(--radius-full);
}

.badge--gold {
    background: var(--color-gold-muted);
    color: var(--color-gold);
}

.badge--dark {
    background: var(--color-bg-dark);
    color: var(--color-gold-light);
}

/* --- Icon circle --- */
.icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-gold-muted);
    color: var(--color-gold);
    flex-shrink: 0;
}

.icon-circle svg {
    width: 28px;
    height: 28px;
}

/* --- Visually Hidden --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Animations d'entree au scroll --- */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .fade-up {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
