/**
 * Steven Webb Cornwall - Public Styles
 *
 * Zen-inspired, clean, minimal design
 * Accent colour: #ff6400
 */

/* ============================================
   CSS Custom Properties
   ============================================ */

:root {
    /* Colours */
    --accent: #ff6400;
    --accent-dark: #e55a00;
    --accent-light: #ff8533;

    --text: #1a1a1a;
    --text-light: #555;
    --text-muted: #777;

    --bg: #fafafa;
    --bg-white: #fff;
    --bg-subtle: #f5f5f5;

    --border: #e5e5e5;
    --border-light: #eee;

    /* Typography */
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;

    --text-base: 1.125rem;
    /* 18px */
    --text-sm: 0.875rem;
    --text-xs: 0.75rem;
    --text-lg: 1.25rem;
    --text-xl: 1.5rem;
    --text-2xl: 2rem;
    --text-3xl: 2.5rem;

    --line-height: 1.7;
    --line-height-tight: 1.3;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Layout */
    --container-max: 1200px;
    --content-max: 700px;

    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 6px;
    --radius-lg: 12px;
    --transition: 0.2s ease;
}


/* ============================================
   Base / Reset
   ============================================ */

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

html {
    font-size: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--line-height);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 var(--space-md);
    font-weight: 600;
    line-height: var(--line-height-tight);
    color: var(--text);
}

h1 {
    font-size: var(--text-3xl);
}

h2 {
    font-size: var(--text-2xl);
}

h3 {
    font-size: var(--text-xl);
}

p {
    margin: 0 0 var(--space-lg);
}

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

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

a:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    margin: 0 0 var(--space-lg);
    padding-left: var(--space-xl);
}

li {
    margin-bottom: var(--space-sm);
}


/* ============================================
   Accessibility
   ============================================ */

.skip-link {
    position: absolute;
    left: -9999px;
    top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--accent);
    color: #fff;
    font-weight: 500;
    z-index: 9999;
    border-radius: var(--radius);
}

.skip-link:focus {
    left: var(--space-md);
    outline: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible for keyboard users */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}


/* ============================================
   Layout
   ============================================ */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-narrow {
    max-width: var(--content-max);
}


/* ============================================
   Header
   ============================================ */

.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-lg) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.site-logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.logo-name {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.logo-title {
    font-size: var(--text-sm);
    color: var(--accent);
    font-weight: 500;
}

.site-logo:hover .logo-name {
    color: var(--accent);
}

/* Navigation */
.main-nav ul {
    display: flex;
    gap: var(--space-xl);
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: var(--text-light);
    font-weight: 500;
    padding: var(--space-sm) 0;
    position: relative;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
    color: var(--accent);
}

.main-nav a[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    width: 44px;
    height: 44px;
}

.nav-toggle-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    position: relative;
    transition: background var(--transition);
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text);
    transition: transform var(--transition);
}

.nav-toggle-icon::before {
    top: -8px;
}

.nav-toggle-icon::after {
    bottom: -8px;
}

/* Mobile navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border-light);
        padding: var(--space-lg);
        box-shadow: var(--shadow);
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav li {
        border-bottom: 1px solid var(--border-light);
    }

    .main-nav li:last-child {
        border-bottom: none;
    }

    .main-nav a {
        display: block;
        padding: var(--space-md) 0;
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-icon {
        background: transparent;
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
        transform: translateY(-8px) rotate(-45deg);
    }
}


/* ============================================
   Hero
   ============================================ */

.hero {
    background: var(--bg-white);
    padding: var(--space-4xl) 0;
    border-bottom: 1px solid var(--border-light);
}

.hero-content {
    max-width: var(--content-max);
}

.hero h1 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-lg);
}

.hero-intro {
    font-size: var(--text-xl);
    color: var(--text-light);
    margin-bottom: var(--space-md);
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}


/* ============================================
   Sections
   ============================================ */

.section {
    padding: var(--space-3xl) 0;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.section-header h2 {
    margin: 0;
}


/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: var(--text-base);
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.btn:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-subtle);
    color: var(--text);
    border: 1px solid var(--border);
}

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


/* ============================================
   Posts Grid & List
   ============================================ */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-xl);
}

.post-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow);
}

.post-card-image {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.post-card:hover .post-card-image img {
    transform: scale(1.02);
}

.post-card-content {
    padding: var(--space-lg);
}

.post-date {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.post-card-title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-sm);
}

.post-card-title a {
    color: var(--text);
}

.post-card-title a:hover {
    color: var(--accent);
}

.post-excerpt {
    color: var(--text-light);
    margin-bottom: var(--space-md);
    font-size: var(--text-base);
}

.read-more {
    font-weight: 500;
    font-size: var(--text-sm);
}

/* Posts list (blog page) */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
}

.post-item {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-xl);
    align-items: start;
}

.post-item-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: var(--radius);
}

.post-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-item-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
}

@media (max-width: 640px) {
    .post-item {
        grid-template-columns: 1fr;
    }

    .post-item-image {
        aspect-ratio: 16/9;
    }
}


/* ============================================
   Article (Single Post)
   ============================================ */

.article {
    padding: var(--space-3xl) 0;
}

.article-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.article-date {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.article-title {
    font-size: var(--text-3xl);
    max-width: 800px;
    margin: 0 auto;
}

.article-featured-image {
    margin: 0 0 var(--space-2xl);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
}

.article-content {
    font-size: var(--text-base);
}

/* Prose styles for article content */
.prose h2 {
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-md);
}

.prose h3 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
}

.prose p {
    margin-bottom: var(--space-lg);
}

.prose a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose blockquote {
    margin: var(--space-xl) 0;
    padding: var(--space-md) var(--space-lg);
    border-left: 4px solid var(--accent);
    background: var(--bg-subtle);
    font-style: italic;
}

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

.prose pre {
    background: var(--text);
    color: #f5f5f5;
    padding: var(--space-lg);
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.prose code {
    font-family: var(--font-mono);
    background: var(--bg-subtle);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.9em;
}

.prose pre code {
    background: none;
    padding: 0;
}

.prose img {
    border-radius: var(--radius);
    margin: var(--space-xl) 0;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--space-2xl) 0;
}


/* ============================================
   Share Buttons
   ============================================ */

.share-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin: var(--space-2xl) 0;
}

.share-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-subtle);
    color: var(--text-light);
    transition: all var(--transition);
}

.share-button:hover {
    background: var(--accent);
    color: #fff;
}


/* ============================================
   Comments
   ============================================ */

.comments-section {
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border);
}

.comments-title {
    margin-bottom: var(--space-xl);
}

.comments-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-2xl);
}

.comment {
    padding: var(--space-lg);
    background: var(--bg-subtle);
    border-radius: var(--radius);
    margin-bottom: var(--space-md);
}

.comment-header {
    display: flex;
    gap: var(--space-md);
    align-items: baseline;
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
}

.comment-date {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.comment-content {
    color: var(--text);
}

.comment-form-wrapper {
    background: var(--bg-white);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.comment-form-wrapper h3 {
    margin-bottom: var(--space-sm);
}

.comment-notice {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}


/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

@media (max-width: 540px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text);
}

.required {
    color: var(--accent);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: var(--text-base);
    color: var(--text);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 100, 0, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Honeypot field - hidden from users */
.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.form-message {
    margin-top: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius);
    font-size: var(--text-sm);
}

.form-message.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}


/* ============================================
   Page Header
   ============================================ */

.page-header {
    text-align: center;
    padding: var(--space-3xl) 0 var(--space-2xl);
}

.page-header h1 {
    margin-bottom: var(--space-sm);
}

.page-description {
    color: var(--text-light);
    font-size: var(--text-lg);
    margin: 0;
}


/* ============================================
   Static Page
   ============================================ */

.page {
    padding: var(--space-3xl) 0;
}

.page-content {
    font-size: var(--text-base);
}

.page-featured-image {
    margin: 0 0 var(--space-2xl);
    border-radius: var(--radius-lg);
    overflow: hidden;
}


/* ============================================
   Contact Form
   ============================================ */

.contact-form-wrapper {
    margin-top: var(--space-2xl);
    padding: var(--space-xl);
    background: var(--bg-subtle);
    border-radius: var(--radius-lg);
}


/* ============================================
   Pagination
   ============================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-light);
}

.pagination-link {
    font-weight: 500;
}

.pagination-info {
    color: var(--text-muted);
    font-size: var(--text-sm);
}


/* ============================================
   Footer
   ============================================ */

.site-footer {
    background: var(--text);
    color: #ccc;
    padding: var(--space-3xl) 0 var(--space-xl);
    margin-top: var(--space-3xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-section h2 {
    color: #fff;
    font-size: var(--text-lg);
    margin-bottom: var(--space-md);
}

.footer-section p {
    margin-bottom: var(--space-md);
    font-size: var(--text-sm);
}

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

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: #ccc;
    font-size: var(--text-sm);
}

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

.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid #333;
    text-align: center;
    font-size: var(--text-sm);
}

.footer-bottom p {
    margin: 0;
}

/* Newsletter form in footer */
.newsletter-form {
    position: relative;
}

.newsletter-input-group {
    display: flex;
    gap: var(--space-sm);
}

.newsletter-input-group input {
    flex: 1;
    background: #333;
    border-color: #444;
    color: #fff;
}

.newsletter-input-group input::placeholder {
    color: #888;
}

.newsletter-input-group input:focus {
    border-color: var(--accent);
}

.newsletter-input-group .btn {
    white-space: nowrap;
}

.newsletter-message {
    margin-top: var(--space-sm);
    font-size: var(--text-sm);
}


/* ============================================
   Error Page (404)
   ============================================ */

.error-page {
    text-align: center;
    padding: var(--space-4xl) 0;
}

.error-page h1 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-md);
}

.error-page p {
    color: var(--text-light);
    margin-bottom: var(--space-xl);
}

.error-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}


/* ============================================
   Empty States
   ============================================ */

.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-2xl);
}


/* ============================================
   Utility Classes
   ============================================ */

.link {
    font-weight: 500;
    font-size: var(--text-sm);
}

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

.text-muted {
    color: var(--text-muted);
}


/* ============================================
   Social Icons
   ============================================ */

/* Social icons in nav menu */
.nav-social {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: var(--space-md);
    padding-left: var(--space-md);
    border-left: 1px solid var(--border-light);
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-light);
    transition: all var(--transition);
}

.social-icon:hover {
    color: var(--accent);
    background: var(--bg-subtle);
}

/* Mobile nav social */
@media (max-width: 768px) {
    .nav-social {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        padding: var(--space-md) 0;
        justify-content: center;
        gap: 0.5rem;
    }

    .nav-social .social-icon {
        width: 44px;
        height: 44px;
        background: var(--bg-subtle);
    }
}

.footer-social {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: var(--space-md);
}

.footer-social .social-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.footer-social .social-icon:hover {
    background: var(--accent);
    color: #fff;
}


/* ============================================
   Print Styles
   ============================================ */

@media print {

    .site-header,
    .site-footer,
    .share-buttons,
    .comment-form-wrapper,
    .pagination {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .article-content {
        max-width: 100%;
    }
}