/* --- CSS Custom Properties (Variables) --- */
/* Light Theme Defaults */
:root {
    --page-bg-color: #eef0f2;
    --content-bg-color: #ffffff;
    --text-color: #444444;
    --heading-color: #004799; /* This is the blue used for headings and icons */
    --header-bg: #004799;
    --header-text: #ffffff;

    --primary-button-bg: #004799;
    --primary-button-text: #ffffff;
    --primary-button-hover-bg: #00367a;

    --accent-color: #343358;
    --accent-button-bg: #304361;
    --accent-button-hover-bg: #00367a;

    --card-bg: #ffffff;
    --card-border: #dcdcdc;
    --box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
    --card-shadow: 0 2px 5px rgba(0,0,0,0.05);
    --card-hover-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);

    --footer-bg: #333333;
    --footer-text: #e0e0e0;
    --footer-copyright-text: #a0a0a0;

    --hr-line-color: #b0b0b0; /* Light gray for the hr line */
    --hr-content-bg: #ffffff; /* Background color behind the § symbol */

    --toggle-bg: #ffffff;
    --toggle-hover-bg: #f1f5f9;
    --toggle-icon-color: #333333;

    --font-family-heading: 'Roboto Flex', sans-serif;
    --font-family-body: 'Roboto Flex', sans-serif;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;

    --border-radius: 0.3rem;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
    --page-bg-color: #1a1a1a;
    --content-bg-color: #2c2c2c;
    --text-color: #e0e0e0;
    --heading-color: #7ab3ed;
    --header-bg: #223344;
    --header-text: #ffffff;

    --primary-button-bg: #4a7bb3;
    --primary-button-text: #ffffff;
    --primary-button-hover-bg: #00367a;

    --accent-color: #2ecc71;
    --accent-button-bg: #2ecc71;
    --accent-button-hover-bg: #00367a;

    --card-bg: #383838;
    --card-border: #555555;
    --box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3);
    --card-shadow: 0 2px 5px rgba(0,0,0,0.2);
    --card-hover-shadow: 0 4px 10px rgba(0,0,0,0.3);

    --footer-bg: #223344;
    --footer-text: #cccccc;
    --footer-copyright-text: #a0a0a0;

    --hr-line-color: #555555; /* Darker gray for hr line in dark theme */
    --hr-content-bg: #2c2c2c; /* Background behind symbol in dark theme */
    --toggle-bg: #333333;
    --toggle-hover-bg: #555555;
    --toggle-icon-color: #ffffff;

    --toggle-bg: #333333;
    --toggle-border: #555555;
    --toggle-icon-color: #ffffff;
}


/* --- Base Styles & Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-body);
    font-weight: 100;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--page-bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--heading-color);
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
    font-weight: 700;
}

h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    margin-bottom: 0;
    color: var(--header-text);
    letter-spacing: -0.02em;
    font-weight: 700;
}
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h4 { font-size: clamp(1.2rem, 3vw, 1.8rem); }
h5 { font-size: clamp(1.0rem, 2.5vw, 1.3rem); }


p {
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
    font-weight: 100;
}

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

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

/* --- Icon Styles --- */
.material-symbols-outlined {
  font-variation-settings:
  'FILL' 0,
  'wght' 200,
  'GRAD' 0,
  'opsz' 24;
}

/* --- Global Utilities --- */
.button {
    display: inline-block;
    padding: 0.8em 1.5em;
    background-color: var(--primary-button-bg);
    color: var(--primary-button-text);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 1rem;
}

.button:hover {
    background-color: var(--primary-button-hover-bg);
    transform: translateY(-2px);
}

.button-primary {
    background-color: var(--accent-button-bg);
}

.button-primary:hover {
    background-color: var(--accent-button-hover-bg);
}

/* --- Header Layout --- */
.site-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: var(--spacing-md) 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .header-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-md);
}

.site-header .branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-header .branding svg {
    height: 2.2rem;
    width: auto;
    color: var(--header-text);
    flex-shrink: 0;
}

/* --- Theme Toggle Styling --- */
.theme-toggle {
    background-color: var(--toggle-bg);
    color: var(--toggle-icon-color);
    border: none;
    padding: 0.5rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevents the toggle from shrinking */
}

.theme-toggle:hover {
    background-color: var(--toggle-hover-bg);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    transform-origin: center;
    transition: transform 0.3s ease;
    display: block;
}

.theme-toggle:active svg {
    transform: rotate(30deg);
}

.sun-icon { display: block; }
[data-theme="dark"] .sun-icon { display: none; }
.moon-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }


/* --- Main Content "Page" Effect --- */
.main-content {
    flex-grow: 1;
    background-color: var(--content-bg-color);
    max-width: 1200px;
    margin: var(--spacing-md) auto;
    padding: var(--spacing-xl) var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

/* --- Section Spacing (within the main-content 'page') --- */
.main-content section {
    margin-bottom: var(--spacing-xl);
}

.main-content section:last-of-type {
    margin-bottom: 0;
}

/* Hero Section */
.hero-section {
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h3 {
    margin-bottom: var(--spacing-sm);
}
.hero-content p {
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--text-color);
    font-weight: 100;
}

/* --- Hero Divider Styling (Final & Precise, using the div to wrap hr) --- */
.hero-divider {
    border: none;
    margin: var(--spacing-lg) auto var(--spacing-xl) auto;
    width: 60%;
    max-width: 300px;
    position: relative;
    height: 0;
    text-align: center;
}

.hero-divider hr {
    border: none;
    border-top: 1px solid var(--hr-line-color);
    border-bottom: 1px solid var(--hr-line-color);
    height: 3px;
    width: 100%;
    margin: 0 auto;
    opacity: 0.8;
    transition: border-color 0.3s ease, opacity 0.3s ease;
    background: none;
}


.hero-divider::after {
    background: var(--content-bg-color);
    content: "§";
    font-size: 1.2rem;
    padding: 0 0.5em;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--hr-line-color);
    line-height: 1;
    white-space: nowrap;
    z-index: 1;
    transition: background-color 0.3s ease, color 0.3s ease;
}


/* About Us Section - Two Columns (with frames/cards) */
.about-us-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    padding-top: var(--spacing-lg);
}

/* Base styling for all card-like items */
.grid-item {
    background-color: var(--card-bg);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-hover-shadow);
}

.about-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

/* Styling for icons within about-item */
.about-item .icon {
    /* Make the container box fluid */
    width: clamp(6rem, 18vw, 8rem);   /* Min: 6rem, Preferred: 18% of viewport width, Max: 8rem */
    height: clamp(6rem, 18vw, 8rem);  /* Keep it square */
    margin-bottom: var(--spacing-md);
    color: var(--heading-color);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease; /* Add a smooth transition for resizing */
}

.about-item .icon .material-symbols-outlined {
    font-size: clamp(4rem, 14vw, 6rem);
}

.about-item h4 {
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
}
.about-item p {
    font-weight: 100;
}

/* Styling for the clickable cards on the homepage */
.card-link,
.card-link:visited {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-link:hover {
    color: inherit; /* Overrides the global a:hover color */
}

.card-link:hover .grid-item,
.card-link:focus .grid-item {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Services Section - Three Columns (as cards) */
.services-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    padding-top: var(--spacing-lg);
}

.service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.service-card h5 {
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
}
.service-card p {
    font-weight: 100;
}


/* --- Site Footer --- */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: var(--spacing-md) 0;
    margin-top: var(--spacing-md);
    transition: background-color 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.site-footer .footer-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-md);
    text-align: center;
}

/* Styling for all individual footer text items */
.site-footer .footer-item {
    margin-bottom: 0;
    font-size: 0.9rem;
    font-weight: 100;
    text-align: center;
    display: flex;
    align-items: baseline;
    justify-content: center;
    line-height: 1.2;
}

/* Style for SVGs directly inside footer items */
.site-footer .footer-item svg {
    width: 1.1em;
    height: 1.1em;
    margin-right: 0.4em;
    flex-shrink: 0;
    color: var(--footer-text);
    vertical-align: middle;
}


/* Specific styling for copyright item */
.site-footer .footer-copyright {
    color: var(--footer-copyright-text);
    font-size: 0.8rem;
}


/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.hero-section { animation-delay: 0.1s; }
.about-us-section { animation-delay: 0.2s; }
.services-section { animation-delay: 0.3s; }


/* --- Responsive Adjustments (Mobile-first with breakpoints) --- */

/* Tablet and larger screens */
@media (min-width: 768px) {
    .main-content {
        margin: var(--spacing-xl) auto;
        padding: var(--spacing-xl) var(--spacing-xl);
    }

    /* About Us: Two Columns */
    .about-us-section {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Services: Three Columns */
    .services-section {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Footer on larger screens */
    .site-footer .footer-content-wrapper {
        flex-direction: row;
        justify-content: center;
        gap: var(--spacing-lg);
        padding: 0 var(--spacing-lg);
    }

    /* Ensure items stay on one line on desktop */
    .site-footer .footer-item {
        white-space: nowrap;
    }
}