/* 
   Classless & ID-less CSS for Socio BSC
   Color Palette: 
   Primary: #0681C5, #132C56
   Accent: #4BBCE4
   Background: #F3F4F6 
*/

:root {
    --primary: #0681C5;
    --primary-dark: #132C56;
    --accent: #4BBCE4;
    --bg-light: #F3F4F6;
    --text-dark: #1F2937;
    --text-light: #4B5563;
    --white: #FFFFFF;
}

/* Global Reset */
html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* Typography */
h1, h2, h3 {
    line-height: 1.2;
    color: var(--primary-dark);
}

/* Normalise hierarchy visually so SEO promotions don't change the design */
main h1 { font-size: 1.5em; } /* Looks like the old h2 */
main h2 { font-size: 1.17em; } /* Looks like the old h3 */


p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent);
}

/* Header & Navigation */
header {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 1rem max(1rem, calc(50% - 600px + 1rem));
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Semantic Logo Styling */
header > a:first-of-type {
    display: flex;
    align-items: center; /* Fixes any vertical alignment 'ghost gaps' */
    text-decoration: none;
}

header > a:first-of-type img {
    max-height: 65px;
    width: auto;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
    margin: 0; /* Reset global image margins if any */
}

header a {
    color: var(--white);
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--white);
}

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

nav > ul > li {
    position: relative;
}

/* Dropdown Menu using semantic <details> */
details {
    position: relative;
}

summary {
    cursor: pointer;
    font-weight: 500;
    list-style: none;
    transition: color 0.3s;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: " ▾";
}

details[open] summary {
    color: var(--accent);
}

details > ul {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--primary-dark);
    list-style: none;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    min-width: 300px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    z-index: 10;
}

details > ul li a {
    padding: 0.5rem 1rem;
    display: block;
}

details > ul li a:hover {
    background-color: var(--accent);
    color: var(--white);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

section {
    margin-bottom: 3rem;
}

section > h1, section > h2 {
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
}

/* Semantic Slider - Targets the first section's figure */
main > figure {
    margin: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

main > figure ul {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    transition: transform 0.5s ease-in-out;
}

main > figure ul li {
    min-width: 100%;
    flex: 0 0 100%;
    backface-visibility: hidden;
    transform: translateZ(0);
    overflow: hidden;
}

/* Global Figures */
figure {
    margin: 0 0 1.5rem 0;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
}

/* Global Images */
img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    
    /* TEMPORARY HACK: Crop in slightly and move to top to hide shadow on old images */
    /* REMEMBER TO REVERT THIS ONCE FINAL IMAGES ARE UPLOADED */
    object-position: top center;
    transform: scale(1.10);
    transform-origin: top center;
}



/* Allow inline images in articles (like from the WYSIWYG editor) to retain their natural sizes and aspect ratios, and disable the scaling hack */
article img {
    width: auto;
    max-width: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    transform: none;
    object-position: center;
    margin: 1rem 0; /* Add some spacing around inline images */
}

/* Force featured images inside figures to retain the strict cinematic hero styling */
article figure img, section > figure img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin: 0;
}
main > figure nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none; /* Let clicks pass through empty space */
}

main > figure nav button {
    pointer-events: auto;
    background-color: rgba(34, 54, 135, 0.7);
    color: var(--white);
    border: none;
    padding: 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    transition: background-color 0.3s;
}

main > figure nav button:hover {
    background-color: var(--accent);
}

/* Footer */
footer {
    background-color: var(--primary-dark);
    color: var(--white);
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    header h1 {
        text-align: center;
    }
    
    nav {
        width: 100%;
    }
    
    nav > ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}


/* Form Styling */
form {
    max-width: 600px;
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}
legend {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    width: 100%;
}
label {
    font-weight: 500;
    color: var(--primary-dark);
}
input, textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    border: 1px solid #D1D5DB;
    background-color: var(--bg-light);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-sizing: border-box;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 54, 135, 0.15);
    background-color: var(--white);
}
button[type="submit"] {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 4px;
    transition: background-color 0.3s;
    margin-top: 1rem;
}
button[type="submit"]:hover {
    background-color: var(--primary-dark);
}

/* Footer Address Styling */
footer address {
    font-style: normal;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}
footer address a {
    color: var(--white);
    text-decoration: underline;
    font-weight: 500;
}
footer address a:hover {
    color: var(--accent);
}

/* Call to Action Links */
a[role="button"] {
    display: block;
    width: fit-content;
    margin: 4rem auto 2rem;
    background-color: var(--primary);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.3s, transform 0.2s;
    text-align: center;
}
a[role="button"]:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    color: var(--white);
}
