/* Community Albums Plugin Styles */

/* Reset any theme interference */
.ca-posts-grid *,
.ca-post-card *,
.ca-post-link *,
.ca-post-image *,
.ca-post-overlay *,
.ca-post-text-card * {
  box-sizing: border-box !important;
}

/* Ensure no theme link styles interfere */
.ca-post-link,
.ca-post-link:hover,
.ca-post-link:focus,
.ca-post-link:visited {
  text-decoration: none !important;
  color: inherit !important;
  border: none !important;
  outline: none !important;
}

/* Ensure no theme list styles interfere */
.ca-posts-grid {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ca-posts-grid li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Community Post Submission Form */
.ca-submit-form{max-width:600px;margin:1rem 0;padding:1.5rem;border:1px solid #e2e8f0;border-radius:12px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,0.1)}
.ca-submit-form .ca-field{margin-bottom:1rem}
.ca-submit-form label{display:block;font-weight:600;color:#374151;margin-bottom:.5rem}
.ca-submit-form input[type="text"], .ca-submit-form input[type="email"], .ca-submit-form textarea{width:100%;padding:.75rem;border:1px solid #cbd5e1;border-radius:8px;font-size:1rem;transition:border-color .2s ease}
.ca-submit-form input[type="text"]:focus, .ca-submit-form input[type="email"]:focus, .ca-submit-form textarea:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,0.1)}

/* WYSIWYG Editor Styling */
.ca-wysiwyg-container{margin-top:.5rem;border:1px solid #cbd5e1;border-radius:8px;overflow:hidden}
.ca-wysiwyg-container .wp-editor-tabs{border-bottom:1px solid #cbd5e1;background:#f8fafc}
.ca-wysiwyg-container .wp-editor-tabs .wp-switch-editor{border:none;background:transparent;padding:.5rem 1rem;border-radius:0}
.ca-wysiwyg-container .wp-editor-tabs .wp-switch-editor:hover{background:#e2e8f0}
.ca-wysiwyg-container .wp-editor-tabs .wp-switch-editor.active{background:#3b82f6;color:#fff}
.ca-wysiwyg-container .wp-editor-wrap{border:none}
.ca-wysiwyg-container .mce-toolbar{border:none;background:#f8fafc}
.ca-wysiwyg-container .mce-toolbar .mce-btn{border:none;background:transparent}
.ca-wysiwyg-container .mce-toolbar .mce-btn:hover{background:#e2e8f0}
.ca-wysiwyg-container .mce-toolbar .mce-btn.mce-active{background:#3b82f6;color:#fff}
.ca-wysiwyg-container .mce-edit-area{border:none;border-top:1px solid #cbd5e1}
.ca-wysiwyg-container .mce-edit-area iframe{border:none;background:#fff}
.ca-submit-form input[type="file"]{width:100%;padding:.5rem;border:1px solid #cbd5e1;border-radius:8px;background:#fff}
.ca-submit-form button{padding:.75rem 1.5rem;border:0;border-radius:8px;cursor:pointer;background:#3b82f6;color:#fff;font-weight:600;font-size:1rem;transition:background-color .2s ease}
.ca-submit-form button:hover{background:#2563eb}
.ca-success{margin:.75rem 0;padding:.75rem 1rem;background:#ecfdf5;border:1px solid #10b98133;border-radius:8px;color:#065f46}
.ca-errors{margin:.75rem 0}
.ca-error{padding:.75rem 1rem;background:#fef2f2;border:1px solid #fecaca;border-radius:8px;color:#dc2626;margin-bottom:.5rem}
.ca-help{display:block;color:#6b7280;font-size:.875rem;margin-top:.25rem;font-style:italic}

/* File preview styles */
.ca-preview-container{margin-top:1rem;padding:1rem;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px}
.ca-preview-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px;margin-top:.5rem}
.ca-preview-item{position:relative;border-radius:8px;overflow:hidden;background:#fff;border:1px solid #e2e8f0;box-shadow:0 1px 3px rgba(0,0,0,0.1)}
.ca-preview-item img{width:100%;height:80px;object-fit:cover;display:block}
.ca-preview-info{padding:.5rem;font-size:.75rem}
.ca-preview-name{display:block;font-weight:500;color:#374151;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ca-preview-size{display:block;color:#6b7280;margin-top:.125rem}

/* Community Posts Grid */
.ca-posts-grid{display:grid !important;grid-template-columns:repeat(auto-fill,minmax(280px,1fr)) !important;gap:20px !important;margin:2rem 0 !important;list-style:none !important;padding:0 !important}
.ca-post-card{position:relative !important;border-radius:12px !important;overflow:hidden !important;background:#fff !important;box-shadow:0 4px 6px rgba(0,0,0,0.1) !important;transition:transform .3s ease, box-shadow .3s ease !important;margin:0 !important;padding:0 !important;border:none !important}
.ca-post-card:hover{transform:translateY(-4px) !important;box-shadow:0 8px 25px rgba(0,0,0,0.15) !important}

.ca-post-link{display:block !important;text-decoration:none !important;color:inherit !important;border:none !important;outline:none !important}

.ca-post-image{position:relative !important;width:100% !important;height:200px !important;overflow:hidden !important}
.ca-post-image img{width:100% !important;height:100% !important;object-fit:cover !important;transition:transform .3s ease !important;display:block !important;border:none !important}
.ca-post-card:hover .ca-post-image img{transform:scale(1.05) !important}

.ca-post-overlay{position:absolute !important;inset:0 !important;background:linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.3) 60%, rgba(0,0,0,0) 100%) !important;display:flex !important;align-items:flex-end !important;padding:1rem !important;color:#fff !important}
.ca-post-overlay-content{width:100% !important}

.ca-post-title{font-size:1.1rem !important;font-weight:700 !important;line-height:1.3 !important;margin:0 0 .5rem !important;color:#fff !important;text-shadow:0 1px 3px rgba(0,0,0,0.5) !important;text-decoration:none !important;border:none !important}
.ca-post-excerpt{font-size:.9rem !important;line-height:1.4 !important;margin:0 0 .5rem !important;color:rgba(255,255,255,0.9) !important;text-shadow:0 1px 2px rgba(0,0,0,0.5) !important;display:-webkit-box !important;-webkit-line-clamp:2 !important;-webkit-box-orient:vertical !important;overflow:hidden !important}
.ca-post-author{font-size:.85rem !important;color:rgba(255,255,255,0.8) !important;text-shadow:0 1px 2px rgba(0,0,0,0.5) !important;font-weight:500 !important;text-decoration:none !important;border:none !important}

/* Text-only cards for posts without images */
.ca-post-text-card{height:200px !important;background:linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;display:flex !important;align-items:center !important;justify-content:center !important;border-radius:12px !important;margin:0 !important;padding:0 !important;border:none !important}
.ca-post-text-content{text-align:center !important;padding:1rem !important;width:100% !important}
.ca-post-text-card .ca-post-title{color:#1f2937 !important;font-size:1.2rem !important;margin-bottom:.5rem !important;text-shadow:none !important;text-decoration:none !important;border:none !important;font-weight:700 !important}
.ca-post-text-card .ca-post-author{color:#6b7280 !important;font-size:.9rem !important;text-shadow:none !important;text-decoration:none !important;border:none !important;font-weight:500 !important}

/* Archive page styles */
.ca-posts-container{max-width:1200px;margin:0 auto;padding:2rem 1rem}
.ca-posts-header{text-align:center;margin-bottom:3rem}
.ca-posts-title{font-size:2.5rem;font-weight:700;color:#1f2937;margin-bottom:.5rem}
.ca-posts-description{font-size:1.1rem;color:#6b7280;max-width:600px;margin:0 auto}
.ca-posts-pagination{margin-top:3rem;text-align:center}
.ca-no-posts{text-align:center;padding:3rem 1rem;color:#6b7280}
.ca-no-posts h2{font-size:1.5rem;margin-bottom:.5rem;color:#1f2937}

/* Responsive adjustments */
@media (min-width: 768px){
  .ca-posts-grid{grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:24px}
  .ca-post-image{height:220px}
  .ca-post-title{font-size:1.2rem}
}

@media (min-width: 1024px){
  .ca-posts-grid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:28px}
  .ca-post-image{height:240px}
  .ca-post-title{font-size:1.25rem}
}

/* Single Post Styles */
.ca-single-post-container{max-width:900px;margin:0 auto;padding:2rem 1rem}
.ca-single-post{background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 8px 25px rgba(0,0,0,0.1)}

/* Preview Card Layout (for posts with featured images) */
.ca-post-preview-card{border-radius:16px 16px 0 0;overflow:hidden;position:relative}
.ca-post-preview-image{position:relative;width:100%;height:300px;overflow:hidden}
.ca-post-preview-image img{width:100%;height:100%;object-fit:cover}
.ca-post-preview-overlay{position:absolute;inset:0;background:linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.3) 60%, rgba(0,0,0,0) 100%);display:flex;align-items:flex-end;padding:2rem;color:#fff}
.ca-post-preview-content{width:100%}
.ca-post-preview-title{font-size:2.5rem;font-weight:700;line-height:1.2;margin:0 0 .5rem;color:#fff;text-shadow:0 2px 4px rgba(0,0,0,0.5)}
.ca-post-preview-author{font-size:1.1rem;color:rgba(255,255,255,0.9);text-shadow:0 1px 3px rgba(0,0,0,0.5);font-weight:500}

/* Header Layout (for posts without featured images) */
.ca-post-header{padding:3rem 3rem 2rem;text-align:center;background:linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);border-bottom:1px solid #e5e7eb}
.ca-post-title{font-size:2.5rem;font-weight:700;line-height:1.2;margin:0 0 1.5rem;color:#1f2937}
.ca-post-meta{display:flex;flex-wrap:wrap;justify-content:center;gap:2rem;font-size:1rem;color:#6b7280}
.ca-post-meta span{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:rgba(255,255,255,0.7);border-radius:20px;backdrop-filter:blur(10px)}

.ca-post-content{padding:3rem}
.ca-post-text{font-size:1.2rem;line-height:1.8;color:#374151;margin-bottom:3rem;text-align:justify}

.ca-post-gallery{margin:3rem 0;padding:2rem;background:#f8fafc;border-radius:12px;border:1px solid #e2e8f0}
.ca-post-gallery h3{font-size:1.5rem;font-weight:600;margin-bottom:1.5rem;color:#1f2937;text-align:center}
.ca-gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:1.5rem}
.ca-gallery-item{border-radius:12px;overflow:hidden;box-shadow:0 4px 12px rgba(0,0,0,0.1);transition:transform .3s ease, box-shadow .3s ease}
.ca-gallery-item:hover{transform:translateY(-4px);box-shadow:0 8px 25px rgba(0,0,0,0.15)}
.ca-gallery-link{display:block}
.ca-gallery-link img{width:100%;height:200px;object-fit:cover;transition:transform .3s ease}
.ca-gallery-link:hover img{transform:scale(1.05)}

.ca-post-pdf{margin:2rem 0;padding:1.5rem;background:#f8fafc;border-radius:8px;border:1px solid #e2e8f0}
.ca-post-pdf h3{font-size:1.25rem;font-weight:600;margin-bottom:1rem;color:#1f2937}
.ca-pdf-link{display:inline-flex;align-items:center;gap:.5rem;padding:.75rem 1rem;background:#3b82f6;color:#fff;text-decoration:none;border-radius:6px;font-weight:500;transition:background-color .3s ease}
.ca-pdf-link:hover{background:#2563eb}
.ca-pdf-link .dashicons{font-size:1.2rem}

.ca-post-footer{padding:2rem;border-top:1px solid #e5e7eb;background:#f8fafc}
.ca-post-navigation{display:flex;justify-content:space-between;margin-bottom:1rem}
.ca-nav-previous, .ca-nav-next{flex:1}
.ca-nav-next{text-align:right}
.ca-nav-previous a, .ca-nav-next a{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:#fff;color:#374151;text-decoration:none;border-radius:6px;border:1px solid #d1d5db;transition:all .3s ease}
.ca-nav-previous a:hover, .ca-nav-next a:hover{background:#f3f4f6;border-color:#9ca3af}

.ca-back-to-posts{text-align:center}
.ca-back-link{display:inline-flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;background:#6b7280;color:#fff;text-decoration:none;border-radius:6px;font-weight:500;transition:background-color .3s ease}
.ca-back-link:hover{background:#4b5563}

@media (max-width: 768px){
  .ca-single-post-container{padding:1rem}
  .ca-post-header, .ca-post-content, .ca-post-footer{padding:1.5rem}
  .ca-post-title{font-size:1.5rem}
  .ca-post-meta{flex-direction:column;gap:.5rem}
  .ca-post-navigation{flex-direction:column;gap:1rem}
  .ca-nav-next{text-align:left}
}
