/*
Theme Name: Minova
Theme URI: https://example.com/minova
Author: Your Name
Author URI: https://example.com
Description: Minova is a lightweight, minimal classic theme for a personal WordPress blog. Inspired by clean reading-focused design, it supports live switching between dark/light modes, serif/sans-serif fonts, and one-column / three-column layouts. Translation ready and fully responsive.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: minova
Tags: blog, minimal, one-column, three-columns, custom-menu, featured-images, dark-mode, translation-ready, threaded-comments, sticky-post, footer-widgets, custom-logo
*/

/* =========================================================
   Design tokens (CSS variables) — light mode default
   ========================================================= */
:root {
  --mv-bg:            #ffffff;
  --mv-surface:       #f7f7f5;
  --mv-text:          #1a1a1a;
  --mv-muted:         #6b6b6b;
  --mv-border:        #e6e6e2;
  --mv-accent:        #1a1a1a;
  --mv-accent-soft:   #efefec;
  --mv-link:          #1a1a1a;
  --mv-max:           720px;   /* one-column reading width */
  --mv-wide:          1180px;  /* three-column width */
  --mv-radius:        10px;
  --mv-font-sans:     "Inter", "Helvetica Neue", Arial, sans-serif;
  --mv-font-serif:    "Lora", Georgia, "Times New Roman", serif;
  --mv-font:          var(--mv-font-sans);
  --mv-transition:    160ms ease;
}

/* Dark mode — toggled by adding .mv-dark to <html> */
html.mv-dark {
  --mv-bg:          #121212;
  --mv-surface:     #1c1c1c;
  --mv-text:        #ededed;
  --mv-muted:       #9a9a9a;
  --mv-border:      #2c2c2c;
  --mv-accent:      #ededed;
  --mv-accent-soft: #242424;
  --mv-link:        #ededed;
}

/* Serif mode — toggled by adding .mv-serif to <html> */
html.mv-serif { --mv-font: var(--mv-font-serif); }

/* =========================================================
   Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--mv-bg);
  color: var(--mv-text);
  font-family: var(--mv-font);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background var(--mv-transition), color var(--mv-transition);
}

a { color: var(--mv-link); text-decoration: none; border-bottom: 1px solid var(--mv-border); transition: opacity var(--mv-transition); }
a:hover { opacity: .65; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 650; margin: 1.6em 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p, ul, ol, blockquote, pre, figure { margin: 0 0 1.2em; }

blockquote {
  margin-left: 0; padding: .2em 0 .2em 1.2em;
  border-left: 3px solid var(--mv-border); color: var(--mv-muted);
}

pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
pre { background: var(--mv-surface); padding: 1em; border-radius: var(--mv-radius); overflow:auto; font-size: .9rem; }
code { background: var(--mv-surface); padding: .1em .35em; border-radius: 4px; font-size: .88em; }

hr { border: 0; border-top: 1px solid var(--mv-border); margin: 2.5em 0; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* =========================================================
   Layout containers
   ========================================================= */
.mv-container { width: 100%; max-width: var(--mv-max); margin: 0 auto; padding: 0 22px; }
.mv-site { display: flex; flex-direction: column; min-height: 100vh; }
.mv-content { flex: 1 0 auto; padding: 40px 0 60px; }

/* When three columns is active, widen the container */
html.mv-cols-3 .mv-content .mv-container { max-width: var(--mv-wide); }

/* =========================================================
   Header
   ========================================================= */
.mv-header {
  border-bottom: 1px solid var(--mv-border);
  padding: 22px 0;
  position: sticky; top: 0; z-index: 50;
  background: var(--mv-bg); /* fallback for browsers without color-mix() */
  background: color-mix(in srgb, var(--mv-bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
}
.mv-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mv-brand { display:flex; align-items:center; gap:12px; }
.mv-site-title { font-size: 1.25rem; font-weight: 700; margin: 0; }
.mv-site-title a { border: 0; }
.mv-site-desc { font-size: .82rem; color: var(--mv-muted); margin: 2px 0 0; }
.mv-custom-logo { max-height: 40px; width:auto; }

/* Nav */
.mv-nav ul { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; flex-wrap: wrap; }
.mv-nav a { border: 0; font-size: .95rem; color: var(--mv-muted); }
.mv-nav a:hover, .mv-nav .current-menu-item > a { color: var(--mv-text); opacity:1; }

/* Toggle buttons (dark/light, serif/sans, layout) */
.mv-toggles { display: flex; gap: 6px; }
.mv-toggle {
  border: 1px solid var(--mv-border);
  background: var(--mv-bg);
  color: var(--mv-text);
  width: 38px; height: 38px;
  padding: 0; /* prevent the global button rule's padding from squeezing the icon */
  border-radius: var(--mv-radius);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
  transition: background var(--mv-transition), border-color var(--mv-transition);
}
.mv-toggle:hover { background: var(--mv-accent-soft); }
.mv-toggle.is-active { background: var(--mv-accent); color: var(--mv-bg); border-color: var(--mv-accent); }
.mv-toggle.is-active svg { stroke: var(--mv-bg); }
.mv-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
/* hide the 3-col toggle on small screens (no room) */
@media (max-width: 720px){ .mv-toggle[data-mv="cols"]{ display:none; } }

/* =========================================================
   Featured carousel (homepage)
   ========================================================= */
.mv-carousel { margin: 0 0 40px; }
.mv-carousel-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 78%;
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 8px; scrollbar-width: thin;
}
@media (min-width: 720px){ .mv-carousel-track { grid-auto-columns: 46%; } }
.mv-slide { scroll-snap-align: start; position: relative; border-radius: var(--mv-radius); overflow: hidden; aspect-ratio: 16/10; }
.mv-slide img { width:100%; height:100%; object-fit: cover; }
.mv-slide a { border: 0; }
.mv-slide-cap {
  position: absolute; inset: auto 0 0 0; padding: 18px;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
  color: #fff; font-weight: 600;
}
.mv-slide-cap .mv-slide-cat { font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; opacity:.85; }

/* =========================================================
   Post list
   ========================================================= */
.mv-posts { display: grid; gap: 44px; }
html.mv-cols-3 .mv-posts {
  grid-template-columns: repeat(3, 1fr); gap: 30px;
}
@media (max-width: 980px){ html.mv-cols-3 .mv-posts { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px){ html.mv-cols-3 .mv-posts { grid-template-columns: 1fr; } }

.mv-card .mv-thumb { display:block; border:0; border-radius: var(--mv-radius); overflow:hidden; margin-bottom: 16px; aspect-ratio: 16/9; }
.mv-card .mv-thumb img { width:100%; height:100%; object-fit: cover; transition: transform 300ms ease; }
.mv-card:hover .mv-thumb img { transform: scale(1.03); }
.mv-card .entry-title { margin: 0 0 .35em; font-size: 1.35rem; }
html.mv-cols-3 .mv-card .entry-title { font-size: 1.12rem; }
.mv-card .entry-title a { border: 0; }
.mv-meta { color: var(--mv-muted); font-size: .82rem; display:flex; gap:10px; flex-wrap:wrap; margin-bottom: .6em; }
.mv-meta a { border: 0; color: var(--mv-muted); }
.mv-excerpt { color: var(--mv-text); }
html.mv-cols-3 .mv-excerpt { font-size: .95rem; }
.mv-readmore { font-size:.9rem; font-weight:600; border:0; }

/* =========================================================
   Single post / page
   ========================================================= */
.mv-entry-header { margin-bottom: 28px; }
.mv-entry-header .entry-title { font-size: 2.2rem; margin: .2em 0; }
.mv-featured { border-radius: var(--mv-radius); overflow:hidden; margin: 0 0 32px; }
.entry-content { font-size: 1.06rem; }
.entry-content > * { max-width: 100%; }
.mv-tags { margin-top: 32px; font-size: .85rem; }
.mv-tags a { display:inline-block; background: var(--mv-surface); border:0; padding: 4px 10px; border-radius: 999px; margin: 0 6px 6px 0; color: var(--mv-muted); }
.mv-postnav { display:flex; justify-content:space-between; gap:16px; margin: 40px 0; border-top:1px solid var(--mv-border); padding-top: 24px; font-size:.95rem; }

/* =========================================================
   Pagination
   ========================================================= */
.mv-pagination { margin: 50px 0 0; display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }
.mv-pagination .page-numbers {
  border:1px solid var(--mv-border); border-radius: var(--mv-radius);
  padding: 8px 14px; font-size:.9rem;
}
.mv-pagination .current { background: var(--mv-accent); color: var(--mv-bg); border-color: var(--mv-accent); }

/* =========================================================
   Comments
   ========================================================= */
.comment-list { list-style:none; padding:0; margin: 0 0 30px; }
.comment-list li { margin-bottom: 24px; }
.comment-body { border:1px solid var(--mv-border); border-radius: var(--mv-radius); padding: 16px 18px; }
.comment-author { font-weight:600; font-size:.95rem; }
.comment-meta { font-size:.78rem; color: var(--mv-muted); margin-bottom: 8px; }
.comment-list .children { list-style:none; margin: 20px 0 0 24px; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea {
  width:100%; padding:12px; border:1px solid var(--mv-border); border-radius: var(--mv-radius);
  background: var(--mv-bg); color: var(--mv-text); font-family:inherit; font-size:1rem; margin-bottom:14px;
}

/* =========================================================
   Buttons & forms
   ========================================================= */
.mv-btn, button, input[type=submit] {
  display:inline-block; cursor:pointer;
  background: var(--mv-accent); color: var(--mv-bg);
  border: 1px solid var(--mv-accent); border-radius: var(--mv-radius);
  padding: 11px 20px; font-size:.95rem; font-weight:600; font-family:inherit;
}
.mv-btn:hover, button:hover, input[type=submit]:hover { opacity:.85; }
.search-form { display:flex; gap:8px; }
.search-form input[type=search] {
  flex:1; padding:11px 14px; border:1px solid var(--mv-border);
  border-radius: var(--mv-radius); background: var(--mv-bg); color: var(--mv-text); font-family:inherit;
}

/* =========================================================
   Sidebar / widgets (only in 3-col + footer)
   ========================================================= */
.mv-footer { border-top:1px solid var(--mv-border); padding: 40px 0; margin-top:auto; color: var(--mv-muted); font-size:.9rem; }
.mv-footer-widgets { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 32px; margin-bottom: 28px; }
.mv-footer-widgets .widget-title { font-size:.95rem; color: var(--mv-text); margin: 0 0 12px; }
.mv-footer-widgets ul { list-style:none; padding:0; margin:0; }
.mv-footer-widgets li { margin-bottom: 8px; }
.mv-footer-bottom { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.mv-footer a { border:0; }

/* WP core alignment helpers */
.alignleft { float:left; margin: 0 20px 16px 0; }
.alignright { float:right; margin: 0 0 16px 20px; }
.aligncenter { margin-left:auto; margin-right:auto; }
.wp-caption-text, .gallery-caption { font-size:.82rem; color: var(--mv-muted); }
.sticky .mv-card .entry-title::before { content:"★ "; }
