/* Gallery */
.fullwidth-section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 2.5rem clamp(1rem, 3vw, 2.5rem);
}

.fullwidth-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .fullwidth-inner {
        padding: 0 1rem;
    }
}

/* Gallery */
.gallery-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: flex-end;
}

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin: 0 0 2.5rem 0; }

/* MASONRY */
.gallery-masonry {
    display: block;
    margin: 0 -0.75rem 2.5rem -0.75rem;
}

.gallery-masonry .gallery-item {
    width: 33.333%;
    padding: 0 0.75rem 1.5rem 0.75rem;
    float: left;
    box-sizing: border-box;
}

@media (max-width: 1000px) {
    .gallery-masonry .gallery-item { width: 50%; }
}

@media (max-width: 600px) {
    .gallery-masonry .gallery-item { width: 100%; }
}

.gallery-link { display: block; overflow: hidden; border-radius: var(--borderRadius); cursor: pointer; position: relative; }
.gallery-link img { width: 100%; height: auto; object-fit: cover; transition: transform 0.5s; vertical-align: top; }
.gallery-link:hover img { transform: scale(1.05); }
.gallery-link:hover .image-download-btn { opacity: 1; }

.gallery-item {
    position: relative;
}

.gallery-item:hover .image-download-btn {
    opacity: 1;
}

.gallery-caption, .shortcode-caption {
    margin: 0;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #6b7280;
    font-style: italic;
    text-align: center;
    line-height: 1.4;
}

.shortcode-container {
}

.shortcode-container .shortcode-image,
.shortcode-container .file-display,
.shortcode-container .video-container {
    margin: 0;
}

/* Habillage de texte (shortcode [image float="left|right"]) */
.shortcode-float-left,
.shortcode-float-right {
    max-width: 50%;
    margin-bottom: 1.5rem;
}

.shortcode-float-left {
    float: left;
    margin-right: 1.5rem;
}

.shortcode-float-right {
    float: right;
    margin-left: 1.5rem;
}

@media (max-width: 768px) {
    .shortcode-float-left,
    .shortcode-float-right {
        float: none;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Carte (shortcode [carte]) */
.map-container {
    border-radius: var(--borderRadius);
    overflow: hidden;
    z-index: 0;
}

.map-link {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    text-align: right;
}

.map-link a {
    color: var(--primaryColor);
}

.map-pin {
    background: none;
    border: none;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}

/* Background helpers for transparent assets */
.bg-check {
    background-image: linear-gradient(45deg, #f5f5f5 25%, transparent 25%), 
                      linear-gradient(-45deg, #f5f5f5 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #f5f5f5 75%), 
                      linear-gradient(-45deg, transparent 75%, #f5f5f5 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: white;
}


/* Base Shortcode Styles */
.lightbox-link {
    cursor: pointer;
    display: inline-block;
    position: relative; /* Pour positionner le bouton de téléchargement */
}

.lightbox-link:hover .image-download-btn {
    opacity: 1;
}

.shortcode-image-wrapper {
    position: relative;
    display: inline-block;
}

.shortcode-image-wrapper:hover .image-download-btn {
    opacity: 1;
}

.shortcode-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--borderRadius);
}

.image-download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.image-download-btn:hover {
    background: white;
    color: var(--primaryBackgroundColor);
}

.image-download-btn svg {
    width: 20px;
    height: 20px;
}

.file-display {
    margin: 2rem 0;
    position: relative; /* Pour le bouton download si c'est une image */
}

.file-display:hover .image-download-btn {
    opacity: 1;
}

.file-display img {
    display: block;
    max-width: 100%;
    height: auto;
}

.file-svg svg {
    display: block;
    width: 100%;
    height: auto;
}

.file-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: #f3f4f6;
    border-radius: var(--borderRadius);
    text-decoration: none;
    color: var(--textColor);
    font-weight: 500;
    transition: background 0.2s;
}

.file-link:hover {
    background: #e5e7eb;
}


/* SLOGAN */
.slogan {
    padding: 1.25rem 1.75rem;
    margin: 2rem 0;
    border-radius: var(--borderRadius);
    border: 1px solid;
    font-weight: 500;
    font-size: 1.05rem;
    line-height: 1.5;
}

.slogan-info {
    background-color: #f8fafc;
    border-color: #dbe6f5;
}

.slogan-warning {
    background-color: #fffcf5;
    border-color: #fcedb1;
}

.slogan-error {
    background-color: #fefaf9;
    border-color: #fcd4d4;
}

.slogan-content {
    display: block;
}


/* COLOR */
.color-display {
    display: inline-flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--borderRadius);
    margin: 0.5rem 0;
    min-width: 220px;
}

.color-swatch {
    width: 42px;
    align-self: stretch;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.05);
}

.color-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.color-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--textColor);
}

.color-value-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 2px 4px;
    margin-left: -4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.clickable-copy {
    cursor: pointer;
}

.clickable-copy:hover {
    background: #f1f5f9;
}

.clickable-copy:active {
    background: #e2e8f0;
}

.color-value {
    font-family: var(--monoFont, monospace);
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Shared icon button style (used for copy and download) */
.btn-icon-minimal {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-icon-minimal:hover {
    background: #f1f5f9;
    color: var(--primaryBackgroundColor);
}

.btn-icon-minimal svg {
    width: 18px;
    height: 18px;
}

/* FONT DISPLAY */
.font-display {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--borderRadius);
}

.font-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.font-info {
    flex-grow: 1;
}

.font-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--textColor);
    margin-bottom: 0.25rem;
}

.font-meta {
    font-size: 0.85rem;
    color: #64748b;
}

.font-preview {
    line-height: 1.4;
    color: var(--textColor);
    word-break: break-word;
}

/* VIDEO */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: var(--borderRadius);
    margin: 2rem 0;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-local-container {
    margin: 2rem 0;
}

.video-local-container video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--borderRadius);
    background: #000;
}

/* GRILLE & COLONNES */
.grid-container {
    display: grid;
    /* Mobile par défaut : soit la valeur mobile, soit 1 */
    grid-template-columns: repeat(var(--grid-cols-mobile, 1), 1fr);
    align-items: start;
}

/* Tablette */
@media (min-width: 768px) {
    .grid-container {
        /* Tablette : soit la valeur tablet, soit la valeur desktop (cols), soit 2 par défaut */
        grid-template-columns: repeat(var(--grid-cols-tablet, var(--grid-cols, 2)), 1fr);
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .grid-container {
        /* Desktop : valeur cols ou 2 par défaut */
        grid-template-columns: repeat(var(--grid-cols, 2), 1fr);
    }
}

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
}

.grid-col {
    min-width: 0;
}

/* SOCIAL LINKS */
.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.1rem;
    border-radius: 2rem;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    transition: opacity 0.2s, transform 0.15s;
    margin: 0.25rem 0.25rem 0.25rem 0;
    vertical-align: middle;
}

.social-link:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.social-link__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.social-link__icon svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}

/* COMMENTAIRE */
.shortcode-commentaire {
    margin: 2rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--primaryBackgroundColor);
    background: #f8fafc;
    border-radius: 0 var(--borderRadius) var(--borderRadius) 0;
}

.shortcode-commentaire .commentaire-contenu > :first-child {
    margin-top: 0;
}

.shortcode-commentaire .commentaire-contenu > :last-child {
    margin-bottom: 0;
}

.shortcode-commentaire .commentaire-auteur {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #64748b;
    font-style: italic;
}
