/*
Theme Name: Nomad Shelf
Author: Marin Cole
Description: Mobile-first classic WordPress theme with a bold FreshBox-inspired editorial layout for flexible publishing.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: abk-theme
*/

:root {
  --abk-ink: #2a1009;
  --abk-muted: #745044;
  --abk-cream: #fff4df;
  --abk-paper: #fffaf0;
  --abk-gold: #f5b52b;
  --abk-rust: #a53818;
  --abk-cocoa: #6d210d;
  --abk-deep: #3b1208;
  --abk-border: rgba(42, 16, 9, 0.16);
  --abk-shadow: 8px 8px 0 rgba(42, 16, 9, 0.16);
  --abk-wrap: min(1120px, calc(100% - 32px));
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--abk-ink);
  background:
    radial-gradient(circle at 15% 6%, rgba(245, 181, 43, 0.25), transparent 28rem),
    linear-gradient(180deg, var(--abk-cream), #fffaf0 48%, var(--abk-cream));
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

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

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

a:hover,
a:focus-visible {
  color: var(--abk-rust);
}

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

.screen-reader-text:focus,
.abk-skip-link:focus {
  z-index: 1000;
  top: 16px;
  left: 16px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  color: #fff;
  background: var(--abk-deep);
  border-radius: 8px;
}

.abk-page-shell {
  min-height: 100vh;
  overflow-x: clip;
}

.abk-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 0;
  background: rgba(255, 244, 223, 0.92);
  border-bottom: 1px solid var(--abk-border);
  backdrop-filter: blur(16px);
}

.abk-header-inner,
.abk-wrap,
.abk-hero,
.abk-category-strip,
.abk-posts-section,
.abk-footer-inner,
.abk-footer-bottom {
  width: var(--abk-wrap);
  margin-inline: auto;
}

.abk-header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}

.abk-brand-link,
.abk-brand .custom-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.abk-brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--abk-cream);
  background: var(--abk-cocoa);
  border: 2px solid var(--abk-ink);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--abk-gold);
  font-weight: 950;
}

.abk-brand-text {
  display: grid;
}

.abk-site-title {
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.05;
}

.abk-site-description {
  max-width: 32ch;
  color: var(--abk-muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.abk-menu-state {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.abk-menu-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--abk-ink);
  border-radius: 50%;
  background: var(--abk-gold);
  box-shadow: 3px 3px 0 var(--abk-ink);
  cursor: pointer;
}

.abk-menu-icon,
.abk-menu-icon::before,
.abk-menu-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--abk-ink);
  border-radius: 999px;
}

.abk-menu-icon {
  position: relative;
}

.abk-menu-icon::before,
.abk-menu-icon::after {
  position: absolute;
  left: 0;
  content: "";
}

.abk-menu-icon::before {
  top: -6px;
}

.abk-menu-icon::after {
  top: 6px;
}

.abk-menu-state:checked + .abk-menu-button .abk-menu-icon {
  background: transparent;
}

.abk-menu-state:checked + .abk-menu-button .abk-menu-icon::before {
  transform: translateY(6px) rotate(45deg);
}

.abk-menu-state:checked + .abk-menu-button .abk-menu-icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

.abk-primary-menu {
  grid-column: 1 / -1;
  display: none;
  padding: 14px;
  background: var(--abk-paper);
  border: 2px solid var(--abk-ink);
  border-radius: 18px;
  box-shadow: 5px 5px 0 var(--abk-gold);
}

.abk-menu-state:checked ~ .abk-primary-menu {
  display: block;
}

.abk-menu-list,
.abk-menu-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.abk-menu-list {
  display: grid;
  gap: 6px;
}

.abk-menu-list a {
  display: block;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 850;
}

.abk-menu-list a:hover,
.abk-menu-list a:focus-visible,
.abk-menu-list .current-menu-item > a,
.abk-menu-list .current_page_item > a {
  color: var(--abk-cream);
  background: var(--abk-cocoa);
}

.abk-menu-list .sub-menu,
.abk-menu-list .children {
  margin: 4px 0 0 12px;
  padding-left: 10px;
  border-left: 2px solid var(--abk-border);
}

.abk-main {
  padding: 26px 0 54px;
}

.abk-hero {
  padding: clamp(28px, 7vw, 74px) 0 10px;
}

.abk-hero-grid {
  display: grid;
  gap: 24px;
  align-items: center;
}

.abk-eyebrow,
.abk-section-kicker {
  margin: 0 0 12px;
  color: var(--abk-rust);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.abk-eyebrow {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 5px 11px;
  color: var(--abk-cream);
  background: var(--abk-cocoa);
  border-radius: 999px;
}

.abk-hero-title,
.abk-section-title,
.abk-post-title,
.abk-single-title,
.abk-footer-title,
.abk-mini-title {
  margin: 0;
  color: var(--abk-deep);
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.abk-hero-title {
  max-width: 880px;
  font-size: clamp(3.1rem, 11vw, 8rem);
  line-height: 0.86;
}

.abk-hero-lead {
  max-width: 660px;
  margin: 18px 0 0;
  color: var(--abk-muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.abk-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.abk-button,
.abk-read-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  color: var(--abk-ink);
  background: var(--abk-gold);
  border: 2px solid var(--abk-ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--abk-ink);
  font-weight: 950;
}

.abk-button:hover,
.abk-button:focus-visible {
  color: var(--abk-ink);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--abk-ink);
}

.abk-button-secondary {
  color: var(--abk-cream);
  background: var(--abk-cocoa);
}

.abk-hero-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  color: var(--abk-cream);
  background:
    radial-gradient(circle at 88% 12%, rgba(245, 181, 43, 0.5), transparent 11rem),
    var(--abk-deep);
  border: 2px solid var(--abk-ink);
  border-radius: 30px;
  box-shadow: 0 22px 60px rgba(42, 16, 9, 0.16);
}

.abk-mini-card {
  min-height: 128px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 18px;
  color: var(--abk-cream);
  background: var(--abk-cocoa);
  border-radius: 18px;
}

.abk-mini-card:nth-child(2) {
  color: var(--abk-ink);
  background: var(--abk-gold);
}

.abk-mini-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.abk-mini-title {
  color: currentColor;
  font-size: clamp(1.5rem, 7vw, 2.6rem);
  line-height: 0.95;
}

.abk-category-strip {
  margin-bottom: 42px;
}

.abk-section-title {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  line-height: 1;
}

.abk-category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.abk-category-link {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  background: var(--abk-paper);
  border: 2px solid var(--abk-border);
  border-radius: 18px;
  font-weight: 950;
}

.abk-category-link:hover,
.abk-category-link:focus-visible {
  color: var(--abk-cream);
  background: var(--abk-cocoa);
  border-color: var(--abk-cocoa);
}

.abk-category-count {
  min-width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  color: var(--abk-ink);
  background: var(--abk-gold);
  border-radius: 999px;
  font-size: 0.82rem;
}

.abk-posts-head {
  margin-bottom: 18px;
}

.abk-post-grid {
  display: grid;
  gap: 18px;
}

.abk-post-card {
  overflow: hidden;
  background: var(--abk-paper);
  border: 2px solid var(--abk-ink);
  border-radius: 30px;
  box-shadow: var(--abk-shadow);
}

.abk-post-media {
  display: block;
  min-height: 210px;
  overflow: hidden;
  background: #f8dfad;
  border-bottom: 2px solid var(--abk-ink);
}

.abk-post-thumb {
  width: 100%;
  height: 100%;
  min-height: 210px;
  object-fit: cover;
}

.abk-post-placeholder {
  min-height: 210px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--abk-cocoa);
  background: linear-gradient(135deg, #fff0c7, #f4c44a);
  font-size: 1.7rem;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.abk-post-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.abk-post-meta,
.abk-single-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--abk-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.abk-post-cats,
.abk-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.abk-post-cats a,
.abk-tag-list a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  color: var(--abk-ink);
  background: rgba(245, 181, 43, 0.35);
  border: 1px solid var(--abk-border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.abk-post-title {
  font-size: clamp(1.45rem, 6vw, 2.25rem);
  line-height: 0.98;
}

.abk-post-excerpt {
  margin: 0;
  color: var(--abk-muted);
}

.abk-read-link {
  justify-self: start;
  min-height: 38px;
  padding: 7px 12px;
  box-shadow: none;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.abk-pagination {
  margin-top: 28px;
}

.abk-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.abk-pagination a,
.abk-pagination span {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: var(--abk-paper);
  border: 2px solid var(--abk-ink);
  border-radius: 999px;
  font-weight: 900;
}

.abk-pagination .current,
.abk-pagination a:hover {
  color: var(--abk-cream);
  background: var(--abk-cocoa);
}

.abk-empty,
.abk-single-wrap,
.abk-comments {
  width: min(80vw, 980px);
  margin-inline: auto;
}

.abk-empty {
  padding: 28px;
  background: var(--abk-paper);
  border: 2px solid var(--abk-ink);
  border-radius: 30px;
}

.abk-single-wrap {
  padding: clamp(26px, 5vw, 58px) 0;
}

.abk-single-header {
  display: grid;
  gap: 14px;
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--abk-border);
}

.abk-single-title {
  font-size: clamp(2.4rem, 10vw, 6rem);
  line-height: 0.9;
}

.abk-single-content {
  font-size: clamp(1.03rem, 2vw, 1.15rem);
}

.abk-single-content > * {
  margin-top: 0;
  margin-bottom: 1.35em;
}

.abk-single-content a {
  color: var(--abk-cocoa);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.abk-single-content h1,
.abk-single-content h2,
.abk-single-content h3,
.abk-single-content h4,
.abk-single-content h5,
.abk-single-content h6 {
  margin-top: 1.25em;
  color: var(--abk-deep);
  line-height: 1.05;
}

.abk-single-content blockquote {
  margin-left: 0;
  padding: 18px 20px;
  background: rgba(245, 181, 43, 0.22);
  border-left: 6px solid var(--abk-gold);
  border-radius: 18px;
  font-weight: 800;
}

.abk-single-content pre {
  overflow-x: auto;
  padding: 16px;
  color: #fff;
  background: var(--abk-deep);
  border-radius: 8px;
}

.abk-single-content table {
  width: 100%;
  border-collapse: collapse;
}

.abk-single-content th,
.abk-single-content td {
  padding: 10px;
  border: 1px solid var(--abk-border);
}

.abk-single-footer {
  display: grid;
  gap: 20px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 2px solid var(--abk-border);
}

.abk-post-nav {
  display: grid;
  gap: 10px;
}

.abk-post-nav a {
  display: block;
  min-height: 52px;
  padding: 14px 16px;
  background: var(--abk-paper);
  border: 2px solid var(--abk-border);
  border-radius: 18px;
  font-weight: 900;
}

.abk-post-nav a:hover {
  color: var(--abk-cream);
  background: var(--abk-cocoa);
}

.abk-page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 24px;
  font-weight: 900;
}

.abk-comments {
  margin-bottom: 48px;
}

.abk-footer {
  padding: 34px 0 22px;
  color: var(--abk-cream);
  background:
    radial-gradient(circle at 82% 8%, rgba(245, 181, 43, 0.24), transparent 18rem),
    var(--abk-deep);
  border-top: 3px solid var(--abk-ink);
}

.abk-footer-inner {
  display: grid;
  gap: 24px;
}

.abk-footer-title {
  color: var(--abk-gold);
  font-size: clamp(1.8rem, 8vw, 4rem);
  line-height: 0.92;
}

.abk-footer-text {
  max-width: 560px;
  margin: 8px 0 0;
  color: rgba(255, 244, 223, 0.78);
}

.abk-footer-columns {
  display: grid;
  gap: 20px;
}

.abk-footer-heading {
  margin: 0 0 10px;
  color: var(--abk-gold);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.abk-footer li + li {
  margin-top: 8px;
}

.abk-footer a {
  color: rgba(255, 244, 223, 0.86);
  font-weight: 800;
}

.abk-footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  color: rgba(255, 244, 223, 0.65);
  border-top: 1px solid rgba(255, 244, 223, 0.18);
  font-size: 0.9rem;
}

.alignwide,
.alignfull,
.wp-caption,
.wp-block-image,
.wp-block-gallery,
.wp-block-embed {
  max-width: 100%;
}

.wp-caption-text,
.wp-block-image figcaption {
  margin-top: 8px;
  color: var(--abk-muted);
  font-size: 0.9rem;
}

@media (min-width: 720px) {
  :root {
    --abk-wrap: min(1120px, calc(100% - 48px));
  }

  .abk-hero-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  }

  .abk-category-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .abk-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .abk-post-card:first-child {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  }

  .abk-post-card:first-child .abk-post-media {
    min-height: 100%;
    border-right: 2px solid var(--abk-ink);
    border-bottom: 0;
  }

  .abk-footer-inner {
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  }

  .abk-footer-columns,
  .abk-post-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .abk-header-inner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .abk-menu-button {
    display: none;
  }

  .abk-primary-menu {
    grid-column: auto;
    display: block;
    justify-self: end;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .abk-menu-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
  }

  .abk-menu-list li {
    position: relative;
  }

  .abk-menu-list a {
    min-height: 38px;
    padding: 8px 12px;
  }

  .abk-menu-list .sub-menu,
  .abk-menu-list .children {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 210px;
    display: none;
    margin: 8px 0 0;
    padding: 8px;
    background: var(--abk-paper);
    border: 2px solid var(--abk-ink);
    border-radius: 18px;
    box-shadow: 5px 5px 0 var(--abk-gold);
  }

  .abk-menu-list li:hover > .sub-menu,
  .abk-menu-list li:focus-within > .sub-menu,
  .abk-menu-list li:hover > .children,
  .abk-menu-list li:focus-within > .children {
    display: block;
  }

  .abk-post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
