/*
Theme Name: Play Sudoku
Theme URI: https://www.playsudoku.org/
Author: Play Sudoku
Author URI: https://www.playsudoku.org/
Description: A fast, distraction-free theme built around playing Sudoku online. Includes a self-contained Sudoku game (generator, solver, pencil notes, hints, timer and saved stats) plus clean blog templates for strategy and how-to articles. No game plugin or iframe required.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.6
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: playsudoku
Tags: custom-colors, custom-logo, custom-menu, featured-images, blog, full-width-template, threaded-comments
*/

/* Design tokens live in assets/css/sudoku.css and are shared with the game. */

/* ------------------------------------------------------------------ */
/*  Reset / base                                                      */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -200px, #fff 0%, var(--paper) 60%) no-repeat,
    var(--paper);
  background-attachment: fixed;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pen); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; color: var(--ink); }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; border-radius: 4px; }

.container { width: min(92%, 1080px); margin-inline: auto; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
.screen-reader-text {
  position: absolute !important; clip: rect(1px,1px,1px,1px);
  width: 1px; height: 1px; overflow: hidden;
}

/* ------------------------------------------------------------------ */
/*  Site header                                                       */
/* ------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 14px 0;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  box-shadow: 0 8px 20px -10px rgba(31,55,173,.7);
}
.brand__mark span { transform: translateY(-1px); }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; color: var(--ink); }
.brand__tag { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }

.main-nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.main-nav a {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  color: var(--ink-soft); font-weight: 600; font-size: .94rem;
}
.main-nav a:hover { color: var(--ink); background: var(--paper-deep); text-decoration: none; }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { color: var(--pen); background: var(--pen-wash); }

.nav-toggle {
  display: none; width: 42px; height: 42px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 18px; height: 2px; background: var(--ink);
  position: relative; transition: transform .2s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px 0; display: none;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 2px; width: min(92%,1080px); margin-inline: auto; }
  .main-nav a { display: block; }
}

/* ------------------------------------------------------------------ */
/*  Hero / play area                                                  */
/* ------------------------------------------------------------------ */
.play {
  padding: 30px 0 56px;
}
.play__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  align-items: start;
}
@media (min-width: 940px) {
  .play__grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; }
  .play__aside { position: sticky; top: 92px; }
}

.play__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--pen); font-weight: 700; margin-bottom: 12px;
}
.play__eyebrow::before {
  content: ""; width: 22px; height: 2px; background: var(--pen); display: inline-block;
}
.play__title {
  font-size: clamp(1.9rem, 5vw, 2.9rem); font-weight: 700;
  margin: 0 0 10px; letter-spacing: -.02em;
}
.play__title em { font-style: normal; color: var(--pen); }
.play__lede { color: var(--ink-soft); font-size: 1.05rem; margin: 0 0 22px; max-width: 46ch; }

/* The game card */
.play__card {
  background: var(--board-bg);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(16px, 4vw, 26px);
  box-shadow: var(--shadow);
}

/* Aside panels */
.panel {
  background: var(--board-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px;
  margin-bottom: 18px;
}
.panel__title {
  font-size: 1.05rem; font-weight: 700; margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.howto-steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.howto-steps li {
  position: relative; padding-left: 38px; margin-bottom: 14px;
  color: var(--ink-soft); font-size: .95rem;
}
.howto-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -1px;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--pen-wash); color: var(--pen-deep);
  font-family: var(--font-display); font-weight: 700; font-size: .85rem;
  display: grid; place-items: center;
}
.howto-steps strong { color: var(--ink); font-weight: 600; }

.keys { display: grid; gap: 9px; }
.keys div { display: flex; align-items: center; justify-content: space-between; font-size: .9rem; color: var(--ink-soft); }
kbd {
  font-family: var(--font-display); font-size: .78rem; font-weight: 600;
  background: var(--paper); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: 2px 7px; color: var(--ink);
}

/* ------------------------------------------------------------------ */
/*  Generic page / post content                                       */
/* ------------------------------------------------------------------ */
.content-area { padding: 40px 0 60px; }
.content-narrow { width: min(92%, 720px); margin-inline: auto; }
.page-hero { padding: 46px 0 8px; text-align: center; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 8px; letter-spacing: -.02em; }
.page-hero .page-hero__meta { color: var(--ink-faint); font-size: .9rem; }

.entry-content { font-size: 1.05rem; color: #2b3344; }
.entry-content > * + * { margin-top: 1.05em; }
.entry-content h2 { font-size: 1.6rem; margin-top: 1.8em; }
.entry-content h3 { font-size: 1.25rem; margin-top: 1.5em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-top: .4em; }
.entry-content blockquote {
  margin: 1.4em 0; padding: 4px 20px; border-left: 3px solid var(--pen);
  color: var(--ink-soft); font-style: italic;
}
.entry-content img { border-radius: 12px; }
.entry-content code {
  background: var(--paper-deep); padding: 2px 6px; border-radius: 5px; font-size: .92em;
}
.entry-content a { text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------------ */
/*  Article cards (blog / tips grid)                                  */
/* ------------------------------------------------------------------ */
.card-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.post-card {
  background: var(--board-bg); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--pen-wash-2); }
.post-card__thumb { aspect-ratio: 16/9; background: var(--paper-deep); overflow: hidden; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card__cat { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--pen); font-weight: 700; }
.post-card__title { font-size: 1.18rem; margin: 0; }
.post-card__title a { color: var(--ink); }
.post-card__title a:hover { color: var(--pen); text-decoration: none; }
.post-card__excerpt { color: var(--ink-soft); font-size: .94rem; margin: 0; }
.post-card__more { margin-top: auto; font-weight: 600; font-size: .9rem; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 22px; gap: 16px; }
.section-head h2 { font-size: 1.5rem; margin: 0; }
.section-head a { font-weight: 600; font-size: .92rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 0; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: .98rem;
  background: var(--ink); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--pen-deep); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn--ghost:hover { border-color: var(--pen); color: var(--pen); background: transparent; }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.pagination .page-numbers {
  padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--line);
  color: var(--ink-soft); font-weight: 600;
}
.pagination .current { background: var(--pen); border-color: var(--pen); color: #fff; }

/* ------------------------------------------------------------------ */
/*  Footer                                                            */
/* ------------------------------------------------------------------ */
.site-footer {
  margin-top: 40px; border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-deep) 60%, #fff);
}
.site-footer__inner { padding: 40px 0 28px; display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .site-footer__inner { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-widgets .widget-title { font-size: 1rem; font-weight: 700; margin: 0 0 12px; }
.footer-widgets ul { list-style: none; margin: 0; padding: 0; }
.footer-widgets li { margin-bottom: 8px; }
.footer-widgets a { color: var(--ink-soft); }
.footer-widgets a:hover { color: var(--pen); }
.site-footer__bottom {
  border-top: 1px solid var(--line); padding: 18px 0;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  color: var(--ink-faint); font-size: .85rem;
}

/* Ad slots (kept neutral; fill via widgets or Customizer) */
.ad-slot { margin: 22px auto; text-align: center; min-height: 1px; }
.ad-slot:empty { display: none; }

/* ------------------------------------------------------------------ */
/*  Language switcher (Prisna GWT / any translator)                    */
/* ------------------------------------------------------------------ */
.site-translate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.site-translate--header {
  margin-left: 4px;
  flex: 0 0 auto;
}
.site-translate--footer {
  margin: 0 auto;
}
.site-translate .widget { margin: 0; }

/* Skin the Google/Prisna <select> to match the ink-on-paper theme. */
.site-translate select,
.site-translate .goog-te-combo {
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 7px 30px 7px 14px;
  line-height: 1.2;
  cursor: pointer;
  max-width: 190px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6478' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color .15s, box-shadow .15s;
}
.site-translate select:hover,
.site-translate .goog-te-combo:hover { border-color: var(--ink-faint); }
.site-translate select:focus-visible,
.site-translate .goog-te-combo:focus-visible {
  outline: none;
  border-color: var(--pen);
  box-shadow: 0 0 0 3px var(--pen-wash);
}

/* Neutralise the top banner + body offset Google Translate injects. */
.goog-te-banner-frame.skiptranslate,
.goog-te-gadget-icon,
#goog-gt-tt,
.goog-te-balloon-frame { display: none !important; }
body { top: 0 !important; }
.goog-text-highlight {
  background: none !important;
  box-shadow: none !important;
  color: inherit !important;
}

@media (max-width: 720px) {
  .site-translate--header { order: 3; }
  .site-translate select,
  .site-translate .goog-te-combo { max-width: 150px; font-size: .85rem; }
}
