/*  phpBB3 Style Sheet
    --------------------------------------------------------------
	Style name:			prosilver (the default phpBB 3.3.x style)
	Based on style:
	Original author:	Tom Beddard ( http://www.subblue.com/ )
	Modified by:		phpBB Limited ( https://www.phpbb.com/ )
    --------------------------------------------------------------
*/

@import url("normalize.css?hash=48eb3f89");
@import url("base.css?hash=7c5543be");
@import url("utilities.css?hash=d8f72c42");
@import url("common.css?hash=843d5d5f");
@import url("links.css?hash=18286e16");
@import url("content.css?hash=d6d1338b");
@import url("buttons.css?hash=56f0d25f");
@import url("cp.css?hash=50d868ab");
@import url("forms.css?hash=9016b55c");
@import url("icons.css?hash=64da33ce");
@import url("colours.css?hash=fcb2f289");
@import url("responsive.css?hash=c9d32cba");


/* Contenedor general en horizontal para la galería */
.attachbox {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    width: 100% !important;
    clear: both !important;
    box-sizing: border-box !important;
}

/* Título de "Adjuntos" arriba ocupando todo el ancho */
.attachbox > dt {
    width: 100% !important;
    display: block !important;
    margin-bottom: 10px !important;
    font-weight: bold !important;
}

/* Estilo unificado para cada tarjeta (Miniaturas de imágenes y PDFs) */
.attachbox dl.file, 
.attachbox dl.thumbnail {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    float: none !important;
    width: 170px !important; 
    max-width: 170px !important; /* Limita estrictamente el ancho para evitar scrolls */
    min-height: 180px !important; 
    margin: 5px !important;
    padding: 10px !important;
    background: #fafafa !important;
    border: 1px solid #dcdcdc !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* Corta cualquier elemento que intente salirse */
}

/* Zona superior: Imágenes o iconos del PDF */
.attachbox dl.thumbnail dt,
.attachbox dl.file dt {
    display: block !important;
    float: none !important;
    width: 100% !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
    order: 1 !important; 
}

/* Zona inferior: Comentarios de fotos o datos de descarga del PDF */
.attachbox dl.thumbnail dd,
.attachbox dl.file dd {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    margin: 8px 0 0 0 !important;
    padding: 0 !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    color: #555555 !important;
    white-space: normal !important; /* Fuerza al texto a saltar de línea en vez de estirarse */
    word-wrap: break-word !important; /* Rompe palabras ultra largas */
    word-break: break-all !important;
    overflow: hidden !important;
    order: 2 !important; 
}

/* Corrección específica para el enlace del nombre en el PDF */
.attachbox dl.file dt a,
.attachbox dl.file dd a {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-all !important;
    color: #105289 !important;
    text-decoration: none !important;
    font-size: 11px !important;
}

/* Control estricto de las dimensiones de las imágenes o iconos */
.attachbox dl.thumbnail dt img,
.attachbox dl.file img {
    max-width: 140px !important;
    max-height: 120px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 4px !important;
}
