/*
Theme Name: Ikistudio Theme
Theme URI: https://github.com/devngauloi/ikistudio-starter
Author: DevNgauLoi
Author URI: https://github.com/devngauloi
Description: Nền tảng block theme tối giản: không phụ thuộc plugin bên thứ ba, không JavaScript front-end, không build step. Toàn bộ design token nằm trong theme.json.
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.2
Version: 0.3.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ikistudio-theme
Tags: block-theme, full-site-editing, blog, one-column, accessibility-ready, block-styles, editor-style, template-editing, translation-ready

Ikistudio Theme
Copyright (C) 2026 DevNgauLoi

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/

/*
 * Chỉ giữ những gì theme.json KHÔNG làm được.
 * Mọi thứ khác (màu, typography, spacing, layout) phải khai báo trong theme.json.
 */

/* Accessibility: skip link — WordPress chèn sẵn, chỉ cần style khi focus. */
.skip-link:focus {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	outline-color: var(--wp--preset--color--accent);
	z-index: 100000;
}

/*
 * Thuộc tính `hidden` phải thắng mọi `display` khai theo class. UA chỉ cho nó
 * `display: none` ở độ ưu tiên thấp nhất, nên một nút có `display: inline-flex` vẫn hiện
 * dù đã `hidden`. Quy tắc reset, nên nằm ở theme chứ không phải từng block. Xem L-068.
 */
[hidden] {
	display: none !important;
}

/*
 * Header dính ở đỉnh khi cuộn — `vitals` đòi "cuộn 400px vẫn còn một thanh ở đỉnh" (L-077).
 * Sticky phải đặt trên chính <header> mà template-part sinh ra, không phải group bên trong:
 * group chỉ cao bằng cha nên không còn quãng nào để dính (L-074). Nền đặc để chữ không chạy
 * xuyên qua. Trang nào cần thanh khác chiếm đỉnh thì cho header `position: static` ở đó.
 */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 50;
	background-color: var(--wp--preset--color--base);
}

/*
 * Font dự phòng khớp bề rộng Archivo (L-079): đo bằng tools/do-size-adjust.py trên câu trộn en/de/pt/es/vi —
 * wght 400 = 98,3 % Arial, wght 800 = 103,3 % Arial Bold. theme.json không khai được local() + size-adjust.
 */
@font-face {
	font-family: "Archivo Fallback";
	src: local("Arial");
	font-weight: 100 500;
	size-adjust: 98.3%;
}

@font-face {
	font-family: "Archivo Fallback";
	src: local("Arial Bold"), local("Arial");
	font-weight: 600 900;
	size-adjust: 103.3%;
}

/*
 * Chặn tràn ngang mà không phá header dính (Hallmark 34: clip, không hidden). Tiêu đề cân dòng,
 * đoạn văn tránh chữ mồ côi (Hallmark F3/F26).
 */
html,
body {
	overflow-x: clip;
}

h1,
h2,
h3 {
	text-wrap: balance;
}

p,
li {
	text-wrap: pretty;
}

/* Header: một đường mảnh ngăn với nội dung. */
header.wp-block-template-part {
	border-bottom: 1px solid var(--wp--preset--color--base-2);
}

/*
 * Chữ ký nhận diện: bốn vạch màu app dưới tên site — cùng dấu với icon Play và favicon
 * (docs/nhan-dien/bo.json). Vạch cứng, không chuyển màu.
 */
.wp-block-site-title a {
	display: inline-block;
	padding-bottom: 0.3rem;
	background-image:
		linear-gradient(var(--wp--preset--color--accent), var(--wp--preset--color--accent)),
		linear-gradient(var(--wp--preset--color--purple), var(--wp--preset--color--purple)),
		linear-gradient(var(--wp--preset--color--gold), var(--wp--preset--color--gold)),
		linear-gradient(var(--wp--preset--color--lime), var(--wp--preset--color--lime));
	background-size: 22% 0.22rem;
	background-position: 0 100%, 34% 100%, 66% 100%, 100% 100%;
	background-repeat: no-repeat;
}

/*
 * Link đứng riêng (menu, tên app trong thẻ, dòng chính sách): vùng chạm ≥ 44px cao (WCAG 2.5.8 sàn 24px,
 * `web_do.py kiem` đo). Link nằm trong câu văn được miễn theo chính WCAG nên không đụng.
 */
.wp-block-navigation a,
.iki-the-ten a,
.iki-chinh-sach a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

/* Link trong chữ: gạch chân màu nhấn. */
a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

/* Landing app: icon + tên app ở đầu, câu dẫn lớn. */
.iki-icon img {
	border-radius: 22%;
}

.iki-ten {
	font-weight: 700;
	font-size: var(--wp--preset--font-size--large);
}

.iki-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.4;
}

/* Ảnh store: bo góc như màn điện thoại. */
.iki-anh img {
	border-radius: 0.75rem;
}

/* Câu hỏi thường gặp: block Details của core, vùng chạm ≥ 44px (WCAG 2.5.8). */
.wp-block-details {
	border-top: 1px solid var(--wp--preset--color--base-2);
	padding-block: 0.25rem;
}

.wp-block-details summary {
	min-height: 44px;
	display: flex;
	align-items: center;
	font-weight: 700;
	cursor: pointer;
}

.iki-chinh-sach {
	font-size: var(--wp--preset--font-size--small);
}

/* Chống CLS: media luôn giữ tỉ lệ, không nhảy layout khi ảnh tải xong. */
img,
video,
iframe {
	max-width: 100%;
	height: auto;
}

/* Tôn trọng thiết lập giảm chuyển động của hệ điều hành. */
@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
