/* ==================================================
ISFP WEBSITE — CANONICAL STYLESHEET (FINAL)
================================================== */

/* ---------- RESET ---------- */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

/* ---------- BODY ---------- */
body {
font-family: Georgia, "Times New Roman", serif;
color: #222;
min-height: 100vh;

background: #b9d3e8;
}

/* ---------- HEADER ---------- */
header {
background: linear-gradient(135deg, #0b1c2d, #142f4f);
color: #ffffff;
padding: 10px 28px 10px 28px;
position: relative;
z-index: 10000;
}

header h1 {
font-size: 1.6em;
font-weight: normal;
text-align: center;
}

/* ---------- NAV BAR ---------- */
nav.main-nav {
margin-top: 10px;
margin-bottom: 0px;
display: flex;
justify-content: center;
align-items: center;
gap: 20px;
flex-wrap: wrap;
}

/* NAV LINKS */
nav.main-nav a,
nav.main-nav .dropbtn {
color: #dbe6f5;
text-decoration: none;
font-size: 0.95em;
cursor: pointer;
white-space: nowrap;
}

nav.main-nav a:hover,
nav.main-nav .dropbtn:hover {
color: #ffffff;
text-decoration: underline;
}

/* ---------- DROPDOWN ---------- */
.dropdown {
position: relative;
}

.dropdown-content {
display: none;
position: absolute;
top: 100%;
left: 0;

background-color: #142f4f;
min-width: 220px;
border-radius: 4px;
padding: 6px 0;

box-shadow: 0 8px 20px rgba(0,0,0,0.35);
z-index: 10001;
}

.dropdown-content a {
display: block;
padding: 8px 14px;
color: #e6eefb;
text-decoration: none;
font-size: 0.9em;
}

.dropdown-content a:hover {
background-color: #1d3f66;
color: #ffffff;
}

/* SHOW DROPDOWN */
.dropdown:hover .dropdown-content {
display: block;
}

/* ---------- MAIN CONTENT ---------- */
main {
max-width: 900px;
margin: 0 auto;
padding: 36px;

background: rgba(250, 248, 245, 0.94);
border-radius: 6px;
}

/* ---------- TEXT (GLOBAL) ---------- */
h2 {
font-weight: normal;
margin-bottom: 16px;
}

h3 {
margin-top: 28px;
margin-bottom: 10px;
}

/* ---------- PARAGRAPHS ---------- */
p {
line-height: 1.65;
margin-bottom: 1.25em;
text-align: justify;
text-justify: inter-word;
}

ul {
margin-left: 22px;
}

li {
margin-bottom: 6px;
}

/* ---------- FOOTER ---------- */
footer {
margin-top: 40px;
margin-bottom: 100px;
text-align: center;
padding: 15px;
background: #e8edf3;
font-size: 0.9em;
color: #333;
}

/* ---------- SUBMENU ---------- */
.submenu-content a {
display: block;
text-align: left;
}

.submenu:hover .submenu-content {
display: block;
}

/* ========================================= */
/* SECOND LEVEL SUBMENU (VISUALIZATION TOOLS) */
/* ========================================= */

.dropdown-sub {
position: relative;
}

.dropdown-sub > a {
display: block;
padding: 8px 14px;
text-align: left;
color: #e6eefb;
text-decoration: none;
font-size: 0.9em;
white-space: nowrap;
}

.dropdown-sub > a:hover {
background-color: #1d3f66;
color: #ffffff;
}

.dropdown-content-sub {
display: none;
position: absolute;
top: 0;
left: 100%;
background-color: #142f4f;
min-width: 240px;
border-radius: 4px;
padding: 6px 0;
box-shadow: 0 8px 20px rgba(0,0,0,0.35);
z-index: 10002;
}

.dropdown-content-sub a {
display: block;
padding: 8px 14px;
color: #e6eefb;
text-decoration: none;
font-size: 0.9em;
text-align: left;
white-space: nowrap;
}

.dropdown-content-sub a:hover {
background-color: #1d3f66;
color: #ffffff;
}

.dropdown-sub:hover .dropdown-content-sub {
display: block;
}


/* ========================================= */
/* LARGE SCREEN RESPONSIVE SUPPORT */
/* ========================================= */

@media (min-width: 1600px) {

main {
max-width: 1000px;
padding: 40px;
font-size: 16px;
}

}

@media (min-width: 1800px) {

main {
max-width: 1100px;
padding: 44px;
font-size: 17px;
}

}

@media (min-width: 2200px) {

main {
max-width: 1250px;
padding: 48px;
font-size: 18px;
}

}

@media (min-width: 2800px) {

main {
max-width: 1450px;
padding: 56px;
font-size: 20px;
}

}

@media (min-width: 3400px) {

main {
max-width: 1650px;
padding: 64px;
font-size: 22px;
}

}



/* ========================================= */
/* MOBILE RESPONSIVE SUPPORT */
/* ========================================= */

@media (max-width: 768px) {

header {
padding: 18px 15px;
}

header h1 {
font-size: 1.25em;
line-height: 1.3;
}

/* HORIZONTAL, WRAPPING MOBILE NAVIGATION */
nav.main-nav {
flex-direction: row;
justify-content: center;
align-items: center;
flex-wrap: wrap;
gap: 12px 18px;
}

nav.main-nav a,
nav.main-nav .dropbtn {
font-size: 0.9em;
white-space: normal;
text-align: center;
line-height: 1.4;
}

main {
width: calc(100% - 24px);
max-width: none;
margin: 24px auto;
padding: 24px 20px;
}

h2 {
font-size: 1.35em;
}

h3 {
font-size: 1.15em;
margin-top: 24px;
}

p {
line-height: 1.65;
margin-bottom: 1.25em;
text-align: justify;
}

ul {
margin-left: 20px;
}

footer {
margin-top: 30px;
margin-bottom: 50px;
padding: 15px 12px;
font-size: 0.85em;
}

/* KEEP DROPDOWNS WITHIN THE MOBILE SCREEN */
.dropdown-content {
position: absolute;
left: 50%;
transform: translateX(-50%);
max-width: calc(100vw - 20px);
min-width: 200px;
}

.dropdown-content-sub {
position: relative;
left: 0;
top: 0;
min-width: 0;
width: 100%;
box-shadow: none;
}

.dropdown-sub > a {
white-space: normal;
}

.dropdown-content-sub a {
white-space: normal;
}

}

/* ========================================= */
/* SMALL MOBILE SCREENS */
/* ========================================= */

@media (max-width: 480px) {

header {
padding: 16px 10px;
}

header h1 {
font-size: 1.1em;
}

/* COMPACT HORIZONTAL NAVIGATION ON PHONES */
nav.main-nav {
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: 10px 14px;
}

nav.main-nav a,
nav.main-nav .dropbtn {
font-size: 0.82em;
line-height: 1.4;
}

main {
width: calc(100% - 16px);
margin: 18px auto;
padding: 20px 15px;
}

h3 {
font-size: 1.1em;
}

p {
line-height: 1.6;
margin-bottom: 1.25em;
}

footer {
font-size: 0.8em;
}

}

/* ========================================= */
/* MATHJAX RESPONSIVE SUPPORT */
/* ========================================= */

/* Ensure long MathJax equations scroll cleanly on small screens */
@media (max-width: 768px) {

.MathJax_Display,
mjx-container[jax="CHTML"][display="true"] {
overflow-x: auto;
overflow-y: hidden;
max-width: 100%;
padding-bottom: 4px;
}

}
