/* --- BASE LAYOUT --- */
body {
    font-family: sans-serif;
    margin: 0;
    /* We removed display: flex; because we are using the bulletproof push method now */
}

/* =========================================
   Header and Footer Styles
========================================= */

header,

.header {
    background-color: #2b4478;
    color: #ffffff;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 15px;
}
.header h1 {
    margin-top: 0;
    font-size: 1.1rem;
}

.heading {
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    margin: 0;
}

footer {
    background-color: #2b4478;
    color: #ffffff;

    /* 1. Ultra-slim vertical padding (0.4rem top/bottom, 1rem left/right) */
    padding: 0.4rem 1rem;

    border-radius: 6px;

    /* 2. Push it away from the content ABOVE it, with no margin below */
    margin-top: 30px;
    margin-bottom: 0;

    /* 3. Center the text cleanly */
    text-align: center;
    font-size: 0.85rem; /* Slightly smaller text for a neat footer look */
}

/* Strip default browser margins from any text inside the footer */
footer p,
footer span {
    margin: 0;
    padding: 0;
}

footer a {
  color: #fff;
}

footer a:visited {
  color: #fff;
}

/* --- THE SIDEBAR (Nailed to the left) --- */
.nav {
    width: 320px;
    background-color: #f8f9fa;
    border-right: 1px solid #ccc;
    padding: 1.5rem;

    /* 1. Nail it to the top left corner */
    position: fixed;
    top: 0;
    left: 0;

    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.nav-logo {
    width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.nav h3 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #333;
    border-bottom: 2px solid #ccc;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

/* --- THE MAIN CONTENT (Pushed to the right) --- */
.main {
    /* 2. Physically push this box exactly the width of the sidebar (320px) */
    margin-left: 320px;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    padding: 1rem 3rem 3rem 3rem;
    max-width: 900px;
    box-sizing: border-box;
}

main img,
.main-content img,
article img {
    cursor: zoom-in; /* Changes mouse cursor to a magnifying glass icon using lightbox */
    transition: transform 0.2s ease, opacity 0.2s ease;
  display: block;
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
  margin: 1.25rem auto;
}

.main img:hover, article img:hover {
    opacity: 0.9;
}

.wide-image {
  overflow-x: auto;
}

.wide-image img {
  max-width: none;
  height: auto;
}

/* --- LIGHTBOX OVERLAY --- */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 10000; /* Sits on top of header, footer, and sidebar */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Semi-transparent black backdrop */
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

/* Shown when active */
.lightbox.show {
    display: flex;
}

/* The enlarged image itself */
.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

/* Close 'X' Button in top right */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* --- THE dt and dd LIST --- */

.details {
  display: grid;
  grid-template-columns: 12rem 1fr;
  margin: 0;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  overflow: hidden;
}

.details dt,
.details dd {
  margin: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #d8dee4;
}

.details dt {
  background: #f6f8fa;
  font-weight: 600;
}

.details dt:last-of-type,
.details dd:last-child {
  border-bottom: 0;
}

/* --- THE ARTICLE LIST --- */
ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

li {
    margin-bottom: 5px;
    cursor: pointer;
    color: #0056b3;
    line-height: 1.4;
    font-size: 1.15rem;
    padding: 4px 8px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

li:hover {
    text-decoration: underline;
    background-color: #e2e6ea;
}

/* =========================================
   Modal Responsiveness using buttons
========================================= */

.term {
  display: inline;
  padding: 0;
  border: 0;
  border-bottom: 1px dotted currentColor;
  color: inherit;
  font: inherit;
  background: none;
  cursor: pointer;
}

.term:hover,
.term:focus-visible {
  border-bottom-style: solid;
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.note {
  width: min(26rem, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid #bbb;
  border-radius: 0.5rem;
  color: #1a1a1a;
  background: #fff;
  box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 20%);
}

.note::backdrop {
  background: transparent;
}

.modal-overlay {
    display: none; /* Hidden on page load */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-checkbox {
    display: none;
}

/* Show only when its specific checkbox is checked */
.modal-checkbox:checked + .modal-overlay {
    display: flex;
}

/* The White Modal Box */
.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    background-color: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;

    /* Styling */
    border: 3px solid #222;
    border-top: 8px solid #0066cc;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

/* =========================================
   Styled Modal Buttons
========================================= */
.modal-link {
    display: inline-block;
    color: #0066cc;                /* Bold blue text */
    font-weight: bold;
    background-color: #f9fbfd;     /* Very light background */
    border: 1px solid #d0e1fd;     /* Light, subtle border */
    padding: 2px 6px;              /* Gives it a little pill/button breathing room */
    border-radius: 4px;            /* Softens the corners */
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.08); /* Soft, subtle shadow */
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;     /* Smooth hover animation */
}

.modal-link:hover {
    background-color: #0066cc;     /* Inverts colors slightly on hover */
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.2); /* Deepens shadow on hover */
    border-color: #0055b3;
}

/* --- ABOUT US LAYOUT --- */
.about-us-wrapper {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0; /* Prevents image blowout */
}

.about-us {
    background-color: rgba(245, 239, 239, 0.95);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* =========================================
   Footer
========================================= */
footer {
    background-color: #2b4478;
    color: #fff;
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
}



/* =========================================
   📱 MOBILE RESPONSIVENESS
========================================= */
@media (max-width: 768px) {
    .nav {
        width: 100%;
        height: auto;

        /* Un-nail the sidebar so it sits on top of the article normally */
        position: relative;
        border-right: none;
        border-bottom: 2px solid #ccc;
    }

    .main {
        /* Remove the 320px push since the sidebar is no longer on the left */
        margin-left: 0;
        padding: 1.5rem;
    }
}
