@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700&display=swap');

:root {
    --primary-color: #422379;
    /* R66 G35 B121 */
    --secondary-color: #9f2a90;
    /* R159 G42 B144 */
    --accent-color: #9f2a90;
    --text-color: #2c3e50;
    --bg-color: #f4f7f6;
    --content-bg: #ffffff;
    --header-bg: #422379;
    --font-heading: 'Outfit', sans-serif;
    --font-main: 'Inter', sans-serif;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

header {
    background-color: var(--header-bg);
    color: white;
    padding: 1.25rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.container {
    width: 92%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.75rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 15px;
}

header h1 img {
    height: 40px;
    width: auto;
    margin-bottom: 0;
}

header h1 a {
    color: white;
    text-decoration: none;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.5rem;
}

nav ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    padding: 0.5rem 0;
}

nav ul li a:hover {
    color: white;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

main {
    padding: 3rem 0;
    min-height: 70vh;
}

/* Page Layout & Container */
.page-content-wrapper {
    background: var(--content-bg);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin: 0 auto;
}

/* Typography Consistency */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    line-height: 1.2;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    margin-top: 0;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 0.5rem;
    display: inline-block;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p,
li,
td,
th {
    font-size: 1.05rem !important;
    /* Enforce consistency */
    line-height: 1.7;
    margin-bottom: 1.25rem;
    font-family: var(--font-main) !important;
}

/* Override inline styles from DB */
span[style*="font-size"],
div[style*="font-size"],
p[style*="font-size"] {
    font-size: 1.05rem !important;
}

span[style*="font-family"],
div[style*="font-family"],
p[style*="font-family"] {
    font-family: var(--font-main) !important;
}

/* Links */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

/* Images & Media */
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

img[style*="float: right"] {
    margin-left: 2rem;
}

img[style*="float: left"] {
    margin-right: 2rem;
}

/* Section Components */
.subpages {
    background: #f8f9fa;
    padding: 2rem;
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    margin: 2rem 0;
}

.subpages h3 {
    margin-top: 0;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.subpages ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.subpages li a {
    display: block;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #eee;
    transition: all 0.2s;
}

.subpages li a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.expanding-section {
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.expanding-section h2 {
    background: #f8f9fa !important;
    padding: 1rem 1.5rem !important;
    margin: 0 !important;
    font-size: 1.25rem;
    cursor: default;
    border-bottom: 1px solid #e1e8ed;
}

.section-content {
    padding: 1.5rem;
}

/* Footer Styling */
footer {
    background-color: var(--primary-color);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0;
    margin-top: 4rem;
    text-align: center;
}

footer p {
    margin: 0.5rem 0;
    font-size: 0.95rem !important;
}

footer .copyright {
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
    font-size: 1rem !important;
}

/* Gallery Enhancements */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    margin-bottom: 0;
    border-radius: 0;
}

.gallery-item .description {
    padding: 1.5rem;
}

.gallery-item .description * {
    font-size: 0.95rem !important;
}

.learnmorebutton {
    display: inline-block;
    background-color: var(--primary-color);
    color: white !important;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
}

.learnmorebutton:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .page-content-wrapper {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}

/* News Grid Styling */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #eee;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.news-card-image {
    width: 100%;
    height: 200px;
    background-color: #f0f0f0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin-bottom: 0;
    border-radius: 0;
}

.news-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-card-content h2 {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border: none;
    padding-bottom: 0;
}

.news-card-excerpt {
    font-size: 0.95rem !important;
    color: #666;
    margin-bottom: 1.5rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    flex-grow: 1;
}

.news-card-link {
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    margin-top: auto;
}

.news-card-link::after {
    content: ' →';
    margin-left: 5px;
    transition: margin-left 0.2s;
}

.news-card:hover .news-card-link::after {
    margin-left: 10px;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000; /* Higher than header */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border: 3px solid white;
}

.gallery-item img {
    cursor: zoom-in;
}