/* main.css - Core styles for Infosec Wales */
/* Defensive Cybersecurity Education Platform - Accessible, secure styling */

/* CSS Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.5;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #2d3748;
    background-color: #ffffff;
}

/* Skip Links for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px !important;
    height: 1px !important;
    overflow: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5em;
    line-height: 1.2;
    font-weight: 600;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* Links */
a {
    color: #2b6cb0;
    text-decoration: underline;
}

a:hover,
a:focus {
    color: #2a4d69;
}

/* Buttons */
.cta-button {
    display: inline-block;
    padding: 12px 24px;
    margin: 8px 4px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cta-button.primary {
    background-color: #2b6cb0;
    color: white;
}

.cta-button.primary:hover,
.cta-button.primary:focus {
    background-color: #2a4d69;
    color: white;
}

.cta-button.secondary {
    background-color: transparent;
    color: #2b6cb0;
    border: 2px solid #2b6cb0;
}

.cta-button.secondary:hover,
.cta-button.secondary:focus {
    background-color: #2b6cb0;
    color: white;
}

/* Layout */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.site-logo img {
    max-height: 50px;
    width: auto;
}

.site-identity {
    flex: 1;
}

.site-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.site-title a {
    text-decoration: none;
    color: #2d3748;
}

.site-description {
    margin: 5px 0 0 0;
    font-size: 1rem;
    color: #4a5568;
    font-weight: 400;
}

/* Navigation */
.main-navigation {
    position: relative;
}

.menu-toggle {
    display: none;
    background: #4299e1;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 15px;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background: #3182ce;
}

.menu-toggle-text {
    margin-right: 8px;
}

.menu-icon {
    display: inline-block;
    width: 20px;
    height: 16px;
    position: relative;
}

.hamburger-line {
    display: block;
    height: 2px;
    width: 100%;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
}

.nav-menu {
    width: 100%;
}

.nav-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    text-decoration: none;
    color: #2d3748;
    border-radius: 4px;
    transition: all 0.2s ease;
    min-width: 140px;
}

.nav-text {
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-description {
    font-size: 0.8rem;
    color: #718096;
    font-weight: 400;
    margin-top: 2px;
}

.nav-link:hover,
.nav-link:focus {
    background-color: #f7fafc;
    color: #2b6cb0;
}

.nav-link[aria-current="page"] {
    background-color: #e2e8f0;
    color: #2b6cb0;
    font-weight: 600;
}

.nav-cta {
    margin-left: auto;
}

.nav-cta-link {
    background: #4299e1 !important;
    color: white !important;
    border-radius: 6px;
}

.nav-cta-link:hover,
.nav-cta-link:focus {
    background: #3182ce !important;
    color: white !important;
}

.external-icon {
    margin-left: 4px;
    font-size: 0.8rem;
}

/* Submenu Styles */
.has-submenu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.has-submenu:hover .sub-menu,
.has-submenu:focus-within .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu li {
    margin: 0;
}

.sub-menu a {
    display: block;
    padding: 10px 16px;
    color: #4a5568;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.sub-menu a:hover,
.sub-menu a:focus {
    background: #f7fafc;
    color: #2b6cb0;
}

/* Search Styles */
.nav-search {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.search-form {
    display: flex;
    align-items: center;
    max-width: 400px;
}

.search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.search-submit {
    padding: 10px 12px;
    background: #4299e1;
    color: white;
    border: 1px solid #4299e1;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 0.9rem;
}

.search-submit:hover,
.search-submit:focus {
    background: #3182ce;
    border-color: #3182ce;
}

.search-icon {
    font-size: 1rem;
}

/* Main Content */
.main-content {
    min-height: 50vh;
}

/* Hero Section */
.hero-section {
    padding: 60px 0;
    text-align: center;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.hero-title {
    color: #2d3748;
    margin-bottom: 20px;
}

.hero-subtitle {
    display: block;
    font-size: 1.2rem;
    color: #4a5568;
    font-weight: 400;
}

.hero-description {
    font-size: 1.1rem;
    color: #4a5568;
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.feature-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.feature-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    margin-bottom: 20px;
}

.feature-title {
    margin-bottom: 15px;
}

.feature-link {
    text-decoration: none;
    color: #2d3748;
}

.feature-link:hover,
.feature-link:focus {
    color: #2b6cb0;
}

.feature-description {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 15px;
}

.feature-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.topic-tag {
    display: inline-block;
    background: #e2e8f0;
    color: #4a5568;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.topic-tag:hover,
.topic-tag:focus {
    background: #cbd5e0;
    color: #2d3748;
    text-decoration: none;
}

.feature-cta {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.cta-link {
    display: inline-block;
    background: #4299e1;
    color: white;
    padding: 10px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.cta-link:hover,
.cta-link:focus {
    background: #3182ce;
    color: white;
    text-decoration: none;
}

.highlight-card {
    border-color: #4299e1;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.external-link {
    position: relative;
}

.external-icon {
    margin-left: 4px;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Section Titles */
.section-title {
    text-align: center;
    margin-bottom: 40px;
    color: #2d3748;
}

/* Updates Section */
.updates-section {
    padding: 60px 0;
    background: #f7fafc;
}

.updates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.update-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 25px;
    transition: box-shadow 0.2s ease;
}

.update-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.update-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.update-date {
    color: #718096;
    font-size: 0.9rem;
}

.update-category {
    background: #e2e8f0;
    color: #4a5568;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.update-title {
    margin-bottom: 10px;
}

.update-title a {
    color: #2d3748;
    text-decoration: none;
    font-weight: 600;
}

.update-title a:hover,
.update-title a:focus {
    color: #2b6cb0;
}

.update-summary {
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}

.updates-cta {
    text-align: center;
}

/* CTA Section */
.cta-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: white;
    text-align: center;
}

.cta-section-title {
    color: white;
    margin-bottom: 20px;
}

.cta-description {
    font-size: 1.1rem;
    color: #cbd5e0;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.cta-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.cta-button.large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.cta-footer {
    color: #a0aec0;
    font-size: 0.9rem;
    margin: 0;
}

.inline-link {
    color: #90cdf4;
    text-decoration: underline;
}

.inline-link:hover,
.inline-link:focus {
    color: #bee3f8;
}

/* Footer */
.site-footer {
    background: #2d3748;
    color: white;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
    padding: 20px 0;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-logo img {
    max-height: 45px;
    width: auto;
    margin-bottom: 15px;
}

.footer-tagline {
    color: #cbd5e0;
    margin-bottom: 10px;
    line-height: 1.5;
}

.footer-mission {
    color: #a0aec0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-heading {
    color: white;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-nav-list,
.footer-resources-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-nav-list li,
.footer-resources-list li {
    margin-bottom: 8px;
}

.footer-link {
    color: #cbd5e0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-link:hover,
.footer-link:focus {
    color: white;
}

.footer-cta-link {
    display: inline-block;
    background: #4299e1;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.footer-cta-link:hover,
.footer-cta-link:focus {
    background: #3182ce;
    color: white;
    text-decoration: none;
}

.footer-contact-link {
    color: #90cdf4;
    text-decoration: underline;
    font-size: 0.9rem;
}

.footer-contact-link:hover,
.footer-contact-link:focus {
    color: #bee3f8;
}

.footer-bottom {
    border-top: 1px solid #4a5568;
    padding: 30px 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 10px 0;
}

.footer-legal {
    flex: 1;
    min-width: 200px;
}

.copyright {
    margin: 0 0 10px 0;
    color: #a0aec0;
    font-size: 0.9rem;
}

.legal-nav-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
}

.legal-link {
    color: #a0aec0;
    text-decoration: none;
    font-size: 0.8rem;
}

.legal-link:hover,
.legal-link:focus {
    color: white;
}

.footer-badges {
    display: flex;
    align-items: center;
    gap: 15px;
}

.compliance-badge img {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.compliance-badge:hover img {
    opacity: 1;
}

.transparency-link {
    color: #a0aec0;
    text-decoration: none;
    font-size: 0.8rem;
}

.transparency-link:hover,
.transparency-link:focus {
    color: white;
}

.company-link {
    color: #90cdf4;
    text-decoration: none;
}

.company-link:hover,
.company-link:focus {
    color: #bee3f8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        padding: 0 15px;
    }
    
    .site-branding {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-menu.active {
        display: block;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0;
    }
    
    .nav-link {
        min-width: auto;
        padding: 15px 0;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .nav-cta {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .has-submenu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: #f7fafc;
        margin-top: 10px;
    }
    
    .sub-menu a {
        padding: 8px 0 8px 20px;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    .updates-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 15px 0;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 15px 0;
    }
    
    .legal-nav-list {
        justify-content: center;
    }
    
    .footer-badges {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .section-container {
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .feature-card {
        padding: 15px;
    }
    
    .update-card {
        padding: 20px;
    }
    
    .cta-section {
        padding: 40px 0;
    }
    
    .footer-container {
        padding: 0 15px;
    }
    
    .footer-content {
        gap: 25px;
    }
}

/* Focus States for Accessibility */
*:focus {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .skip-link,
    .site-header,
    .site-footer,
    .hero-actions {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}