/**
 * Public styles for the Info Modal plugin
 */

/* Modal overlay */
.info-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
    justify-content: center;
    align-items: center;
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Modal container */
.info-modal {
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    overflow: hidden;
}

/* Aspect ratio containers */
.info-modal-inner {
    position: relative;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    z-index: 1; /* Lower z-index for background */
}

.aspect-ratio-16-9 {
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.aspect-ratio-4-3 {
    padding-bottom: 75%; /* 4:3 aspect ratio */
}

/* Modal content */
.info-modal-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    overflow: auto;
    box-sizing: border-box;
    font-size: 16px;
    line-height: 1.5;
    font-family: inherit;
    z-index: 10; /* Add z-index to ensure content appears above background */
}

/* Close button */
.info-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: transparent;
    border: none;
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

.info-modal-close:hover {
    color: #000;
}

/* Modal heading */
.info-modal-heading {
    margin-top: 0;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
    line-height: 1.4;
    font-family: inherit;
    position: relative;
    z-index: 15; /* Higher z-index than the content container */
}

h1.info-modal-heading {
    font-size: 48px;
    font-family: Lobster;
}

h2.info-modal-heading {
    font-size: 36px;
    font-family: Permanent Marker;
}

h3.info-modal-heading {
    font-size: 32px;
    font-family: inherit;
}

h4.info-modal-heading {
    font-size: 28px;
    font-family: inherit;
}

h5.info-modal-heading {
    font-size: 24px;
    font-family: inherit;
}

/* Modal body */
.info-modal-body {
    max-width: 80%;
    overflow: auto;
    max-height: 70vh;
    font-size: 16px;
    line-height: 1.5;
    width: 100%;
    font-family: Permanent Marker;
    position: relative;
    z-index: 15; /* Higher z-index than the content container */
}

.info-modal-body p {
    margin-bottom: 15px;
    text-align: center;
    font-size: 16px;
    line-height: 1.5;
    font-family: inherit;
}

.info-modal-body ul,
.info-modal-body ol {
    display: inline-block;
    text-align: left;
    margin-left: 0;
    margin-bottom: 15px;
    padding-left: 20px;
    font-size: 16px;
    line-height: 1.5;
    font-family: inherit;
}

.info-modal-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Ensure all elements inside the modal body inherit colors and fonts */
.info-modal-body * {
    color: inherit;
    font-family: inherit;
}

/* Preserve color inheritance but allow font inheritance from theme */
.info-modal-body a {
    text-shadow: none !important;
    text-decoration: underline;
}

/* Ensure paragraphs and other elements inside the modal body inherit the color */
.info-modal-body p,
.info-modal-body div,
.info-modal-body span,
.info-modal-body li,
.info-modal-body h1,
.info-modal-body h2,
.info-modal-body h3,
.info-modal-body h4,
.info-modal-body h5,
.info-modal-body h6 {
    color: inherit;
}

/* Make sure lists display correctly */
.info-modal-body ul, 
.info-modal-body ol {
    text-align: left;
    margin-left: 20px;
    margin-right: 20px;
    padding-left: 20px;
}

.info-modal-body li {
    margin-bottom: 5px;
    list-style-position: outside;
    display: list-item;
}

.info-modal-body ul li {
    list-style-type: disc;
}

.info-modal-body ol li {
    list-style-type: decimal;
}

/* Ensure all elements inside the modal body inherit fonts */
.info-modal-content *,
.info-modal-heading,
.info-modal-body,
.info-modal-body p,
.info-modal-body ul,
.info-modal-body ol,
.info-modal-body li,
.info-modal-body div,
.info-modal-body span,
.info-modal-body h1,
.info-modal-body h2,
.info-modal-body h3,
.info-modal-body h4,
.info-modal-body h5,
.info-modal-body h6 {
    font-family: inherit !important;
}

/* Make sure text shadow doesn't affect links */
.info-modal-body a {
    text-shadow: none !important;
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .info-modal {
        width: 95% !important;
    }
    
    .info-modal-body {
        max-width: 95%;
    }
}
