/*
Theme Name: IPFlame
Author: IPFlame
Description: Giao diện IPFlame theo bản thiết kế final, hỗ trợ trình soạn thảo block và Polylang.
Version: 2.0.0
Requires at least: 6.8
Requires PHP: 8.0
Text Domain: ipflame
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* WordPress integration; the reference design is in assets/preview.css. */
body { line-height: normal; }
main { min-width: 0; }
main:focus { outline: none; }
img { max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: inherit; text-underline-offset: .2em; }
a:focus-visible, summary:focus-visible, input:focus-visible, button:focus-visible { outline: 2px solid var(--brand-red); outline-offset: 5px; }
.site-header { gap: 24px; }
.custom-logo { display: block; width: auto; height: 24px; }
.custom-logo-link { display: block; flex-shrink: 0; }
.brand { font: 600 22px var(--font-ui); text-decoration: none; }
.site-menu { display: flex; flex-wrap: wrap; gap: 8px 30px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; text-decoration: none; white-space: nowrap; }
.site-nav .current-menu-item > a, .site-nav .current-menu-ancestor > a { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.site-nav .sub-menu { display: none; list-style: none; padding: 12px; background: var(--paper); border: 1px solid var(--hair); position: absolute; z-index: 110; }
.site-menu > li:hover > .sub-menu, .site-menu > li:focus-within > .sub-menu { display: block; }
.lang-switch { flex-shrink: 0; }
.lang-switch { align-items: center; }
.lang-switch a { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.admin-bar .site-header { top: 32px; }
.home-content .hero { background-image: none; isolation: isolate; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; margin: 0; overflow: hidden; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,15,30,.05), rgba(10,15,30,.4)); z-index: -1; pointer-events: none; }
.hero-slogan { line-height: normal; letter-spacing: normal; margin: 0; }
.wp-block-group > * { margin-block-start: 0; }
.about-grid > *, .person > *, .latest-post > *, .contact-grid > * { min-width: 0; }
figure.about-icon { width: 220px; height: auto; aspect-ratio: 3/4.4; border: 0; }
.about-icon img { width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--hair); display: block; }
.fact p { margin: 0; }
.person-meta p { margin: 0; }
figure.services-photo { aspect-ratio: 16/9; }
.services-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; display: block; }
.acc-item summary { list-style: none; padding: 22px 48px 22px 24px; font: 400 17px var(--font-ui); color: var(--ink); cursor: pointer; position: relative; }
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary::after { content: '▾'; position: absolute; right: 24px; top: 24px; font-size: 14px; color: var(--ink-soft); transition: transform .2s ease; }
.acc-item[open] summary::after { transform: rotate(180deg); }
.acc-item > :not(summary) { margin-left: 24px; margin-right: 24px; font-family: 'Lora', serif; font-size: 14px; line-height: 1.9; color: var(--ink-soft); }
.acc-item .lead { font-style: italic; font-size: 14px; line-height: normal; margin-bottom: 14px; }
.acc-item ul { padding-left: 18px; margin-top: 0; }
.acc-item > :last-child { margin-bottom: 26px; }
.latest-post .post-thumb { padding: 0; overflow: hidden; text-decoration: none; }
.latest-post .post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.latest-post h2 a { text-decoration: none; }
.latest-post h2 a:hover { text-decoration: underline; }
.article-view .article-image { width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: 4px; margin-bottom: 28px; display: block; }
.article-view ul { list-style: disc; }
.article-view .wp-block-table { overflow-x: auto; max-width: 100%; }
.article-view .wp-block-table table { min-width: 560px; margin-bottom: 0; }
.article-view .wp-block-table { margin-bottom: 24px; }
.article-view .wp-block-table th:first-child { width: 20%; }
.article-view .wp-block-table th:not(:first-child) { width: 40%; }
.article-view pre { overflow-x: auto; max-width: 100%; background: var(--panel); padding: 20px; }
.entry-content { overflow-wrap: anywhere; }
.back-link { text-decoration: none; }
.contact-grid { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); }
figure.contact-photo { aspect-ratio: 3/2; }
.contact-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; display: block; }
.contact-info > p:last-child { margin-bottom: 20px; }
#page-content .inner, .utility-page { max-width: 900px; margin-inline: auto; }
#page-content .inner { font-size: 15px; line-height: 1.85; }
.pagination { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; font: 14px var(--font-ui); }
.pagination:empty { display: none; }
.nav-links { display: flex; gap: 14px; flex-wrap: wrap; }
.search-form { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
input, textarea, button { font: inherit; max-width: 100%; }
.search-form input, .comment-form input:not([type=checkbox]), .comment-form textarea { border: 1px solid var(--hair-strong); padding: 10px 14px; background: white; }
.search-form button, .comment-form .submit { border: 1px solid var(--ink); background: var(--ink); color: white; padding: 10px 20px; cursor: pointer; }
.error-code { font: 600 13px var(--font-ui); color: var(--brand-red); }
.screen-reader-text { border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 99999; background: white; padding: 12px; font-family: var(--font-ui); }
.skip-link:focus { top: 12px; }
@media (min-width: 1100px) {
  /* Match the reference's fixed hero background while keeping its image editable. */
  .hero-photo { clip-path: inset(0); }
  .hero-photo img { position: fixed; inset: 0; height: 100vh; width: 100vw; }
}
@media (max-width: 1100px) {
  .site-header { padding-inline: 28px; gap: 20px; }
  .site-menu { gap: 8px 20px; }
  .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
  .site-footer { gap: 24px; }
  .footer-brand { max-width: 44%; }
}
@media (max-width: 900px) {
  .site-header { flex-wrap: wrap; justify-content: center; }
  .site-nav { order: 3; width: 100%; justify-content: center; }
  .site-menu { justify-content: center; }
  .about-grid { grid-template-columns: 180px minmax(0, 1fr); gap: 28px; }
  figure.about-icon { width: 180px; }
  .facts-strip { margin-left: 208px; }
  .fact { flex-wrap: wrap; }
  .fact .fact-label { min-width: 140px; }
}
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 640px) {
  .site-header { flex-direction: row; gap: 8px 12px; padding-inline: 16px; }
  .custom-logo { height: 22px; }
  .site-menu { gap: 8px 16px; }
  .site-nav { gap: 0; }
  .site-nav a { font-size: 12px; }
  .hero-photo img { position: static; height: 100%; width: 100%; }
  .hero { height: 480px; }
  .about-grid, .person, .latest-post, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  figure.about-icon { width: 220px; }
  .facts-strip { margin-left: 0; }
  .fact { gap: 2px; }
  .fact .fact-separator { display: none; }
  .fact .fact-label { min-width: 0; }
  .site-footer { text-align: center; gap: 14px; }
  .footer-brand { max-width: 100%; }
  .article-view h1, .latest-post h2 { overflow-wrap: anywhere; }
  .article-view .wp-block-table table { min-width: 520px; }
}
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
