/*
Theme Name: Creopic
Theme URI: https://creopic.com
Author: Jasurbek
Description: Minimalist editorial theme for Creopic — a curated resource site for fonts, templates, graphics and creative software. One accent color, hairline dividers, generous whitespace, no page-builder dependency.
Version: 1.0.3
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: creopic
*/

/* =====================================================
   1. DESIGN TOKENS
   ===================================================== */
:root {
  /* colors — matched to the pages already published on creopic.com */
  --c-bg: #ffffff;
  --c-text: #1d1d1f;
  --c-text-secondary: #6e6e73;
  --c-accent: #0071e3;
  --c-accent-hover: #0077ed;
  --c-border: #e5e5e5;
  --c-black: #000000;
  --c-white: #ffffff;
  --c-surface: #f5f5f7;

  /* type */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-hero: clamp(34px, 6vw, 56px);
  --fs-h1: clamp(28px, 4.5vw, 44px);
  --fs-h2: clamp(24px, 3.4vw, 36px);
  --fs-h3: 20px;
  --fs-body: 17px;
  --fs-body-lg: 19px;
  --fs-small: 14px;
  --lh-tight: 1.1;
  --lh-heading: 1.25;
  --lh-body: 1.6;

  /* layout */
  --w-reading: 720px;
  --w-wide: 980px;
  --w-max: 1200px;
  --gutter: 24px;

  /* misc */
  --radius: 12px;
  --radius-pill: 980px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: 220ms;
}

/* =====================================================
   2. RESET
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
h1, h2, h3, h4, p, figure { margin: 0; }

/* =====================================================
   3. LAYOUT UTILITIES
   ===================================================== */
.container { max-width: var(--w-max); margin-inline: auto; padding-inline: var(--gutter); }
.safe-pad { padding-inline: var(--gutter); }
.container--reading { max-width: var(--w-reading); margin-inline: auto; padding-inline: var(--gutter); }
.container--wide { max-width: var(--w-wide); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: 88px; }
.section--tight { padding-block: 56px; }
.hairline { border: 0; border-top: 1px solid var(--c-border); margin: 0; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 1000;
  background: var(--c-black); color: var(--c-white);
  padding: 12px 20px; border-radius: 8px; transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; border-radius: 4px; }

/* =====================================================
   4. TYPOGRAPHY
   ===================================================== */
.type-hero { font-size: var(--fs-hero); font-weight: 600; line-height: var(--lh-tight); letter-spacing: -0.015em; }
.type-h1   { font-size: var(--fs-h1); font-weight: 600; line-height: var(--lh-heading); letter-spacing: -0.01em; }
.type-h2   { font-size: var(--fs-h2); font-weight: 600; line-height: var(--lh-heading); letter-spacing: -0.01em; }
.type-h3   { font-size: var(--fs-h3); font-weight: 600; line-height: 1.35; }
.type-secondary { color: var(--c-text-secondary); }
.type-lg   { font-size: var(--fs-body-lg); }
.type-small{ font-size: var(--fs-small); color: var(--c-text-secondary); }

/* =====================================================
   5. BUTTONS & FORMS
   ===================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 500;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.btn--primary { background: var(--c-accent); color: var(--c-white); }
.btn--primary:hover { background: var(--c-accent-hover); }
.btn--primary:active { transform: scale(.98); }
.btn--ghost { background: transparent; color: var(--c-text); border: 1px solid var(--c-border); }
.btn--ghost:hover { border-color: var(--c-text); }

.field {
  width: 100%; padding: 13px 18px; border-radius: 10px;
  border: 1px solid var(--c-border); background: var(--c-white);
  font-size: 16px; transition: border-color var(--dur) var(--ease);
}
.field:focus { border-color: var(--c-accent); }

/* =====================================================
   6. SITE HEADER
   ===================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--c-border);
}
.site-header__inner {
  max-width: var(--w-max); margin-inline: auto; padding-inline: var(--gutter);
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.site-branding__link { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; color: var(--c-text); }
.site-branding img.custom-logo { max-height: 30px; width: auto; }

.site-nav { display: none; }
.site-nav ul { display: flex; align-items: center; gap: 32px; }
.site-nav a { font-size: 14px; color: var(--c-text-secondary); transition: color var(--dur) var(--ease); }
.site-nav a:hover, .site-nav .current-menu-item > a { color: var(--c-text); }

.nav-toggle {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; align-items: center;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--c-text); border-radius: 2px; transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none; border-bottom: 1px solid var(--c-border); background: var(--c-white);
}
.mobile-nav.is-open { display: block; }
.mobile-nav ul { padding: 8px var(--gutter) 20px; }
.mobile-nav li { border-top: 1px solid var(--c-border); }
.mobile-nav a { display: block; padding: 14px 0; font-size: 16px; }

@media (min-width: 900px) {
  .site-nav { display: block; }
  .nav-toggle, .mobile-nav { display: none !important; }
}

/* =====================================================
   7. CARDS (articles)
   ===================================================== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 40px 32px; }

.card { display: flex; flex-direction: column; }
.card__media {
  aspect-ratio: 16/10; border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
  background: var(--c-surface);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease); }
.card:hover .card__media img { transform: scale(1.035); }
.card__placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 28px; font-weight: 600;
}
.card__tag {
  align-self: flex-start; font-size: 12px; font-weight: 500; color: var(--c-accent);
  background: rgba(0,113,227,.08); padding: 4px 12px; border-radius: var(--radius-pill); margin-bottom: 12px;
}
.card__title { font-size: 20px; font-weight: 600; line-height: 1.35; margin-bottom: 8px; }
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card__excerpt { color: var(--c-text-secondary); font-size: 15px; line-height: 1.55; margin-bottom: 14px; }
.card__meta { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--c-text-secondary); margin-top: auto; }

/* signature scroll-reveal effect */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 560ms var(--ease), transform 560ms var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* =====================================================
   8. EMPTY STATES
   ===================================================== */
.empty-state {
  text-align: center; padding: 72px var(--gutter);
  border: 1px solid var(--c-border); border-radius: 16px;
}
.empty-state p { color: var(--c-text-secondary); max-width: 440px; margin-inline: auto; }
.empty-state .btn { margin-top: 20px; }

/* =====================================================
   9. SUBSCRIBE
   ===================================================== */
.subscribe { background: var(--c-surface); border-radius: 20px; padding: 64px var(--gutter); text-align: center; }
.subscribe__form { display: flex; gap: 10px; max-width: 420px; margin: 28px auto 0; }
.subscribe__form .field { flex: 1; }
@media (max-width: 520px) { .subscribe__form { flex-direction: column; } }

/* =====================================================
   10. BREADCRUMBS
   ===================================================== */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--c-text-secondary); margin-bottom: 24px; }
.breadcrumbs a:hover { color: var(--c-text); }
.breadcrumbs span[aria-hidden] { color: var(--c-border); }

/* =====================================================
   11. SINGLE POST
   ===================================================== */
.entry-header { margin-bottom: 32px; }
.entry-header .card__tag { margin-bottom: 16px; }
.entry-title { font-size: var(--fs-h1); font-weight: 600; line-height: var(--lh-tight); letter-spacing: -0.01em; margin-bottom: 14px; }
.entry-subtitle { font-size: var(--fs-body-lg); color: var(--c-text-secondary); margin-bottom: 18px; }
.entry-meta { display: flex; align-items: center; font-size: 14px; color: var(--c-text-secondary); }
.entry-meta span:not(:first-child) { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--c-border); }
.entry-thumbnail { border-radius: var(--radius); overflow: hidden; margin-block: 32px; }

.entry-toc { border: 1px solid var(--c-border); border-radius: 14px; padding: 24px 28px; margin-bottom: 40px; }
.entry-toc__title { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.entry-toc li { padding: 5px 0; }
.entry-toc a { color: var(--c-text-secondary); font-size: 15px; }
.entry-toc a:hover { color: var(--c-accent); }
.entry-toc .toc-level-3 { padding-left: 18px; }

.entry-content { font-size: var(--fs-body-lg); line-height: 1.75; }
.entry-content > * + * { margin-top: 1.4em; }
.entry-content h2 { font-size: 28px; font-weight: 600; margin-top: 1.8em; letter-spacing: -0.01em; scroll-margin-top: 96px; }
.entry-content h3 { font-size: 21px; font-weight: 600; margin-top: 1.6em; scroll-margin-top: 96px; }
.entry-content a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 2px; }
.entry-content img { border-radius: var(--radius); }
.entry-content blockquote {
  border-left: 3px solid var(--c-accent); padding-left: 24px; margin-left: 0;
  font-size: 24px; font-weight: 500; line-height: 1.5; color: var(--c-text);
}
.entry-content code { background: var(--c-surface); padding: .15em .4em; border-radius: 5px; font-size: .9em; }
.entry-content pre { background: var(--c-surface); padding: 20px; border-radius: var(--radius); overflow-x: auto; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; list-style: revert; }

.entry-cta { border: 1px solid var(--c-border); border-radius: 16px; padding: 32px; text-align: center; margin-top: 48px; }
.entry-cta__label { font-size: 13px; color: var(--c-text-secondary); margin-bottom: 10px; }

.entry-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 48px; }
.entry-tags a { font-size: 13px; border: 1px solid var(--c-border); padding: 6px 14px; border-radius: var(--radius-pill); color: var(--c-text-secondary); }
.entry-tags a:hover { border-color: var(--c-text); color: var(--c-text); }

.related-posts { border-top: 1px solid var(--c-border); margin-top: 64px; padding-top: 56px; }

/* =====================================================
   12. ALIGN-WIDE support for block content (used by
   theme-generated pages via the_content on page.php)
   ===================================================== */
.entry-content > .alignwide, .safe-pad > .alignwide { max-width: var(--w-max); }
.entry-content > .alignfull, .safe-pad > .alignfull { max-width: none; margin-inline: calc(50% - 50vw); }

/* =====================================================
   13. PAGINATION
   ===================================================== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 56px; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 14px; color: var(--c-text-secondary);
}
.pagination a:hover { background: var(--c-surface); }
.pagination .current { background: var(--c-text); color: var(--c-white); }

/* =====================================================
   14. SEARCH
   ===================================================== */
.search-form { display: flex; gap: 10px; }
.search-form .field { flex: 1; }
mark { background: rgba(0,113,227,.16); color: inherit; border-radius: 3px; padding: 0 2px; }

/* =====================================================
   15. 404
   ===================================================== */
.error-404 { text-align: center; padding-block: 120px; }
.error-404__code { font-size: clamp(64px,12vw,120px); font-weight: 700; color: var(--c-border); line-height: 1; }
.error-404 .search-form { max-width: 420px; margin: 32px auto 0; }

/* =====================================================
   16. COMMENTS
   ===================================================== */
.comment-list li { border-top: 1px solid var(--c-border); padding: 24px 0; }
.comment-author { font-weight: 600; font-size: 15px; }
.comment-meta a { color: var(--c-text-secondary); font-size: 13px; }
.comment-content p { margin-top: 8px; }
.comment-reply-link { font-size: 13px; color: var(--c-accent); }
#respond { margin-top: 32px; }
#respond .comment-form-comment textarea { min-height: 130px; }
.comment-form p { margin-top: 14px; }

/* =====================================================
   17. WIDGETS / SIDEBAR
   ===================================================== */
.widget { margin-bottom: 40px; }
.widget-title { font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.widget ul li { padding: 8px 0; border-top: 1px solid var(--c-border); }

/* =====================================================
   18. FOOTER
   ===================================================== */
.site-footer { border-top: 1px solid var(--c-border); margin-top: 96px; }
.site-footer__widgets {
  padding-block: 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 32px;
}
.site-footer__bottom {
  border-top: 1px solid var(--c-border); padding-block: 24px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--c-text-secondary);
}
.site-footer__bottom nav ul { display: flex; gap: 20px; }

/* =====================================================
   19. RESPONSIVE TWEAKS
   ===================================================== */
@media (max-width: 640px) {
  .section { padding-block: 56px; }
  .grid { grid-template-columns: 1fr; }
}
