/*
Theme Name:   BugzYard Scrapbook
Theme URI:    https://bugzyard.com
Author:       Ahmad Bilal
Description:  A cosy scrapbook theme for bugzyard.com: lined paper, washi tape, polaroids and handwritten headings. Installs and activates the BugzYard Hub plugin automatically, which syncs your classroom and diary from fatsup.wordpress.com.
Version:      1.5.0
Requires at least: 6.0
Requires PHP: 7.4
License:      GPL-2.0-or-later
Text Domain:  bugzyard-scrapbook
Tags:         blog, custom-menu, featured-images, threaded-comments
*/

/* Layout: one centred column of taped paper sheets on a lined-paper desk. */
:root{
	--paper:#efe3cf; --line:rgba(120,90,60,.09); --card:#fffaf0; --edge:#e6d7bf;
	--ink:#4a3726; --muted:#8a6e55; --link:#b85c38;
	--tapeA:rgba(255,183,197,.8); --tapeB:rgba(160,220,200,.8); --tapeC:rgba(255,214,120,.8);
	--hand:"Caveat","Segoe Print",cursive; --body:"Nunito",system-ui,-apple-system,sans-serif;
}
*{box-sizing:border-box}
body{margin:0;background:var(--paper) repeating-linear-gradient(0deg,transparent 0 27px,var(--line) 27px 28px);color:var(--ink);font-family:var(--body);font-size:16px;line-height:1.65}
a{color:var(--link)}
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid var(--link);outline-offset:2px}
img{max-width:100%;height:auto}
.screen-reader-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}
.skip-link:focus{position:fixed;top:8px;left:8px;width:auto;height:auto;clip:auto;background:#fff;padding:8px 12px;z-index:100}

.site{max-width:1040px;margin:0 auto;padding:28px max(16px,3vw) 40px;display:grid;gap:24px}
.paper{background:var(--card);box-shadow:0 2px 0 var(--edge),0 10px 20px rgba(80,50,20,.14);position:relative;padding:22px 24px}
.tape::before{content:"";position:absolute;top:-10px;left:50%;width:90px;height:22px;transform:translateX(-50%) rotate(-3deg);background:var(--t,var(--tapeA))}
.hand{font-family:var(--hand);font-weight:700;line-height:1.1;margin:0;text-wrap:balance}

/* Header */
.site-header{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.polaroid{flex:none;width:60px;height:60px;background:#fff;border:6px solid #fff;box-shadow:0 3px 8px rgba(0,0,0,.2);transform:rotate(-5deg);display:grid;place-items:center}
.site-title{font-size:38px}
.site-title a{color:var(--ink);text-decoration:none}
.site-description{margin:2px 0 0;color:var(--muted)}
.header-cat{position:absolute;right:26px;bottom:-6px;width:72px}
.main-nav ul{list-style:none;margin:0;padding:0;display:flex;gap:10px;flex-wrap:wrap}
.main-nav li{position:relative}
.main-nav a{display:flex;gap:6px;align-items:center;font-family:var(--hand);font-size:22px;color:#4a3726;text-decoration:none;background:#fff3c4;padding:2px 14px;box-shadow:2px 3px 5px rgba(0,0,0,.12)}
.main-nav li:nth-child(3n+2)>a{background:#ffe0e8;transform:rotate(1deg)}
.main-nav li:nth-child(3n)>a{background:#dff3ea;transform:rotate(-1deg)}
.main-nav .current-menu-item>a,.main-nav a[aria-current="page"]{outline:2px dashed var(--link);outline-offset:2px}
.main-nav .sub-menu{display:none;position:absolute;top:100%;left:0;z-index:20;flex-direction:column;gap:6px;padding:10px;background:var(--card);box-shadow:0 8px 16px rgba(0,0,0,.15);min-width:200px}
.main-nav li:hover>.sub-menu,.main-nav li:focus-within>.sub-menu{display:flex}
.paw{width:13px;height:13px;fill:currentColor;flex:none}

/* Post lists */
.page-head{display:grid;gap:4px}
.page-head h1{font-size:36px}
.page-head p{margin:0;color:var(--muted)}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:26px}
.card{display:grid;gap:8px;align-content:start;text-decoration:none;color:var(--ink)}
.cards .card:nth-child(odd){transform:rotate(-.5deg)}.cards .card:nth-child(even){transform:rotate(.5deg)}
.cards .card:nth-child(3n+2){--t:var(--tapeB)}.cards .card:nth-child(3n){--t:var(--tapeC)}
.card:hover{transform:rotate(0) translateY(-3px)}
.card .photo{display:grid;place-items:center;aspect-ratio:4/3;max-width:100%;background:#fff;border:6px solid #fff;box-shadow:0 3px 8px rgba(0,0,0,.15);overflow:hidden;transform:rotate(-1.5deg)}
.card .photo img{width:100%;height:100%;object-fit:cover}
.card .photo .paw{width:44px;height:44px;color:#e7b9a3}
.card h2{font-size:25px}
.card p{margin:0;color:var(--muted);font-size:14px}
.meta{font-size:13px;color:var(--muted);display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.chip{display:inline-block;font-size:11px;font-weight:700;padding:1px 8px;background:#fff3c4;color:#4a3726;text-decoration:none}
.pagination .nav-links{display:flex;gap:14px;justify-content:center;font-family:var(--hand);font-size:22px}
.pagination .current{color:var(--muted)}

/* Single */
.entry{max-width:760px;width:100%;margin:0 auto;display:grid;gap:18px}
.entry-title{font-size:clamp(34px,6vw,46px)}
.entry-cover{background:#fff;border:10px solid #fff;border-bottom-width:34px;box-shadow:0 4px 12px rgba(0,0,0,.18);transform:rotate(-1deg);margin:6px auto 0;max-width:100%}
.entry-cover img{display:block;width:100%}
.entry-content{font-size:17px;overflow-wrap:break-word}
.entry-content>*{max-width:68ch}
.entry-content h2,.entry-content h3{font-family:var(--hand);font-size:30px;line-height:1.15;margin:1.4em 0 .3em}
.entry-content h3{font-size:25px}
.entry-content img{background:#fff;padding:6px;box-shadow:0 3px 8px rgba(0,0,0,.15)}
.entry-content blockquote{margin:1em 0;padding:12px 16px;background:#fff7b8;color:#4a3726;font-family:var(--hand);font-size:22px;transform:rotate(-.5deg);box-shadow:2px 4px 8px rgba(0,0,0,.12)}
.entry-content pre{background:#fff;border:1px dashed var(--edge);padding:12px;overflow-x:auto;max-width:100%}
.entry-content .wp-block-gallery{gap:14px}
.entry-content figure{margin:1.2em 0;max-width:100%}
.entry-content figcaption{font-family:var(--hand);font-size:19px;color:var(--muted);text-align:center}
.entry-content table{border-collapse:collapse;display:block;overflow-x:auto;max-width:100%}
.entry-content td,.entry-content th{border:1px solid var(--edge);padding:6px 10px}
.entry-footer{display:flex;gap:8px;flex-wrap:wrap}
.post-nav{display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap;font-family:var(--hand);font-size:21px}

/* Sensitive images: blurred until tapped */
.bz-sensitive{position:relative;display:block;overflow:hidden;cursor:pointer}
.bz-sensitive img{filter:blur(22px) saturate(.6);transform:scale(1.08);transition:filter .3s}
.bz-sensitive::after{content:attr(data-note);position:absolute;inset:auto 12px 12px;background:#fffaf0;color:#4a3726;font-size:13px;font-weight:700;padding:8px 12px;text-align:center;box-shadow:0 2px 6px rgba(0,0,0,.2)}
.bz-sensitive.is-shown img{filter:none;transform:none}
.bz-sensitive.is-shown::after{display:none}

/* Comments & forms */
.comments{max-width:760px;width:100%;margin:0 auto}
.comment-list{list-style:none;padding:0;display:grid;gap:14px}
.comment-list .children{list-style:none;padding-left:24px}
.comment-body{background:var(--card);padding:14px 16px;border:1px solid var(--edge)}
input[type=text],input[type=email],input[type=url],input[type=search],textarea{font:inherit;color:var(--ink);background:#fff;border:1px solid var(--edge);padding:9px 12px;width:100%;max-width:100%}
button,input[type=submit]{font:600 15px var(--body);background:#4a3726;color:#fffaf0;border:0;padding:9px 16px;cursor:pointer}
.search-form{display:flex;gap:8px}

.note{background:#fff7b8;color:#4a3726;padding:14px 16px;font-family:var(--hand);font-size:22px;transform:rotate(-1deg);box-shadow:2px 4px 8px rgba(0,0,0,.15);max-width:560px}
.site-footer{text-align:center;color:var(--muted);display:grid;gap:4px;justify-items:center}
.site-footer .hand{font-size:22px}
.site-footer small{font-size:12px}

/* Hub plugin inside the theme */
.bzh.bzh-bare{background:none;padding:0}

@media (max-width:560px){.header-cat{display:none}.site-title{font-size:31px}.paper{padding:18px}}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
