/*
Theme Name: AVThai Catalog
Theme URI: https://www.avthai.cz/
Author: AVThai
Description: A responsive charcoal, pink and white media catalog theme with sidebar filters and a dense card grid.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: avthai-catalog
*/

:root {
  --av-pink: #ff2e78;
  --av-pink-soft: #ffd7e5;
  --av-ink: #2b2b2c;
  --av-paper: #ffffff;
  --av-panel: #f5f5f6;
  --av-line: #dedee1;
  --av-muted: #74747b;
  --av-content: 1440px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--av-ink); background: #e9eaed; font-family: Arial, Helvetica, sans-serif; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { clip: auto; width: auto; height: auto; margin: 8px; padding: 10px 14px; z-index: 100000; color: #111; background: white; }

.site-frame { width: min(100%, var(--av-content)); min-height: 100vh; margin: 0 auto; background: var(--av-paper); box-shadow: 0 0 40px rgba(21,22,27,.08); }
.masthead { min-height: 88px; display: grid; grid-template-columns: minmax(190px, 260px) minmax(280px, 540px) 1fr; align-items: center; gap: 42px; padding: 16px 36px; background: #f7f7f8; }
.site-branding { min-width: 0; }
.site-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: clamp(1.2rem,2.4vw,1.8rem); font-weight: 900; letter-spacing: -.04em; white-space: nowrap; }
.site-title::before { content: ""; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: var(--av-pink); box-shadow: inset 0 0 0 10px var(--av-pink), inset 13px 0 0 white; clip-path: polygon(0 0,100% 0,100% 100%,0 100%); }
.site-description { margin: 4px 0 0 44px; color: var(--av-muted); font-size: .72rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.header-search .search-form { display: flex; height: 44px; overflow: hidden; background: white; border-radius: 999px; box-shadow: 0 8px 24px rgba(34,34,38,.04); }
.header-search label { display: flex; flex: 1; }
.search-field { width: 100%; min-width: 0; padding: 0 18px; border: 0; outline: 0; background: transparent; color: var(--av-ink); font-size: .9rem; }
.search-field:focus { box-shadow: inset 0 0 0 2px var(--av-pink-soft); }
.search-submit { min-width: 64px; padding: 0 18px; border: 0; background: var(--av-pink); color: white; font-size: 0; cursor: pointer; }
.search-submit::before { content: "⌕"; font-size: 1.7rem; font-weight: 700; }
.header-accent { justify-self: end; display: flex; gap: 10px; }
.header-accent i { width: 29px; height: 29px; display: block; border-radius: 6px; background: #dedee1; }

.primary-nav { min-height: 54px; padding: 0 34px; background: var(--av-ink); border-bottom: 4px solid transparent; }
.primary-nav .menu, .primary-nav ul { min-height: 54px; display: flex; align-items: stretch; gap: 2px; margin: 0; padding: 0; list-style: none; overflow-x: auto; }
.primary-nav li { display: flex; align-items: stretch; position: relative; }
.primary-nav a { min-width: 96px; display: grid; place-items: center; padding: 0 16px; color: #efeff1; font-size: .9rem; font-weight: 700; white-space: nowrap; transition: background .2s ease; }
.primary-nav a:hover, .primary-nav a:focus, .primary-nav .current-menu-item > a { background: #373739; }
.primary-nav .current-menu-item::after, .primary-nav li:first-child::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -4px; height: 4px; background: var(--av-pink); }

.catalog-shell { display: grid; grid-template-columns: 220px minmax(0,1fr); }
.catalog-sidebar { min-height: 1020px; padding: 32px 25px; background: var(--av-panel); }
.sidebar-section { padding: 0 4px 27px; margin-bottom: 26px; border-bottom: 1px solid #dcdcdf; }
.sidebar-section:last-child { border-bottom: 0; }
.sidebar-title { margin: 0 0 18px; color: #505057; font-size: 1rem; font-weight: 800; }
.filter-list, .catalog-sidebar ul { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.filter-list a, .catalog-sidebar li a, .tag-cloud-link { display: block; padding: 5px 8px; border-radius: 5px; color: #57575d; font-size: .88rem; transition: color .2s ease, background .2s ease, transform .2s ease; }
.filter-list a::before { content: "●"; margin-right: 9px; color: #bfc0c4; font-size: .55rem; vertical-align: 2px; }
.filter-list li:first-child a::before { color: var(--av-pink); }
.filter-list a:hover, .catalog-sidebar li a:hover, .tag-cloud-link:hover { color: var(--av-pink); background: white; transform: translateX(2px); }
.catalog-sidebar .tagcloud { display: flex; flex-wrap: wrap; gap: 7px; }
.catalog-sidebar .tag-cloud-link { padding: 6px 9px; background: white; border: 1px solid #e3e3e6; font-size: .72rem !important; }

.catalog-content { min-width: 0; padding: 28px 30px 48px; }
.catalog-heading { margin: 0 0 4px; font-size: 1.4rem; font-weight: 800; }
.catalog-tabs { min-height: 48px; display: flex; align-items: flex-end; gap: 0; margin-bottom: 20px; border-bottom: 1px solid #e1e1e4; overflow-x: auto; }
.catalog-tabs a { min-width: 110px; height: 46px; display: grid; place-items: center; padding: 0 14px; position: relative; color: #606067; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.catalog-tabs a + a { border-left: 1px solid #e4e4e7; }
.catalog-tabs a:hover, .catalog-tabs a.active { color: var(--av-pink); }
.catalog-tabs a.active::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: -1px; height: 3px; background: var(--av-pink); }

.catalog-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 30px 14px; }
.catalog-card { min-width: 0; overflow: hidden; border-radius: 4px; background: white; transition: transform .2s ease, box-shadow .2s ease; }
.catalog-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(22,24,30,.10); }
.card-media { display: block; aspect-ratio: 1.42/1; position: relative; overflow: hidden; background: linear-gradient(135deg,#d4d5d9,#f0f0f2 55%,#c8c9ce); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.catalog-card:hover .card-media img { transform: scale(1.035); }
.card-placeholder { width: 100%; height: 100%; background: linear-gradient(110deg,#d4d5d9 0%,#f2f2f4 48%,#c9cacf 100%); }
.card-body { padding: 11px 4px 4px; }
.card-title { min-height: 2.8em; margin: 0; font-size: .88rem; font-weight: 800; line-height: 1.38; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a:hover { color: var(--av-pink); }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; color: #a1a1a7; font-size: .69rem; }
.card-meta .comments { width: 16px; height: 16px; border-radius: 50%; background: #ededf0; font-size: 0; }

.empty-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 30px 14px; }
.skeleton-card { min-width: 0; }
.skeleton-thumb { aspect-ratio: 1.42/1; border-radius: 4px; background: linear-gradient(135deg,#d4d5d9,#f0f0f2 55%,#c8c9ce); }
.skeleton-line { width: 76%; height: 9px; margin: 12px 4px 0; border-radius: 99px; background: #bfc0c4; }
.skeleton-line.small { width: 34%; height: 7px; margin-top: 10px; background: var(--av-pink-soft); }

.pagination, .nav-links { display: flex; justify-content: center; gap: 8px; padding-top: 48px; }
.page-numbers { min-width: 34px; height: 34px; display: grid; place-items: center; padding: 0 9px; border-radius: 5px; background: #ededf0; color: #63636a; font-size: .8rem; font-weight: 700; }
.page-numbers:hover, .page-numbers.current { background: var(--av-pink); color: white; }

.single-content { max-width: 900px; margin: 0 auto; }
.single-content .entry-title { font-size: clamp(1.7rem,4vw,2.6rem); line-height: 1.2; }
.single-content .post-thumbnail img { width: 100%; border-radius: 8px; }
.entry-content { font-size: 1rem; }
.entry-content a { color: var(--av-pink); text-decoration: underline; }
.entry-content iframe { max-width: 100%; }

.footer-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 30px 42px; border-top: 1px solid #ededf0; background: #fafafb; }
.footer-tags a { padding: 7px 11px; border: 1px solid #e2e2e5; border-radius: 5px; background: white; color: #77777e; font-size: .72rem; }
.footer-tags a::before { content: "●"; margin-right: 7px; color: var(--av-pink); font-size: .5rem; }
.site-footer { min-height: 130px; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; padding: 28px 42px; background: var(--av-ink); color: #b9b9be; }
.footer-brand { margin: 0 0 5px; color: white; font-size: 1.15rem; font-weight: 800; }
.footer-copy { margin: 0; font-size: .75rem; }
.footer-menu { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 22px; margin: 0; padding: 0; list-style: none; }
.footer-menu a { color: #b9b9be; font-size: .78rem; }
.footer-menu a:hover { color: var(--av-pink); }

@media (max-width: 1120px) {
  .masthead { grid-template-columns: 190px minmax(260px,1fr) auto; gap: 24px; }
  .catalog-grid, .empty-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .masthead { grid-template-columns: 1fr auto; gap: 12px; padding: 15px 18px; }
  .header-search { grid-column: 1/-1; grid-row: 2; }
  .header-accent i:nth-child(-n+2) { display: none; }
  .primary-nav { padding: 0 12px; }
  .catalog-shell { grid-template-columns: 1fr; }
  .catalog-sidebar { min-height: auto; display: none; }
  .catalog-content { padding: 24px 16px 38px; }
  .catalog-grid, .empty-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 10px; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-menu { justify-content: flex-start; }
}
@media (max-width: 430px) {
  .site-description, .header-accent { display: none; }
  .masthead { grid-template-columns: 1fr; }
  .catalog-grid, .empty-grid { grid-template-columns: 1fr; }
  .card-media, .skeleton-thumb { aspect-ratio: 1.65/1; }
  .footer-tags, .site-footer { padding-left: 20px; padding-right: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
