/* Around Summerlin — newspaper editorial style */

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

:root {
    --background: hsl(0, 0%, 100%);
    --foreground: hsl(220, 10%, 15%);
    --primary: hsl(156, 20%, 25%);
    --primary-foreground: hsl(0, 0%, 100%);
    --secondary: hsl(0, 0%, 96%);
    --muted: hsl(0, 0%, 96%);
    --border: hsl(0, 0%, 85%);
    --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --max-width: 72rem;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--foreground);
    background: var(--background);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.25rem 1rem;
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 0.75rem;
    font-weight: 500;
}

.top-bar-tagline {
    flex: 1;
    text-align: center;
}

.top-bar-links {
    display: flex;
    gap: 0.75rem;
}

.top-bar-links a:hover {
    text-decoration: underline;
}

/* Masthead */
.masthead {
    padding: 2rem 1rem;
    border-bottom: 6px double var(--foreground);
}

.masthead-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.masthead-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--foreground);
}

.masthead-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.5rem 0;
    border-top: 2px solid var(--foreground);
    border-bottom: 2px solid var(--foreground);
    font-family: var(--font-serif);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.masthead-tagline {
    font-weight: 700;
    color: var(--primary);
}

.masthead-date,
.masthead-free {
    display: none;
}

@media (min-width: 640px) {
    .masthead-date,
    .masthead-free {
        display: inline-block;
    }
}

/* Hero */
.hero {
    padding: 3rem 1rem;
    text-align: center;
    border-bottom: 2px solid var(--foreground);
}

.hero-box {
    position: relative;
    max-width: 56rem;
    margin: 0 auto;
    padding: 2rem;
    border: 4px solid var(--foreground);
    background: hsl(0 0% 96% / 0.3);
}

@media (min-width: 768px) {
    .hero-box {
        padding: 3rem;
    }
}

.corner {
    position: absolute;
    width: 0.75rem;
    height: 0.75rem;
}

.corner-tl { top: 0.5rem; left: 0.5rem; border-top: 2px solid var(--foreground); border-left: 2px solid var(--foreground); }
.corner-tr { top: 0.5rem; right: 0.5rem; border-top: 2px solid var(--foreground); border-right: 2px solid var(--foreground); }
.corner-bl { bottom: 0.5rem; left: 0.5rem; border-bottom: 2px solid var(--foreground); border-left: 2px solid var(--foreground); }
.corner-br { bottom: 0.5rem; right: 0.5rem; border-bottom: 2px solid var(--foreground); border-right: 2px solid var(--foreground); }

.hero h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 5vw, 3.5rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-style: italic;
    color: hsl(220 10% 15% / 0.8);
    margin-bottom: 2.5rem;
}

.subscribe-form {
    display: flex;
    flex-direction: column;
    max-width: 32rem;
    margin: 0 auto;
    border: 2px solid var(--foreground);
}

@media (min-width: 640px) {
    .subscribe-form {
        flex-direction: row;
    }
}

.subscribe-form input {
    flex: 1;
    height: 3.5rem;
    padding: 0 0.75rem;
    border: none;
    border-bottom: 2px solid var(--foreground);
    background: white;
    font-family: var(--font-serif);
    font-size: 1.125rem;
    color: var(--foreground);
    outline: none;
}

@media (min-width: 640px) {
    .subscribe-form input {
        border-bottom: none;
        border-right: 2px solid var(--foreground);
    }
}

.subscribe-form input::placeholder {
    font-family: var(--font-serif);
    font-style: italic;
    color: hsl(220 10% 40%);
}

.subscribe-form button {
    height: 3.5rem;
    padding: 0 2rem;
    border: none;
    background: var(--foreground);
    color: var(--background);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.subscribe-form button:hover:not(:disabled) {
    background: var(--primary);
    color: var(--primary-foreground);
}

.subscribe-form button:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* Issues */
.issues {
    flex: 1;
    padding: 4rem 1rem;
}

.issues-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.search-box {
    position: relative;
    max-width: 28rem;
    margin: 0 auto 4rem;
    border-bottom: 2px solid var(--foreground);
    padding-bottom: 0.5rem;
}

.search-icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: hsl(220 10% 15% / 0.6);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 2.5rem;
    padding-left: 2.5rem;
    border: none;
    background: transparent;
    font-family: var(--font-serif);
    font-size: 1.125rem;
    color: var(--foreground);
    outline: none;
}

.search-box input::placeholder {
    font-family: var(--font-serif);
    font-style: italic;
    color: hsl(220 10% 40%);
}

.issues-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .issues-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
    }

    .issue-card {
        padding: 0 2rem;
        border-left: 2px solid hsl(220 10% 15% / 0.2);
    }

    .issue-card:first-child {
        padding-left: 0;
        border-left: none;
    }

    .issue-card:last-child {
        padding-right: 0;
    }
}

.issue-image-link {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    margin-bottom: 1.5rem;
    border: 2px solid var(--foreground);
    overflow: hidden;
    background: var(--muted);
}

.issue-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.5s;
}

.issue-card:hover .issue-image-link img {
    filter: grayscale(0%);
}

.issue-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background: var(--background);
    border: 1px solid var(--foreground);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.issue-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid hsl(220 10% 15% / 0.3);
}

.issue-vol {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
}

.issue-date {
    font-family: var(--font-serif);
    font-size: 0.75rem;
    font-style: italic;
    color: hsl(220 10% 15% / 0.7);
}

.issue-title-link h3 {
    font-family: var(--font-serif);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.issue-card:hover .issue-title-link h3 {
    color: var(--primary);
}

.issue-excerpt {
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.6;
    color: hsl(220 10% 15% / 0.9);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.issue-read {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.2s;
}

.issue-card:hover .issue-read {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.issue-card[hidden] {
    display: none;
}

.search-empty {
    text-align: center;
    font-family: var(--font-serif);
    font-style: italic;
    color: hsl(220 10% 15% / 0.7);
    padding: 2rem 0;
}

.load-more {
    margin-top: 5rem;
    padding-top: 3rem;
    text-align: center;
    border-top: 2px solid var(--foreground);
}

.load-more button {
    padding: 1.5rem 2.5rem;
    border: 2px solid var(--foreground);
    background: var(--background);
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.load-more button:hover {
    background: var(--foreground);
    color: var(--background);
}

/* Footer */
.footer {
    margin-top: 2rem;
    padding: 4rem 1rem;
    background: var(--foreground);
    color: var(--background);
    border-top: 6px double var(--foreground);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 768px) {
    .footer-inner {
        grid-template-columns: repeat(3, 1fr);
    }
}

.footer-brand h2 {
    font-family: var(--font-serif);
    font-size: 1.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.footer-brand p {
    font-family: var(--font-serif);
    font-size: 0.875rem;
    font-style: italic;
    color: hsl(0 0% 100% / 0.7);
    max-width: 20rem;
}

.footer-col h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: hsl(0 0% 100% / 0.5);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid hsl(0 0% 100% / 0.2);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.75rem;
}

.footer-col a {
    font-family: var(--font-serif);
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 1px solid hsl(0 0% 100% / 0.2);
    transition: background 0.2s, border-color 0.2s;
}

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

.social-links svg {
    width: 1.25rem;
    height: 1.25rem;
}

.footer-copy {
    font-family: var(--font-serif);
    font-size: 0.75rem;
    color: hsl(0 0% 100% / 0.5);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 1.5rem;
    font-family: var(--font-serif);
    font-size: 0.875rem;
    border: 2px solid var(--foreground);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: toastIn 0.3s ease;
    max-width: calc(100vw - 2rem);
}

.toast-success {
    background: var(--foreground);
    color: var(--background);
}

.toast-error {
    background: #fff5f5;
    color: #7f1d1d;
    border-color: #7f1d1d;
}

.toast[hidden] {
    display: none;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile top bar */
@media (max-width: 480px) {
    .top-bar-tagline {
        display: none;
    }
}
