/*
Theme Name: Thingography Child
Template: generatepress
Version: 1.0
Description: Child theme for Thingography.com using GeneratePress
Author: ChatGPT
*/

/* ------------------------------
   Base fonts & layout
--------------------------------*/
@import url('https://fonts.googleapis.com/css2?family=Inter&family=Nunito:wght@400;600&display=swap');

body {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.entry-content { padding: 0 3rem; }

h1, h2, h3, h4, h5, h6, .main-title a {
  font-family: 'Nunito', sans-serif;
}

.main-title a {
  font-size: 32px;
  font-weight: 500;
  text-decoration: none;
}

/* Images scale by default */
img { max-width: 100%; height: auto; display: block; }

/* ------------------------------
   Homepage/category grids
--------------------------------*/
.thing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.thing-item {
  border: 1px solid #ccc;
  padding: 15px;
  text-align: center;
}

.thing-item img { max-width: 100%; height: auto; }

/* Category tiles on homepage */
.thing-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
  padding: 1rem;
}
.thing-category {
  background: #f5f5f5;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}
.thing-category:hover { transform: translateY(-5px); }
.thing-category h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.thing-category h2 a {
  color: #0aac8e;
  text-decoration: none;
  transition: color 0.3s ease;
}
.thing-category h2 a:hover { text-decoration: underline; color: #088c74; }
.thing-category p { font-size: 1rem; line-height: 1.5; }

/* Card grid used on category pages */
.thing-category-wrapper { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.thing-category-title { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 0 0 8px; }
.thing-category-description { margin: 0 0 24px; color: #555; font-style: italic; }

.thing-category-grid,
.thing-grid { /* support either class */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  align-items: stretch;
}

.thing-card,
.thing-category-item {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
.thing-card:hover,
.thing-category-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

.thing-thumb,
.thing-category-item a:first-child { display: block; }
.thing-thumb img,
.thing-category-item img { width: 100%; height: auto; margin: 0 auto; }

.thing-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 160px; background: #f3f3f3; color: #888; font-size: .95rem;
}

.thing-card-title,
.thing-category-item h2 { font-size: 1.06rem; line-height: 1.25; margin: 12px 12px 6px; }
.thing-card-title a,
.thing-category-item h2 a { color: #1f1f1f; text-decoration: none; }
.thing-card-title a:hover,
.thing-category-item h2 a:hover { text-decoration: underline; }

.thing-card p,
.thing-category-item p { margin: 0 14px 14px; color: #5a5a5a; font-size: .95rem; line-height: 1.45; }

.thing-card > *:last-child,
.thing-category-item > *:last-child { margin-bottom: 16px; }

/* Pagination */
.thing-pagination { margin: 28px 0 8px; text-align: center; }
.thing-pagination a,
.thing-pagination span {
  display: inline-block; margin: 0 5px 6px; padding: 8px 12px;
  background: #eee; border-radius: 6px; text-decoration: none; color: #222; font-size: .95rem;
}
.thing-pagination .current { background: #333; color: #fff; }
.thing-pagination a:hover { background: #ddd; }

/* Small screens */
@media (max-width: 480px) {
  .thing-grid,
  .thing-category-grid { grid-template-columns: 1fr; }
}

/* ------------------------------
   Posts: headings, paragraphs, media
--------------------------------*/
.blog .post-image img,
.archive .post-image img { max-width: 300px; height: auto; }

body.home h1.entry-title { display: none; }

.entry-title a { font-weight: 600; font-size: 1.0em; color: #0aac8e; }
.entry-title { padding-left: 30px; }

.post-image a img { text-align: center; margin: 0 auto; }

/* Section headings inside posts */
.entry-content h2 {
  font-size: 1.4em;
  line-height: 1.2;
  font-weight: 600;
  margin: 1.4em 0 0;        /* top space, no bottom gap */
  background: #eee;
  padding-left: 30px;
}

/* Remove extra gap when content follows a heading */
.entry-content h2 + p,
.entry-content h2 + ul,
.entry-content h2 + ol,
.entry-content h2 + blockquote { margin-top: 0; }

/* Paragraph rhythm inside posts */
.entry-content p {
  margin-top: 0;          /* avoid gap after headings */
  margin-bottom: 0.5em;
  padding-top: 1em;       /* site rhythm */
  padding-bottom: 0;
}

/* Optional h3 styling */
.entry-content h3 {
  font-size: 1.2em; line-height: 1.25; font-weight: 600;
  margin: 1.1em 0 0;
}
.entry-content h3 + p,
.entry-content h3 + ul,
.entry-content h3 + ol { margin-top: 0; }

/* Smaller “as of” date inside Availability heading */
.entry-content h2 .as-of-date { font-size: 0.65em; font-weight: normal; color: #666; }

/* Video credit */
.video-credit { font-size: 0.9em; color: #666; margin-top: 0.5em; }

/* Featured image block */
.featured-pick { text-align: center; margin: 1em auto; }
.featured-pick img {
  display: inline-block;
  max-width: 100%; height: auto;
  border: 1px solid #fff; border-radius: 4px;
}

/* Caption + hint: consistent gap using grid */
.featured-pick .caption {
  display: grid;
  row-gap: 0.4rem;        /* << controls space between caption text and hint */
  margin-top: 0.4rem;     /* space under image */
  margin-bottom: 0;       /* keep tight to next section */
  padding: 0;             /* override global p padding so featured/secondary match */
  font-size: 0.9em;
  color: #333;
  line-height: 1.4;
}
.featured-pick .caption .hint {
  display: block;         /* no extra margin; gap handled by grid */
  font-size: .82rem;
  color: #999;
}

/* Remove large featured image above single posts (GeneratePress default) */
.single .post-image,
.single .page-header-image,
.single .page-header-image-single { display: none !important; }

/* ------------------------------
   Quick Facts & Fun Facts lists
--------------------------------*/
/* Correct selector: class is on the UL itself */
ul.quick-facts,
ul.thing-fun-facts {
  margin: 1.5em 0;
  padding-left: 2.5rem;         /* indent to show bullets */
  list-style: disc outside;
}

/* Item spacing */
ul.quick-facts li,
ul.thing-fun-facts li {
  margin: 0.35rem 0;
  font-size: 0.95em;
}

/* ------------------------------
   Content blocks
--------------------------------*/
.thing-content {
  padding: 1.2em;
  font-size: 1.05em;
  line-height: 1.6;
}

/* Responsive video embeds */
iframe {
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: none;
}

/* Mobile tweaks */
@media screen and (max-width: 600px) {
  .thing-content { padding: 1em; font-size: 1em; }

  ul.quick-facts li,
  ul.thing-fun-facts li { margin-bottom: 0.5em; }

  .thing-fun-facts h3,
  .quick-facts h3 { font-size: 1.1em; }
}

/* ------------------------------
   Dark mode (optional)
--------------------------------*/
@media (prefers-color-scheme: dark) {
  .thing-card,
  .thing-category-item { background: #171717; box-shadow: 0 2px 12px rgba(0,0,0,.4); }
  .thing-card-title a,
  .thing-category-item h2 a { color: #f0f0f0; }
  .thing-card p,
  .thing-category-item p { color: #c7c7c7; }
  .thing-category-title { color: #f5f5f5; }
  .thing-category-description { color: #b7b7b7; }
  .thing-pagination a,
  .thing-pagination span { background: #2a2a2a; color: #eaeaea; }
  .thing-pagination .current { background: #f0f0f0; color: #111; }
}

/* ------------------------------
   Affiliate Image UX
   (tooltip + caption hint + screen-reader helper)
   Works on ANY anchor with data-tooltip="..."
--------------------------------*/

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Tooltip */
a[data-tooltip] {
  position: relative;
  display: inline-block;
}
a[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translate(-50%, 0);
  background: rgba(0,0,0,.85);
  color: #fff;
  font-size: 12px; line-height: 1;
  padding: 6px 8px; border-radius: 6px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease;
  z-index: 20;
}
a[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 50%; bottom: 100%;
  transform: translate(-50%, 4px);
  border: 6px solid transparent;
  border-top-color: rgba(0,0,0,.85);
  opacity: 0; transition: opacity .15s ease; z-index: 19;
}

/* Show on hover and keyboard focus */
a[data-tooltip]:hover::after,
a[data-tooltip]:focus::after,
a[data-tooltip]:hover::before,
a[data-tooltip]:focus::before { opacity: 1; }

/* Focus ring for linked images */
a[data-tooltip]:focus img { outline: 2px solid #0073aa; outline-offset: 2px; }

/* Disable tooltip on touch-only devices */
@media (hover: none) {
  a[data-tooltip]::before,
  a[data-tooltip]::after { display: none; }
}



/* Affiliate disclosure bar (above footer) */
.aff-disclosure{
  width:100%;
  box-sizing:border-box;
  background:#f5f5f7;
  color:#555;
  border-top:1px solid #e6e6ea;
  padding:12px 16px;
  text-align:center;
  font-size:.9rem;
  line-height:1.4;
}
.aff-disclosure p{ margin:0; }

/* Dark mode */
@media (prefers-color-scheme: dark){
  .aff-disclosure{
    background:#1e1f22;
    color:#c9c9cf;
    border-top-color:#2a2b2f;
  }
}


/* Link-level disclosure: show only on affiliate images */
@supports(selector(.featured-pick:has(a))) {
  .featured-pick:has(a[rel~="sponsored"]) .hint::after{
    content:" (affiliate link)";
    font-size:.8em;
    color:#888;
    margin-left:2px;
  }
}


.category-intro {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.25rem;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 10px;
}
.cat-hero {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 10px;
}
.cat-hero--new {
  background: #f0f8ff;
  border: 1px solid #cce0ff;
}

/*  for Block POst Grid */
/* Category intro block */
/* Cap the total grid width so each card isn't massive on big monitors */
.archive-grid--fixed3{
  max-width: 1200px;   /* adjust to taste: 1080–1280 works well */
  margin: 0 auto;
}

/* 3 / 2 / 1 columns */
.archive-grid--fixed3{
  display:grid; gap:20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1024px){
  .archive-grid--fixed3{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .archive-grid--fixed3{ grid-template-columns: 1fr; }
}

/* Card structure */
.post-card{ 
  background:#fff; border:1px solid #666 !important; border-radius:14px; overflow:hidden;
  display:flex; flex-direction:column;
}

/* Constrain image display height so it doesn't take over */
.post-card__thumb{ display:block; }
.post-card__img, .thumb-placeholder{
  width:100%;
  height: 240px;        /* <- shrink/enlarge here (200–280px is a sweet spot) */
  object-fit: cover;    /* crop to fill without distortion */
  background:#fff !important;
 }

/* Tidy text so it never "bleeds" strangely */
.post-card__title{ font-size:1.05rem; line-height:1.3; margin:.75rem .75rem 0; }
.post-card__title a{ text-decoration:none; }
.post-card__meta{ color:#777; font-size:.85rem; margin:.25rem .75rem; }
.post-card__excerpt{ margin:.5rem .75rem 1rem; color:#333; }

/* Optional: clamp lines to keep cards even height */
.post-card__title, .post-card__excerpt{
  display:-webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__title{ -webkit-line-clamp: 2; }
.post-card__excerpt{ -webkit-line-clamp: 3; }

/* Add this modifier class anywhere on the parent to switch behavior */
.archive-grid--contain .post-card__thumb img{ object-fit: contain; }

/* fix for post sway */
/* 1) Kill horizontal scroll caused by any rogue wide element */
html, body { max-width: 100%; overflow-x: hidden; }

/* 2) Make ALL images responsive */
.entry-content img,
.thing-content img,
.featured-pick img,
.wp-block-image img {
  max-width: 100%;
  height: auto;
}

/* 3) Make YouTube/video iframes responsive (no 560px overflow) */
.entry-content iframe,
.thing-content iframe,
.wp-block-embed__wrapper iframe,
.wp-block-video iframe {
  width: 100% !important;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  display: block;
}

/* 4) Gutenberg wide/full blocks shouldn’t exceed the screen on mobile */
.alignwide, .alignfull {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 5) Tables & code blocks shouldn’t blow out the layout */
.entry-content table, .thing-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
pre, code, .wp-block-code {
  white-space: pre-wrap;
  word-break: break-word;
}

/* 6) Avoid 100vw pitfalls (scrollbar math causes tiny overflow) */
[class*="full-width"], [style*="100vw"] {
  width: 100% !important;
  max-width: 100% !important;
}

/* 7) Give the content breathing room on small screens */
@media (max-width: 480px){
  .site-content, .content-area, .inside-article, .entry-content {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* 8) Our archive grid (from earlier) stays within the viewport */
.archive-grid--fixed3 { max-width: 1200px; margin: 0 auto; }
.post-card__thumb { aspect-ratio: 1 / 1; overflow: hidden; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }



/* fix text post width - leave Header % footer alone */

@media (max-width: 480px){
  /* undo earlier padding that made content look narrower */
  .site-content,
  .content-area,
  .inside-article,
  .entry-content{
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
  }

  /* small inner gutter so text isn’t touching the screen edge */
  .entry-content > *{
    padding-left: 10px;
    padding-right: 10px;
  }
}
/*  CSS for Guess Reveal  */
/* Answer reveal styling */
.guess-reveal details{
  border:1px solid #e6e6e6; border-radius:10px; padding:.75rem 1rem; background:#fafafa;
}
.guess-reveal summary{
  font-weight:600; cursor:pointer; outline:none; list-style:none;
}
.guess-reveal summary::-webkit-details-marker{ display:none; } /* hide default triangle (WebKit) */
.guess-reveal details[open]{ background:#fff; }
.guess-reveal .guess-answer{ margin-top:.6rem; }
.guess-reveal .button{
  display:inline-block; margin-top:.5rem; padding:.5rem .8rem; border:1px solid #ddd;
  border-radius:8px; text-decoration:none;
}

.blog .guess-reveal,
.archive .guess-reveal { display: none; }

/* for content card */
.post-card--ar-4x3 .post-card__thumb { aspect-ratio: 4 / 3; }
.post-card--ar-16x9 .post-card__thumb { aspect-ratio: 16 / 9; }
.post-card--contain .post-card__thumb img { object-fit: contain; } /* optional no-crop */

/* Show the entire image inside the card (no cropping) */
.archive-grid--fixed3 .post-card__thumb{
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;      /* square slot; keep if you want uniform cards */
  overflow: hidden;
  background: #fff;         /* letterbox color if image isn't square */
  border-bottom: 1px solid #ddd;
}
.archive-grid--fixed3 .post-card__thumb img{
  position: absolute;
  inset: 0;
  width: 90% !important;
  height: 90% !important;
  max-width: none !important;
  object-fit: contain !important;   /* <-- key change */
  object-position: center center;    /* center the image */
  display: block;
  margin: 0 auto;
}
