/*
Theme Name: CraftIdea
Theme URI: https://craftidea.org
Author: CraftIdea
Description: Printable library theme: coloring pages, printable puzzles and craft templates, grouped into collections. Twilight Reading Nook palette.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: craftidea
*/

:root {
  --bg: #EDE7E3;
  --ink: #2B1538;
  --muted: #4D3F5C;
  --line: #DDD3D0;
  --plum: #2B1538;
  --violet: #5A4B8A;
  --accent: #FF6A3D;
  --accent-dark: #E0501F;
  --lav: #D9CBEF;
  --sky: #C5D3F0;
  --peach: #FFD0C0;
  --white: #FFFFFF;
  --radius: 20px;
  --wrap: 1240px;
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-head: 'Fredoka', 'Nunito', sans-serif;
  --font-logo: 'Fraunces', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.6; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--violet); }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(34px, 5vw, 56px); }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: 24px; }
p { margin: 0 0 1em; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 12px 16px; background: var(--white); color: var(--ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.section { padding: 24px 0 56px; }
.section > .wrap > h2 { margin-bottom: 28px; }

/* Header */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px 0; }
.brand:hover { text-decoration: none; }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--font-logo); font-weight: 900; font-size: 30px; letter-spacing: -0.02em; color: var(--ink); font-variation-settings: 'SOFT' 100, 'opsz' 144; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.main-nav a { display: block; padding: 12px 14px; color: var(--ink); font-weight: 700; font-size: 16px; text-decoration: none; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-cat > a { text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--accent); text-decoration-thickness: 3px; }

/* Buttons */
.btn { display: inline-block; padding: 14px 24px; border-radius: 12px; border: 2px solid var(--ink); background: transparent; color: var(--ink); font: 700 17px var(--font-body); text-decoration: none; cursor: pointer; min-height: 48px; }
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn-primary { background: var(--accent); border-color: var(--plum); color: var(--plum); }
.btn-dark { background: var(--plum); border-color: var(--plum); color: var(--white); }
.btn-light { background: var(--white); border-color: var(--white); color: var(--plum); }
.btn-ghost-light { border-color: var(--white); color: var(--white); }
.btn-sm { padding: 12px 18px; border-radius: 10px; font-size: 16px; }

/* Hero */
.hero { background: linear-gradient(180deg, #2B1538 0%, #5A4B8A 85%, #EDE7E3 100%); color: var(--white); }
.hero .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; padding-top: 72px; padding-bottom: 72px; }
.hero-copy { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero h1 { color: var(--white); margin: 0; font-size: clamp(36px, 5.2vw, 56px); }
.eyebrow { font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.hero .eyebrow { color: #C9D8F5; }
.hero p.lead { font-size: 20px; line-height: 1.55; color: #EEE9F8; max-width: 560px; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { flex: 1 1 360px; min-width: 0; display: flex; justify-content: center; }
.hero-art svg { width: min(320px, 70vw); height: auto; }

/* Cards */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-body h3 { font-size: 22px; margin: 0; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-body h3 a:hover { text-decoration: underline; }
.card-thumb { display: block; aspect-ratio: 4 / 3; background: var(--lav); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-thumb.placeholder { display: flex; align-items: center; justify-content: center; }
.card-thumb.placeholder svg { width: 72px; height: 72px; opacity: .85; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--bg); font-weight: 700; font-size: 14px; color: var(--ink); text-decoration: none; }
.chip:hover { text-decoration: none; background: var(--lav); }
.muted { color: var(--muted); }

.cat-card { padding: 28px; gap: 14px; }
.cat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.cat-card ul { list-style: none; margin: 0; padding: 0; }
.cat-card li a { display: block; padding: 10px 0; font-weight: 700; color: var(--ink); text-decoration: none; }
.cat-card li a:hover { text-decoration: underline; }
.cat-card .more { font-weight: 800; }

.collections { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.collection { border-radius: 24px; padding: 40px; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.collection h3 { font-size: 38px; margin: 0; color: inherit; }
.collection p { font-size: 18px; margin: 0; }
.collection.c1 { background: var(--violet); color: var(--white); }
.collection.c2 { background: var(--plum); color: var(--white); }
.collection .eyebrow { color: inherit; opacity: .9; }

/* Signup */
.signup { background: var(--white); border: 1px solid var(--line); border-radius: 24px; padding: 40px; display: flex; flex-wrap: wrap; gap: 40px; }
.signup > div { flex: 1 1 380px; min-width: 0; }
.signup ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.signup ol li { display: flex; gap: 14px; align-items: flex-start; }
.signup ol .n { flex: none; width: 36px; height: 36px; border-radius: 999px; background: var(--sky); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.signup input[type=email], .signup input[type=text] { width: 100%; max-width: 460px; padding: 14px 16px; border-radius: 10px; border: 2px solid #6B5E80; font: 17px var(--font-body); }
.signup button, .signup input[type=submit] { padding: 14px 24px; border-radius: 10px; border: 2px solid var(--plum); background: var(--accent); color: var(--plum); font: 800 17px var(--font-body); cursor: pointer; min-height: 48px; margin-top: 8px; }
.admin-note { padding: 12px 16px; border: 2px dashed var(--violet); border-radius: 12px; font-size: 15px; background: var(--bg); }

/* Single / page / archive */
.breadcrumbs { font-size: 15px; color: var(--muted); padding: 24px 0 8px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .sep { margin: 0 8px; }
.entry { max-width: 820px; margin: 0 auto; padding: 16px 32px 64px; }
.entry-header .eyebrow { color: var(--violet); }
.entry-thumb { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--white); }
.entry-thumb img { display: block; width: 100%; }
.entry-content { font-size: 18px; }
.entry-content h2, .entry-content h3 { margin-top: 1.6em; }
.entry-content img { border-radius: 12px; }
.entry-content .wp-block-file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.entry-content .wp-block-file__button, .entry-content .wp-block-button__link { display: inline-block; padding: 12px 18px; border-radius: 10px; border: 2px solid var(--plum); background: var(--accent); color: var(--plum) !important; font-weight: 800; text-decoration: none; }
.archive-head { padding: 40px 0 24px; }
.archive-head p { max-width: 720px; color: var(--muted); font-size: 19px; }
.pagination { margin: 40px 0 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { padding: 10px 16px; border-radius: 10px; border: 2px solid var(--ink); text-decoration: none; color: var(--ink); font-weight: 700; }
.pagination .current { background: var(--plum); color: var(--white); }
.related { margin-top: 56px; }
.not-found { text-align: center; padding: 96px 0; }

/* Footer */
.site-footer { background: var(--plum); color: var(--white); margin-top: 24px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-top: 32px; padding-bottom: 32px; }
.site-footer a { color: var(--white); text-decoration: none; padding: 12px 14px; display: inline-block; }
.site-footer a:hover { text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.site-footer .copy { font-size: 14px; color: #E1D4D8; }

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .collection { padding: 28px; }
  .collection h3 { font-size: 30px; }
  .signup { padding: 28px; }
  .entry { padding-left: 20px; padding-right: 20px; }
}
