/*
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.0
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; }

/* ===== 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 (1 big + 2x2 pattern) ===== */
.pg-grid-block{ margin-bottom:20px; }
.pg-post-featured{
  background:var(--cat-bg,#FCEDF6); border-radius:12px; min-height:110px;
  display:flex; align-items:center; padding:16px 20px; gap:16px; margin-bottom:10px;
}
.pg-post-featured .pg-thumb{
  width:80px; height:80px; border-radius:8px; background:var(--cat-thumb,#F2B5E1); flex-shrink:0;
  overflow:hidden; display:flex; align-items:center; justify-content:center;
}
.pg-post-featured .pg-thumb img{ width:100%; height:100%; object-fit:cover; }
.pg-post-featured h3{ font-size:15px; font-weight:500; margin:0 0 4px; color:var(--cat-text,#5A1D48); }
.pg-post-featured .pg-cat-label{ font-size:12px; color:var(--pg-muted); }

.pg-grid-2x2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.pg-card{
  background:var(--cat-bg,#F3E9FB); border-radius:10px; padding:12px;
}
.pg-card .pg-thumb{
  background:var(--cat-thumb,#E0B7F4); border-radius:8px; height:90px; margin-bottom:8px;
  overflow:hidden; display:flex; align-items:center; justify-content:center;
}
.pg-card .pg-thumb img{ width:100%; height:100%; object-fit:cover; }
.pg-card h3{ font-size:13px; font-weight:500; margin:0; color:var(--cat-text,#3A1F4D); }

/* ===== 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; }
.pg-square-image{
  width:100%; margin:0 0 18px; aspect-ratio:4/3; border-radius:12px; 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-box{
  background:var(--cat-bg,#FCEDF6); border-radius:10px; padding:16px; 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-bottom:14px;
}
.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;
}

/* ===== 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; }
  .pg-post-featured{ padding:14px 16px; }
  .pg-post-featured .pg-thumb{ width:64px; height:64px; }
}

@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-cat-list{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:0; }
  .pg-cat-list li a{ margin-bottom:0; white-space:nowrap; }

  /* 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-2x2{ 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-post-featured{ padding:12px 14px; gap:12px; }
  .pg-post-featured .pg-thumb{ width:56px; height:56px; }
  .pg-footer{ padding:24px 14px; }
}