/* Base Styles
------------------------------------------------------ */
:root {
    --primary-color: #005e85;
    --secondary-color: #f8ad00;
    --text-color: #333333;
    --light-text: #ffffff;
    --light-bg: #f7f7f7;
    --border-color: #dddddd;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --link-color: #005e85;
    --link-hover: #004260;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

html {
    font-size: 62.5%; /* 1rem = 10px for easier calculations */
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #ffffff;
}

img, svg {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover, a:focus {
    color: var(--link-hover);
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 120rem;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography
------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

h1 {
    font-size: 3.6rem;
}

h2 {
    font-size: 2.8rem;
}

h3 {
    font-size: 2.4rem;
}

h4 {
    font-size: 2rem;
}

h5 {
    font-size: 1.8rem;
}

h6 {
    font-size: 1.6rem;
}

p {
    margin-top: 0;
    margin-bottom: 1.6rem;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    padding-bottom: 1.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8rem;
    height: 0.3rem;
    background-color: var(--secondary-color);
}

/* Utility Classes
------------------------------------------------------ */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: 1rem 2.4rem;
    font-size: 1.6rem;
    line-height: 1.5;
    border-radius: 0.4rem;
    transition: var(--transition);
}

.btn-primary {
    color: var(--light-text);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--link-hover);
    border-color: var(--link-hover);
    text-decoration: none;
    color: var(--light-text);
}

.btn-secondary {
    color: var(--text-color);
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: #e59d00;
    border-color: #e59d00;
    text-decoration: none;
    color: var(--text-color);
}

/* Header
------------------------------------------------------ */
.site-header {
    background-color: #ffffff;
    box-shadow: var(--box-shadow);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    flex: 0 0 auto;
}

.logo img {
    max-height: 5rem;
}

.main-nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
}

.hamburger {
    display: block;
    position: relative;
    width: 2.4rem;
    height: 0.3rem;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 2.4rem;
    height: 0.3rem;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.hamburger::before {
    top: -0.8rem;
}

.hamburger::after {
    bottom: -0.8rem;
}

.menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu li {
    margin: 0 1.5rem;
}

.menu a {
    display: block;
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
}

.menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0.2rem;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

.menu a:hover::after, 
.menu a:focus::after {
    width: 100%;
}

.search-box {
    flex: 0 0 auto;
    position: relative;
}

.search-box form {
    display: flex;
    align-items: center;
}

.search-box input[type="search"] {
    width: 20rem;
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    outline: none;
    transition: var(--transition);
}

.search-box input[type="search"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 94, 133, 0.25);
}

.search-box button {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

.icon-search {
    width: 1.8rem;
    height: 1.8rem;
    fill: currentColor;
}

/* Hero Section
------------------------------------------------------ */
.hero {
    background-color: var(--primary-color);
    background-image: linear-gradient(rgba(0, 94, 133, 0.9), rgba(0, 94, 133, 0.8)), url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--light-text);
    padding: 8rem 0;
    text-align: center;
}

.hero-content {
    max-width: 70rem;
    margin: 0 auto;
}

.hero h1 {
    color: var(--light-text);
    font-size: 4.8rem;
    margin-bottom: 2rem;
}

.hero p {
    font-size: 2rem;
    margin-bottom: 3rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

/* Features Section
------------------------------------------------------ */
.features {
    padding: 8rem 0;
    background-color: var(--light-bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28rem, 1fr));
    gap: 3rem;
}

.feature-card {
    background-color: #ffffff;
    border-radius: 0.8rem;
    box-shadow: var(--box-shadow);
    padding: 3rem;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-0.5rem);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    margin-bottom: 2rem;
}

.feature-icon svg {
    width: 6rem;
    height: 6rem;
    fill: var(--primary-color);
}

.feature-card h3 {
    margin-bottom: 1.5rem;
}

.read-more {
    display: inline-block;
    margin-top: 1.5rem;
    font-weight: 600;
    position: relative;
}

.read-more::after {
    content: '→';
    margin-left: 0.5rem;
    transition: var(--transition);
}

.read-more:hover::after {
    margin-left: 1rem;
}

/* Categories Section
------------------------------------------------------ */
.categories {
    padding: 8rem 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
    gap: 2rem;
}

.category-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.4rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.category-item:hover {
    transform: translateY(-0.3rem);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-item a {
    display: block;
    padding: 1.5rem 2rem;
    background-color: var(--light-bg);
    color: var(--text-color);
    text-align: center;
    font-weight: 600;
    transition: var(--transition);
}

.category-item a:hover {
    background-color: var(--primary-color);
    color: var(--light-text);
    text-decoration: none;
}

/* Newsletter Section
------------------------------------------------------ */
.newsletter {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 6rem 0;
    text-align: center;
}

.newsletter .section-title {
    color: var(--light-text);
}

.newsletter p {
    max-width: 60rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 3rem;
}

.newsletter-form {
    max-width: 60rem;
    margin: 0 auto;
}

.form-group {
    display: flex;
    margin-bottom: 1.5rem;
}

.form-group input[type="email"] {
    flex: 1;
    padding: 1.2rem 1.5rem;
    border: none;
    border-radius: 0.4rem 0 0 0.4rem;
    outline: none;
}

.form-group .btn {
    border-radius: 0 0.4rem 0.4rem 0;
}

.form-consent {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.form-consent input[type="checkbox"] {
    margin-right: 1rem;
}

.form-consent a {
    color: var(--light-text);
    text-decoration: underline;
}

/* Footer
------------------------------------------------------ */
.site-footer {
    background-color: #333;
    color: #fff;
    padding: 6rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr));
    gap: 3rem;
    margin-bottom: 5rem;
}

.footer-column h3 {
    color: var(--light-text);
    margin-bottom: 2rem;
    font-size: 2rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--secondary-color);
}

.social-links svg {
    width: 2rem;
    height: 2rem;
    fill: var(--light-text);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #ccc;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--light-text);
    text-decoration: none;
}

address {
    font-style: normal;
    line-height: 1.8;
}

address p {
    margin-bottom: 0.8rem;
}

address a {
    color: #ccc;
}

address a:hover {
    color: var(--light-text);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin: 0;
    font-size: 1.4rem;
}

/* 404 Error Page
------------------------------------------------------ */
.error-page {
    padding: 8rem 0;
    text-align: center;
}

.error-content {
    max-width: 70rem;
    margin: 0 auto;
}

.error-page h1 {
    font-size: 12rem;
    margin: 0;
    color: var(--primary-color);
    line-height: 1;
}

.error-page h2 {
    font-size: 3.6rem;
    margin-bottom: 2rem;
}

.error-page p {
    font-size: 1.8rem;
    margin-bottom: 3rem;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

.error-suggestions {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.error-suggestions h3 {
    margin-bottom: 1.5rem;
}

.error-suggestions ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.error-suggestions ul li a {
    display: block;
    padding: 1rem 2rem;
    background-color: var(--light-bg);
    border-radius: 0.4rem;
    transition: var(--transition);
}

.error-suggestions ul li a:hover {
    background-color: var(--primary-color);
    color: var(--light-text);
    text-decoration: none;
}

@media (max-width: 768px) {
    .error-page h1 {
        font-size: 8rem;
    }

    .error-page h2 {
        font-size: 2.8rem;
    }

    .error-actions {
        flex-direction: column;
        gap: 1.5rem;
    }

    .error-suggestions ul {
        flex-direction: column;
    }
}

/* Article Pages
------------------------------------------------------ */
.article-header {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 6rem 0;
    text-align: center;
}

.article-header h1 {
    color: var(--light-text);
    margin-bottom: 2rem;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 1.4rem;
}

.article-meta span {
    display: flex;
    align-items: center;
}

.article-meta svg {
    width: 1.6rem;
    height: 1.6rem;
    fill: currentColor;
    margin-right: 0.5rem;
}

.article-content {
    padding: 6rem 0;
}

.article-container {
    display: grid;
    grid-template-columns: 1fr 30rem;
    gap: 4rem;
    align-items: start;
}

.article-main {
    font-size: 1.7rem;
    line-height: 1.7;
}

.article-main h2 {
    margin-top: 4rem;
}

.article-main h3 {
    margin-top: 3rem;
}

.article-main ul, 
.article-main ol {
    margin-bottom: 2rem;
}

.article-main img {
    border-radius: 0.4rem;
    margin: 3rem 0;
}

.article-sidebar {
    position: sticky;
    top: 10rem;
}

.sidebar-widget {
    background-color: var(--light-bg);
    border-radius: 0.8rem;
    padding: 2.5rem;
    margin-bottom: 3rem;
}

.sidebar-widget h3 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-widget ul li {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.sidebar-widget ul li:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.toc-list {
    list-style: none;
    padding-left: 0;
}

.toc-list li {
    margin-bottom: 1rem;
}

.toc-list a {
    display: block;
    padding: 0.5rem 0;
    border-left: 3px solid transparent;
    padding-left: 1.5rem;
    transition: var(--transition);
}

.toc-list a:hover {
    border-left-color: var(--primary-color);
    padding-left: 2rem;
    text-decoration: none;
}

/* Contact Page
------------------------------------------------------ */
.contact-form-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 6rem 0;
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.form-full-width {
    grid-column: 1 / -1;
}

.form-field {
    margin-bottom: 2rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    background-color: #fff;
    transition: var(--transition);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 94, 133, 0.25);
    outline: none;
}

.form-field textarea {
    min-height: 15rem;
    resize: vertical;
}

.form-submit {
    grid-column: 1 / -1;
    text-align: center;
}

.contact-info {
    margin-top: 6rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr));
    gap: 3rem;
}

.contact-card {
    text-align: center;
    padding: 3rem;
    background-color: var(--light-bg);
    border-radius: 0.8rem;
}

.contact-icon {
    margin-bottom: 2rem;
}

.contact-icon svg {
    width: 5rem;
    height: 5rem;
    fill: var(--primary-color);
}

.contact-card h3 {
    margin-bottom: 1rem;
}

/* Search Page
------------------------------------------------------ */
.search-header {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 4rem 0;
    text-align: center;
}

.search-form-large {
    max-width: 70rem;
    margin: 3rem auto 0;
}

.search-input-group {
    display: flex;
    align-items: center;
}

.search-input-group input[type="search"] {
    flex: 1;
    padding: 1.5rem;
    border: none;
    border-radius: 0.4rem 0 0 0.4rem;
    font-size: 1.6rem;
}

.search-input-group .btn {
    border-radius: 0 0.4rem 0.4rem 0;
    padding: 1.5rem 3rem;
}

.search-results {
    padding: 5rem 0;
}

.search-results-container {
    display: grid;
    grid-template-columns: 25rem 1fr;
    gap: 4rem;
    align-items: start;
}

.search-filters {
    background-color: var(--light-bg);
    border-radius: 0.8rem;
    padding: 2.5rem;
    position: sticky;
    top: 10rem;
}

.search-filters h2 {
    margin-bottom: 2rem;
    font-size: 2.2rem;
}

.filter-group {
    margin-bottom: 2.5rem;
}

.filter-group h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.filter-list input[type="checkbox"] {
    margin-right: 1rem;
}

.search-info {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item h3 {
    margin-bottom: 1rem;
}

.result-excerpt {
    margin-bottom: 1.5rem;
}

.result-meta {
    display: flex;
    gap: 2rem;
    font-size: 1.4rem;
    color: #666;
}

.search-pagination {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.btn-pagination {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.8rem 1.5rem;
    font-size: 1.4rem;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-pagination:hover:not([disabled]) {
    background-color: var(--border-color);
}

.btn-pagination[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 1.4rem;
}

.no-results-message {
    text-align: center;
    padding: 4rem 0;
}

.popular-topics {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.popular-topics li a {
    display: block;
    padding: 1rem 1.5rem;
    background-color: var(--light-bg);
    border-radius: 0.4rem;
    transition: var(--transition);
}

.popular-topics li a:hover {
    background-color: var(--primary-color);
    color: var(--light-text);
    text-decoration: none;
}

/* Responsive Styles
------------------------------------------------------ */
@media (max-width: 1024px) {
    html {
        font-size: 58%;
    }

    .hero h1 {
        font-size: 4.2rem;
    }

    .article-container {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
    }

    .search-results-container {
        grid-template-columns: 1fr;
    }

    .search-filters {
        position: static;
        margin-bottom: 3rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 55%;
    }

    .site-header .container {
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .main-nav {
        flex-basis: 100%;
        order: 3;
    }

    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 2rem;
    }

    .menu.active {
        display: flex;
    }

    .menu li {
        margin: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .menu a {
        padding: 1.2rem 0;
    }

    .hero {
        padding: 6rem 0;
    }

    .hero h1 {
        font-size: 3.6rem;
    }

    .hero p {
        font-size: 1.8rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 1.5rem;
    }

    .features,
    .categories {
        padding: 6rem 0;
    }

    .contact-form {
        grid-template-columns: 1fr;
    }

    .search-input-group {
        flex-direction: column;
    }

    .search-input-group input[type="search"] {
        width: 100%;
        border-radius: 0.4rem;
        margin-bottom: 1rem;
    }

    .search-input-group .btn {
        width: 100%;
        border-radius: 0.4rem;
    }

    .result-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    html {
        font-size: 52%;
    }
    
    .section-title {
        margin-bottom: 3rem;
    }
    
    .search-box {
        display: none;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group {
        flex-direction: column;
    }
    
    .form-group input[type="email"] {
        border-radius: 0.4rem;
        margin-bottom: 1.5rem;
    }
    
    .form-group .btn {
        border-radius: 0.4rem;
        width: 100%;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}