/*
Theme Name: Canuckle
Theme URI: https://canucklewordgame.com
Description: Fast, dependency-free theme for canucklewordgame.com. No jQuery, no web fonts, one stylesheet.
Author: Canucklewordgame.com
Version: 1.2.0
Requires at least: 6.4
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: canuckle
*/

/* ── Tokens ──
   Red is the brand, used for the stripe, primary buttons and the active tile only.
   Text and headings are ink; links are one darker red, always underlined, so they're never
   confused with headings or buttons. Gold appears once, on the U in the wordmark. */
:root {
  --red: #c8102e;
  --red-hover: #a90d26;
  --red-soft: #fbeaed;
  --gold: #c6a046;
  --ink: #1a1a1b;
  --ink-2: #4b4f54;
  --ink-3: #767b82;
  --line: #e4e6e9;
  --paper: #ffffff;
  --paper-2: #f5f6f7;
  --link: #a50d24;
  --focus: #1d4ed8;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20,20,20,.06), 0 8px 24px rgba(20,20,20,.06);
}

*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--paper); }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.screen-reader-text { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(1px,1px,1px,1px); white-space:nowrap; }
.skip-link { position:absolute; left:-999px; top:8px; background:var(--ink); color:#fff; padding:8px 14px; z-index:1000; }
.skip-link:focus { left:8px; }

/* ── Buttons: one primary style everywhere (theme + plugin + block buttons) ── */
.btn, .wp-block-button__link, .ct-btn, .search-form button, .comment-form .submit {
  display: inline-block; background: var(--red); color: #fff !important; border: 0; border-radius: 999px;
  padding: 11px 22px; font: inherit; font-weight: 700; font-size: 15px; line-height: 1.2; text-decoration: none !important; cursor: pointer;
  transition: background .15s;
}
.btn:hover, .wp-block-button__link:hover, .ct-btn:hover, .search-form button:hover, .comment-form .submit:hover { background: var(--red-hover); }
.btn-outline { background: #fff; color: var(--ink) !important; border: 1.5px solid var(--line); }
.btn-outline:hover { background: var(--paper-2); border-color: var(--ink-3); }

/* ── Header: white, with the flag-red stripe on top ── */
.site-header { background: var(--paper); border-top: 5px solid var(--red); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.header-inner { max-width: 1080px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.wordmark .site-logo { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; }
.wordmark-tiles { display: inline-flex; gap: 3px; }
.wordmark-tiles span { width: 28px; height: 28px; display: grid; place-items: center; background: var(--red); color: #fff; font-weight: 800; font-size: 16px; border-radius: 4px; }
.wordmark-tiles span:nth-child(4) { background: var(--gold); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.site-nav a:hover { background: var(--paper-2); color: var(--ink); }
.site-nav .current-menu-item > a, .site-nav .current_page_item > a { color: var(--red); box-shadow: inset 0 -2px 0 var(--red); border-radius: 6px 6px 0 0; }
.nav-toggle { display: none; background: none; border: 1.5px solid var(--line); color: var(--ink); padding: 7px 12px; border-radius: 6px; font: inherit; font-weight: 600; }
@media (max-width: 760px) {
  .header-inner { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px; }
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 8px 0 6px; }
  .site-nav a { display: block; }
  .site-nav .current-menu-item > a { box-shadow: none; background: var(--red-soft); }
  .wordmark-tiles span { width: 24px; height: 24px; font-size: 14px; }
}

/* ── Layout ── */
.site-main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 64px; }
.single .site-main, .page .site-main { max-width: 800px; }
.page-title, .entry-title { font-size: clamp(1.7rem, 3.5vw, 2.3rem); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; color: var(--ink); }
.entry-meta { color: var(--ink-3); font-size: 15px; margin-bottom: 20px; }
.breadcrumbs { font-size: 14px; color: var(--ink-3); margin-bottom: 14px; }
.breadcrumbs a { color: var(--ink-2); text-decoration: none; }
.breadcrumbs a:hover { color: var(--red); text-decoration: underline; }

/* Content typography */
.entry-content h2 { font-size: 1.5rem; margin: 1.7em 0 .5em; line-height: 1.25; color: var(--ink); }
.entry-content h3 { font-size: 1.2rem; margin: 1.4em 0 .4em; color: var(--ink); }
.entry-content p, .entry-content ul, .entry-content ol { margin: 0 0 1.1em; }
.entry-content li + li { margin-top: .3em; }
.entry-content blockquote { border-left: 4px solid var(--gold); margin: 1.2em 0; padding: 4px 18px; color: var(--ink-2); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
.entry-content th { font-weight: 700; }
.entry-content code { background: var(--paper-2); padding: 2px 6px; border-radius: 4px; font-size: .92em; }
.entry-content img { border-radius: var(--radius); }
.entry-content > .canuckle-game { max-width: 520px; margin: 0 auto 28px; }
.entry-content > .canuckle-game + * { margin-top: 32px; }
.wp-block-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.wp-block-button.is-style-outline .wp-block-button__link { background: #fff; color: var(--ink) !important; border: 1.5px solid var(--line); }

/* Hints / answers page (plugin markup): headings ink, answers red, everything else quiet */
.canuckle-today { max-width: none; }
.canuckle-today h2 { color: var(--ink); font-size: 1.4rem; margin: 40px 0 10px; }
.canuckle-today h2:first-child { margin-top: 8px; }
.canuckle-today .ct-intro, .canuckle-today .ct-note { color: var(--ink-2); font-size: 15px; }
.ct-hint { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.ct-hint-q { font-weight: 600; color: var(--ink); }
.ct-hint-q:hover, .ct-hint-q[aria-expanded="true"] { background: var(--paper-2); }
.ct-chevron { color: var(--ink-3); }
.ct-hint-a { color: var(--red); }
.ct-reveal { background: var(--paper-2); border-radius: 12px; }
.ct-tile:hover { border-color: var(--red); color: var(--red); }
.ct-fact { border-left-color: var(--red); background: #fff; }
.ct-fact h4 { color: var(--ink-2); }
.canuckle-info-table thead th { background: var(--ink); }
.canuckle-info-table tr.canuckle-today-row { background: var(--red-soft); }
.canuckle-info-table td:nth-child(1) { white-space: nowrap; }

/* Post lists */
.post-list { display: grid; gap: 28px 24px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); list-style: none; padding: 0; margin: 20px 0 0; }
.post-card { display: flex; flex-direction: column; }
.post-card h2 { font-size: 1.15rem; line-height: 1.35; margin: 12px 0 6px; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--red); text-decoration: underline; }
.post-card .thumb { display: block; aspect-ratio: 16/9; overflow: hidden; border-radius: var(--radius); background: var(--paper-2); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.post-card:hover .thumb img { transform: scale(1.03); }
.post-card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.archive-lede { color: var(--ink-2); max-width: 68ch; }
.pagination { margin-top: 36px; display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); }
.pagination .page-numbers:hover { border-color: var(--ink-3); }
.pagination .current { background: var(--red); border-color: var(--red); color: #fff; }

/* Game page */
.template-game .site-main { padding-top: 16px; }
.game-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 22px 0 8px; }

/* Search / 404 */
.search-form { display: flex; gap: 8px; max-width: 480px; }
.search-form input[type=search] { flex: 1; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 999px; font: inherit; }
.search-form input[type=search]:focus { border-color: var(--ink-3); outline: none; }

/* Comments */
.comment-list { list-style: none; padding: 0; }
.comment { border-top: 1px solid var(--line); padding: 16px 0; }
.comment-form textarea, .comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url] { width: 100%; padding: 10px; border: 1.5px solid var(--line); border-radius: 6px; font: inherit; }

/* ── Footer: three columns, then a quiet legal line ── */
.site-footer { background: var(--paper-2); border-top: 1px solid var(--line); margin-top: 40px; }
.footer-grid { max-width: 1080px; margin: 0 auto; padding: 40px 20px 28px; display: grid; gap: 32px; grid-template-columns: 1.4fr 1fr 1fr; }
.footer-brand p { margin: 12px 0 0; color: var(--ink-2); font-size: 15px; max-width: 40ch; }
.footer-col h2 { font-size: 13px; letter-spacing: .02em; color: var(--ink-3); margin: 0 0 12px; font-weight: 700; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0 0 8px; }
.footer-col a { color: var(--ink); text-decoration: none; font-size: 15px; }
.footer-col a:hover { color: var(--red); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom .inner { max-width: 1080px; margin: 0 auto; padding: 16px 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.footer-bottom a { color: var(--ink-3); }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .footer-grid { grid-template-columns: 1fr; } }
