/* =========================================
   Grocery Buddies Ghost Theme
   screen.css
   ========================================= */

/* -----------------------------------------
   CSS Variables
   ----------------------------------------- */
:root {
    --color-sand: #cec1ae;
    --color-sand-dark: #b8a992;
    --color-sage: #d2da93;
    --color-bg: #f5f3f0;
    --color-white: #ffffff;
    --color-text: #18181b;
    --color-text-muted: #52525b;
    --color-text-light: #71717a;
    --color-border: #e4e4e7;
    --color-shadow: rgba(0, 0, 0, 0.08);

    --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;

    --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
    --shadow-card-hover: 0 4px 8px rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.08);

    --max-width: 72rem;
    --content-width: 64rem;
}

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

html {
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    antialiased: true;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

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

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-logo img {
    height: 40px;
    width: auto;
}

.site-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.site-nav ul {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.site-nav a {
    display: block;
    padding: 0.5rem 0.875rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border-radius: var(--radius-lg);
    transition: color 150ms, background 150ms;
}

.site-nav a:hover,
.site-nav a.nav-current {
    color: var(--color-text);
    background: var(--color-bg);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.25rem;
    height: 2.25rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-lg);
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 200ms, opacity 200ms;
}

@media (max-width: 48rem) {
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 4rem;
        left: 0;
        right: 0;
        background: var(--color-white);
        border-bottom: 1px solid var(--color-border);
        padding: 0.75rem 1.25rem;
    }

    .site-nav.is-open {
        display: block;
    }

    .site-nav ul {
        flex-direction: column;
        align-items: stretch;
    }

    .site-nav a {
        padding: 0.75rem 0.875rem;
    }
}

/* -----------------------------------------
   Buttons
   ----------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6875rem 1.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-xl);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background 150ms, color 150ms, border-color 150ms, box-shadow 150ms;
    text-decoration: none;
    line-height: 1;
}

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

.btn-primary:hover {
    background: var(--color-sand-dark);
    border-color: var(--color-sand-dark);
}

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

.btn-outline:hover {
    background: var(--color-text);
    color: var(--color-white);
    border-color: var(--color-text);
}

/* -----------------------------------------
   Hero Section
   ----------------------------------------- */
.hero,
.page-hero {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0 1.25rem;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card);
    padding: 3rem;
    overflow: hidden;
}

.hero-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

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

.hero-image-placeholder {
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    border-radius: var(--radius-xl);
}

.hero-text h1 {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--color-text);
}

.hero-text p {
    margin-top: 1rem;
    font-size: 1.0625rem;
    color: var(--color-text-muted);
    line-height: 1.65;
}

.hero-actions {
    margin-top: 2rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Hero full-width (no image) */
.hero-text--full {
    grid-column: 1 / -1;
}

@media (max-width: 48rem) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.75rem;
    }

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

    .hero-text h1 {
        font-size: 1.75rem;
    }
}

/* -----------------------------------------
   Content Cards
   ----------------------------------------- */
.home-content,
.page-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.content-card {
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card);
    padding: 1.75rem;
}

.content-card h2 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

.content-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.content-card p {
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

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

.content-card code {
    font-family: ui-monospace, monospace;
    font-size: 0.875em;
    background: var(--color-bg);
    padding: 0.125em 0.375em;
    border-radius: 0.25rem;
}

.small-note {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    margin-top: 0.5rem;
}

/* Ghost editor content styles */
.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-content ul, .post-content ol {
    list-style: disc;
    padding-left: 1.5rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}

.post-content ol {
    list-style: decimal;
}

.post-content a {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content blockquote {
    border-left: 3px solid var(--color-sand);
    padding-left: 1.25rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin: 1.5rem 0;
}

.post-content figure {
    margin: 1.5rem 0;
}

.post-content figure img {
    border-radius: var(--radius-lg);
    width: 100%;
}

/* Koenig editor card widths - required by Ghost */
.kg-width-wide {
    position: relative;
    width: 85vw;
    min-width: 100%;
    margin: 1.5rem calc(50% - 42.5vw);
}

.kg-width-full {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.kg-width-wide img,
.kg-width-full img {
    width: 100%;
    border-radius: 0;
}

.post-content figcaption {
    font-size: 0.875rem;
    color: var(--color-text-light);
    text-align: center;
    margin-top: 0.5rem;
}

/* -----------------------------------------
   Ways to Help Grid
   ----------------------------------------- */
.help-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.help-card {
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: box-shadow 150ms;
}

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

.help-card-inner {
    aspect-ratio: 4 / 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 0.75rem;
}

.help-card-inner img {
    height: 65%;
    width: auto;
    object-fit: contain;
}

.help-card-inner span {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.3;
}

@media (max-width: 48rem) {
    .help-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 28rem) {
    .help-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* -----------------------------------------
   Team Grid (About page)
   ----------------------------------------- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.team-card-btn {
    width: 100%;
    background: var(--color-bg);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: box-shadow 150ms, border-color 150ms;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    text-align: center;
}

.team-card-btn:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--color-sand);
}

.team-photo {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    object-fit: cover;
}

.team-photo--placeholder {
    background: var(--color-sand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.team-card-btn h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.team-role {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

@media (max-width: 48rem) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 30rem) {
    .team-grid {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------------------
   Team Modal
   ----------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-panel {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    max-width: 28rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-close {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    width: 2rem;
    height: 2rem;
    background: var(--color-bg);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms;
}

.modal-close:hover {
    background: var(--color-border);
}

.modal-photo {
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
}

.modal-panel h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-role {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.modal-bio {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.65;
    margin-top: 0.5rem;
}

/* -----------------------------------------
   Post Archive (News listing)
   ----------------------------------------- */
.archive-header {
    max-width: var(--content-width);
    margin: 2rem auto 0;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.archive-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.post-archive {
    max-width: var(--content-width);
    margin: 1.5rem auto 4rem;
    padding: 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.post-card {
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: grid;
    grid-template-columns: 12rem 1fr;
    transition: box-shadow 150ms;
}

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

.post-card-image {
    display: block;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms;
}

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

.post-card-content {
    padding: 1.5rem;
}

.post-tag {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.post-card-content h2 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.375rem;
}

.post-card-content h2 a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-card-content time {
    font-size: 0.875rem;
    color: var(--color-text-light);
    display: block;
    margin-bottom: 0.5rem;
}

.post-card-content p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

@media (max-width: 40rem) {
    .post-card {
        grid-template-columns: 1fr;
    }

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

/* Homepage post list (compact) */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.post-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.post-item h3 {
    font-size: 1rem;
    font-weight: 600;
}

.post-item h3 a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-item time {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    display: block;
    margin: 0.25rem 0;
}

.post-item p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* -----------------------------------------
   Single Post
   ----------------------------------------- */
.post-single {
    max-width: var(--content-width);
    margin: 0 auto;
    padding-bottom: 4rem;
}

.post-feature-image {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0 1.25rem;
    border-radius: var(--radius-2xl);
    overflow: hidden;
}

.post-feature-image img {
    width: 100%;
    border-radius: var(--radius-2xl);
    max-height: 28rem;
    object-fit: cover;
}

.post-inner {
    padding: 0 1.25rem;
}

.post-header {
    margin-bottom: 1.5rem;
}

.post-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-top: 0.5rem;
}

.post-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.post-footer {
    margin-top: 2rem;
}

/* -----------------------------------------
   Pagination
   ----------------------------------------- */
.pagination {
    max-width: var(--content-width);
    margin: 0 auto 4rem;
    padding: 0 1.25rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.pagination a {
    padding: 0.5rem 1.25rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-xl);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background 150ms, color 150ms;
}

.pagination a:hover {
    background: var(--color-text);
    color: var(--color-white);
    border-color: var(--color-text);
}

/* -----------------------------------------
   Footer
   ----------------------------------------- */
.site-footer {
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    margin-top: 2rem;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-brand .site-title {
    font-size: 1rem;
    font-weight: 700;
}

.footer-brand p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 0.375rem;
    max-width: 28rem;
    line-height: 1.6;
}

.footer-nav ul {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.footer-nav a {
    display: block;
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    border-radius: var(--radius-lg);
    transition: color 150ms, background 150ms;
}

.footer-nav a:hover {
    color: var(--color-text);
    background: var(--color-bg);
}

.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding: 1rem 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

@media (max-width: 40rem) {
    .footer-container {
        flex-direction: column;
        gap: 1.5rem;
    }
}
