/*
Theme Name: Nostalgia Workstation
Description: A desktop-inspired editorial theme with beveled windows and original pixel artwork.
Version: 1.0.0
Text Domain: nostalgia-workstation
*/

:root {
    color-scheme: light;
    --desktop: #086e6d;
    --ink: #182532;
    --muted: #40505d;
    --chrome: #d0d2ce;
    --chrome-light: #f8f8ee;
    --chrome-dark: #3f4b53;
    --paper: #fbfbf5;
    --navy: #213474;
    --title: linear-gradient(100deg, #26346e 10%, #336891 82%);
    --raised: inset 1px 1px var(--chrome-light), inset -1px -1px #858e91, 1px 1px #202d39;
    --sunken: inset 1px 1px #67737a, inset -1px -1px var(--chrome-light);
    --system: Tahoma, Verdana, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; background: var(--desktop); color: var(--ink); font: 16px/1.55 var(--system); }
main { flex: 1; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.13; }
a { color: inherit; text-underline-offset: .19em; }
a:hover { text-decoration-thickness: .13em; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid #0e3e9a; outline-offset: 3px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; padding: 0; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; z-index: 2; inset: 8px auto auto 8px; transform: translateY(-200%); background: var(--paper); padding: 10px 14px; }
.skip-link:focus { transform: none; }
.pixel-icon, .hero-illustration img { image-rendering: pixelated; }

.site-header, .site-footer { background: var(--chrome); }
.site-header { border-top: 2px solid var(--chrome-light); border-bottom: 2px solid #3a5154; }
.site-footer { border-top: 2px solid var(--chrome-light); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1312px; margin: auto; padding: 10px 28px; }
.brand { display: inline-flex; align-items: center; gap: 8px; padding: 4px 9px 4px 5px; background: #d8dad5; box-shadow: var(--raised); color: #172635; font-size: 1rem; line-height: 1.2; font-weight: 700; text-decoration: none; }
.brand:hover { background: #eff0e6; }
.brand .pixel-icon { width: 26px; height: 26px; }
.main-nav, .footer-inner nav { display: flex; align-items: center; gap: 6px; font-size: .93rem; font-weight: 650; }
.main-nav a, .footer-inner nav a { text-decoration: none; padding: 7px 12px; }
.main-nav a:hover, .footer-inner nav a:hover, .main-nav a[aria-current] { background: #e1e3dd; box-shadow: var(--raised); }
.main-nav a[aria-current] { color: var(--navy); }

.desk-search { display: flex; max-width: 200px; gap: 2px; }
.desk-search input, .desk-search button { border: 0; border-radius: 0; color: var(--ink); }
.desk-search input { min-width: 0; width: 100%; padding: 7px 10px; background: var(--paper); box-shadow: var(--sunken); font: inherit; font-size: .85rem; }
.desk-search button { background: var(--chrome); box-shadow: var(--raised); padding: 8px 11px; cursor: pointer; }
.desk-search button:hover { background: #eff0e6; }
.desk-search button span { position: relative; display: block; width: 10px; height: 10px; border: 1.5px solid; border-radius: 45%; }
.desk-search button span::after { content: ""; position: absolute; right: -4px; bottom: -2px; width: 5px; border-top: 1.5px solid; transform: rotate(45deg); }

.desktop { padding: clamp(30px, 4vw, 60px) 28px 22px; }
.desktop-inner { display: grid; grid-template-columns: 99px minmax(0, 1fr); align-items: start; gap: 24px; max-width: 1190px; margin-inline: auto; }
.desktop-inner .hero { grid-column: 2; grid-row: 1; }
.desktop-topics { grid-column: 1; grid-row: 1; display: grid; gap: 9px; padding-top: 4px; }
.desktop-topics a { display: grid; align-content: center; justify-items: center; gap: 4px; min-height: 70px; padding: 5px 3px; color: #fff; font-size: .86rem; font-weight: 700; text-decoration: none; text-align: center; }
.desktop-topics a:hover, .desktop-topics a:focus-visible { background: #0b565e; outline: 1px dashed #e2eadb; outline-offset: -3px; }
.desktop-topics .pixel-icon { width: 38px; height: 38px; filter: drop-shadow(1px 2px #163841); }
.desktop-topics a span { padding: 0 3px; background: #086161; }

.window { min-width: 0; padding: 4px; background: var(--chrome); box-shadow: var(--raised), 4px 5px #164747; }
.window-bar { display: flex; min-height: 30px; align-items: center; gap: 6px; padding: 3px 7px; color: #fff; background: var(--title); font-size: .88rem; font-weight: 700; }
.window-bar h2 { font-size: inherit; font-weight: inherit; }
.window-bar .pixel-icon { flex: 0 0 20px; width: 20px; height: 20px; }
.window-help { display: grid; place-items: center; width: 24px; height: 24px; margin-left: auto; color: var(--ink); background: var(--chrome); box-shadow: var(--raised); font: 700 1rem/1 var(--system); text-decoration: none; }
.window-help:hover { background: var(--paper); }
.window-help:focus-visible { outline-color: #fff8aa; }

.hero-body { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); align-items: center; gap: clamp(20px, 3vw, 42px); padding: clamp(24px, 4vw, 48px); background: #e7e8df; }
.hero-copy { min-width: 0; }
.hero h1 { color: #1a2e4c; font: 750 clamp(2.7rem, 5.1vw, 5rem)/.99 Arial, sans-serif; letter-spacing: -.055em; }
.hero p { max-width: 31ch; color: #354657; font-size: clamp(.98rem, 1.4vw, 1.12rem); line-height: 1.45; margin-block: 17px 23px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 7px 15px; color: #17263b; background: var(--chrome); box-shadow: var(--raised); font-size: .91rem; font-weight: 700; text-decoration: none; }
.button:hover { background: #f1f1e7; }
.button:active { box-shadow: var(--sunken); }
.button .pixel-icon { width: 25px; height: 25px; flex: 0 0 25px; }
.hero-illustration { min-width: 0; background: #29394e; border: 2px solid #627277; border-right-color: #f8f8ee; border-bottom-color: #f8f8ee; padding: 3px; }
.hero-illustration img { width: 100%; height: auto; }

.workspace { width: 100%; max-width: 1246px; margin-inline: auto; padding: 28px 28px 60px; }
.latest { padding-top: 0; }
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.latest .story-grid { padding: 14px; }
.story-card { min-width: 0; display: flex; flex-direction: column; color: var(--ink); background: var(--paper); border: 1px solid #6c7c84; }
.story-image { display: block; background: #c7d5d7; border-bottom: 1px solid #6c7c84; }
.story-image img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.story-details { flex: 1; padding: 13px 15px 16px; }
.story-topic, .byline { color: #3a5265; font: 700 .74rem/1.3 var(--system); margin-bottom: 7px; }
.story-title { color: #212d55; font: 700 1.22rem/1.16 var(--system); overflow-wrap: anywhere; }
.story-title a { text-decoration: none; }
.story-title a:hover, .story-title a:focus-visible { text-decoration: underline; }
.story-card p { margin-top: 8px; color: var(--muted); font-size: .9rem; }

.reading { max-width: 1000px; }
.article-inner { padding: clamp(22px, 4.5vw, 51px); background: var(--paper); }
.article-header, .article-cover, .prose { max-width: 70ch; margin-inline: auto; }
.article-header h1 { color: #172e51; font: 750 clamp(2rem, 5vw, 4rem)/1.05 Arial, sans-serif; letter-spacing: -.035em; overflow-wrap: anywhere; }
.byline { margin: 12px 0 0; }
.article-cover { margin-top: 23px; }
.article-cover img { width: 100%; border: 1px solid #838e90; }
.prose { margin-top: 20px; color: #21303b; font-size: 1.04rem; line-height: 1.7; overflow-wrap: anywhere; }
.prose p, .prose ul, .prose ol { margin-block: 1rem; }
.prose h2 { color: #21346b; font-size: clamp(1.4rem, 3vw, 1.94rem); margin: 1.75em 0 .5em; }
.prose a { color: #214282; }
.prose li + li { margin-top: .31em; }
.prose table { width: 100%; border-collapse: collapse; }
.prose td, .prose th { padding: 8px; border: 1px solid #84939a; text-align: left; }

.results { width: 100%; color: #fff; }
.results h1 { margin-bottom: 18px; font-size: clamp(2rem, 4vw, 3rem); overflow-wrap: anywhere; }
.results p:not(.story-card p) { margin-bottom: 19px; }
.results > p .button:focus-visible, .results .pagination a:focus-visible { outline-color: #fff8aa; }
.pagination { margin-top: 30px; }
.pagination .page-numbers { margin-right: .75em; }
.footer-inner { padding-block: 11px; }

@media (max-width: 870px) {
    .header-inner { gap: 13px; flex-wrap: wrap; }
    .desk-search { max-width: 158px; }
    .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .desktop-inner { grid-template-columns: 82px minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 680px) {
    .header-inner, .footer-inner { padding-inline: 13px; gap: 10px; }
    .header-inner .main-nav { order: 3; width: 100%; justify-content: space-between; }
    .header-inner .brand { font-size: .9rem; }
    .header-inner .desk-search { max-width: 119px; }
    .main-nav a, .footer-inner nav a { padding-inline: 7px; }
    .desktop { padding: 17px 13px; }
    .desktop-inner { grid-template-columns: minmax(0, 1fr); gap: 13px; }
    .desktop-inner .hero, .desktop-topics { grid-column: 1; grid-row: auto; }
    .desktop-topics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
    .desktop-topics a { font-size: .76rem; min-height: 57px; padding-inline: 0; }
    .desktop-topics a span { white-space: nowrap; }
    .desktop-topics .pixel-icon { width: 32px; height: 32px; }
    .hero-body { grid-template-columns: minmax(0, 1fr); gap: 21px; padding: 22px 18px 17px; }
    .hero h1 { font-size: clamp(2.65rem, 9vw, 3.8rem); }
    .hero p { margin-block: 12px 16px; }
    .workspace { padding: 18px 13px 45px; }
    .latest { padding-top: 0; }
    .latest .story-grid { padding: 9px; }
    .story-grid { grid-template-columns: minmax(0, 1fr); gap: 11px; }
    .footer-inner { flex-wrap: wrap; }
}
