/* ===========================
   INNER PAGE STYLES
=========================== */

/* BREADCRUMB */
.breadcrumb {
  font-size: 12px;
  color: #888;
  margin-bottom: 15px;
  font-family: sans-serif;
}
.breadcrumb a { color: var(--teal); }
.breadcrumb a:hover { text-decoration: underline; }

/* ARTICLE LAYOUT */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  padding: 15px 0;
}

/* ARTICLE MAIN */
.article-main { min-width: 0; }

.article-tag {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 10px;
  font-weight: 600;
}

.article-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  color: #111;
}

.article-meta {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: #888;
  margin-bottom: 12px;
  font-family: sans-serif;
  flex-wrap: wrap;
}
.article-meta span i { margin-right: 5px; color: var(--teal); }

.article-share {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 13px;
}
.share-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
}
.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #1da1f2; }
.share-btn.wa { background: #25d366; }

.article-img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 20px;
  max-height: 500px;
  /* object-fit: cover; */
}

.article-content p {
  margin-bottom: 15px;
  font-size: 16px;
  line-height: 1.85;
  color: #333;
}
.article-content h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 20px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--teal);
}

.article-note {
  background: #e0f7fa;
  border-left: 4px solid var(--teal);
  padding: 12px 15px;
  border-radius: 4px;
  font-size: 13px;
  color: #333;
  margin: 20px 0;
}
.article-note i { color: var(--teal); margin-right: 8px; }

.article-tags {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.article-tags span { color: #666; font-weight: 600; }
.article-tags a {
  background: #f0f0f0;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: #555;
  transition: background 0.2s;
}
.article-tags a:hover { background: var(--teal); color: #fff; }

/* RELATED ARTICLES */
.related-section {
  margin-top: 25px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.related-card {
  display: block;
  padding: 12px;
  border-right: 1px solid #eee;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
  text-decoration: none;
}
/* Remove right border on last column, bottom border on last row */
.related-card:nth-child(3n) { border-right: none; }
.related-card:last-child,
.related-card:nth-last-child(2):nth-child(3n+1),
.related-card:nth-last-child(3):nth-child(3n+1) { border-bottom: none; }
.related-card:hover { background: var(--teal-light); }

/* Fixed-ratio image wrapper — all cards same height */
.related-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 8px;
  background: #eee;
}
.related-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.related-card:hover .related-card-img img { transform: scale(1.04); }

/* Legacy — keep for video page which uses inline img */
.related-card > img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 8px;
  display: block;
}
.related-card p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .related-card:nth-child(3n) { border-right: 1px solid #eee; }
  .related-card:nth-child(2n) { border-right: none; }
}
@media (max-width: 480px) {
  .related-grid { grid-template-columns: 1fr; }
  .related-card { border-right: none; }
}

/* Responsive video embed wrapper (16:9) */
.video-embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  margin-bottom: 20px;
}
.video-embed-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ARTICLE SIDEBAR */
.article-sidebar { min-width: 0; }

.widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 15px;
}
.widget-list { padding: 8px; }
.widget-item {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  align-items: flex-start;
}
.widget-item:last-child { border-bottom: none; }
.widget-item img {
  width: 65px;
  height: 50px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}
.widget-item span {
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.widget-item:hover span { color: var(--teal); }

.ad-widget { padding: 10px; }
.ad-widget .ad-placeholder-box {
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 13px;
  font-family: sans-serif;
  border-radius: 4px;
}

.widget-videos { padding: 10px; }
.video-thumb {
  display: block;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}
.video-thumb img { width: 100%; height: 160px; object-fit: cover; }
.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  font-size: 40px;
  color: #ff0000;
  opacity: 0.9;
}
.video-thumb p {
  font-size: 12.5px;
  color: var(--text);
  margin-top: 8px;
  line-height: 1.5;
}

/* CATEGORY PAGE */
.category-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  padding: 15px 0;
}
.category-main { min-width: 0; }
.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--teal);
}
.category-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--teal-dark);
}
.category-header span {
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}
.article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.article-card:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.article-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.article-card-body { padding: 12px; }
.article-card-tag {
  font-size: 10px;
  background: var(--teal-light);
  color: var(--teal-dark);
  padding: 2px 8px;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 6px;
  font-weight: 600;
}
.article-card-body h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 8px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-body h3 a:hover { color: var(--teal); }
.article-card-meta {
  font-size: 11px;
  color: #999;
  font-family: sans-serif;
}
.article-card-meta i { margin-right: 4px; }

/* VIDEOS PAGE */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.video-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.video-card:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.video-card-thumb {
  position: relative;
  overflow: hidden;
}
.video-card-thumb img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: transform 0.3s;
}
.video-card:hover .video-card-thumb img { transform: scale(1.05); }
.video-card-thumb .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 44px;
  color: #ff0000;
}
.video-card-body { padding: 12px; }
.video-card-body h3 {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card-body .article-card-meta { margin-top: 6px; }

/* CONTACT PAGE */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 20px 0;
}
.contact-form-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 25px;
}
.contact-form-box h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--teal);
}
.form-group { margin-bottom: 15px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #444;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-tel);
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--teal); }
.form-group textarea { height: 120px; resize: vertical; }
.btn-submit {
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--font-tel);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-submit:hover { background: var(--teal-dark); }

.contact-info-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 25px;
}
.contact-info-box h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--teal);
}
.info-item {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.info-icon {
  width: 44px; height: 44px;
  background: var(--teal-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 18px;
  flex-shrink: 0;
}
.info-text h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.info-text p { font-size: 13px; color: #666; }

/* ABOUT PAGE */
.about-hero {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  padding: 50px 0;
  text-align: center;
  margin-bottom: 30px;
}
.about-hero h1 { font-size: 28px; margin-bottom: 10px; }
.about-hero p { font-size: 15px; opacity: 0.9; max-width: 600px; margin: 0 auto; }

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
.about-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 25px;
}
.about-box h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 15px;
  padding-left: 12px;
  border-left: 4px solid var(--teal);
}
.about-box p { font-size: 14px; line-height: 1.8; color: #444; margin-bottom: 10px; }

.team-section { margin-bottom: 30px; }
.team-section h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 20px;
  text-align: center;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.team-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: box-shadow 0.2s;
}
.team-card:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.team-card img {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 3px solid var(--teal-light);
}
.team-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.team-card p { font-size: 12px; color: var(--teal); }

/* RESPONSIVE INNER */
@media (max-width: 1024px) {
  .article-layout,
  .category-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
}

@media (max-width: 768px) {
  /* Article layout */
  .article-layout,
  .category-layout { grid-template-columns: 1fr; padding: 10px 0; }
  .article-sidebar { display: none; }

  /* Article title & meta */
  .article-title { font-size: 18px; line-height: 1.45; margin-bottom: 10px; }
  .article-meta { gap: 10px; font-size: 11px; margin-bottom: 10px; }
  .article-share { margin-bottom: 12px; }

  /* Featured image */
  .article-img {
    max-height: 240px;
    border-radius: 4px;
    margin-bottom: 14px;
  }

  /* Article body text */
  .article-content p { font-size: 15px; line-height: 1.75; margin-bottom: 12px; }
  .article-content h2 { font-size: 16px; margin: 16px 0 8px; }

  /* "ఇది కూడా చదవండి" links inside content */
  .article-content a {
    color: var(--teal);
    word-break: break-word;
  }

  /* Tags */
  .article-tags { margin-top: 14px; gap: 6px; }
  .article-tags a { font-size: 11px; padding: 3px 9px; }

  /* Related grid — 2 columns on tablet */
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .related-card:nth-child(3n) { border-right: 1px solid #eee; }
  .related-card:nth-child(2n) { border-right: none; }
  .related-card p { font-size: 12px; }

  /* Category & articles */
  .articles-grid { grid-template-columns: 1fr; }
  .videos-grid { grid-template-columns: 1fr 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .about-content { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr 1fr; }

  /* Prevent horizontal overflow from CMS content */
  .article-main,
  .article-content { overflow-x: hidden; max-width: 100%; }
  .article-content img,
  .article-content table { max-width: 100% !important; height: auto !important; }
  .article-content table { display: block; overflow-x: auto; }
  /* Responsive iframes inside article content (CMS-inserted) */
  .article-content iframe {
    max-width: 100% !important;
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  /* Article */
  .article-title { font-size: 16px; }
  .article-img { max-height: 200px; }
  .article-content p { font-size: 14px; }

  /* Related — single column on phones */
  .related-grid { grid-template-columns: 1fr; }
  .related-card { border-right: none; }

  /* Other grids */
  .videos-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }

  /* Breadcrumb */
  .breadcrumb { font-size: 11px; }
  .breadcrumb span { display: none; } /* hide long article title in breadcrumb */
}

/* ===========================
   TAG PAGE — article list
=========================== */
.tag-article-item {
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s;
  align-items: flex-start;
}
.tag-article-item:last-child { border-bottom: none; }
.tag-article-item:hover { background: #f5fdfd; }
.tag-article-item img {
  width: 110px;
  height: 75px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.tag-article-text { flex: 1; min-width: 0; }
.tag-article-text h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 6px;
  color: var(--text);
  transition: color 0.2s;
}
.tag-article-item:hover .tag-article-text h3 { color: var(--teal); }
.tag-article-date {
  font-size: 11px;
  color: #999;
  font-family: sans-serif;
}
.tag-article-date i { margin-right: 4px; color: var(--teal); }

/* ===========================
   TAG PAGE — pagination
=========================== */
.tag-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 20px;
}
.tag-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 13px;
  font-family: sans-serif;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
}
.tag-page-btn:hover {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.tag-page-btn.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  cursor: default;
}
.tag-page-btn.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}
.tag-page-ellipsis {
  font-size: 14px;
  color: #999;
  padding: 0 4px;
  line-height: 36px;
}
