/*
Theme Name: MAQ.BIO
Theme URI: https://www.maq.bio/
Author: MAQ.BIO
Author URI: https://www.maq.bio/
Description: Ultra-lightweight Pinterest-inspired editorial discovery for native WordPress Posts and Pages. Responsive masonry, no animation, crawlable pagination and related discovery.
Version: 1.0.7
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: maqbio
Tags: blog, news, photography, portfolio, grid-layout, custom-logo, custom-menu, featured-images, block-styles, wide-blocks
*/

/* =========================================================
   MAQ.BIO — EASY DESIGN SETTINGS
   Change only these variables first. More instructions in
   CUSTOMIZATION-GUIDE.md. Only the optional clickable tag strip moves; all other UI avoids decorative animation.
   ========================================================= */
:root {
  --maq-background: #fff;
  --maq-text: #22221f;
  --maq-muted: #757570;
  --maq-accent: #77764c;
  --maq-border: #e7e7e2;
  --maq-soft: #f3f2ed;
  --maq-grid-gap: 15px;         /* Space between cards; try 12px-20px. */
  --maq-max-width: 1680px;     /* Max width for header/footer and wide media; Discover ignores this cap. */
  --maq-reading-width: 740px;  /* Comfortable article text width. */
  --maq-wide-width: 1100px;    /* Width of wide post images. */
  --maq-edge: clamp(18px, 1.5vw, 32px); /* Breathing room at both sides. */
  --maq-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --maq-cols: 9;               /* Maximum desktop columns; responsive overrides below. */
}

/* Base and screen-reader accessibility */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-wrap: break-word; }
body { margin: 0; min-width: 280px; color: var(--maq-text); background: var(--maq-background); font: 400 16px/1.6 var(--maq-font); }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--maq-accent); outline-offset: 3px; }
img, svg, video { max-width: 100%; }
img { height: auto; }
button, input { font: inherit; }
button { cursor: pointer; }
::selection { background: #dedfc1; color: #202020; }
.screen-reader-text, .maq-skip-link:not(:focus) { position: absolute !important; overflow: hidden; width: 1px; height: 1px; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; clip-path: inset(50%); }
.maq-skip-link:focus { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 16px; color: #fff; background: #222; }
.maq-container { width: min(calc(100% - var(--maq-edge) * 2), var(--maq-max-width)); margin-inline: auto; }

/* Header — logo, menu and native search only. */
.maq-site-header { border-bottom: 1px solid var(--maq-border); }
.maq-header-inner { display: flex; align-items: center; min-height: 79px; gap: clamp(15px, 2.8vw, 47px); }
.maq-brand { flex: 0 0 auto; line-height: 1; }
.maq-brand-name { display: inline-block; font-size: 25px; font-weight: 800; letter-spacing: -.055em; white-space: nowrap; }
.maq-brand .custom-logo { display: block; width: auto; max-height: 52px; max-width: 190px; object-fit: contain; }
.maq-site-nav { flex: 1 1 auto; min-width: 0; }
.maq-menu, .maq-footer-menu { display: flex; gap: clamp(12px, 1.5vw, 26px); align-items: center; list-style: none; margin: 0; padding: 0; }
.maq-menu { overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.maq-menu li { margin: 0; padding: 0; }
.maq-menu a { display: inline-block; padding-block: 9px; color: #44443e; font-size: 12px; font-weight: 650; }
.maq-menu a:hover, .maq-menu .current-menu-item a, .maq-menu .current-cat a { color: var(--maq-accent); text-decoration: underline; text-underline-offset: 5px; }
.maq-header-search { flex: 0 0 160px; min-width: 0; }
.maq-search { display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--maq-border); padding: 5px 0; }
.maq-search svg { flex: none; color: var(--maq-muted); }
.maq-search input { width: 100%; min-width: 0; border: 0; outline-offset: 3px; background: transparent; font-size: 12px; color: var(--maq-text); }
.maq-search input::placeholder { color: var(--maq-muted); }

/* Feed / category / tag / search pages. */
.maq-main { padding-top: 30px; padding-bottom: 70px; }
/* MAQ.BIO v1.0.3 — FULL-WIDTH DISCOVER / ARCHIVES
   Only listing grids expand to the browser width. Reading pages stay comfortably narrow.
   Change --maq-edge (above) to control the small outer gutter.
   Remove this override to restore the old centered/max-width listing layout. */
main.maq-main.maq-container {
  width: calc(100% - (var(--maq-edge) * 2));
  max-width: none;
  margin-inline: var(--maq-edge);
}

.maq-list-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin: 0 0 25px; }
.maq-list-heading h1 { font-size: 13px; letter-spacing: .15em; font-weight: 750; text-transform: uppercase; margin: 0; }
.maq-archive-description { color: var(--maq-muted); font-size: 13px; }
.maq-archive-description p { margin: 0; }

/*
 * No-JS masonry: CSS columns. With JS, site.js enhances it to a true
 * CSS Grid whose row spans fit every card's natural height. No visual motion.
 */
.maq-grid { column-count: var(--maq-cols); column-gap: var(--maq-grid-gap); }
.maq-grid .maq-card { break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 var(--maq-grid-gap); vertical-align: top; }
.maq-grid.is-measured { display: grid; column-count: initial; grid-template-columns: repeat(var(--maq-cols), minmax(0, 1fr)); grid-auto-rows: 8px; gap: var(--maq-grid-gap); align-items: start; }
.maq-grid.is-measured .maq-card { display: block; margin: 0; min-width: 0; }
/* FEATURE CATEGORY: add the WordPress category "Feature" (slug: feature) to any Post.
   The entire card occupies TWO grid columns, including image, title, and hook.
   The fallback CSS-columns view uses normal one-column cards if JS is unavailable.
   Don't use grid-auto-flow: dense here; keeping reading/focus order is important. */
.maq-grid.is-measured .maq-card--featured { grid-column: span 2; }
.maq-card { min-width: 0; }
.maq-card-link { display: block; outline-offset: 4px; }
.maq-card-media, .maq-card-placeholder { overflow: hidden; background: var(--maq-soft); }
.maq-card-image { display: block; width: 100%; height: auto; }
.maq-card-caption { padding: 11px 2px 0; }
.maq-card-kicker { display: block; color: var(--maq-muted); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; font-weight: 680; line-height: 1.5; }
/* HOME CARD HOOK: font and spacing can be adjusted here. No animations. */
.maq-card-hook { margin: 5px 0 0; color: var(--maq-muted); font-size: clamp(11px, .83vw, 13px); line-height: 1.5; overflow-wrap: anywhere; }
body.home .maq-card-title { margin-top: 0; }
.maq-card-title { font-size: clamp(12px, .94vw, 15px); line-height: 1.45; margin: 4px 0 0; font-weight: 610; letter-spacing: -.012em; }
.maq-card-link:hover .maq-card-title { color: var(--maq-accent); text-decoration: underline; text-underline-offset: 3px; }
.maq-card-placeholder { min-height: 140px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 4/5; }
.maq-card-placeholder span { color: #6f6e66; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.maq-card-placeholder strong { font: 500 clamp(18px, 1.6vw, 29px)/1.14 Georgia, serif; letter-spacing: -.025em; }
.maq-empty { column-span: all; font-size: 14px; color: var(--maq-muted); }
.maq-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 20px; min-height: 60px; margin-top: 27px; font-size: 12px; color: var(--maq-muted); }
.maq-pagination a { display: inline-block; padding: 10px 14px; color: var(--maq-text); border: 1px solid var(--maq-border); }
.maq-pagination a:hover { background: var(--maq-soft); }
.maq-load-status { font-size: 12px; color: var(--maq-muted); }

/* Article / standalone Pages: readable editorial typography. */
.maq-entry { width: min(calc(100% - var(--maq-edge) * 2), var(--maq-wide-width)); margin: 0 auto; }
.maq-entry-header { margin-inline: auto; max-width: var(--maq-wide-width); }
.maq-entry-kicker { margin: 0 0 15px; color: var(--maq-accent); font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: .16em; }
.maq-entry-title { max-width: 940px; margin: 0 0 13px; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(34px, 5.3vw, 78px); line-height: 1.095; letter-spacing: -.044em; font-weight: 400; overflow-wrap: break-word; }
.maq-entry-meta { display: flex; gap: 10px; align-items: center; margin: 0 0 30px; color: var(--maq-muted); font-size: 12px; }
.maq-entry-meta a:hover { text-decoration: underline; }
.maq-entry-cover { margin: 22px 0 0; }
.maq-hero-image { display: block; height: auto; width: 100%; }
.maq-entry-cover figcaption { padding-top: 9px; font-size: 12px; color: var(--maq-muted); }
.maq-entry-content { width: min(100%, var(--maq-reading-width)); margin: 44px auto 0; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.85; overflow-wrap: break-word; }
.maq-entry-content > :first-child { margin-top: 0; }
.maq-entry-content p { margin: 0 0 1.45em; }
.maq-entry-content h2, .maq-entry-content h3, .maq-entry-content h4 { line-height: 1.23; letter-spacing: -.025em; margin: 1.8em 0 .65em; }
.maq-entry-content h2 { font-size: clamp(26px, 3vw, 37px); }
.maq-entry-content h3 { font-size: clamp(21px, 2.3vw, 27px); }
.maq-entry-content h4 { font-size: 19px; }
.maq-entry-content a:not(.wp-block-button__link) { color: var(--maq-accent); text-decoration: underline; text-underline-offset: 3px; }
.maq-entry-content a:hover { color: var(--maq-text); }
.maq-entry-content figure { margin-top: 1.6em; margin-bottom: 1.8em; max-width: 100%; }
.maq-entry-content img { max-width: 100%; height: auto; }
.maq-entry-content figcaption { color: var(--maq-muted); font-size: 12px; line-height: 1.5; margin-top: 8px; }
.maq-entry-content blockquote { margin: 1.7em 0; padding: 0 0 0 22px; border-left: 3px solid var(--maq-accent); font: italic 400 1.25em/1.55 Georgia, serif; }
.maq-entry-content blockquote p { margin-bottom: .6em; }
.maq-entry-content ul, .maq-entry-content ol { padding-left: 1.5em; margin: 0 0 1.4em; }
.maq-entry-content li { margin-bottom: .4em; }
.maq-entry-content table { width: 100%; border-collapse: collapse; font-size: .9em; display: block; overflow-x: auto; }
.maq-entry-content th, .maq-entry-content td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--maq-border); }
.maq-entry-content pre { max-width: 100%; overflow-x: auto; padding: 15px; background: var(--maq-soft); font-size: 14px; }
.maq-entry-content iframe { max-width: 100%; }
.maq-entry-content .alignwide { max-width: none; width: min(calc(100vw - var(--maq-edge) * 2), var(--maq-wide-width)); position: relative; left: 50%; transform: translateX(-50%); }
.maq-entry-content .alignfull { max-width: none; width: min(calc(100vw - var(--maq-edge) * 2), var(--maq-max-width)); position: relative; left: 50%; transform: translateX(-50%); }
.maq-entry-content .wp-block-image img { display: block; }
.maq-entry-content .wp-block-cover { min-height: 260px; }
.maq-entry-content .wp-block-columns { gap: 24px; }
.maq-entry-tags { width: min(100%, var(--maq-reading-width)); margin: 38px auto 0; display: flex; flex-wrap: wrap; gap: 8px; }
.maq-entry-tags a { font-size: 12px; border: 1px solid var(--maq-border); padding: 5px 10px; }
.maq-entry-tags a:hover { border-color: var(--maq-accent); }
.maq-page-entry .maq-entry-title { font-size: clamp(36px, 5vw, 65px); }
.maq-page-entry .maq-entry-content { margin-top: 35px; }
.maq-recommendations { margin-top: clamp(55px, 7vw, 115px); padding-top: 25px; border-top: 1px solid var(--maq-border); }
.maq-recommendations > h2 { margin: 0 0 29px; font: 680 13px/1.4 var(--maq-font); letter-spacing: .13em; text-transform: uppercase; }
.maq-not-found { max-width: 720px; min-height: 55vh; }
.maq-not-found h1 { margin: 8px 0; font: 400 clamp(38px, 6vw, 68px)/1.15 Georgia, serif; }
.maq-not-found > p { color: var(--maq-muted); }
.maq-not-found .maq-search { max-width: 330px; }

/* Footer */
.maq-site-footer { border-top: 1px solid var(--maq-border); color: var(--maq-muted); font-size: 11px; }
.maq-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 77px; }
.maq-footer-inner p { margin: 0; }
.maq-footer-menu { gap: 17px; }
.maq-footer-menu a:hover { text-decoration: underline; }

/* =========================================================
   RESPONSIVE MASONRY COLUMNS — MAQ.BIO v1.0.5
   Never more than NINE columns, even on ultra-wide monitors.
   "Feature" cards can use TWO of those columns; on two-column
   mobile layouts, a featured card spans the entire row.
   Change --maq-cols here; JS masonry and no-JS columns agree.
   ========================================================= */
@media (min-width: 1780px) { :root { --maq-cols: 9; } }
@media (min-width: 1550px) and (max-width: 1779px) { :root { --maq-cols: 8; } }
@media (min-width: 1360px) and (max-width: 1549px) { :root { --maq-cols: 7; } }
@media (min-width: 1150px) and (max-width: 1359px) { :root { --maq-cols: 6; } }
@media (min-width: 980px) and (max-width: 1149px) { :root { --maq-cols: 5; } }
@media (min-width: 741px) and (max-width: 979px) { :root { --maq-cols: 4; --maq-grid-gap: 14px; } }
@media (max-width: 740px) {
  :root { --maq-cols: 2; --maq-edge: 15px; --maq-grid-gap: 12px; }
  .maq-header-inner { min-height: 65px; flex-wrap: wrap; row-gap: 0; padding-top: 11px; padding-bottom: 8px; }
  .maq-brand-name { font-size: 23px; }
  .maq-brand .custom-logo { max-height: 37px; max-width: 170px; }
  .maq-site-nav { order: 3; flex-basis: 100%; }
  .maq-menu { gap: 21px; }
  .maq-menu a { padding: 9px 0; font-size: 12px; }
  .maq-header-search { margin-left: auto; flex-basis: min(37%, 140px); }
  .maq-main { padding-top: 21px; padding-bottom: 50px; }
  .maq-list-heading { margin-bottom: 17px; }
  .maq-card-caption { padding-top: 8px; }
  .maq-card-kicker { font-size: 9px; }
  .maq-card-title { font-size: 12px; line-height: 1.38; }
  .maq-entry-title { font-size: clamp(33px, 7.8vw, 50px); }
  .maq-entry-content { margin-top: 27px; font-size: 16px; }
  .maq-recommendations { margin-top: 58px; }
  .maq-footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 20px; }
}
@media (max-width: 370px) { :root { --maq-cols: 1; } .maq-card-title { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Narrowest one-column screens cannot span two columns. */
@media (max-width: 370px) {
  .maq-grid.is-measured .maq-card--featured { grid-column: span 1; }
}

/* =========================================================
   MAQ.BIO v1.0.7 — SEARCH LOGO / PINTEREST CARDS / ADS / TAGS
   These overrides keep older layouts compatible with this ZIP.
   Notes and options: CUSTOMIZATION-GUIDE.md
   ========================================================= */

/* Header and topics remain accessible at the top while reading the feed. */
.maq-site-header { position: sticky; top: 0; z-index: 60; background: #fff; }
body.admin-bar .maq-site-header { top: 32px; }
.maq-header-inner { justify-content: flex-start; gap: clamp(15px, 2.4vw, 34px); min-height: 68px; }
.maq-brand { flex: none; }
.maq-logo-search-button { appearance: none; border: 0; padding: 0; background: transparent; display: flex; align-items: center; cursor: pointer; border-radius: 2px; }
.maq-logo-search-button:active { outline: 3px solid var(--maq-accent); outline-offset: 3px; }
.maq-brand .custom-logo { max-height: 46px; max-width: 190px; }
.maq-site-nav { flex: none; display: flex; gap: 20px; align-items: center; min-width: 0; justify-content: flex-start; }
.maq-site-nav .maq-discover-link { font-size: 12px; font-weight: 650; white-space: nowrap; }
.maq-site-nav .maq-discover-link:hover { color: var(--maq-accent); text-decoration: underline; }
.maq-menu { gap: clamp(12px, 1.4vw, 25px); overflow-x: auto; }
.maq-header-search { display: none !important; }

/* Popup search is the only visible search box. Logo triggers it. */
.maq-search-dialog { width: min(92vw, 640px); max-width: 640px; border: 1px solid var(--maq-border); padding: 26px; border-radius: 9px; box-shadow: 0 12px 42px #0002; }
.maq-search-dialog::backdrop { background: rgb(0 0 0 / .4); }
.maq-search-dialog-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 19px; }
.maq-search-dialog h2 { margin: 0; font-size: 20px; font-weight: 650; }
.maq-search-close { background: transparent; border: 0; font-size: 31px; line-height: 1; padding: 3px 9px; }
.maq-search-dialog .maq-search { width: 100%; padding: 10px 0; }
.maq-search-dialog .maq-search input { font-size: 17px; }

/* Clickable tags run below the header; hover/focus pauses for accessibility. */
.maq-tag-strip { border-top: 1px solid var(--maq-border); overflow: hidden; white-space: nowrap; background: #fff; }
.maq-tag-scroll { display: flex; width: max-content; gap: 22px; animation: maq-tag-run 45s linear infinite; }
.maq-tag-group { display: flex; gap: 22px; align-items: center; flex: none; min-height: 35px; }
.maq-tag-group a { display: inline-block; padding: 6px 2px; font-size: 11px; color: #4c4c47; }
.maq-tag-group a:focus-visible, .maq-tag-group a:hover { color: var(--maq-accent); text-decoration: underline; }
.maq-tag-strip:hover .maq-tag-scroll, .maq-tag-strip:focus-within .maq-tag-scroll { animation-play-state: paused; }
@keyframes maq-tag-run { to { transform: translateX(calc(-50% - 11px)); } }

/* Make card UI feel responsive to clicks without decorating it with hover animation. */
.maq-card-inner { width: 100%; min-width: 0; }
.maq-card-inner a:active, .maq-gallery-prev:active, .maq-gallery-next:active { outline: 2px solid var(--maq-accent); outline-offset: 2px; background-color: rgb(90 90 90 / .07); }
.maq-card-media-link { display: block; }
.maq-card-link { display: block; }
.maq-card-caption { overflow-wrap: break-word; }
.maq-grid.is-measured .maq-card { align-self: start; }
.maq-grid.is-measured { grid-auto-flow: row dense; }

/* Brand category: a standalone logo tile, or clean text mark if no logo selected. */
.maq-brand-card { display: grid; place-items: center; min-height: 130px; padding: 16px 12px; background: #f9f9f8; border: 1px solid var(--maq-border); }
.maq-brand-card .maq-brand-logo-image { display: block; max-width: 100%; width: auto; max-height: 140px; height: auto; object-fit: contain; }
.maq-brand-wordmark { font-size: clamp(16px, 1.4vw, 24px); letter-spacing: -.02em; text-align: center; overflow-wrap: anywhere; }
.maq-card--featured .maq-brand-card { min-height: 180px; }

/* Swipeable card galleries: consistent frame prevents card jumping as slides change. */
.maq-card-gallery { position: relative; overflow: hidden; aspect-ratio: var(--maq-gallery-ratio, 4/5); }
.maq-gallery-slide { display: block; width: 100%; height: 100%; }
.maq-gallery-slide[hidden] { display: none !important; }
.maq-gallery-prev, .maq-gallery-next { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 36px; background: rgb(255 255 255 / .93); border: 0; border-radius: 4px; font: 28px/1 var(--maq-font); display: none; }
.maq-gallery-prev { left: 4px; }
.maq-gallery-next { right: 4px; }
.js .maq-gallery-prev, .js .maq-gallery-next { display: block; }
.maq-gallery-count { position: absolute; bottom: 7px; right: 7px; background: rgb(0 0 0 / .7); color: white; border-radius: 4px; padding: 2px 6px; font-size: 10px; pointer-events: none; }
.maq-gallery-slide img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Advertisements always identified; do not disguise commercial links. */
.maq-sponsored-label { display: inline-block; color: var(--maq-muted); text-transform: uppercase; font-weight: 700; font-size: 10px; letter-spacing: .08em; }
.maq-card--manual-ad .maq-card-caption { border-top: 1px solid var(--maq-border); }
.maq-ad-card .maq-card-inner { min-height: 160px; border: 1px solid var(--maq-border); background: #fafafa; padding: 8px; }
.maq-ad-card .adsbygoogle { min-height: 125px; width: 100%; }

/* Mobile: tighter, left-aligned navigation, two-column masonry; avoid huge holes. */
@media (max-width: 740px) {
  .maq-header-inner { align-items: flex-start; min-height: 0; padding-top: 12px; padding-bottom: 9px; flex-direction: column; flex-wrap: nowrap; gap: 5px; }
  .maq-brand .custom-logo { max-height: 38px; max-width: 170px; }
  .maq-site-nav { order: 0; flex: none; width: 100%; gap: 17px; justify-content: flex-start; }
  .maq-menu { gap: 18px; }
  .maq-site-nav .maq-discover-link, .maq-menu a { font-size: 12px; padding-block: 5px; }
  .maq-tag-group { min-height: 33px; }
  .maq-grid.is-measured .maq-card--featured { grid-column: span 1; }
  .maq-gallery-prev, .maq-gallery-next { width: 28px; height: 30px; font-size: 23px; }
  .maq-brand-card { min-height: 115px; padding: 12px; }
  .maq-brand-logo-image { max-height: 105px !important; }
}
@media (max-width: 782px) { body.admin-bar .maq-site-header { top: 46px; } }
@media (max-width: 600px) { body.admin-bar .maq-site-header { top: 0; } }
@media (max-width: 370px) { .maq-grid.is-measured .maq-card--featured { grid-column: span 1; } }
@media (prefers-reduced-motion: reduce) {
  .maq-tag-scroll { animation: none; }
  .maq-tag-strip { overflow-x: auto; }
  .maq-tag-clone { display: none; }
}
