:root{font-family:system-ui,-apple-system,Segoe UI,sans-serif;color:#15333b;background:#f5f8f7}*{box-sizing:border-box}body{margin:0;min-height:100vh}header{background:#102b34;color:white;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px max(24px,calc((100vw - 1160px)/2))}header a{color:inherit;text-decoration:none}.brand{display:flex;align-items:center;gap:12px;font-size:20px;font-weight:800}.brand img{width:48px;height:48px;object-fit:contain}.brand small{display:block;font-size:12px;font-weight:500;color:#b6d5d2}main{max-width:1160px;margin:auto;padding:30px 22px 70px}.hero{padding:32px 0 28px}.hero h1{font-size:clamp(32px,5vw,56px);letter-spacing:-.045em;margin:6px 0}.hero p{max-width:650px;color:#516b71;font-size:17px}.eyebrow{color:#177f75!important;text-transform:uppercase;font-size:13px!important;letter-spacing:.08em;font-weight:800}.toolbar{display:flex;gap:14px;flex-wrap:wrap;padding:20px;background:#fff;border:1px solid #e0e9e7;border-radius:18px}.toolbar label{flex:1 1 200px}label{display:block;font-size:14px;font-weight:650}input,select,textarea{display:block;width:100%;margin-top:7px;border:1px solid #cbd9d7;border-radius:10px;padding:12px;background:#fff;color:#15333b;font:inherit}input:focus,select:focus,textarea:focus,button:focus-visible{outline:3px solid #58bcae;outline-offset:2px}.count{margin:22px 0;color:#536a70}.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(235px,1fr));gap:20px}.item{background:#fff;border:1px solid #e2eae8;border-radius:18px;overflow:hidden;box-shadow:0 8px 24px #15333b0b}.item img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block;cursor:zoom-in}.item-body{padding:16px}.item h2{font-size:18px;margin:0 0 8px}.item p{margin:6px 0;color:#536a70;font-size:14px}.tag{display:inline-block;background:#e1f3ef;color:#12695f;border-radius:100px;padding:5px 10px;font-size:12px;font-weight:750;margin-bottom:10px}.delivered{background:#f1f1f1;color:#606b6d}.empty,.error{padding:35px;text-align:center;background:white;border-radius:16px;margin-top:20px}.error{color:#a22d32}footer{text-align:center;color:#687e82;padding:22px}footer a{color:#126f66}dialog{border:0;border-radius:16px;max-width:min(95vw,850px);padding:15px}dialog::backdrop{background:#001b23c9}dialog img{display:block;max-width:100%;max-height:75vh;margin:auto}.close{float:right;border:0;background:transparent;font-size:30px;cursor:pointer}.admin-main{max-width:860px}.panel{background:white;border:1px solid #dfe9e7;border-radius:18px;padding:25px;margin-bottom:24px;box-shadow:0 8px 24px #15333b09}.panel h1{margin-top:0}.fields{display:grid;grid-template-columns:1fr 1fr;gap:15px}form label{margin-bottom:17px}.primary,.secondary{padding:12px 20px;border:0;border-radius:11px;cursor:pointer;font-weight:750}.primary{background:#147e73;color:white}.primary:disabled{opacity:.55;cursor:wait}.secondary{background:#e6efed;color:#15333b}.admin-heading{display:flex;justify-content:space-between;align-items:center;gap:16px}.preview{max-width:250px;max-height:210px;object-fit:contain;border-radius:12px;margin-bottom:15px}.admin-row{display:flex;gap:15px;align-items:center;padding:12px 0;border-bottom:1px solid #e2eae8}.admin-row img{width:76px;height:76px;object-fit:cover;border-radius:10px}.admin-row .details{flex:1}.admin-row button{margin:3px;padding:7px 10px;cursor:pointer}.admin-link{font-size:14px}@media(max-width:600px){header{padding:14px}.fields{grid-template-columns:1fr}.admin-heading{align-items:start;flex-direction:column}.hero{padding:15px 0}.panel{padding:18px}}

.upload-choice{display:flex;gap:16px;align-items:end;flex-wrap:wrap}.upload-choice label{flex:1 1 260px}.upload-choice button{margin-bottom:17px}.multi-row{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) auto;gap:12px;align-items:end;border-bottom:1px solid #e2eae8;padding:10px 0}.multi-row label{min-width:0}.multi-row button{margin-bottom:17px;font-size:20px}.multi-actions{margin-top:20px}#addMulti{margin-top:16px}@media(max-width:600px){.multi-row{grid-template-columns:minmax(0,1fr) auto}.multi-row label:first-child{grid-column:1 / -1}.multi-row label:nth-child(2){grid-column:1}.multi-row button{grid-column:2}}

.object-code{display:inline-block;margin-left:9px;font-weight:800;letter-spacing:.06em;color:#15333b;background:#eaf0f0;border-radius:7px;padding:4px 8px}.remove-actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}#removeDialog{width:min(94vw,480px);padding:24px}#removeDialog h2{margin-top:0}#removeError{color:#a22d32}

/* Código de referencia alineado al extremo derecho de cada ficha */
.item-body{display:flex;flex-wrap:wrap;align-items:center;column-gap:8px}.item-body .tag{margin-bottom:10px}.item-body .object-code{margin-left:auto;margin-bottom:10px;white-space:nowrap}.item-body p{flex-basis:100%}

/* Navegación entre páginas de la galería */
.pagination{display:flex;justify-content:center;align-items:center;gap:14px;flex-wrap:wrap;margin:30px 0 6px;color:#536a70;font-size:14px;font-weight:650}
.pagination[hidden]{display:none}
.pagination button{border:1px solid #cbd9d7;border-radius:10px;background:#fff;color:#12695f;font:inherit;font-weight:750;padding:11px 18px;cursor:pointer;min-height:44px}
.pagination button:hover:not(:disabled){background:#e1f3ef;border-color:#58bcae}
.pagination button:disabled{opacity:.45;cursor:default}
@media(max-width:480px){.pagination{gap:10px}.pagination button{padding:10px 12px}}

/* Aviso mientras GitHub Pages publica las nuevas fotografías */
.photo-loading{display:block;position:relative;overflow:hidden;background:#eaf0ee;min-width:0}
.item .photo-loading{width:100%;aspect-ratio:4/3}
.item .photo-loading img{width:100%;height:100%;object-fit:cover}
.admin-row .photo-loading{width:76px;height:76px;flex:0 0 76px;border-radius:10px}
.admin-row .photo-loading img{width:100%;height:100%;object-fit:cover}
.photo-loading:not(.photo-ready) img{opacity:0}
.photo-loading-status{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:10px;color:#38565b;font-size:13px;font-weight:650;background:#eaf0ee}
.admin-row .photo-loading-status{font-size:10px;padding:5px;line-height:1.25}

/* Visor: la X ocupa una fila propia, nunca encima de la fotografía. */
#photoDialog[open]{display:flex;flex-direction:column;align-items:stretch;gap:10px;box-sizing:border-box;max-width:min(95vw,850px);max-height:95dvh;overflow:auto}
#photoDialog .close{float:none;align-self:flex-end;flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:1px solid #d7e2df;border-radius:10px;background:#f4f8f7;color:#172e32;font-size:30px;line-height:1;cursor:pointer}
#photoDialog .close:hover{background:#e2eeeb}
#photoDialog #bigPhoto{display:block;max-width:100%;max-height:calc(95dvh - 145px);width:auto;height:auto;object-fit:contain;margin:0 auto}
#photoDialog #bigCaption{margin:0 0 3px}

/* La pregunta principal debe leerse desde un PC y una pantalla grande. */
.hero .eyebrow{font-size:clamp(23px,2.7vw,38px)!important;line-height:1.18;letter-spacing:-.025em;text-transform:none;color:#126f66!important;font-weight:850;max-width:100%;margin:0 0 16px}
@media(max-width:600px){.hero .eyebrow{font-size:clamp(22px,5.5vw,29px)!important}}

/* Cabecera de Objetos perdidos: icono más visible en pantallas de ordenador. */
@media(min-width:900px){header .brand img{width:104px;height:104px;flex:0 0 104px}header .brand{gap:18px;font-size:clamp(22px,2vw,29px)}header .brand small{font-size:14px;margin-top:5px}}
@media(min-width:600px) and (max-width:899px){header .brand img{width:76px;height:76px}}

/* Editor de fotografías publicadas */
.photo-actions{display:flex;flex-direction:column;gap:8px;align-items:center}
.photo-editor{width:min(96vw,1040px);max-height:94vh;overflow:auto;border:1px solid #d8e3e5;border-radius:18px;padding:clamp(16px,3vw,28px);background:#fff;color:#102b34}
.photo-editor::backdrop{background:rgba(0,15,24,.78)}
.photo-editor h2{margin:0 0 10px}
.photo-editor p{line-height:1.5}
#editPhotoCanvas{display:block;max-width:100%;height:auto;margin:14px auto;background:#e7eff0;cursor:crosshair;touch-action:none;border-radius:8px}
.photo-editor-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin:14px 0}
#editPhotoMessage{min-height:1.5em;text-align:center}

/* Editor: imagen completa y botones visibles sin desplazarse por la ventana */
.photo-editor{box-sizing:border-box;width:min(96vw,1040px);max-height:calc(100dvh - 28px);overflow-y:auto}
#editPhotoCanvas{width:auto;height:auto;max-width:100%;max-height:clamp(180px,52dvh,620px);object-fit:contain;margin:8px auto}
.photo-editor h2{margin-bottom:6px}
.photo-editor p{margin:7px 0}
.photo-editor-actions{margin:8px 0;gap:8px}
@media(max-height:720px){#editPhotoCanvas{max-height:42dvh}.photo-editor{padding:12px 18px}}

.editor-category-label{display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-weight:700;margin:8px 0 12px}.editor-category-label select{flex:1;min-width:210px;max-width:420px;padding:9px 12px;border:1px solid #c6d6d9;border-radius:9px;background:#fff;color:#102b34;font:inherit}
