/*
Theme Name: Aetomatic Minimal
Theme URI: https://aetomatic.com
Author: Aetomatic
Description: Ultra-clean, modern, minimal news theme for Aetomatic with responsive chat, square avatars, working resize handle, infinite scroll, and social sharing.
Version: 1.3.0
*/

/* ==========================================================================
   1. RESET & GLOBAL LAYOUT RULES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  background-color: #ffffff;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.8;
  overflow-x: hidden;
}

body {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px 60px 20px;
}

/* ==========================================================================
   GLOBAL LINK COLOR OVERRIDES (REMOVED BLUE LINKS)
   ========================================================================== */
a, 
a:link, 
a:visited, 
a:active {
  color: #0f172a !important; /* Dark Slate / Theme primary text color */
  text-decoration: none !important;
}

a:hover {
  color: #475569 !important; /* Muted Slate on hover */
  text-decoration: underline !important;
}

/* Chat user links & navigation overrides */
.chat-msg-user,
nav.main-nav a,
.entry-title a {
  color: #0f172a !important;
}

nav.main-nav a:hover,
.entry-title a:hover {
  color: #475569 !important;
}

/* ==========================================================================
   2. HEADER & LOGO STYLING
   ========================================================================== */
header {
  text-align: center;
  padding: 30px 0 20px 0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 30px;
}

.site-branding {
  text-align: center;
  margin-bottom: 10px;
}

.custom-logo-link {
  display: inline-block !important;
}

.custom-logo-link img,
.site-branding img {
  max-width: 140px !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 auto !important;
  display: block !important;
}

nav.main-nav {
  margin-top: 15px;
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

nav.main-nav a {
  color: #475569;
  font-weight: 600;
  font-size: 1rem;
}

nav.main-nav a:hover {
  color: #0f172a;
}

/* ==========================================================================
   3. CHATBOX CONTAINER & WORKING RESIZE ENGINE
   ========================================================================== */
#aetomatic-chatbox {
  width: 100% !important;
  max-width: 650px !important;
  margin: 20px auto 10px auto !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  overflow: hidden !important;
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08) !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

.chat-header {
  background: #0f172a !important;
  color: #ffffff !important;
  padding: 10px 16px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  text-align: center !important;
}

/* MESSAGES CONTAINER WITH WORKING RESIZE HANDLE */
#chat-messages {
  min-height: 180px !important;
  max-height: 600px !important;
  flex-basis: 250px; /* Allows starting height without locking manual drag */
  resize: vertical !important; /* Enables manual browser drag handle */
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 12px !important; /* Matches 12px padding on form below */
  background: #f8fafc !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

/* ==========================================================================
   4. CHAT BUBBLE & SQUARE AVATAR ALIGNMENT
   ========================================================================== */
.chat-msg {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  margin-bottom: 8px !important;
  text-align: left !important;
  box-sizing: border-box !important;
}

/* Square Profile Photo (42px x 42px) */
.chat-msg-avatar {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  border-radius: 8px !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  border: 1px solid #cbd5e1 !important;
  box-sizing: border-box !important;
}

/* Chat Cloud (Matches 42px Avatar Height & Flush Right Alignment) */
.chat-msg-bubble {
  min-height: 42px !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  font-size: 0.85rem !important;
  line-height: 1.35 !important;
  color: #1e293b !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  text-align: left !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.chat-msg-header {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-bottom: 1px !important;
  line-height: 1 !important;
}

/* ==========================================================================
   CHATBOX USERNAME COLOR OVERRIDES (REMOVED BLUE)
   ========================================================================== */
/* Chat message header username */
.chat-msg-user {
  font-weight: 700 !important;
  color: #0f172a !important; /* Dark Slate instead of blue */
  font-size: 0.8rem !important;
}

.chat-msg-time {
  font-size: 0.68rem !important;
  color: #94a3b8 !important;
  font-weight: 500 !important;
}

.chat-msg-media img,
.chat-msg-media video {
  max-width: 100% !important;
  max-height: 180px !important;
  border-radius: 6px !important;
  margin-top: 6px !important;
  display: block !important;
  object-fit: cover !important;
}

/* ==========================================================================
   5. INPUT FORM LAYOUT (FLUSH ALIGNED INLINE BAR)
   ========================================================================== */
#chat-form {
  padding: 12px !important; /* Exact same 12px horizontal boundary as #chat-messages */
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.chat-input-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.chat-avatar-upload {
  cursor: pointer !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
}

#avatar-preview {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  border-radius: 8px !important;
  object-fit: cover !important;
  border: 1px solid #cbd5e1 !important;
  box-sizing: border-box !important;
  display: block !important;
}

/* Chat input field for username */
#chat-username {
  height: 42px !important;
  min-height: 42px !important;
  width: 85px !important;
  flex-shrink: 0 !important;
  padding: 0 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  color: #0f172a !important; /* Dark Slate text */
  box-sizing: border-box !important;
  margin: 0 !important;
}
#chat-input {
  height: 42px !important;
  min-height: 42px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  padding: 0 12px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.chat-file-btn {
  height: 42px !important;
  min-height: 42px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.2rem !important;
  cursor: pointer !important;
  padding: 0 4px !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

#chat-send {
  height: 42px !important;
  min-height: 42px !important;
  background: #0f172a !important;
  color: #ffffff !important;
  border: none !important;
  padding: 0 16px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

#chat-send:hover {
  background: #2563eb !important;
}

/* File preview text below chat input */
#file-chosen-preview {
  font-size: 0.75rem !important;
  color: #475569 !important; /* Muted Slate instead of blue */
  margin-top: 4px !important;
  padding-left: 50px !important;
}

/* ==========================================================================
   6. ARTICLE & TYPOGRAPHY STYLING
   ========================================================================== */
article.post {
  margin-bottom: 50px;
  padding-bottom: 30px;
  border-bottom: 1px solid #f1f5f9;
}

h1.entry-title, h2.entry-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
  text-align: center;
  margin-bottom: 12px;
}

.post-meta {
  text-align: center;
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 20px;
}

.featured-image img, .entry-content img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
  display: block;
  margin: 1.5rem auto;
}

.entry-content {
  font-size: 1.2rem;
  color: #1e293b;
}

.entry-content p {
  margin-bottom: 1.5rem;
  line-height: 1.85;
}

/* ==========================================================================
   7. SOCIAL SHARING & FOOTER
   ========================================================================== */
.share-container {
  margin: 30px 0 15px 0;
  padding: 15px 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
}

.share-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 10px;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff !important;
  text-decoration: none !important;
}

.share-x { background-color: #000000; }
.share-fb { background-color: #1877f2; }
.share-linkedin { background-color: #0a66c2; }
.share-wa { background-color: #25d366; }

#infinite-loader {
  text-align: center;
  padding: 20px;
  font-weight: 600;
  color: #64748b;
  display: none;
}

footer {
  text-align: center;
  padding-top: 30px;
  font-size: 0.85rem;
  color: #94a3b8;
  border-top: 1px solid #f1f5f9;
}

/* ==========================================================================
   8. SMARTPHONE & IPHONE 16 RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 600px) {
  #chat-messages { 
    flex-basis: 210px !important; 
    padding: 10px !important; 
  }
  
  #chat-input { 
    font-size: 16px !important; /* Prevents iOS auto-zoom on click */
  }
  
  #chat-username { 
    width: 75px !important; 
  }
}