/*
Theme Name: Everything Xiaomi — Charge
Theme URI: https://everythingxiaomi.com/
Author: Everything Xiaomi
Description: The stories in Everything Xiaomi's own look: the directory's bar and foot, a reading column with the site's own sidebars, cards for every list of stories. Own code, written for this site.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: everythingxiaomi-charge
*/

/* The bar, the foot, the colours and the type come from the directory (its stylesheet arrives with the chrome). This file is the
   stories' own layout. */
body.exmc { background: var(--paper); }
/* the products plugin colours every heading grey site-wide; the stories' headings are ink in both themes */
body.exmc h1, body.exmc h2, body.exmc h3, body.exmc h4, body.exmc h5, body.exmc h6 { color: var(--ink); }
.exmc-wrap { width: 100%; max-width: var(--wrap, 1240px); margin: 0 auto; padding: 28px var(--gut, 20px) 0; }
.exmc-two { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
@media (max-width: 1000px) { .exmc-two { grid-template-columns: minmax(0, 1fr); } }
.exmc-main { min-width: 0; }
.exmc-anchor { display: block; height: 0; margin: 0; overflow: hidden; }

/* a story */
.exmc-story { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l, 24px); padding: clamp(20px, 4vw, 44px); }
.exmc-head .kick, .exmc-listhead .kick, .exmc-404 .kick { display: inline-block; font: 700 12.5px/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--tang-text); text-decoration: none; margin-bottom: 12px; }
.exmc-head h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.12; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.exmc-meta { margin: 14px 0 0; color: var(--muted); font-size: 14.5px; }
.exmc-hero { margin: 24px 0 8px; border-radius: 20px; overflow: hidden; background: var(--card-2); }
.exmc-hero img { width: 100%; height: auto; display: block; }
.entry-content { font-size: 18px; line-height: 1.75; color: var(--ink-2); margin-top: 22px; overflow-wrap: break-word; }
.entry-content > * { max-width: 100%; }
.entry-content h2 { font-size: clamp(22px, 2.6vw, 28px); margin: 1.7em 0 0.6em; color: var(--ink); }
.entry-content h3 { font-size: 21px; margin: 1.5em 0 0.5em; color: var(--ink); }
.entry-content a { color: var(--violet-text); }
.entry-content img { height: auto; border-radius: 14px; }
.entry-content figure { margin: 1.4em 0; }
.entry-content figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
.entry-content blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--tang); color: var(--ink); }
.entry-content pre { overflow-x: auto; background: var(--card-2); padding: 14px; border-radius: 12px; font-size: 14.5px; }
.entry-content table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 15.5px; max-width: 100%; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.entry-content iframe, .entry-content video { max-width: 100%; }
.exmc-tags a { display: inline-block; margin: 4px 6px 0 0; padding: 6px 12px; border-radius: 999px; background: var(--card-2); text-decoration: none; font-size: 13.5px; color: var(--ink-2); }

/* lists of stories */
.exmc-listhead { margin: 6px 0 22px; }
.exmc-listhead h1 { font-size: clamp(30px, 4.4vw, 48px); }
.exmc-lede { color: var(--ink-2); max-width: 760px; margin-top: 10px; }
.exmc-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.exmc-grid .exmc-lead { grid-column: 1 / -1; }
.exmc-grid .exmc-lead .exmc-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.exmc-grid .exmc-lead .exmc-card .pic { aspect-ratio: auto; min-height: 280px; }
.exmc-grid .exmc-lead .exmc-card .h { font-size: clamp(22px, 2.6vw, 30px); }
.exmc-card { display: flex; flex-direction: column; border-radius: var(--r-l, 24px); overflow: hidden; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; transition: transform 0.15s, box-shadow 0.15s; }
.exmc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.exmc-card .pic { aspect-ratio: 16 / 9; background: var(--card-2); overflow: hidden; display: block; }
.exmc-card .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.exmc-card .in { padding: 16px 18px 18px; display: grid; gap: 8px; }
.exmc-card .kick { font: 700 12px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--tang-text); }
.exmc-card .h { font: 700 18px/1.3 var(--display); overflow-wrap: anywhere; }
.exmc-card .meta { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .exmc-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .exmc-grid .exmc-lead .exmc-card { grid-template-columns: minmax(0, 1fr); } .exmc-grid .exmc-lead .exmc-card .pic { min-height: 0; aspect-ratio: 16 / 9; } }
@media (max-width: 600px) { .exmc-cards { grid-template-columns: minmax(0, 1fr); } }
.exmc-next { margin: 36px 0; }
.exmc-next h2 { font-size: 24px; margin-bottom: 14px; }
.exmc-pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 28px 0; }
.exmc-pager .page-numbers { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); text-decoration: none; font: 650 15px/1 var(--display); color: var(--ink); }
.exmc-pager .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* the sidebar: the site's own widgets, then the latest stories */
.exmc-side { display: grid; gap: 18px; align-content: start; }
.exmc-side .widget { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; min-width: 0; overflow: hidden; }
.exmc-side .widget-title { font: 700 13px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.exmc-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.exmc-latest a { display: grid; gap: 3px; text-decoration: none; color: var(--ink); }
.exmc-latest .t { font: 600 15px/1.35 var(--display); }
.exmc-latest .d { font-size: 12.5px; color: var(--muted); }
.exmc-side .search-form, .exmc-404 .search-form { display: flex; gap: 8px; }
.exmc-side input[type='search'], .exmc-404 input[type='search'] { flex: 1; min-width: 0; min-height: 42px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); }
.exmc-side .search-submit, .exmc-404 .search-submit { min-height: 42px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--tang); color: #10121f; font: 650 14px/1 var(--display); cursor: pointer; }

/* comments */
.exmc-comments { margin: 28px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l, 24px); padding: clamp(18px, 3vw, 30px); }
.exmc-comments h2 { font-size: 22px; margin-bottom: 12px; }
.exmc-comments .comment-list { padding-left: 1.2em; }
.exmc-comments textarea, .exmc-comments input[type='text'], .exmc-comments input[type='email'], .exmc-comments input[type='url'] { width: 100%; max-width: 100%; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); }
.exmc-comments .submit { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--tang); color: #10121f; font: 650 15px/1 var(--display); cursor: pointer; }

.exmc-404 { padding: 40px 0; max-width: 720px; }
.exmc-404 h1 { font-size: clamp(30px, 4.4vw, 48px); margin-bottom: 12px; }
.exmc-empty { padding: 30px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: 20px; color: var(--muted); }
/* AAWP boxes and ads keep their own look; they only must not push the page sideways */
.entry-content .aawp, .entry-content ins.adsbygoogle { max-width: 100%; }
/* a story without a picture: a band in the site's colours instead of an empty box */
.exmc-card .band { display: flex; align-items: flex-end; aspect-ratio: 16 / 7; padding: 16px 18px; background: radial-gradient(circle at 85% 20%, rgba(255, 106, 19, 0.55), transparent 55%), linear-gradient(135deg, #171a2c 0%, #2a1d52 100%); }
.exmc-card .band span { font: 800 13px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: #ffb27a; }
.exmc-grid .exmc-lead .exmc-card.no-pic { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.exmc-grid .exmc-lead .exmc-card.no-pic .band { aspect-ratio: auto; min-height: 220px; }
