:root {
    --color-navy: #0b1d3c;
    --color-charcoal: #2b2f36;
    --color-teal: #1f9cb3;
    --color-light: #f4f7fb;
    --color-white: #ffffff;
    --color-grey: #636b75;
    --color-accent: #1b8f9a;
    --color-muted: #d7dde5;
    --font-primary: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
    margin: 0;
    font-family: var(--font-primary);
    color: var(--color-charcoal);
    background-color: var(--color-white);
    line-height: 1.6;
}

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

a:hover,
a:focus {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
    border-radius: 6px;
}

.container {
    width: min(1180px, 92%);
    margin: 0 auto;
}

.site-header {
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-muted);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.04em;
    color: var(--color-navy);
}

.brand span {
    color: var(--color-teal);
}

.main-nav {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.nav-link {
    color: var(--color-charcoal);
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-link:focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 1rem;
    background: var(--color-teal);
    color: var(--color-white);
    padding: 0.5rem 0.75rem;
    z-index: 10000;
    border-radius: 4px;
    transition: top 0.2s ease-in-out;
}

.skip-link:focus {
    top: 1rem;
}

.page-hero {
    padding: clamp(3rem, 4vw, 5rem) 0;
    background-color: var(--color-light);
}

.page-hero.homepage-hero {
    background: linear-gradient(140deg, rgba(11, 29, 60, 0.92), rgba(31, 156, 179, 0.88)),
        url("https://picsum.photos/seed/energygrid/1600/900") center/cover no-repeat;
    color: var(--color-white);
}

.page-hero.homepage-hero .hero-content {
    display: grid;
    gap: 2rem;
}

.page-hero.homepage-hero .hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.86);
}

.hero-heading {
    font-size: clamp(2.3rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    max-width: 820px;
}

.hero-summary {
    font-size: 1.1rem;
    max-width: 760px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.4rem;
    background-color: var(--color-teal);
    color: var(--color-white);
    border-radius: 999px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn:hover,
.btn:focus {
    background-color: #167a8a;
    transform: translateY(-1px);
}

.section-heading {
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
    color: var(--color-navy);
}

.section-heading span {
    color: var(--color-teal);
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid.featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 2rem;
}

.card {
    background-color: var(--color-white);
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(15, 25, 45, 0.08);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover,
.card:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px rgba(15, 25, 45, 0.12);
}

.card h3 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--color-navy);
}

.card p {
    margin: 0;
    color: var(--color-grey);
    font-size: 0.98rem;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-grey);
}

.category-tag {
    background: rgba(31, 156, 179, 0.12);
    color: var(--color-teal);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.editor-picks {
    background-color: var(--color-light);
    padding: 3rem 0;
    border-radius: 18px;
}

.editor-picks .card {
    background-color: var(--color-white);
}

.tile {
    background: var(--color-light);
    border-radius: 12px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: background 0.2s ease;
}

.tile:hover {
    background: rgba(31, 156, 179, 0.08);
}

.tile h4 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--color-navy);
}

.posts-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.75rem;
}

.posts-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-input {
    padding: 0.6rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--color-muted);
    min-width: 240px;
    font-size: 1rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-button {
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--color-muted);
    background-color: var(--color-white);
    color: var(--color-charcoal);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.filter-button.active {
    background-color: var(--color-teal);
    color: var(--color-white);
    border-color: var(--color-teal);
}

.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--color-muted);
    color: var(--color-charcoal);
    font-weight: 600;
}

.pagination .current {
    background-color: var(--color-teal);
    color: var(--color-white);
    border-color: var(--color-teal);
}

.article-header {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.article-hero {
    border-radius: 14px;
    overflow: hidden;
}

.article-content {
    max-width: 760px;
    margin: 0 auto;
    display: grid;
    gap: 1.5rem;
}

.article-content h2 {
    font-size: 1.5rem;
    color: var(--color-navy);
}

.article-content p {
    font-size: 1.03rem;
    color: var(--color-charcoal);
}

.related-posts {
    margin-top: 3rem;
}

.site-footer {
    background-color: var(--color-navy);
    color: var(--color-white);
    padding: 2.5rem 0;
    margin-top: 4rem;
}

.footer-inner {
    display: grid;
    gap: 2rem;
}

.footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.footer-brand {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.footer-nav {
    display: grid;
    gap: 0.5rem;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-contacts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-contacts a {
    color: var(--color-white);
    font-weight: 600;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.contact-form {
    background: var(--color-light);
    padding: 2rem;
    border-radius: 14px;
    display: grid;
    gap: 1rem;
}

.contact-form label {
    font-weight: 600;
    color: var(--color-charcoal);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--color-muted);
    font-size: 1rem;
}

.contact-form textarea {
    min-height: 160px;
    resize: vertical;
}

.contact-details {
    display: grid;
    gap: 1rem;
    background: var(--color-white);
    padding: 1.75rem;
    border-radius: 12px;
    box-shadow: 0 20px 36px rgba(15, 25, 45, 0.08);
}

.contact-details a {
    color: var(--color-teal);
    font-weight: 600;
}

.map-embed {
    border: none;
    border-radius: 12px;
    width: 100%;
    height: 320px;
}

.policy-section {
    margin-bottom: 2rem;
}

.policy-section h2 {
    font-size: 1.4rem;
    color: var(--color-navy);
    margin-bottom: 0.75rem;
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    border-radius: 10px;
    overflow: hidden;
}

.cookie-table th,
.cookie-table td {
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-muted);
    text-align: left;
}

.cookie-table th {
    background-color: var(--color-light);
    font-weight: 700;
    color: var(--color-navy);
}

.notice-box {
    border-left: 4px solid var(--color-teal);
    background: rgba(31, 156, 179, 0.08);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: var(--color-charcoal);
}

.cookie-banner {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-white);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 25, 45, 0.18);
    padding: 1.25rem 1.5rem;
    width: min(700px, 94%);
    display: grid;
    gap: 1rem;
    z-index: 5000;
}

.cookie-banner.hidden {
    display: none;
}

.cookie-banner p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-charcoal);
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cookie-action {
    padding: 0.65rem 1.2rem;
    border-radius: 999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.cookie-action.accept {
    background-color: var(--color-teal);
    color: var(--color-white);
}

.cookie-action.decline {
    background-color: transparent;
    border-color: var(--color-teal);
    color: var(--color-teal);
}

.thanks-banner {
    background: var(--color-light);
    padding: 3rem 0;
    text-align: center;
    border-radius: 16px;
}

@media (max-width: 768px) {
    .main-nav {
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: flex-end;
    }

    .page-hero {
        padding: 3rem 0;
    }

    .page-hero.homepage-hero {
        background-position: center;
    }

    .posts-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        width: 100%;
    }

    .search-input {
        flex: 1;
    }

    .cookie-actions {
        width: 100%;
    }

    .cookie-action {
        flex: 1;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}