/* Simple CSS for TEI manuscript catalog */

/* Base styles */
tei-TEI {
    max-width: 1200px;
    margin: 0 auto;
    font-family: Helvetica, Arial, sans-serif;
    font-size: large;
    line-height: 1.2;
}

/* Manuscript container */
tei-msDesc {
    display: block;
    margin: 20px 0;
    margin-bottom: 50px;
}

/* Manuscript identifier */
tei-msIdentifier {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 1.2em;
}

tei-msIdentifier > tei-settlement::after,
tei-msIdentifier > tei-repository::after {
    content: ", ";
}

/* Contents */
tei-msContents {
    display: block;
    margin-bottom: 30px;
    margin-left: 20px;
}

tei-msContents::before {
    content: "Content";
    display: block;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 10px;
}

/* Summary */
tei-summary {
    display: block;
    margin: 10px 0;
    margin-left: 20px;
}

tei-summary::before {
    content: "Attribution: ";
    font-weight: bold;
}

/* Manuscript items */
tei-msItem {
    display: block;
    margin-bottom: 15px;
    margin-top: 10px;
    margin-left: 20px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-left: 3px solid #ccc;
    background-color: #fafafa;
}

/* Nested msItems - indent more */
tei-msItem tei-msItem {
    margin-left: 20px;
    background-color: #f0f8ff;
    border-left-color: #5bc0de;
}

tei-msItem tei-msItem tei-msItem {
    margin-left: 40px;
    background-color: #fff8e1;
    border-left-color: #f0ad4e;
}

/* Titles */
.msitem-container > tei-title,
tei-msItem > tei-title {
    display: block;
    font-weight: bold;
    font-style: italic;
    margin-bottom: 5px;
}

.msitem-container > tei-title::before,
tei-msItem > tei-title::before {
    content: "Title: ";
    font-weight: bold;
    font-style: normal;
}

/* Authors */
tei-author {
    display: block;
    font-style: italic;
    margin-bottom: 5px;
}

/* Locus references */
tei-locus {
    display: block;
    margin-bottom: 5px;
}

tei-locus::before {
    content: "ff. " attr(from) "–" attr(to);
    font-weight: bold;
}

tei-locus[from]:not([to])::before {
    content: "f. " attr(from);
    font-weight: bold;
}

tei-locus[to]:not([from])::before {
    content: "f. " attr(to);
    font-weight: bold;
}

.locusGrp-container::before {
    content: "ff. ";
    font-weight: bold;
}

.locusGrp-container {
    font-weight: bold;
}



/* Notes */
tei-note {
    display: block;
    margin: 10px 0;
}

tei-note[type="attribution"]::before {
    content: "Note (attribution): ";
    font-weight: bold;
}

tei-note[type="content"]::before {
    content: "Note (content): ";
    font-weight: bold;
}

tei-note[type="msRelationship"]::before {
    content: "Note (Mss relationships): ";
    font-weight: bold;
}

tei-note[type="paleo"]::before {
    content: "Note (paleo): ";
    font-weight: bold;
}

tei-note[type="desc"]::before {
    content: "Note (description): ";
    font-weight: bold;
}

tei-note[type="biblio"]::before {
    content: "Note (biblio): ";
    font-weight: bold;
}

tei-note[type="editorial"] {
    display: none;
}

/* Hide editorial notes in PersonRegister. Not sure why the over rule does not work also for Personregister */

#PersonRegister tei-note[type="editorial"] {
    display: none;
}



tei-altIdentifier{
    display: none;
}

/* Quotes */
tei-quote {
    display: inline;
    margin: 10px 0;
}

tei-quote::before {
    content: '"';
}

tei-quote::after {
    content: '"';
}

/* Quotes */
tei-q {
    display: inline;
    margin: 10px 0;
}

tei-q::before {
    content: '"';
}

tei-q::after {
    content: '"';
}


/* Colophons */
tei-colophon {
    display: block;
    margin: 10px 0;
}

tei-colophon::before {
    content: "Colophon: ";
    font-weight: bold;
}

/* Explicit and Incipit */
tei-explicit, tei-incipit {
    display: block;
    margin: 10px 0;
}

tei-explicit::before {
    content: "Explicit: ";
    font-weight: bold;
}

tei-explicit[defective="true"]::before {
    content: "Explicit mut.: ";
}

tei-incipit::before {
    content: "Incipit: ";
    font-weight: bold;
}

tei-incipit[defective="true"]::before {
    content: "Incipit mut.: ";
}

/* History */
tei-history {
    display: block;
    margin: 20px 0;
    margin-left: 20px;
}

tei-history::before {
    content: "History";
    display: block;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 10px;
}

tei-origin {
    display: block;
    margin-bottom: 10px;
    margin-left: 20px;
}

/* Dates and places */
tei-origDate {
}

tei-origPlace {
    display: block;
    margin-top: 10px;
}

/* Person names */
tei-persName {
    text-decoration: underline;
    text-decoration-color: orange;
}

/* Place and organization names */
tei-placeName {
    font-weight: 600;
}

tei-orgName {
    font-weight: 600;
}

/* References */
tei-ref {
    color: #337ab7;
    text-decoration: underline;
}

/* ADDITIONAL */

tei-additional {
    display: block;
    margin-top: 20px;
    margin-left: 20px;
}

tei-adminInfo {
    display: block;
    margin-bottom: 10px;
    margin-left: 20px;
}

tei-recordHist > tei-source[cert="high"] > tei-p::after
{
    content: " ✓";
    font-weight: bold;
    color: green;
}


tei-listBibl::before {
    content: "Bibliography";
    display: block;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 10px;
}

tei-listBibl {
    display: block;
    margin-top: 10px;
}

tei-listBibl > tei-bibl {
    display: block;
    margin-bottom: 10px;
    position: relative;
    padding-left: 15px;
}

tei-listBibl > tei-bibl::before {
    content: "•";
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
    tei-TEI {
        padding: 15px;
    }
}

/* Scroll behavior */
[id] {
    scroll-margin-top: 56px;
}

/* Custom styles for Bootstrap 4/5 multi-level dropdowns */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    display: none;
    position: absolute;
}

.dropdown-submenu:hover > .dropdown-menu,
.dropdown-submenu:focus-within > .dropdown-menu {
    display: block;
}

.scrollable-menu {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Display n attribute in parentheses for all elements */
tei-colophon[n]::after {
    content: " (" attr(n) ")";
    font-style: normal;
}

/* Person styling */
		tei-person {
			display: block;
			margin: 30px 0;
			padding: 20px;
			border: 1px solid #e9ecef;
			border-radius: 0.5rem;
			background-color: #fff;
			box-shadow: 0 2px 4px rgba(0,0,0,0.1);
		}

		tei-person > tei-name:first-of-type {
			font-size: 1.4em;
			font-weight: bold;
			color: #495057;
			margin-bottom: 10px;
		}

		tei-name {
			display: block;
			margin-bottom: 5px;
		}

		tei-name:not(:first-of-type) {
			font-style: italic;
			color: #6c757d;
		}

		tei-birth, tei-death, tei-floruit {
			display: inline;
		}

		tei-birth::before {
			content: "Born: ";
			font-weight: bold;
		}

		tei-death::before {
			content: "Died: ";
			font-weight: bold;
		}

        tei-floruit::before {
                content: "Floruit: ";
                font-weight: bold;
            }


		tei-affiliation {
			display: inline-block;
			background-color: #17a2b8;
			color: white;
			padding: 2px 8px;
			border-radius: 3px;
			font-size: 0.9em;
			margin: 5px 0;
		}


		#PersonRegister tei-note {
			display: block;
			margin: 15px 0;
			padding: 10px;
			background-color: #f8f9fa;
			border-left: 4px solid #007bff;
			line-height: 1.6;
		}

        tei-note[type="biblio"]::before {
            content: "Note (biblio): ";
            font-weight: bold;
}

		tei-occupation {

		}

        #PersonRegister tei-note[type="role"]::before {
            content: "Note (role): ";
            font-weight: bold;
            margin-left: 20px;
        }

        #PersonRegister tei-note[type="role"]{
            margin-left: 20px;
            border: none;
            background: none;
        }

        #PersonRegister tei-note[type="biblio"] {
            margin-left: 20px;
            border: none;
            background: none;
        }

        #PersonRegister tei-note[type="attribution"] {
            margin-left: 40px;
            border: none;
            background: none;
        }

        div.tei-occupation::before {
            content: "Role: ";
            font-weight: bold;
        }

        #PersonRegister tei-listBibl::before {
            content: "Bibliography";
            display: block;
            font-weight: bold;
            margin-bottom: 10px;
        }

        #PersonRegister tei-listBibl {
            margin-left: 0px;
        }

		tei-idno {
			display: inline;
			margin: 5px 10px 5px 0;
			padding: 2px 6px;
			background-color: #6c757d;
			color: white;
			border-radius: 3px;
			font-size: 0.8em;
		}


		tei-idno[type="VIAF"] {
			background: none;
			padding: 0;
		}

		tei-idno[type="VIAF"]::before {
			content: "VIAF: ";
			background-color: #6c757d;
			color: white;
			padding: 2px 6px;
			border-radius: 3px;
			margin-right: 5px;
		}

		tei-idno[type="GND"] {
			background: none;
			padding: 0;
		}

		tei-idno[type="GND"]::before {
			content: "GND: ";
			background-color: #6c757d;
			color: white;
			padding: 2px 6px;
			border-radius: 3px;
			margin-right: 5px;
		}

		tei-idno[type="CERL"] {
			background: none;
			padding: 0;
		}

        tei-idno[type="CERL"]::before {
			content: "CERL: ";
			background-color: #6c757d;
			color: white;
			padding: 2px 6px;
			border-radius: 3px;
			margin-right: 5px;
		}

		/* Override tei-idno styles when it contains URI content */
		tei-idno:has(.uri-link-container) {
			background: none;
			padding: 0;
			margin: 0;
			display: block;
		}

        /* Override idno display in msPart*/

        tei-msPart > tei-msIdentifier tei-idno {
         background: none;
            padding: 0;
			margin: 0;
}

		/* URI link container */
		.uri-link-container {
			display: block;
			margin: 10px 0 5px 0;
		}

		.uri-link-label {
			color: #333;
			font-weight: bold;
		}

		.uri-link-url {
			color: #0d6efd;
			text-decoration: underline;
		}

		.uri-link-url:hover {
			color: #0a58ca;
		}


		.ms-link {
			color: #007bff;
			text-decoration: underline;
			cursor: pointer;
		}

		.ms-link:hover {
			color: #0056b3;
		}

		.dates {
			margin: 10px 0;
			font-size: 0.95em;
		}

		.identifiers {
			margin: 10px 0;
		}

        tei-provenance {
            display: block;
            margin-bottom: 10px;
            margin-left: 20px;
        }

        tei-provenance::before {
            content: "Provenance: ";
            font-weight: bold;
        }

        tei-metamark[function="signum"]::before {
            content: "[signum]"
        }

        tei-hi[rend="superscript"] {
          vertical-align: super;
          font-size: smaller;
        }
