/*
Theme Name:   AIInfo Notion Warm
Description:  Child theme of Twenty Twenty-Four — Notion Warm v3
Author:       AIInfo
Template:     twentytwentyfour
Version:      3.0.0
License:      GNU General Public License v2 or later
Text Domain:  aiinfo-notion-warm
*/

/* =====================================================================
   PERFORMANCE — critical above-fold CSS only
   Everything below is lightweight: no gradients, no shadows on scroll
===================================================================== */

/* ── Reading progress ── */
#aiinfo-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: #c8880a; z-index: 9999;
  transition: width .08s linear;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}

/* ── Scroll to top ── */
#aiinfo-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 38px; height: 38px;
  background: #1c1a17; color: #f5f3ee;
  border: none; border-radius: 8px; cursor: pointer;
  font-size: 17px; z-index: 800;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s, transform .2s, visibility .2s;
  box-shadow: 0 2px 8px rgba(28,26,23,.2);
}
#aiinfo-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#aiinfo-top:hover { background: #c8880a; color: #1c1a17; }

/* ── Cookie ── */
#aiinfo-cookie {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9000;
  background: #fff; border-top: 1px solid #d8d4cc;
  padding: 12px 24px; display: flex; align-items: center;
  gap: 16px; flex-wrap: wrap;
  box-shadow: 0 -2px 12px rgba(28,26,23,.06);
  transform: translateY(100%); transition: transform .3s ease;
}
#aiinfo-cookie.show { transform: translateY(0); }
#aiinfo-cookie p { font-size: 13px; color: #6b6760; margin: 0; flex: 1; min-width: 200px; }
#aiinfo-cookie a { color: #c8880a; }
.aiinfo-ck-ok {
  background: #1c1a17; color: #f5f3ee; border: none;
  border-radius: 6px; padding: 7px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.aiinfo-ck-no {
  background: transparent; color: #6b6760;
  border: 1px solid #d8d4cc; border-radius: 6px;
  padding: 6px 14px; font-size: 13px; cursor: pointer; font-family: inherit;
}

/* =====================================================================
   TYPOGRAPHY FIXES — readability issues from screenshots
===================================================================== */

/* Fix: Lora italic making body content italic and hard to read */
.wp-block-post-content p,
.entry-content p,
.wp-block-paragraph {
  font-style: normal !important;
  font-family: 'DM Sans', system-ui, sans-serif !important;
  font-size: 1.0625rem !important;
  line-height: 1.75 !important;
  color: #3d3a35 !important;
}

/* Fix: blockquote too large and all-italic (Image 3) */
.wp-block-quote,
blockquote {
  font-style: normal !important;
  font-family: 'DM Sans', system-ui, sans-serif !important;
  font-size: 1rem !important;
  line-height: 1.65 !important;
  border-left: 3px solid #c8880a !important;
  background: #fef3d8 !important;
  padding: 1rem 1.25rem !important;
  border-radius: 0 8px 8px 0 !important;
  margin: 1.5em 0 !important;
  color: #3d3a35 !important;
}
.wp-block-quote p,
blockquote p {
  font-style: normal !important;
  font-size: 1rem !important;
  margin-bottom: .5em !important;
}
.wp-block-quote cite,
.wp-block-quote footer {
  font-size: 0.8rem !important;
  color: #6b6760 !important;
  font-style: normal !important;
}

/* Headings — keep Lora but fix sizing */
h1, h2, h3, h4, h5, h6,
.wp-block-post-title,
.wp-block-heading {
  font-style: normal !important;
  color: #1c1a17 !important;
}

/* =====================================================================
   HERO SECTION — fix text overflow & trust signal cut-off
===================================================================== */

/* Hero text size constraints */
.aiinfo-hero-headline {
  font-size: clamp(1.875rem, 3.5vw, 2.75rem) !important;
  line-height: 1.1 !important;
}

/* Fix: trust signals text */
.aiinfo-trust-line {
  font-size: 0.875rem;
  line-height: 1.9;
  color: #3d3a35;
}

/* Dynamic hero cards */
.aiinfo-hero-cards { display: flex; flex-direction: column; gap: 10px; }
.aiinfo-hero-card {
  background: #fff;
  border: 1px solid #d8d4cc;
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none !important;
  display: block;
  transition: border-color .15s, box-shadow .15s;
}
.aiinfo-hero-card:hover {
  border-color: #b8b4ac;
  box-shadow: 0 3px 10px rgba(28,26,23,.08);
}
.aiinfo-hero-card.featured { border-color: #c8880a; border-width: 1.5px; }
.aiinfo-hc-tag {
  font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: #c8880a; display: block; margin-bottom: 4px;
}
.aiinfo-hc-title {
  font-size: 0.9rem; font-weight: 700; line-height: 1.35;
  color: #1c1a17; display: block; margin-bottom: 4px;
}
.aiinfo-hc-meta { font-size: 0.75rem; color: #9a9490; }

/* =====================================================================
   ARTICLE CARDS — hover lift, consistent aspect ratio
===================================================================== */

.wp-block-post {
  transition: transform .18s ease, box-shadow .18s ease !important;
}
.wp-block-post:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 6px 20px rgba(28,26,23,.09) !important;
}
.wp-block-post-title a {
  text-decoration: none !important;
  color: #1c1a17 !important;
  transition: color .15s !important;
}
.wp-block-post-title a:hover { color: #c8880a !important; }

/* Category labels in card */
.wp-block-post-terms a {
  font-size: 0.62rem !important; font-weight: 700 !important;
  letter-spacing: .1em !important; text-transform: uppercase !important;
  color: #c8880a !important; text-decoration: none !important;
}

/* Excerpt in card */
.wp-block-post-excerpt p {
  font-size: 0.8rem !important; color: #6b6760 !important;
  line-height: 1.5 !important; margin-bottom: 0 !important;
}

/* Date in card */
.wp-block-post-date a,
.wp-block-post-date time { color: #9a9490 !important; font-size: 0.75rem !important; }

/* =====================================================================
   PAGINATION — styled properly
===================================================================== */

.wp-block-query-pagination {
  display: flex !important;
  justify-content: center !important;
  gap: 5px !important;
  margin-top: 3rem !important;
  flex-wrap: wrap !important;
}
.wp-block-query-pagination-numbers .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
  display: inline-flex !important; align-items: center !important;
  justify-content: center !important;
  min-width: 38px !important; height: 38px !important;
  padding: 0 12px !important;
  background: #fff !important; border: 1px solid #d8d4cc !important;
  border-radius: 7px !important;
  font-size: 0.875rem !important; font-weight: 600 !important;
  color: #3d3a35 !important; text-decoration: none !important;
  transition: all .15s ease !important;
}
.wp-block-query-pagination-numbers .page-numbers:hover,
.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
  background: #1c1a17 !important; border-color: #1c1a17 !important;
  color: #f5f3ee !important;
}
.wp-block-query-pagination-numbers .page-numbers.current {
  background: #1c1a17 !important; border-color: #1c1a17 !important;
  color: #f5f3ee !important;
}

/* =====================================================================
   SINGLE POST — byline improvements (Image 6)
===================================================================== */

/* Post meta bar */
.aiinfo-byline {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding-bottom: 1.25rem !important;
  margin-bottom: 1.75rem !important;
  border-bottom: 1px solid #d8d4cc !important;
  flex-wrap: wrap !important;
}

/* TT4 author block — fix square avatar to circle */
.wp-block-post-author__avatar img {
  border-radius: 50% !important;
  width: 32px !important; height: 32px !important;
  object-fit: cover !important;
  border: 2px solid #f0ede8 !important;
}
.wp-block-post-author {
  align-items: center !important;
  gap: 8px !important;
}
.wp-block-post-author__content {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.wp-block-post-author__name {
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: #3d3a35 !important;
}
.wp-block-post-author__bio { display: none !important; } /* hide in post header */

/* Read time badge */
.aiinfo-read-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: #9a9490;
  background: #f0ede8;
  border-radius: 50px;
  padding: 3px 10px;
}

/* =====================================================================
   AUTHOR BOX — override WordPress purple defaults (Image 2)
===================================================================== */

/* Hide the big "Author" heading that renders above the bio box */
.wp-block-post-author-biography h2,
.author-title,
h2.author,
.entry-author h2 {
  display: none !important;
}

/* The actual author card box */
.wp-block-post-author-biography,
.author-info,
.entry-author,
.author-bio-card {
  background: #fafaf8 !important;
  border: 1px solid #d8d4cc !important;
  border-radius: 10px !important;
  padding: 1.25rem 1.5rem !important;
  margin-top: 2.5rem !important;
  margin-bottom: 0 !important;
}
.wp-block-post-author-biography p { color: #3d3a35 !important; font-size: 0.9rem !important; }

/* TT4 post-author block when used as bio box */
.wp-block-post-author.is-style-with-bio {
  background: #fafaf8 !important;
  border: 1px solid #d8d4cc !important;
  border-radius: 10px !important;
  padding: 1.25rem 1.5rem !important;
}

/* "View all posts" button — override purple */
.wp-block-post-author a[class*="button"],
.wp-block-buttons a,
.author-box a.button,
.wp-block-post-author__link {
  background: #1c1a17 !important;
  color: #f5f3ee !important;
  border-color: #1c1a17 !important;
  border-radius: 6px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}
.wp-block-post-author a[class*="button"]:hover {
  background: #c8880a !important;
  color: #1c1a17 !important;
  border-color: #c8880a !important;
}

/* =====================================================================
   RELATED POSTS — fix portrait images, better cards (Image 1)
===================================================================== */

.aiinfo-related {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid #d8d4cc;
}
.aiinfo-related-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: #6b6760; margin-bottom: 1.25rem; display: block;
}
.aiinfo-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.aiinfo-related-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid #d8d4cc;
  border-radius: 10px; overflow: hidden;
  text-decoration: none !important;
  transition: transform .18s ease, box-shadow .18s ease, border-color .15s;
  color: #1c1a17 !important;
}
.aiinfo-related-card:hover {
  border-color: #b8b4ac;
  box-shadow: 0 5px 18px rgba(28,26,23,.09);
  transform: translateY(-2px);
}
/* Fix: image wrapper with fixed 16:9 ratio — no more portrait crops */
.aiinfo-related-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eceae3;
  flex-shrink: 0;
}
.aiinfo-related-img-wrap img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  /* No height or width attributes override — CSS wins */
}
.aiinfo-related-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #c8c4bc;
}
.aiinfo-related-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.aiinfo-related-cat {
  font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: #c8880a;
}
.aiinfo-related-title {
  font-size: 0.875rem; font-weight: 700; line-height: 1.35;
  color: #1c1a17;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.aiinfo-related-meta { font-size: 0.72rem; color: #9a9490; margin-top: auto; }

/* =====================================================================
   FLOATING SHARE BAR — XDA-style vertical sidebar
===================================================================== */

/* Desktop: fixed vertical bar on left side of content */
#aiinfo-float-share {
  position: fixed;
  /* Sits just left of the content area (740px max, centered) */
  left: max(12px, calc(50vw - 430px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 7px;
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
#aiinfo-float-share.visible {
  opacity: 1;
  visibility: visible;
}
/* Hide on viewports too narrow to show it beside content */
@media (max-width: 1080px) {
  #aiinfo-float-share { display: none !important; }
}

.aiinfo-fsb {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid #d8d4cc;
  background: #fff;
  color: #6b6760;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
  white-space: nowrap;
}
.aiinfo-fsb:hover { background: #1c1a17; color: #f5f3ee; border-color: #1c1a17; }
.aiinfo-fsb.twitter:hover  { background: #000; border-color: #000; color: #fff; }
.aiinfo-fsb.whatsapp:hover { background: #25d366; border-color: #25d366; color: #fff; }
.aiinfo-fsb.linkedin:hover { background: #0077b5; border-color: #0077b5; color: #fff; }
.aiinfo-fsb.copy.done      { background: #c8880a; border-color: #c8880a; color: #1c1a17; }

/* Share count label above buttons */
#aiinfo-float-share .fsb-label {
  font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: #9a9490; text-align: center;
  margin-bottom: 2px;
}

/* =====================================================================
   MOBILE SHARE BAR — bottom sticky, horizontal (replaces float bar)
===================================================================== */

#aiinfo-mobile-share {
  display: none;
}
@media (max-width: 1080px) {
  #aiinfo-mobile-share {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid #d8d4cc;
    padding: 10px 16px;
    gap: 8px;
    z-index: 600;
    justify-content: center;
    align-items: center;
    transform: translateY(100%);
    transition: transform .25s ease;
    box-shadow: 0 -2px 12px rgba(28,26,23,.07);
  }
  #aiinfo-mobile-share.visible { transform: translateY(0); }
  .aiinfo-msb {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 13px; border: 1px solid #d8d4cc;
    border-radius: 6px; font-size: 12px; font-weight: 600;
    color: #3d3a35; background: #f5f3ee;
    text-decoration: none !important; cursor: pointer;
    font-family: inherit; flex: 1; justify-content: center;
    max-width: 100px;
  }
  .aiinfo-msb:active { background: #1c1a17; color: #f5f3ee; border-color: #1c1a17; }
  /* Push page content up so share bar doesn't cover */
  body.is-single-post { padding-bottom: 60px; }
}

/* =====================================================================
   INLINE SHARE (after content, above related posts)
===================================================================== */

.aiinfo-inline-share {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 14px 0; margin: 2rem 0 0;
  border-top: 1px solid #d8d4cc;
  border-bottom: 1px solid #d8d4cc;
}
.aiinfo-inline-share-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: #9a9490; margin-right: 4px;
}
.aiinfo-isb {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border: 1px solid #d8d4cc;
  border-radius: 6px; font-size: 12px; font-weight: 600;
  color: #3d3a35; background: #f5f3ee;
  text-decoration: none !important; cursor: pointer;
  font-family: inherit; transition: all .15s ease;
}
.aiinfo-isb:hover { background: #1c1a17; color: #f5f3ee; border-color: #1c1a17; }
/* Hide inline share on desktop where float bar shows */
@media (min-width: 1081px) { .aiinfo-inline-share { display: none; } }

/* =====================================================================
   BYLINE — improved (mobile + desktop, Image 6)
===================================================================== */

/* Better byline wrapper */
.aiinfo-byline-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid #d8d4cc;
  font-size: 0.85rem;
  color: #6b6760;
}
.aiinfo-byline-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #eceae3;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #6b6760;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid #f0ede8;
}
.aiinfo-byline-avatar img { width: 100%; height: 100%; object-fit: cover; }
.aiinfo-byline-author { font-weight: 600; color: #3d3a35; }
.aiinfo-byline-sep { color: #d8d4cc; }
.aiinfo-byline-date { color: #9a9490; }
.aiinfo-byline-readtime {
  display: inline-flex; align-items: center;
  background: #f0ede8; border-radius: 50px;
  padding: 2px 9px; font-size: 0.72rem; color: #6b6760;
}

@media (max-width: 600px) {
  .aiinfo-byline-wrap { gap: 6px; }
  .aiinfo-byline-readtime { margin-left: 0; }
}

/* =====================================================================
   POST NAVIGATION
===================================================================== */

.wp-block-post-navigation-link {
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: #3d3a35 !important;
  text-decoration: none !important;
  font-family: 'DM Sans', system-ui, sans-serif !important;
}
.wp-block-post-navigation-link:hover { color: #c8880a !important; }
.wp-block-post-navigation-link__label {
  font-size: 0.68rem !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: .1em !important;
  color: #9a9490 !important; display: block !important;
  margin-bottom: 4px !important;
}

/* =====================================================================
   COMMENTS
===================================================================== */

.wp-block-comment-author-name a { color: #1c1a17 !important; font-weight: 600 !important; }
.wp-block-comment-date time { color: #9a9490 !important; font-size: 0.78rem !important; }
.wp-block-comment-content p { color: #3d3a35 !important; font-size: 0.9rem !important; }
.wp-block-post-comments-form input,
.wp-block-post-comments-form textarea {
  border: 1px solid #d8d4cc !important;
  border-radius: 7px !important;
  background: #fafaf8 !important;
  color: #1c1a17 !important;
  padding: 10px 14px !important;
}
.wp-block-post-comments-form input:focus,
.wp-block-post-comments-form textarea:focus {
  border-color: #c8880a !important; outline: none !important;
  box-shadow: 0 0 0 3px rgba(200,136,10,.12) !important;
}

/* =====================================================================
   RANK MATH — breadcrumbs & TOC
===================================================================== */

.rank-math-breadcrumb,
.rank-math-breadcrumb p { font-size: 0.78rem !important; color: #9a9490 !important; }
.rank-math-breadcrumb a { color: #9a9490 !important; text-decoration: none !important; }
.rank-math-breadcrumb a:hover { color: #c8880a !important; }
.rank-math-breadcrumb .separator { color: #d8d4cc !important; }

.rank-math-toc {
  background: #fafaf8 !important; border: 1px solid #d8d4cc !important;
  border-radius: 8px !important; padding: 1rem 1.25rem !important;
  margin: 1.5rem 0 !important;
}
.rank-math-toc h5 { font-size: 0.78rem !important; font-weight: 700 !important; color: #6b6760 !important; text-transform: uppercase !important; letter-spacing: .08em !important; }
.rank-math-toc a { color: #3d3a35 !important; font-size: 0.875rem !important; }
.rank-math-toc a:hover { color: #c8880a !important; }

/* =====================================================================
   RESPONSIVE
===================================================================== */

@media (max-width: 768px) {
  .aiinfo-related-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  #aiinfo-top { bottom: 16px; right: 16px; }
  /* Add bottom padding for mobile share bar */
  body.is-single-post { padding-bottom: 64px; }
}
@media (max-width: 600px) {
  .aiinfo-related-grid { grid-template-columns: 1fr !important; }
  #aiinfo-cookie { padding: 10px 14px; }
}

/* =====================================================================
   MISC — newsletter search form in footer
===================================================================== */

.wp-block-search__inside-wrapper {
  border-radius: 7px !important; overflow: hidden !important;
  background: #2a2825 !important; border: 1px solid #3a3835 !important;
}
.wp-block-search__input {
  background: transparent !important; border: none !important;
  color: #f5f3ee !important; padding: 10px 14px !important;
  font-size: 14px !important;
}
.wp-block-search__input::placeholder { color: #6b6660 !important; }
.wp-block-search__button {
  background: #c8880a !important; color: #1c1a17 !important;
  border: none !important; font-weight: 700 !important;
  padding: 10px 18px !important; font-size: 13px !important;
}
