/* CSS Custom Properties */
:root {
    /* Colors - Light theme (default) */
    --color-primary: #2c3e50;
    --color-secondary: #34495e;
    --color-accent: #e74c3c;
    --color-text: #2c3e50;
    --color-text-light: #7f8c8d;
    --color-background: #f8f9fa;
    --color-background-alt: #ffffff;
    --color-border: #e9ecef;
    --color-error: #e74c3c;
    --color-success: #27ae60;

    /* Typography */
    --font-primary: 'NRC Sans', 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'NRC Serif', Georgia, 'Times New Roman', serif;
    --font-size-base: 16px;
    --line-height-base: 1.5;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;

    /* Spacing - Updated for tighter vertical spacing */
    --spacing-unit: 0.75rem;
    --container-padding: 0.75rem;
    --section-spacing: 2rem;
    --spacing-xl: 2rem;
    --spacing-lg: 1.5rem;
    --max-width: 1200px;
    --spacing-md: 0.75rem;

    /* Border Radius */
    --border-radius: 4px;
}

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

html {
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    scroll-behavior: smooth;
    background-color: var(--color-background);
    color: var(--color-text);
}

body {
    font-family: var(--font-primary);
    color: var(--color-text);
    background-color: var(--color-background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header Styles */
.header {
    background-color: var(--color-background-alt);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-unit);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header--scrolled {
    background-color: var(--color-background);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.nav {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
}

.nav__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.5rem;
    position: relative;
}

.nav__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex: 0 0 auto;
}

.nav__logo-img {
    height: 40px;
    width: auto;
    transition: transform 0.2s ease;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.nav__bottom {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    position: relative;
}

.nav__logo:hover .nav__logo-img {
    transform: scale(1.05);
}

.nav__menu {
    display: flex;
    list-style: none;
    gap: calc(var(--spacing-unit) * 1.5);
}

.nav__link {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.nav__link:hover {
    color: var(--color-accent);
}

/* Mobile Menu Button */
.nav__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.nav__toggle-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    position: relative;
    transition: background-color 0.3s ease;
}

.nav__toggle-icon::before,
.nav__toggle-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    transition: transform 0.3s ease;
}

.nav__toggle-icon::before {
    top: -6px;
}

.nav__toggle-icon::after {
    bottom: -6px;
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .nav__top {
        margin-bottom: 0.75rem;
    }

    .nav__logo-img {
        height: 35px;
    }

    .theme-toggle {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }

    .nav__toggle {
        display: block;
    }

    .nav__menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--color-background-alt);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        transition: right 0.3s ease;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        align-items: flex-end;
    }

    .nav__menu--active {
        right: 0;
    }

    .nav__item {
        margin: 1rem 0;
        text-align: right;
        width: 100%;
    }

    .nav__link {
        font-size: 1.1rem;
        display: block;
        padding: 0.5rem 0;
        text-align: right;
    }

    /* Hamburger Animation */
    .nav__toggle--active .nav__toggle-icon {
        background-color: transparent;
    }

    .nav__toggle--active .nav__toggle-icon::before {
        transform: rotate(45deg);
        top: 0;
    }

    .nav__toggle--active .nav__toggle-icon::after {
        transform: rotate(-45deg);
        bottom: 0;
    }

    /* Overlay when menu is open */
    .nav__overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .nav__overlay--active {
        display: block;
    }
}

/* Main Content Styles */
.main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

/* Hero Section */
.hero {
    text-align: left;
    padding: calc(var(--section-spacing) * 1.25) 0;
    background-color: var(--color-background);
    margin: calc(var(--spacing-unit) * -1);
    margin-bottom: calc(var(--section-spacing) * 0.5);
}

.hero__title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.hero__subtitle {
    font-size: 1.1rem;
    color: var(--color-text-light);
    line-height: 1.4;
    max-width: 800px;
}

.hero__text {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: calc(var(--spacing-unit) * 2);
    max-width: 600px;
}

.hero__cta {
    display: flex;
    gap: var(--spacing-unit);
    justify-content: center;
}

/* Button Styles */
.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.button--primary:hover {
    background-color: var(--color-accent);
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.button--secondary {
    background-color: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}

.button--secondary:hover {
    background-color: var(--color-accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Features Section */
.features {
    padding: calc(var(--section-spacing) * 0.5) 0;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    font-weight: var(--font-weight-bold);
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-unit);
    margin-top: var(--spacing-unit);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.feature-card {
    background-color: var(--color-background-alt);
    padding: var(--spacing-unit);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.feature-card__title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
    font-weight: var(--font-weight-bold);
    text-align: center;
}

.feature-card__text {
    color: var(--color-text-light);
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: center;
    margin-bottom: 0.5rem;
}

.feature-card__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.feature-card__image-container {
    width: 100%;
    height: 350px;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin-top: auto;
    background-color: var(--color-background-alt);
    padding: 0.125rem;
}

.feature-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-card__image {
    transform: scale(1.05);
}

/* Footer Styles */
.footer {
    background-color: var(--color-background-alt);
    padding: calc(var(--spacing-unit) * 2) 0;
    margin-top: auto;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

.footer__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: calc(var(--spacing-unit) * 1.5);
}

.footer__section {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.footer__title {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 0.15rem;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer__text {
    color: var(--color-text-light);
    margin-bottom: 0.1rem;
    font-size: 0.875rem;
}

.footer__bottom {
    background-color: var(--color-background-alt);
    padding: var(--spacing-unit);
    margin-top: calc(var(--spacing-unit) * 1.5);
    text-align: center;
}

.footer__copyright {
    color: var(--color-text-light);
    font-size: 0.75rem;
}

/* Contact Page Styles */
.contact {
    padding: var(--section-spacing) 0;
}

.contact__grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.contact__form {
    background-color: var(--color-background-alt);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 0;
}

.contact__subtitle {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
    font-weight: var(--font-weight-bold);
}

.contact__details {
    background-color: var(--color-background-alt);
    padding: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.contact__details p {
    margin-bottom: var(--spacing-unit);
}

.contact__details p:last-child {
    margin-bottom: 0;
}

.contact__details h3.contact__subtitle {
    margin-top: 2rem;
    margin-bottom: 0.25rem;
}

.contact__details h3.contact__subtitle:first-of-type {
    margin-top: 1.5rem;
}

/* Form Styles */
.form {
    background-color: var(--color-background);
    padding: calc(var(--spacing-unit) * 2);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form__group {
    margin-bottom: 1.5rem;
}

.form__label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form__input,
.form__textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: var(--color-background);
    color: var(--color-text);
}

.form__input:focus,
.form__textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form__textarea {
    resize: vertical;
    min-height: 120px;
}

/* Form validation styles */
.form__input--error {
    border-color: var(--color-error);
}

.form__error {
    color: var(--color-error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.25rem;
}

.form__success {
    color: var(--color-success);
    background-color: rgba(39, 174, 96, 0.1);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    max-width: 100%;
    width: fit-content;
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    position: relative;
}

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

.theme-toggle__icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.theme-toggle__icon--sun {
    display: block;
}

.theme-toggle__icon--moon {
    display: none;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: var(--spacing-unit);
    }

    .nav__menu {
        flex-direction: column;
        text-align: center;
        width: 100%;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__cta {
        flex-direction: column;
        align-items: flex-start;
    }

    .features__grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .contact__grid {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: var(--spacing-unit); }
.mt-2 { margin-top: calc(var(--spacing-unit) * 2); }
.mb-1 { margin-bottom: var(--spacing-unit); }
.mb-2 { margin-bottom: calc(var(--spacing-unit) * 2); }

/* Dark theme */
[data-theme="dark"],
.dark-theme {
    --color-primary: #ffffff;
    --color-secondary: #cccccc;
    --color-accent: #ff3333;
    --color-text: #ffffff;
    --color-text-light: #999999;
    --color-background: #1a1a1a;
    --color-background-alt: #2a2a2a;
    --color-border: #404040;
    --color-error: #ff3333;
    --color-success: #00cc66;
}

/* Light theme */
[data-theme="light"],
.light-theme {
    --color-primary: #2c3e50;
    --color-secondary: #34495e;
    --color-accent: #e74c3c;
    --color-text: #2c3e50;
    --color-text-light: #7f8c8d;
    --color-background: #f8f9fa;
    --color-background-alt: #ffffff;
    --color-border: #e9ecef;
    --color-error: #e74c3c;
    --color-success: #27ae60;
}

/* Dark mode transitions */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode specific adjustments */
[data-theme="dark"] .header {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .header--scrolled {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .feature-card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .feature-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .button {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .button:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .contact__details,
[data-theme="dark"] .form {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .footer {
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.3);
}

/* Add font-face declarations for NRC fonts */
@font-face {
    font-family: 'NRC Sans';
    src: local('NRC Sans'),
         local('Helvetica Neue'),
         local('Arial');
    font-weight: var(--font-weight-normal);
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NRC Sans';
    src: local('NRC Sans'),
         local('Helvetica Neue'),
         local('Arial');
    font-weight: var(--font-weight-medium);
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NRC Sans';
    src: local('NRC Sans'),
         local('Helvetica Neue'),
         local('Arial');
    font-weight: var(--font-weight-bold);
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NRC Serif';
    src: local('NRC Serif'),
         local('Georgia'),
         local('Times New Roman');
    font-weight: var(--font-weight-normal);
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NRC Serif';
    src: local('NRC Serif'),
         local('Georgia'),
         local('Times New Roman');
    font-weight: var(--font-weight-bold);
    font-style: normal;
    font-display: swap;
}

/* Articles Section */
.articles {
    padding: var(--spacing-xl) var(--spacing-lg);
    max-width: var(--max-width);
    margin: 0 auto;
}

.articles__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.article {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    transition: transform 0.2s ease-in-out;
    max-width: 350px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.article:hover {
    transform: translateY(-4px);
}

.article__link {
    text-decoration: none;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article__image-container {
    position: relative;
    padding-top: 75%; /* 4:3 aspect ratio for more consistent image display */
    overflow: hidden;
    background-color: var(--color-background-alt);
}

.article__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Changed from cover to contain to prevent cropping */
    object-position: center;
    transition: transform 0.3s ease-in-out;
    padding: 0.5rem; /* Add some padding around the images */
}

.article__title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    padding: var(--spacing-md);
    margin: 0;
    line-height: 1.3;
    text-align: center;
    margin-top: auto; /* Push title to bottom */
}

@media (max-width: 1024px) {
    .articles__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .articles__grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .article__title {
        font-size: 1rem;
    }
}

/* Ensure Firefox applies theme changes */
[data-theme="light"],
[data-theme="dark"],
.light-theme,
.dark-theme {
    background-color: var(--color-background);
    color: var(--color-text);
} 