/* ================================================
   ICE POP TOURISM — style.css
   Aesthetic: Editorial luxury / minimal warmth
   ================================================ */

/* ─── Variables ─────────────────────────────────── */
:root {
    --sand:       #F5F0E8;
    --sand-dark:  #EAE2D4;
    --stone:      #C8BAA5;
    --clay:       #8B7355;
    --earth:      #4A3728;
    --ink:        #1A1410;
    --white:      #FDFCFA;
    --accent:     #C4753A;
    --accent-lt:  #F0E0D0;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'Jost', 'Helvetica Neue', sans-serif;

    --nav-h: 72px;
    --radius: 4px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --transition: 0.25s ease;
    --max-w: 1200px;
    --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--sand) !important;;
    color: var(--earth);
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }



.tpl-overlay { display: none; }
.tpl-overlay.open { display: flex; }

/* ─── NAV ─────────────────────────────────────────── */
#mainNav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: var(--white);
    border-bottom: 1px solid var(--stone);
    display: flex;
    align-items: center;
}

#mainNav > div {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Logo */
#mainNav .nav-logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--earth);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Nav links */
#mainNav .nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

#mainNav .nav-links a {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--clay);
    transition: color var(--transition);
}
#mainNav .nav-links a:hover { color: var(--accent); }

/* Nav CTA */
#mainNav .nav-cta {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--clay);
    border-radius: var(--radius);
    color: var(--clay);
    transition: all var(--transition);
    white-space: nowrap;
}
#mainNav .nav-cta:hover {
    background: var(--earth);
    border-color: var(--earth);
    color: var(--sand);
}

/* Hamburger (mobile) */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
}
.nav-hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--earth);
    transition: all var(--transition);
}

/* ─── MOBILE MENU ────────────────────────────────── */
.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--stone);
    padding: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease, padding 0.3s ease;
}
.mobile-menu.open {
    max-height: 400px;
    padding: 1rem 0;
}
.mobile-menu a {
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--clay);
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--sand-dark);
    transition: color var(--transition), background var(--transition);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--accent); background: var(--sand); }

/* ─── MAIN CONTENT ───────────────────────────────── */
main, .page-content {
    flex: 1;
    max-width: var(--max-w);
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
}

/* ─── HERO BANNER ────────────────────────────────── */
.hero {
    padding: 5rem 2rem 4rem;
    text-align: center;
    background: var(--white);
    border-bottom: 1px solid var(--sand-dark);
}
.hero-eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 400;
    color: var(--earth);
    line-height: 1.15;
    margin-bottom: 1rem;
}
.hero p {
    font-size: 1rem;
    color: var(--clay);
    max-width: 520px;
    margin: 0 auto;
}

/* ─── PAGE TITLE ─────────────────────────────────── */
.page-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    color: var(--earth);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}
.page-subtitle {
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--clay);
    margin-bottom: 2.5rem;
}

/* ─── TEMPLATES GRID ─────────────────────────────── */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2.5rem;
}

/* ─── TEMPLATE CARD ──────────────────────────────── */
.template-card {
    background: var(--white);
    border: 1px solid var(--sand-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.template-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(74,55,40,0.10);
}

/* ─── INFO BLOCK ─────────────────────────────────── */
/*
   .info-template est un <a> (lien vers la page du template).
   On le rend block pour que toute la zone soit cliquable.
*/
.info-template {
    display: block;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--sand-dark);
    transition: background var(--transition);
}
.info-template:hover {
    background: var(--sand);
}

.info-template .tpl-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--earth);
    margin-bottom: 0.25rem;
}
.info-template .tpl-desc {
    display: block;
    font-size: 0.875rem;
    color: var(--clay);
    line-height: 1.55;
    margin-bottom: 0.5rem;
}
.info-template .tpl-place {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}
.info-template .tpl-place::before {
    content: "◎";
    font-size: 0.65rem;
}

/* ─── PICTURE GALLERY ────────────────────────────── */
.picture-template {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
    padding: 6px;
    background: var(--sand-dark);
}

/* ── Image item — sélection multiple ─────────────── */
.pic-item {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: pointer;
    border-radius: 4px;
}
.pic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.25s ease;
    pointer-events: none; /* évite que l'img intercepte le clic */
}
.pic-item:hover img {
    transform: scale(1.06);
    filter: brightness(0.85);
}

/* Overlay de sélection */
.pic-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(196, 117, 58, 0);
    transition: background var(--transition);
    pointer-events: none;
    z-index: 1;
}

/* Tick visible quand sélectionné */
.pic-item::before {
    content: "✓";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity var(--transition), transform var(--transition);
    pointer-events: none;
    z-index: 3;
    line-height: 22px;
    text-align: center;
}

/* État sélectionné */
.pic-item.selected::after {
    background: rgba(196, 117, 58, 0.35);
}
.pic-item.selected::before {
    opacity: 1;
    transform: scale(1);
}
.pic-item.selected img {
    filter: brightness(0.75);
}

/* Barre de sélection flottante */
.selection-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--earth);
    color: var(--sand);
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 200;
    box-shadow: 0 8px 24px rgba(26,20,16,0.25);
    white-space: nowrap;
}
.selection-bar.visible {
    transform: translateX(-50%) translateY(0);
}
.selection-bar .sel-count {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent);
}
.selection-bar button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--transition);
}
.selection-bar button:hover { background: var(--clay); }
.selection-bar .sel-clear {
    background: none;
    color: var(--stone);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    font-family: var(--font-body);
    padding: 0;
}
.selection-bar .sel-clear:hover { color: var(--sand); background: none; }

/* ─── FOOTER ─────────────────────────────────────── */
#contact {
    background: var(--earth);
    color: var(--sand);
    margin-top: auto;
}

#contact > div {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 4rem 2rem 3rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand .footer-logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--sand);
    margin-bottom: 0.75rem;
}
.footer-brand p {
    font-size: 0.85rem;
    color: var(--stone);
    line-height: 1.65;
    max-width: 240px;
}

.footer-col h4 {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a {
    font-size: 0.875rem;
    color: var(--stone);
    transition: color var(--transition);
}
.footer-col ul li a:hover { color: var(--sand); }

.footer-bottom {
    border-top: 1px solid rgba(200,186,165,0.2);
    padding: 1.5rem 2rem;
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.footer-bottom p {
    font-size: 0.775rem;
    color: var(--stone);
    opacity: 0.7;
}


#add-template{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:9999;
}

#add-template-content{
    background:white;
    padding:30px;
    border-radius:16px;
    width:600px;
    max-width:90%;
    display:flex;
    flex-direction:column;
    gap:20px;
}

#add-template input{
    width:100%;
    padding:10px;
    border-radius:8px;
    border:1px solid #ccc;
    margin-top:5px;
}

.upload-zone{
    border:2px dashed #ccc;
    border-radius:12px;
    padding:20px;
    text-align:center;
    cursor:pointer;
}

#add-picture{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.thumb-wrapper{
    position:relative;
    width:120px;
    height:120px;
}

.thumb-wrapper img{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:10px;
}

.thumb-wrapper button{
    position:absolute;
    top:5px;
    right:5px;
    border:none;
    background:red;
    color:white;
    border-radius:50%;
    width:25px;
    height:25px;
    cursor:pointer;
}

.modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
}

.modal-actions button{
    padding:10px 15px;
    border:none;
    border-radius:8px;
    cursor:pointer;
}

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 900px) {
    #contact > div {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    #mainNav .nav-links,
    #mainNav .nav-cta { display: none; }
    .nav-hamburger { display: flex; }
    .mobile-menu { display: flex; }

    main, .page-content { padding: 2rem 1.25rem 4rem; }
    .hero { padding: 3rem 1.25rem 2.5rem; }

    .templates-grid { grid-template-columns: 1fr; gap: 1.5rem; }

    #contact > div {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2.5rem 1.25rem 2rem;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }

    .selection-bar {
        width: calc(100% - 2.5rem);
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        bottom: 1rem;
    }
}
/* ── Admin page header ── */
.admin-page-header {
    background: var(--white);
    border-bottom: 1px solid var(--sand-dark);
    margin-bottom: 2.5rem;
}
.admin-page-header__inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 2.5rem 2rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.admin-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.4rem;
}
.admin-page-header .page-title  { margin-bottom: 0.15rem; }
.admin-page-header .page-subtitle { margin-bottom: 0; }

/* ── Buttons ── */
.btn-detail,
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.65rem 1.4rem;
    background: var(--earth);
    color: var(--sand);
    border: 1px solid var(--earth);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    white-space: nowrap;
}
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }

.btn-icon {
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 300;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 0.55rem 1.1rem;
    background: transparent;
    color: var(--clay);
    border: 1px solid var(--stone);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-ghost:hover { background: var(--sand); color: var(--earth); border-color: var(--clay); }

.btn-danger-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 0.55rem 1.1rem;
    background: transparent;
    color: var(--clay);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-danger-ghost:hover { color: #b83232; border-color: #f5d0d0; background: #fff5f5; }

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.65rem 1.4rem;
    background: #b83232;
    color: white;
    border: 1px solid #b83232;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}
.btn-danger:hover  { background: #8c2222; }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Admin grid ── */
.admin-grid {
    max-width: var(--max-w);
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem 5rem;
}

/* ── Admin card ── */
.admin-card {
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: cardIn 0.45s ease forwards;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.admin-card__gallery {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 90px 90px;
    gap: 3px;
    background: var(--sand-dark);
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.admin-card__gallery--empty {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stone);
}

.admin-card__thumb {
    overflow: hidden;
    position: relative;
}
.admin-card__thumb--main {
    grid-row: 1 / 3;
}
.admin-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.admin-card:hover .admin-card__thumb img { transform: scale(1.05); }

.admin-card__thumb--more {
    background: var(--earth);
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-card__thumb--more span {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--sand);
}

.admin-card__body {
    padding: 1.25rem 1.5rem 0.75rem;
    flex: 1;
}
.admin-card__name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--earth);
    margin-bottom: 0.3rem;
    line-height: 1.2;
}
.admin-card__desc {
    font-size: 0.85rem;
    color: var(--clay);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.admin-card__place {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}
.admin-card__place::before { content: "◎ "; }

.admin-card__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--sand-dark);
    background: var(--sand);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    max-width: 400px;
    margin: 0 auto;
}
.empty-state__icon {
    font-size: 2.5rem;
    color: var(--stone);
    margin-bottom: 1.25rem;
}
.empty-state__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--earth);
    margin-bottom: 0.5rem;
}
.empty-state__sub {
    font-size: 0.875rem;
    color: var(--clay);
    margin-bottom: 1.75rem;
}

/* ── Overlay / Modal ── */
.tpl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 20, 16, 0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: stretch;
    justify-content: center;
    z-index: 9999;
    padding: 0;
}
.tpl-overlay.open { display: flex; }

.tpl-modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(26,20,16,0.30);
    animation: modalIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.tpl-modal--sm { max-width: 420px; }
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.93) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.tpl-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.75rem 3.5rem 1.25rem 1.75rem; /* right padding leaves room for fixed ✕ */
    border-bottom: 1px solid var(--sand-dark);
    flex-shrink: 0;
}
.tpl-modal__eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--clay);
    margin-bottom: 0.25rem;
}
.tpl-modal__title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--earth);
    line-height: 1.15;
}
.tpl-modal__close {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--sand-dark);
    border-radius: 50%;
    font-size: 1rem;
    color: var(--earth);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(26,20,16,.18);
    transition: background var(--transition), color var(--transition), transform .15s;
    flex-shrink: 0;
}
.tpl-modal__close:hover {
    background: var(--earth);
    color: var(--white);
    transform: scale(1.08);
}

.tpl-modal__body {
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
}

.tpl-modal__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--sand-dark);
    background: var(--sand);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-shrink: 0;
}

/* ── Form fields ── */
.tpl-field { display: flex; flex-direction: column; gap: 0.4rem; }
.tpl-label {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--clay);
    font-weight: 500;
}
.tpl-editor,
.tpl-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--earth);
    background: var(--white);
    border: 1px solid var(--sand-dark);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.tpl-input:focus {
    border-color: var(--clay);
    box-shadow: 0 0 0 3px rgba(139,115,85,0.12);
}
.tpl-input::placeholder { color: var(--stone); }

/* ── Upload zone ── */
.tpl-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    border: 1.5px dashed var(--stone);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.tpl-upload-zone:hover { border-color: var(--clay); background: var(--sand); }
.tpl-upload-icon {
    font-size: 1.5rem;
    color: var(--clay);
    line-height: 1;
}
.tpl-upload-text {
    font-size: 0.85rem;
    color: var(--clay);
    font-weight: 500;
}
.tpl-upload-hint {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--stone);
}

/* ── Thumbnails ── */
.tpl-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0.25rem;
}
.thumb-wrapper {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(26,20,16,0.12);
}
.thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.thumb-wrapper button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    line-height: 1;
    border: none;
    background: var(--earth);
    color: var(--sand);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}
.thumb-wrapper:hover button { opacity: 1; }

/* ── Feedback ── */
.tpl-feedback {
    font-size: 0.82rem;
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius);
    background: var(--sand);
}

/* ── Delete warning ── */
.tpl-delete-warning {
    font-size: 0.875rem;
    color: var(--clay);
    line-height: 1.65;
    padding: 1rem 1.1rem;
    background: var(--sand);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .admin-page-header__inner { align-items: flex-start; flex-direction: column; }
    .admin-grid { padding: 0 1.25rem 3rem; }
    .tpl-modal__header, .tpl-modal__body, .tpl-modal__footer { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/*---------------------------------------------------------------------------*/
/* ── Editor modal ── */
.lightbox-modal {
    background: var(--white);
    border-radius: 0;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    animation: modalIn .28s cubic-bezier(.34,1.56,.64,1) forwards;
    overflow-y: auto;   /* scroll vertical libre */
    overflow-x: hidden;
}

/* ── Wrapper that holds stage + all floating overlays — reverted ── */
.lb-stage-wrapper {
    display: contents; /* transparent, enfants directement dans le flex column */
}

/* ── Tabs ── */
.editor-tabs {
    display: flex;
    gap: .25rem;
    align-items: center;
    padding: 0 .25rem;
    flex: 1;
    /*justify-content: center;*/
    justify-content: flex-start;
}
.editor-tab {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--clay);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: .4rem .9rem;
    cursor: pointer;
    transition: all var(--transition);
}
.editor-tab:hover { background: var(--sand); color: var(--earth); }
.editor-tab.is-active {
    background: var(--earth);
    color: var(--sand);
    border-color: var(--earth);
}
.tab-icon { font-size: .95rem; line-height: 1; }

/* ── Stage ── */
.lb-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;   /* hauteur proportionnelle, toujours visible */
    flex-shrink: 0;
    overflow: hidden;
    background: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
}
/* Sur grands écrans, le stage prend tout l'espace restant */
@media (min-height: 600px) and (min-width: 641px) {
    .lb-stage {
        aspect-ratio: unset;
        flex: 1;
        min-height: 0;
    }
}
#lbImg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
    transition: opacity .25s;
}
#lbVideo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
    transition: opacity .25s;
}
/* ── Drop hint ── */
.lb-drop-hint {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color: rgba(255,255,255,.14);
    font-size: .8rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    pointer-events: none;
    transition: color .2s;
}
.lb-stage.drag-over .lb-drop-hint { color: rgba(196,117,58,.7); }
.lb-drop-hint span:first-child { font-size: 2rem; }

/* ── Panel + toolbar — normal flow, scrollable ── */
.lb-panel {
    flex-shrink: 0;
    width: 100%;
}
.lb-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--sand-dark);
    background: var(--sand);
}
.lb-toolbar--custom { gap: .75rem; }
.lb-toolbar__group {
    display: flex;
    align-items: center;
    gap: .45rem;
}
.lb-toolbar__group + .lb-toolbar__group {
    padding-left: .65rem;
    border-left: 1px solid var(--stone);
}
.lb-text-input  { width: 160px; padding: .5rem .7rem; font-size: .85rem; }
.lb-counter     { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--clay); min-width: 48px; text-align: center; }
.lb-nav         { padding: .45rem .85rem; }
.lb-size-btn    { padding: .3rem .65rem; font-size: 1rem; line-height: 1; min-width: 28px; justify-content: center; }

/* ── Color picker ── */
.lb-color-label { display: flex; flex-direction: column; gap: .25rem; align-items: center; cursor: pointer; }
.lb-color-input {
    width: 36px;
    height: 28px;
    border: 1px solid var(--stone);
    border-radius: var(--radius);
    padding: 2px;
    cursor: pointer;
    background: none;
}

/* ── Select ── */
.lb-select {
    font-family: var(--font-body);
    font-size: .8rem;
    color: var(--earth);
    background: var(--white);
    border: 1px solid var(--sand-dark);
    border-radius: var(--radius);
    padding: .4rem .6rem;
    cursor: pointer;
}

/* ── Style buttons (Bold / Italic) ── */
.lb-style-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--stone);
    background: var(--white);
    border-radius: var(--radius);
    font-size: .9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--earth);
    transition: all var(--transition);
}
.lb-style-btn.is-active, .lb-style-btn:hover {
    background: var(--earth);
    color: var(--sand);
    border-color: var(--earth);
}

/* ── Blocs panel ── */
.lb-blocs-panel {
    border-top: 1px solid var(--sand-dark);
    background: var(--sand);
    padding: .85rem 1.25rem;
}
.lb-blocs-hint {
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--stone);
    margin-bottom: .75rem;
}
.lb-blocs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}
.bloc-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    background: var(--white);
    border: 1px solid var(--sand-dark);
    border-radius: var(--radius);
    padding: .6rem .75rem;
    cursor: pointer;
    transition: all var(--transition);
    min-width: 72px;
}
.bloc-item:hover { border-color: var(--accent); background: var(--accent-lt, #f0e0d0); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(196,117,58,.15); }
.bloc-label { font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; color: var(--clay); }

/* Bloc previews */
.bloc-preview {
    font-size: .78rem;
    padding: .2rem .45rem;
    border-radius: 2px;
    white-space: nowrap;
    line-height: 1.3;
}
.bloc-preview--titre      { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: white; background: linear-gradient(135deg, #1a1410, #4a3728); padding: .15rem .4rem; }
.bloc-preview--citation   { font-family: var(--font-display); font-style: italic; font-size: .95rem; color: white; background: rgba(74,55,40,.85); padding: .2rem .5rem; }
.bloc-preview--info       { background: rgba(196,117,58,.9); color: white; font-size: .72rem; }
.bloc-preview--etiquette  { background: white; color: #1a1410; border: 1.5px solid rgba(0,0,0,.3); font-size: .72rem; border-radius: 20px; padding: .15rem .5rem; }
.bloc-preview--date       { background: rgba(0,0,0,.7); color: white; font-size: .72rem; border-radius: 3px; }
.bloc-preview--cadre      { font-size: 1.4rem; color: var(--clay); line-height: 1; }
.bloc-preview--hashtag    { color: var(--accent); font-weight: 600; font-size: .8rem; }
.bloc-preview--separateur { color: rgba(255,255,255,.7); background: rgba(0,0,0,.5); font-size: .75rem; letter-spacing: .2em; border-radius: 2px; }

/* ── Layer controls bar — flux normal, scrollable avec le reste ── */
.lb-layer-controls {
    flex-shrink: 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1.25rem;
    background: var(--accent-lt, #f0e0d0);
    border-top: 2px solid var(--accent);
}
.lc-group { display: flex; align-items: center; gap: .4rem; }
.lc-label { font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; color: var(--clay); white-space: nowrap; }
.lc-val   { font-size: .72rem; color: var(--clay); min-width: 34px; }

/* ── Draggable layers ── */
.lb-layer {
    position: absolute;
    cursor: grab;
    user-select: none;
    touch-action: none;
    z-index: 10;
    transform-origin: center center;
}
.lb-layer:active { cursor: grabbing; }
.lb-layer:hover .lb-layer-del { opacity: 1; }
.lb-layer.selected { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* Text layer */
.lb-layer--text {
    font-family: var(--font-display);
    font-size: 28px;
    color: white;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0,0,0,.6), 0 0 20px rgba(0,0,0,.3);
    padding: .15em .35em;
}

/* Image layer */
.lb-layer--img img {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
    display: block;
    pointer-events: none;
}

/* Bloc layers */
.lb-layer--bloc {  }

.lb-bloc--titre {
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1.12;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, rgba(26,20,16,.85), rgba(74,55,40,.75));
    padding: .3em .6em;
    border-radius: 3px;
    text-shadow: 0 2px 8px rgba(0,0,0,.5);
    white-space: nowrap;
    backdrop-filter: blur(4px);
    cursor: text;
}
.lb-bloc--citation {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.3rem;
    color: white;
    background: rgba(26,20,16,.72);
    border-left: 3px solid var(--accent);
    padding: .5em .9em;
    border-radius: 0 3px 3px 0;
    max-width: 240px;
    white-space: normal;
    line-height: 1.4;
    backdrop-filter: blur(4px);
    cursor: text;
}
.lb-bloc--info {
    display: flex;
    align-items: flex-start;
    gap: .4em;
    background: rgba(196,117,58,.88);
    color: white;
    padding: .45em .75em;
    border-radius: 4px;
    font-size: .85rem;
    white-space: normal;
    line-height: 1.4;
    backdrop-filter: blur(4px);
    cursor: text;
}
.lb-bloc--etiquette {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    line-height: 1.2;
    background: white;
    color: #1a1410;
    border: 1.5px solid rgba(0,0,0,.25);
    padding: .3em .75em;
    border-radius: 100px;
    font-size: .82rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    cursor: text;
}
.lb-bloc--date {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    background: rgba(0,0,0,.7);
    color: white;
    padding: .35em .75em;
    border-radius: 4px;
    font-size: .82rem;
    line-height: 1.2;
    letter-spacing: .04em;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    cursor: text;
}
.lb-bloc--cadre {
    border: 2.5px solid rgba(255,255,255,.65);
    border-radius: 4px;
    width: 180px;
    height: 120px;
    pointer-events: auto;
    box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}
.lb-bloc--hashtag {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
    text-shadow: 0 1px 6px rgba(0,0,0,.5);
    white-space: nowrap;
    cursor: text;
}
.lb-bloc--separateur {
    background: rgba(0,0,0,.5);
    color: rgba(255,255,255,.8);
    letter-spacing: .3em;
    padding: .25em .8em;
    border-radius: 2px;
    font-size: .8rem;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

/* Delete button on layer */
.lb-layer-del {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 20px;
    height: 20px;
    background: #b83232;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: .6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
    z-index: 20;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .lightbox-modal { border-radius: 0; }
    .lb-toolbar { gap: .4rem; padding: .65rem .85rem; }
    .lb-text-input { width: 120px; }
    .editor-tabs { gap: .15rem; }
    .editor-tab  { padding: .35rem .6rem; font-size: .65rem; }
    .lb-blocs-grid { gap: .4rem; }
    .bloc-item { min-width: 60px; }
}

/* ── Gallery header ── */
.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .85rem;
    flex-wrap: wrap;
    gap: .65rem;
}
.gallery-meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .75rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--clay);
}
.gallery-sep { color: var(--stone); }
.gallery-add-btn { cursor: pointer; }

/* ── Gallery error toast ── */
.gallery-error {
    background: #fff5f5;
    border: 1px solid #f5c6c6;
    color: #b83232;
    border-radius: var(--radius);
    padding: .6rem 1rem;
    font-size: .82rem;
    margin-bottom: .75rem;
    animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity:0; transform: translateY(-4px); } to { opacity:1; transform: none; } }

/* ── Gallery empty ── */
.gallery-empty {
    padding: 2rem;
    color: var(--stone);
    font-size: .85rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    grid-column: 1 / -1;
}

/* ── Delete button on pic-item ── */
.pic-item .pic-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    background: rgba(26,20,16,.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: .65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition), background var(--transition);
    z-index: 5;
    backdrop-filter: blur(4px);
}
.pic-item:hover .pic-delete-btn { opacity: 1; }
.pic-item .pic-delete-btn:hover { background: #b83232; }

/* ── Video item in gallery ── */
.pic-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.pic-item .vid-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(26,20,16,.7);
    color: var(--sand);
    font-size: .65rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .2rem .5rem;
    border-radius: 2px;
    backdrop-filter: blur(4px);
    z-index: 4;
    pointer-events: none;
}
.html2canvas-fix .lb-layer-del {
    display: none !important;
}

.html2canvas-fix .lb-bloc--titre,
.html2canvas-fix .lb-bloc--citation,
.html2canvas-fix .lb-bloc--info,
.html2canvas-fix .lb-bloc--etiquette,
.html2canvas-fix .lb-bloc--date,
.html2canvas-fix .lb-bloc--separateur {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}


.tourism-login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    background:
        radial-gradient(circle at 12% 18%, rgba(196, 117, 58, 0.18), transparent 34%),
        linear-gradient(135deg, var(--white) 0%, var(--sand) 52%, var(--sand-dark) 100%);
    overflow: hidden;
}

.tourism-login__visual {
    position: relative;
    min-height: 100%;
    padding: 4rem;
    display: flex;
    align-items: flex-end;
    isolation: isolate;
}

.tourism-login__visual::before {
    content: "";
    position: absolute;
    inset: 2rem 0 2rem 2rem;
    background:
        linear-gradient(135deg, rgba(26, 20, 16, 0.12), rgba(26, 20, 16, 0.58)),
        radial-gradient(circle at 70% 28%, rgba(253, 252, 250, 0.28), transparent 24%),
        linear-gradient(140deg, var(--clay), var(--earth) 58%, var(--ink));
    border-radius: 0 26rem 26rem 0;
    box-shadow: 0 28px 80px rgba(74, 55, 40, 0.18);
    z-index: -1;
}

.tourism-login__visual::after {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    right: 5vw;
    top: 16vh;
    border: 1px solid rgba(253, 252, 250, 0.55);
    border-radius: 50%;
    z-index: -1;
}

.tourism-login__caption {
    max-width: 520px;
    color: var(--white);
    text-shadow: 0 10px 30px rgba(26, 20, 16, 0.42);
}

.tourism-login__eyebrow {
    font-size: 0.76rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
}

.tourism-login__caption h1 {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 5.6rem);
    font-weight: 400;
    line-height: 0.98;
    margin-bottom: 1.25rem;
}

.tourism-login__caption p {
    color: rgba(253, 252, 250, 0.82);
    max-width: 430px;
}

.tourism-login__panel-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.tourism-login__panel {
    width: 100%;
    max-width: 430px;
    background: rgba(253, 252, 250, 0.78);
    border: 1px solid rgba(200, 186, 165, 0.72);
    border-radius: 18px;
    padding: 2.35rem;
    box-shadow: 0 22px 70px rgba(74, 55, 40, 0.14);
    backdrop-filter: blur(18px);
}

.tourism-login__kicker {
    color: var(--accent);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.tourism-login__title {
    font-family: var(--font-display);
    color: var(--earth);
    font-size: 2.35rem;
    font-weight: 400;
    line-height: 1.05;
    margin-bottom: 0.65rem;
}

.tourism-login__intro {
    color: var(--clay);
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
}

.tourism-login__field {
    margin-bottom: 1rem;
}

.tourism-login__label {
    display: block;
    color: var(--clay);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
}

.tourism-login__alert {
    border-radius: var(--radius);
    padding: 0.8rem 0.95rem;
    margin-bottom: 1.25rem;
    font-size: 0.86rem;
    line-height: 1.45;
}

.tourism-login__alert--error {
    color: #7f1d1d;
    background: rgba(185, 28, 28, 0.08);
    border: 1px solid rgba(185, 28, 28, 0.22);
}

.tourism-login__alert--info {
    color: var(--earth);
    background: var(--sand);
    border: 1px solid var(--sand-dark);
}

.tourism-login__actions {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.45rem;
}

.tourism-login__link {
    color: var(--accent);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tourism-login__link:hover {
    color: var(--earth);
}

@media (max-width: 900px) {
    .tourism-login {
        grid-template-columns: 1fr;
    }

    .tourism-login__visual {
        min-height: 320px;
        padding: 2rem;
    }

    .tourism-login__visual::before {
        inset: 1rem;
        border-radius: 20px;
    }

    .tourism-login__panel-wrap {
        padding: 2rem 1.25rem 3rem;
    }
}

/* Style pour le groupe de radios */
.tpl-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

/* Style pour chaque item radio */
.tpl-radio-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

/* Style pour l'input radio (masqué visuellement) */
.tpl-radio-input {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--stone);
    border-radius: 50%;
    background: var(--white);
    position: relative;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.tpl-radio-input:hover {
    border-color: var(--clay);
}

.tpl-radio-input:checked {
    border-color: var(--accent);
    background: var(--accent);
}

.tpl-radio-input:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--sand);
    border-radius: 50%;
}

/* Style pour le label du radio */
.tpl-radio-label {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--earth);
    cursor: pointer;
    transition: color var(--transition);
}

.tpl-radio-label:hover {
    color: var(--accent);
}

/* Style pour le label du champ (déjà présent dans ton CSS) */
.tpl-label {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--clay);
    font-weight: 500;
}



/* ── Show layout: two columns ── */
.show-layout {
    display: grid;
    grid-template-columns: 1fr 5fr;
    gap: 2.5rem;
    align-items: start;
    margin-bottom: 3rem;
}
.show-layout__info { /* natural flow */ }
.show-layout__carousel { position: relative; }

@media (max-width: 860px) {
    .show-layout { grid-template-columns: 1fr; }
}

/* ── Template carousel ── */
.tpl-carousel {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--ink);
    aspect-ratio: 16 / 9;
    user-select: none;
}
.tpl-carousel__track {
    position: relative;
    width: 100%;
    height: 100%;
}
.tpl-carousel__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
}
.tpl-carousel__slide.is-active {
    opacity: 1;
    pointer-events: auto;
}
.tpl-carousel__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Nav buttons */
.tpl-carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 38px;
    height: 38px;
    background: rgba(26,20,16,.62);
    color: var(--sand);
    border: 1px solid rgba(253,252,250,.18);
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.2s;
    backdrop-filter: blur(4px);
    opacity: 0;
}
.tpl-carousel:hover .tpl-carousel__btn { opacity: 1; }
.tpl-carousel__btn:hover { background: rgba(196,117,58,.85); border-color: transparent; }
.tpl-carousel__btn:disabled { opacity: .25 !important; cursor: not-allowed; }
.tpl-carousel__btn--prev { left: 10px; }
.tpl-carousel__btn--next { right: 10px; }
/* Dots */
.tpl-carousel__dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}
.tpl-carousel__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(253,252,250,.45);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}
.tpl-carousel__dot.is-active { background: var(--accent); transform: scale(1.3); }
/* Counter */
.tpl-carousel__counter {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: .65rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(253,252,250,.75);
    background: rgba(26,20,16,.5);
    padding: .2rem .55rem;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    z-index: 10;
    pointer-events: none;
}
/* Video badge */
.tpl-carousel__vid-badge {
    position: absolute;
    bottom: 32px;
    left: 12px;
    background: rgba(26,20,16,.7);
    color: var(--sand);
    font-size: .65rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .2rem .5rem;
    border-radius: 2px;
    backdrop-filter: blur(4px);
    z-index: 4;
    pointer-events: none;
}

.btn-save {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1rem; border-radius: 6px; font-size: .8rem;
    font-weight: 600; cursor: pointer; border: none;
    background: #2a9d5c; color: #fff; transition: background .15s, opacity .15s;
}
.btn-save:hover  { background: #228a4e; }
.btn-save:disabled { opacity: .55; cursor: not-allowed; }
.btn-save.is-saved { background: #1a6e3d; }
.btn-save.is-error { background: #c0392b; }

/* ── Carousel pleine largeur (modification == 0) ── */
.show-layout__carousel--full {
    margin-bottom: 0;
}
.show-layout__info--full {
    margin-top: 2rem;
}

/* ── Actions sous le carousel : télécharger + champ de verrouillage ── */
.show-carousel-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}

/* ── Champ de verrouillage ── */
.lock-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.lock-field--editor {
    margin: 2rem 0 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--white);
    border: 1px solid var(--sand-dark);
    border-radius: var(--radius-lg);
    max-width: 480px;
}
.lock-field__row {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.lock-field__hint {
    font-size: .78rem;
    color: var(--stone);
    letter-spacing: .02em;
    line-height: 1.4;
    margin-top: .15rem;
}

/* ── Input de type texte (style cohérent) ── */
.tpl-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 .85rem;
    font-family: var(--font-body);
    font-size: .875rem;
    color: var(--earth);
    background: var(--sand);
    border: 1px solid var(--stone);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition), background var(--transition);
}
.tpl-input::placeholder { color: var(--stone); }
.tpl-input:focus {
    border-color: var(--clay);
    background: var(--white);
}

/* ── Bouton Bloquer ── */
.btn-lock {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    height: 38px;
    padding: 0 1.1rem;
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--sand);
    background: var(--earth);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition);
}
.btn-lock:hover  { background: var(--accent); }
.btn-lock:active { opacity: .8; }

/* ── View Lightbox plein écran (modification == 0) ── */
.view-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(26, 20, 16, 0.96);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}
.view-lightbox__media-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: calc(100vw - 120px);
    max-height: calc(100vh - 80px);
}
.view-lightbox__media-wrap img,
.view-lightbox__media-wrap video {
    max-width: 100%;
    max-height: calc(100vh - 80px);
    border-radius: var(--radius-md);
    object-fit: contain;
    box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.view-lightbox__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    background: rgba(253,252,250,.12);
    border: 1px solid rgba(253,252,250,.2);
    border-radius: 50%;
    color: var(--sand);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    z-index: 10;
}
.view-lightbox__close:hover { background: rgba(196,117,58,.85); border-color: transparent; }
.view-lightbox__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    background: rgba(253,252,250,.12);
    border: 1px solid rgba(253,252,250,.2);
    border-radius: 50%;
    color: var(--sand);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    z-index: 10;
}
.view-lightbox__btn:hover { background: rgba(196,117,58,.85); border-color: transparent; }
.view-lightbox__btn--prev { left: 1.25rem; }
.view-lightbox__btn--next { right: 1.25rem; }
.view-lightbox__counter {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(253,252,250,.65);
    background: rgba(26,20,16,.5);
    padding: .25rem .7rem;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

/* ================================================================
   MOBILE OPTIMISATIONS — show page (modification 0 et 1)
   Mobile-first : on ajuste d'abord le petit écran,
   puis on surcharge pour le desktop au besoin.
   ================================================================ */

/* ── 1. Base mobile globals ── */
@media (max-width: 640px) {

    /* Page padding réduit */
    main, .page-content {
        padding: 0 0 4rem;
    }

    /* Admin header compact */
    .admin-page-header__inner {
        padding: 1.25rem 1rem 1rem;
        gap: .75rem;
    }
    .admin-page-header .page-title {
        font-size: 1.6rem;
    }
    .admin-page-header .page-subtitle {
        font-size: .78rem;
    }

    /* ── Carousel pleine largeur : retire l'aspect-ratio fixe,
          laisse le carousel prendre toute la hauteur utile ── */
    .show-layout__carousel--full {
        margin: 0;
    }
    .tpl-carousel {
        aspect-ratio: 4 / 3;   /* plus carré = plus grand sur mobile */
        border-radius: 0;       /* bord à bord sur mobile */
    }

    /* Flèches plus grosses = meilleure cible tactile */
    .tpl-carousel__btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        opacity: 1;            /* toujours visibles sur mobile (pas de hover) */
    }
    .tpl-carousel__btn--prev { left: 6px; }
    .tpl-carousel__btn--next { right: 6px; }

    /* Dots plus grands */
    .tpl-carousel__dot {
        width: 9px;
        height: 9px;
    }

    /* Actions sous le carousel : colonne sur mobile */
    .show-carousel-actions {
        flex-direction: column;
        align-items: stretch;
        gap: .75rem;
        padding: .75rem 1rem;
        background: var(--white);
        border-bottom: 1px solid var(--sand-dark);
    }
    .show-carousel-actions .btn-primary {
        width: 100%;
        justify-content: center;
        padding: .75rem 1rem;
        font-size: .82rem;
        min-height: 44px;
    }

    /* Champ lock pleine largeur */
    .lock-field {
        width: 100%;
    }
    .lock-field__row {
        width: 100%;
    }
    .tpl-input {
        height: 44px;   /* cible tactile iOS recommandée */
        font-size: 16px; /* empêche le zoom auto sur iOS */
    }
    .btn-lock {
        height: 44px;
        padding: 0 1.25rem;
        font-size: .8rem;
        flex-shrink: 0;
    }

    /* Infos texte avec padding */
    .show-layout__info--full {
        padding: 0 1rem;
        margin-top: 1.25rem;
    }
    .show-layout__info--full p {
        font-size: .95rem !important;
        line-height: 1.7 !important;
        margin-bottom: 1.25rem !important;
    }

    /* ── View lightbox : cible tactile agrandie ── */
    .view-lightbox__btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    .view-lightbox__btn--prev { left: .5rem; }
    .view-lightbox__btn--next { right: .5rem; }
    .view-lightbox__close {
        width: 44px;
        height: 44px;
        top: .75rem;
        right: .75rem;
    }
    .view-lightbox__media-wrap {
        max-width: 100vw;
        max-height: calc(100vh - 100px);
        padding: 0 .5rem;
    }

    /* ── Gallery grille : 2 colonnes serrées sur mobile ── */
    .picture-template {
        grid-template-columns: repeat(2, 1fr);
        gap: 3px;
        padding: 3px;
    }
    .pic-item {
        aspect-ratio: 1 / 1;  /* carré = plus lisible */
    }

    /* ── Gallery header ── */
    .gallery-header {
        padding: .75rem 1rem;
        gap: .5rem;
    }

    /* ── Lock field éditeur ── */
    .lock-field--editor {
        margin: 1rem;
        max-width: none;
        border-radius: var(--radius-md);
    }

    /* ── Span explication éditeur ── */
    main > span {
        display: block;
        padding: .75rem 1rem;
        font-size: .82rem;
        line-height: 1.6;
        color: var(--clay);
        background: var(--accent-lt);
        border-left: 3px solid var(--accent);
    }

    /* ── Lightbox éditeur (modal) ── */
    .lightbox-modal {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 96vh;
        width: 100%;
    }
    .tpl-overlay {
        align-items: flex-end;  /* modal glisse du bas sur mobile */
    }

    /* ── Editor tabs ── */
    .editor-tabs {
        gap: .25rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .editor-tabs::-webkit-scrollbar { display: none; }
    .editor-tab {
        flex-shrink: 0;
        padding: .4rem .7rem;
        font-size: .7rem;
    }

    /* ── Modal header compact ── */
    .tpl-modal__header {
        padding: 1rem 3rem 1rem 1rem;
    }
    .tpl-modal__title { font-size: 1.25rem; }

    /* ── Toolbar éditeur ── */
    .editor-toolbar {
        padding: .5rem .75rem;
        gap: .35rem;
        flex-wrap: wrap;
    }
}

/* ── 2. Très petits écrans (< 380px) ── */
@media (max-width: 380px) {
    .tpl-carousel {
        aspect-ratio: 3 / 2;
    }
    .tpl-carousel__btn {
        width: 38px;
        height: 38px;
    }
    .show-carousel-actions {
        padding: .5rem .75rem;
    }
    .admin-page-header .page-title {
        font-size: 1.4rem;
    }
}

/* ── 3. Tablet (641px – 860px) ── */
@media (min-width: 641px) and (max-width: 860px) {
    .tpl-carousel {
        aspect-ratio: 16 / 9;
    }
    .tpl-carousel__btn {
        opacity: 1;   /* toujours visibles sur tablette tactile */
        width: 42px;
        height: 42px;
    }
    .show-carousel-actions {
        padding: .75rem 1.5rem;
        flex-wrap: wrap;
    }
    .tpl-input {
        height: 42px;
        font-size: 16px;
    }
    .btn-lock {
        height: 42px;
    }
    .show-layout__info--full {
        padding: 0 1.5rem;
    }
    .picture-template {
        grid-template-columns: repeat(3, 1fr);
    }
    .admin-page-header__inner {
        padding: 1.75rem 1.5rem;
    }
}

/* ── 4. Desktop : flèches carousel visibles au hover seulement ── */
@media (min-width: 861px) {
    .tpl-carousel__btn {
        opacity: 0;  /* masqué par défaut, visible au hover (déjà défini) */
    }
}

/* ── 5. Touch device : supprimer les états hover qui bloquent ── */
@media (hover: none) {
    /* Flèches toujours visibles sur écran tactile */
    .tpl-carousel__btn { opacity: .85; }
    .view-lightbox__btn { opacity: 1; }
    /* Pas de zoom au hover sur les cards */
    .template-card:hover { transform: none; }
    .pic-item:hover img  { transform: none; filter: none; }
}

