/*
Theme Name: Prompt Gallery
Theme URI: https://promptgallery.pro
Author: Prompt Gallery
Description: Custom theme for Prompt Gallery - a free AI photo prompt gallery site.
Version: 1.1
Text Domain: promptsgallery
*/

:root{
  --pg-bg:#FFFFFF;
  --pg-text:#2C2C2A;
  --pg-text-light:#5A5A5A;
  --pg-muted:#9A93AA;
  --pg-border:#EEEEEE;
  --pg-accent:#7C3AED;
  --pg-accent-dark:#5A2E75;
}

*{box-sizing:border-box;}

/* Browsers don't make form controls inherit the body font by default —
   without this, buttons/inputs/selects showed the system default font
   instead of Poppins/Inter, breaking the site's typography consistency. */
button, input, select, textarea{ font-family:inherit; }

body{
  margin:0;
  font-family:'Poppins','Inter',Arial,sans-serif;
  background:var(--pg-bg);
  color:var(--pg-text);
  font-size:15px;
  line-height:1.6;
}

a{ text-decoration:none; color:inherit; }
img{ max-width:100%; display:block; }
ul{ list-style:none; margin:0; padding:0; }

.pg-container{ max-width:1200px; margin:0 auto; padding:0 20px; }

/* ===== Header ===== */
.pg-header{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:16px 20px; border-bottom:1px solid var(--pg-border); flex-wrap:wrap;
}
.pg-logo{ font-size:19px; font-weight:600; color:var(--pg-accent-dark); flex-shrink:0; }
.pg-search{
  flex:1; max-width:320px; background:#F5F3FA; border-radius:8px; padding:9px 14px;
  display:flex; align-items:center; gap:8px;
}
.pg-search input{ border:none; background:transparent; outline:none; font-size:13px; width:100%; }
.pg-header-right{ display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.pg-submit-request{ color:var(--pg-accent); font-weight:500; font-size:13px; }
.pg-social-icons{ display:flex; gap:12px; }
.pg-social-icons a{ font-size:18px; }

/* ===== Mobile menu toggle + drawer =====
   Hidden unconditionally by default (not just via the mobile media query)
   so there is zero effect on desktop even if JS runs unexpectedly. It's
   only switched on inside the max-width:780px block below. */
.pg-menu-toggle{
  display:none; align-items:center; justify-content:center; width:34px; height:34px;
  border-radius:8px; background:#F5F3FA; border:none; color:var(--pg-accent-dark);
  cursor:pointer; flex-shrink:0; padding:0;
}
.pg-mobile-drawer{ display:none; }
.pg-mobile-drawer-overlay{ position:absolute; inset:0; background:rgba(44,44,42,.45); }
.pg-mobile-drawer-panel{
  position:relative; width:78%; max-width:280px; height:100%; background:#fff;
  padding:16px; box-sizing:border-box; overflow-y:auto;
  transform:translateX(-100%); transition:transform .25s ease;
}
.pg-mobile-drawer-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.pg-menu-close{
  width:28px; height:28px; border-radius:6px; background:#F5F3FA; border:none;
  display:flex; align-items:center; justify-content:center; color:var(--pg-accent-dark); cursor:pointer; padding:0;
}
.pg-mobile-drawer-foot{
  border-top:1px solid var(--pg-border); margin-top:16px; padding-top:16px;
  display:flex; flex-direction:column; align-items:flex-start; gap:12px;
}

/* ===== Primary menu (optional — only appears if a menu is assigned
   under Appearance > Menus > Primary Menu; hidden otherwise) ===== */
.pg-primary-menu-list{ display:flex; gap:16px; flex-wrap:wrap; margin:0; padding:0; list-style:none; }
.pg-primary-menu-list a{ font-size:13px; color:#4A4A4A; font-weight:500; }
.pg-primary-menu-list a:hover{ color:var(--pg-accent); }

/* ===== Breadcrumbs ===== */
.pg-breadcrumbs{
  padding:10px 20px; border-bottom:1px solid var(--pg-border);
  font-size:12px; color:var(--pg-muted);
}
.pg-breadcrumbs a{ color:var(--pg-accent-dark); }
.pg-breadcrumbs .sep{ margin:0 6px; }

/* ===== Layout ===== */
.pg-layout{ display:flex; align-items:flex-start; }
.pg-sidebar{
  width:180px; flex-shrink:0; padding:20px 14px; border-right:1px solid var(--pg-border);
}
.pg-sidebar-right{ border-right:none; border-left:1px solid var(--pg-border); }
.pg-sidebar-title{
  font-size:11px; color:var(--pg-muted); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:10px;
}
.pg-cat-list{ margin-bottom:22px; }
.pg-cat-list li a{
  display:block; font-size:13px; padding:7px 10px; border-radius:6px; color:#4A4A4A; margin-bottom:2px;
}
.pg-cat-list li.active a, .pg-cat-list li a:hover{ background:var(--cat-bg,#F5F3FA); color:var(--cat-text,#3A2E4D); }

.pg-tag-list{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:22px; }
.pg-tag-list a{
  font-size:11.5px; padding:5px 11px; border-radius:14px; background:#F5F3FA; color:#4A4A4A;
}
.pg-tag-list a:hover{ background:var(--pg-accent); color:#fff; }

.pg-related-list{ display:flex; flex-direction:column; gap:10px; }
.pg-related-list a{ display:flex; gap:8px; align-items:center; }
.pg-related-thumb{
  width:36px; height:36px; border-radius:6px; flex-shrink:0; background:var(--cat-thumb,#F2B5E1);
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.pg-related-thumb img{ width:100%; height:100%; object-fit:cover; }
.pg-related-list span{ font-size:12px; color:#4A4A4A; line-height:1.3; }

.pg-content{ flex:1; padding:20px; min-width:0; }

/* ===== Post Grid (pure 2-column grid) ===== */
/* max-width caps how wide the grid gets, so each card's width — and its
   4:3-derived image height — stays limited instead of stretching to fill
   very wide screens. */
.pg-grid-only{ display:grid; grid-template-columns:1fr 1fr; gap:16px; max-width:820px; margin:0 auto; }
.pg-card{
  background:var(--cat-bg,#F3E9FB); border-radius:12px; overflow:hidden;
}
.pg-card a{ display:block; }
.pg-card .pg-thumb{
  width:100%; aspect-ratio:4/3; background:var(--cat-thumb,#E0B7F4);
  overflow:hidden; display:flex; align-items:center; justify-content:center;
}
/* object-fit:contain keeps the whole featured image visible, whatever its
   own aspect ratio is, instead of cropping it to fill the 4:3 box. */
.pg-card .pg-thumb img{ width:100%; height:100%; object-fit:contain; }
.pg-card h3{ font-size:14px; font-weight:500; margin:12px 14px 8px; color:var(--cat-text,#3A1F4D); }
.pg-card-tags{ display:flex; flex-wrap:wrap; gap:6px; margin:0 14px 14px; }
.pg-card-tag{
  display:inline-block; font-size:11px; color:var(--cat-text,#3A1F4D);
  background:rgba(255,255,255,0.55); padding:3px 9px; border-radius:6px;
}
.pg-card-tag:hover{ background:rgba(255,255,255,0.85); }

/* ===== Search results grid ===== */
.pg-search-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; }

/* ===== Pagination ===== */
.pg-pagination{ display:flex; justify-content:center; gap:6px; margin-top:20px; flex-wrap:wrap; }
.pg-pagination a, .pg-pagination span{
  min-width:28px; height:28px; padding:0 6px; border-radius:6px; border:1px solid #E3E3E3;
  color:#6B6B6B; display:flex; align-items:center; justify-content:center; font-size:12px;
}
.pg-pagination .current{ background:var(--pg-accent); color:#fff; border-color:var(--pg-accent); }

/* ===== Category page header ===== */
.pg-cat-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; gap:10px; }
.pg-cat-header h1{ font-size:19px; font-weight:500; margin:0; }
.pg-cat-header .pg-count{ font-size:12px; color:var(--pg-muted); }
.pg-sort select{ padding:8px 10px; border-radius:8px; border:1px solid #E3E3E3; font-size:13px; }

/* ===== Single post ===== */
.pg-single-title{ font-size:28px; font-weight:600; line-height:1.25; margin:0 0 16px; }
.pg-single-featured{
  border-radius:12px; overflow:hidden; margin-bottom:16px; background:var(--cat-thumb,#F2B5E1);
  aspect-ratio:4/3; display:flex; align-items:center; justify-content:center;
}
.pg-single-featured img{ width:100%; height:100%; object-fit:cover; }
.pg-intro p{ font-size:13.5px; color:var(--pg-text-light); line-height:1.8; margin-bottom:14px; }
/* Merged image + prompt card */
.pg-prompt-card{
  border:1px solid var(--pg-border,#E3E3E3); border-radius:12px; overflow:hidden;
  margin-bottom:18px; background:var(--cat-bg,#FCEDF6);
}
.pg-square-image{
  width:100%; margin:0; aspect-ratio:4/3; overflow:hidden;
  background:var(--cat-thumb,#F2B5E1); display:flex; align-items:center; justify-content:center;
}
.pg-square-image img{ width:100%; height:100%; object-fit:cover; }
.pg-prompt-card-body{ padding:16px; }
.pg-prompt-box{ margin-bottom:14px; }
.pg-prompt-box .label{ font-size:12px; color:var(--pg-muted); margin-bottom:6px; }
.pg-prompt-box .text{ font-size:13.5px; color:var(--cat-text,#5A1D48); line-height:1.7; }
.pg-copy-btn{
  width:100%; background:var(--pg-accent); color:#fff; border:none; border-radius:8px;
  padding:12px; font-size:14px; cursor:pointer; display:flex; align-items:center; justify-content:center;
  gap:8px; margin:0;
}
.pg-copy-btn.copied{ background:#22A06B; }
.pg-share-row{ display:flex; align-items:center; gap:12px; padding-top:12px; border-top:1px solid var(--pg-border); }
.pg-share-row .label{ font-size:12px; color:var(--pg-muted); }
.pg-share-btn{
  width:36px; height:36px; border-radius:50%; border:1px solid #E3E3E3; background:#fff;
  display:flex; align-items:center; justify-content:center; font-size:16px; cursor:pointer;
}

/* ===== Inline internal-link box (auto-inserted between prompt cards) — image-only thumbnails ===== */
.pg-inline-related{
  margin:4px 0 18px;
}
.pg-inline-related-heading{
  font-size:13px; font-weight:500; color:#6B6B68; margin:0 0 12px;
}
.pg-inline-related-grid{
  display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:12px;
}
.pg-inline-related-thumb{
  display:block; text-decoration:none; min-width:0;
  transition:opacity .15s ease, transform .15s ease;
}
.pg-inline-related-thumb:hover{ opacity:.9; transform:translateY(-2px); }
.pg-inline-related-img{
  display:block; width:100%; aspect-ratio:1/1; border-radius:10px; overflow:hidden;
  border:1px solid var(--pg-border,#E3E3E3);
}
.pg-inline-related-img img{
  width:100%; height:100%; object-fit:cover; display:block;
}
.pg-inline-related-title{
  display:block; margin-top:6px; font-size:12px; font-weight:500; color:#1a1a1a;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.4;
}

/* ===== Author bio box (end of single post) ===== */
.pg-author-box{
  display:flex; gap:20px; align-items:flex-start; margin-top:24px; padding:24px;
  border:1px solid var(--pg-border); border-radius:14px; background:#fff;
}
.pg-author-avatar{ border-radius:12px; width:90px; height:90px; object-fit:cover; flex-shrink:0; }
.pg-author-info h3{ font-size:19px; font-weight:600; margin:0 0 8px; }
.pg-author-info p{ font-size:14px; color:#4A4A4A; line-height:1.7; margin:0; }
.pg-author-badge{
  display:inline-block; margin-left:4px; font-size:12px; font-weight:500;
  background:var(--cat-bg,#EAF1FB); color:var(--cat-text,#123152); padding:4px 12px; border-radius:20px;
}

/* ===== Simple forms (contact, submit request) ===== */
.pg-form-page{ max-width:480px; margin:0 auto; padding:36px 20px; }
.pg-form-page h1{ font-size:20px; font-weight:500; margin:0 0 6px; }
.pg-form-page .desc{ font-size:13px; color:var(--pg-muted); margin-bottom:24px; line-height:1.6; }
.pg-field{ margin-bottom:16px; }
.pg-field label{ display:block; font-size:13px; color:#4A4A4A; margin-bottom:6px; }
.pg-field input[type=text], .pg-field input[type=email], .pg-field select, .pg-field textarea{
  width:100%; padding:10px 12px; border:1px solid #DDD; border-radius:8px; font-size:13px; font-family:inherit;
}
.pg-submit-btn{
  width:100%; background:var(--pg-accent); color:#fff; border:none; border-radius:8px;
  padding:12px; font-size:14px; cursor:pointer;
}
.pg-upload-box{
  border:1px dashed #D8D5E0; border-radius:8px; padding:20px; text-align:center; color:var(--pg-muted); cursor:pointer;
}

/* ===== Static content pages ===== */
.pg-static-page{ max-width:560px; margin:0 auto; padding:32px 20px; }
.pg-static-page h1{ font-size:20px; font-weight:500; margin-bottom:6px; }
.pg-static-page .updated{ font-size:12px; color:var(--pg-muted); margin-bottom:22px; }
.pg-static-page h2{ font-size:14px; font-weight:500; margin:20px 0 8px; }
.pg-static-page p{ font-size:13px; color:var(--pg-text-light); line-height:1.8; }
.pg-info-box{ background:#F5F3FA; border-radius:10px; padding:16px; margin-top:20px; font-size:12px; color:#5A5A5A; line-height:1.6; }

/* ===== Footer ===== */
.pg-footer{ background:#FAF9FC; padding:32px 20px; margin-top:30px; border-top:1px solid var(--pg-border); }
.pg-footer-grid{ display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:24px; margin-bottom:22px; max-width:1200px; margin-left:auto; margin-right:auto; }
.pg-footer-grid h4{ font-size:12px; color:var(--pg-muted); text-transform:uppercase; letter-spacing:0.5px; margin:0 0 10px; }
.pg-footer-grid ul li{ font-size:13px; color:#5A5A5A; margin-bottom:8px; }
.pg-footer-bottom{
  display:flex; align-items:center; justify-content:space-between; padding-top:16px; border-top:1px solid #E8E5EF;
  max-width:1200px; margin:0 auto; font-size:12px; color:var(--pg-muted); flex-wrap:wrap; gap:10px;
}
.pg-footer-bottom .pg-social-icons a{ font-size:17px; }

/* ===== Responsive ===== */

/* Tablet range (e.g. iPad portrait/landscape): keep the side-by-side layout
   but narrow the sidebar so content doesn't get squeezed — previously this
   range was untouched and just reused the full desktop layout. */
@media (max-width: 1024px){
  .pg-sidebar{ width:150px; padding:20px 10px; }
  .pg-cat-list li a{ font-size:12.5px; padding:6px 8px; }
  .pg-related-thumb{ width:32px; height:32px; }
}

@media (max-width: 780px){
  .pg-layout{ flex-direction:column; }
  .pg-sidebar{ width:100%; border-right:none; border-bottom:1px solid var(--pg-border); padding:14px 20px; }
  .pg-sidebar-right{ border-left:none; }
  .pg-sidebar .pg-cat-list{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:0; }
  .pg-sidebar .pg-cat-list li a{ margin-bottom:0; white-space:nowrap; }

  /* Categories move into the slide-in drawer on mobile, so the plain
     in-page list is hidden here (the "More in [category]" related list
     that shares this same sidebar is untouched and still shows below). */
  .pg-cat-block{ display:none; }

  /* Hamburger + drawer replace the desktop categories sidebar. */
  .pg-menu-toggle{ display:flex; }
  .pg-mobile-drawer.is-open{ display:block; position:fixed; inset:0; z-index:999; }
  .pg-mobile-drawer.is-open .pg-mobile-drawer-panel{ transform:translateX(0); }

  /* Submit-a-request + social icons move to the bottom of the drawer on
     mobile instead of crowding the header; footer's own copy of these
     (same markup, different place in the page) is untouched. */
  .pg-header .pg-submit-request,
  .pg-header .pg-social-icons{ display:none; }

  /* Related posts used to be display:none on mobile (content just vanished).
     Now shown as a horizontal-scrolling row instead of being dropped. */
  .pg-related-list{
    display:flex; flex-direction:row; gap:10px; overflow-x:auto; padding-bottom:6px;
    -webkit-overflow-scrolling:touch; scrollbar-width:thin;
  }
  .pg-related-list a{ flex-direction:column; align-items:flex-start; flex-shrink:0; width:88px; }
  .pg-related-thumb{ width:72px; height:72px; }
  .pg-related-list span{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

  .pg-grid-only{ grid-template-columns:1fr; }
  .pg-search{ order:3; max-width:100%; flex-basis:100%; }
  .pg-footer-grid{ grid-template-columns:1fr; }
  .pg-primary-menu{ order:4; flex-basis:100%; gap:12px; }
}

/* Small phones: tighten padding and type scale a bit further. */
@media (max-width: 420px){
  .pg-container{ padding:0 14px; }
  .pg-content{ padding:14px; }
  .pg-header{ padding:12px 14px; }
  .pg-single-title{ font-size:22px; }
  .pg-footer{ padding:24px 14px; }
}