/*
Theme Name: Boolala Journal
Description: The Boolala editorial theme with an image-led story grid.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: boolala-journal
*/

:root {
  --paper: #faf5f1; --ink: #292329; --wine: #641c34;
  --night: #1b1018; --gold: #d4b89a; --line: #dcccce;
  --serif: 'Bodoni Moda', 'Times New Roman', serif;
  --sans: Manrope, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 400 15px/1.65 var(--sans); }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
[hidden] { display: none !important; }
a:focus-visible, summary:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--wine); outline-offset: 4px;
}
.skip { position: absolute; inset-inline-start: 1rem; inset-block-start: -6rem; z-index: 5; background: white; padding: .5rem 1rem; }
.skip:focus { inset-block-start: .5rem; }
.shell { width: min(100% - 64px, 1480px); margin-inline: auto; }
.masthead { border-block-start: 4px solid var(--wine); border-block-end: 1px solid var(--line); }
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 82px; }
.brand { font: 600 clamp(38px, 5vw, 64px)/.9 var(--serif); letter-spacing: -.08em; color: var(--wine); text-decoration: none; }
.header-logo { display: block; width: clamp(118px, 17vw, 218px); }
.header-logo img { width: 100%; height: auto; }
.nav-link, .chip, .pager a, .actions button, .action-link { font-weight: 700; font-size: .75rem; letter-spacing: .05em; }
.nav-link { justify-self: start; text-decoration: none; border-block-end: 1px solid var(--wine); }
.nav-link:hover, .chip:hover, .footer a:hover { color: var(--wine); }
.controls { justify-self: end; display: flex; align-items: center; gap: 8px; }
.disclosure { position: relative; }
.disclosure summary { cursor: pointer; list-style: none; display: grid; place-items: center; width: 44px; height: 44px; color: var(--wine); }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary:hover { background: #efe3e7; }
.disclosure svg { width: 22px; height: 22px; }
.mobile-nav { display: none; }
.popover {
  position: absolute; z-index: 4; inset-inline-end: 0; inset-block-start: calc(100% + 8px);
  width: min(320px, calc(100vw - 32px)); padding: 14px; border: 1px solid var(--line);
  background: var(--paper); box-shadow: 0 12px 30px #380f2022;
}
.popover a { display: block; padding: 8px; }
.popover form { display: flex; gap: 8px; }
.popover input { min-width: 0; width: 100%; padding: 7px; border: 1px solid #a4838d; background: white; color: var(--ink); }
.popover button, .actions button { border: 0; padding: 8px 12px; background: var(--wine); color: white; cursor: pointer; }
.collection { padding-block: 23px 64px; min-height: 55vh; }
.collection-heading { margin: 0 0 16px; font: 500 clamp(23px, 3vw, 36px)/1.08 var(--serif); letter-spacing: -.035em; }
.categories:empty { display: none; }
.category-links { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 0 15px; padding: 3px; }
.chip { flex: none; text-decoration: none; border: 1px solid var(--line); border-radius: 30px; padding: 5px 12px; }
.chip[aria-current='page'] { background: var(--wine); color: white; border-color: var(--wine); }
.post-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 24px); }
.post-card { min-width: 0; }
.cover {
  display: grid; grid-template: 1fr / 1fr; width: 100%; aspect-ratio: 4 / 5; overflow: hidden;
  position: relative; isolation: isolate; color: white; background: var(--wine); text-decoration: none;
}
.cover > * { grid-area: 1 / 1; min-height: 0; min-width: 0; }
.cover img, .related-item img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.cover img { z-index: 1; transition: transform 340ms ease; }
.cover::after { content: ''; grid-area: 1 / 1; z-index: 2; background: linear-gradient(180deg, transparent 30%, #150a1270 59%, #150a12f2 100%); pointer-events: none; }
.cover-copy { align-self: end; z-index: 3; padding: clamp(10px, 1.7vw, 25px); }
.cover-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f0dac5; font-size: clamp(.63rem, .77vw, .77rem); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cover-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; margin: 4px 0 0; font: 600 clamp(17px, 2.5vw, 38px)/1.02 var(--serif); }
.cover-fallback { display: grid; place-items: center; position: relative; color: #e7cbd0; background: #380f20; }
.cover-fallback::before { content: ''; position: absolute; inset: 12%; border: 1px solid #d4b89a74; border-radius: 50% 50% 0 0; }
.cover-fallback span { font: italic 500 clamp(48px, 8vw, 120px)/1 var(--serif); transform: translateY(-12%); }
.post-card:nth-child(even) .cover-fallback { background: #4a2a3a; }
@media (hover: hover) { .cover:hover img { transform: scale(1.055); } }
.pager { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-block-start: 28px; }
.pager a { text-decoration-thickness: 1px; text-underline-offset: 4px; }
.empty { border-block-start: 1px solid var(--line); padding-block: 24px; }
.reading { max-width: 740px; margin: 0 auto; }
.reading-header { padding-block: 16px 24px; border-block-end: 1px solid var(--line); margin-block-end: 26px; }
.reading h1 { font: 600 clamp(36px, 7vw, 84px)/.98 var(--serif); letter-spacing: -.045em; margin: 9px 0 13px; overflow-wrap: anywhere; }
.reading h2, .reading h3 { font: 600 1.65em/1.08 var(--serif); }
.reading-meta { color: var(--wine); font-size: .8rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 5px 10px; list-style: none; padding: 0; margin: 0; }
.crumbs li + li::before { content: "/"; margin-inline-end: 10px; }
.reading .entry { font-size: clamp(18px, 2.2vw, 20px); line-height: 1.78; overflow-wrap: anywhere; }
.entry p { margin: 0 0 1.25em; }
.entry img { margin-inline: auto; max-width: 100%; height: auto; }
.entry a { color: var(--wine); text-underline-offset: .15em; }
.entry iframe, .entry video { max-width: 100%; }
.entry blockquote { margin: 1.5em 0; padding: 12px 0 12px 22px; border-inline-start: 2px solid var(--wine); font: italic 500 1.45em/1.25 var(--serif); color: var(--wine); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-block: 32px; }
.related { border-block-start: 1px solid var(--line); padding-block-start: 18px; }
.related-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.related-item { display: grid; gap: 6px; align-content: start; text-decoration: none; font: 600 1.25rem/1.15 var(--serif); }
.related-item img { aspect-ratio: 4 / 3; }
.footer { border-block-start: 1px solid var(--line); padding-block: 24px; }
.footer-inner { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; }
.footer .brand { font-size: 32px; }
.footer small { font-size: .7rem; }
.footer-pages { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: .78rem; }
@media (max-width: 1023px) {
  .shell { width: calc(100% - 40px); }
  .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 28px); }
  .bar { min-height: 58px; }
  .header-logo { width: clamp(118px, 40vw, 168px); }
  .desktop-nav { display: none; }
  .mobile-nav { display: block; justify-self: start; }
  .mobile-nav .popover { inset-inline-start: 0; inset-inline-end: auto; }
  .collection { padding-block: 16px 42px; }
  .collection-heading { margin-block-end: 11px; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .category-links { flex-wrap: nowrap; overflow-x: auto; margin-block-end: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

.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;
}
.entry .alignwide { max-width: 100%; }
.entry > * { max-width: 100%; }
.entry table { display: block; overflow-x: auto; }
.entry pre { overflow: auto; }
.pager .nav-links { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.footer-pages .menu { display:flex; flex-wrap:wrap; gap:10px 16px; margin:0; padding:0; list-style:none; }
.comments-area { max-width:740px; margin:40px auto 0; border-top:1px solid var(--line); }
.comments-area textarea, .comments-area input:not([type=checkbox]) { max-width:100%; }
