/*
Theme Name: Tally Mena
Theme URI: https://tallymena.ae/
Author: Tally Mena
Author URI: https://tallymena.ae/
Description: WordPress theme for Tally Mena (tallymena.ae). Reproduces the Tally Mena Bootstrap front-end with page templates that mirror the live site, plus enhanced, modern blog templates.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tallymena
Tags: blog, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   Theme-owned styles.
   The site's original design system is loaded from assets/css/styles.min.css.
   Everything below only adds the enhanced blog experience and small helpers,
   all namespaced under .tm-* so the original design is never affected.
   ========================================================================== */

:root {
  --tm-primary: #2b68b2;
  --tm-primary-dark: #1f4f88;
  --tm-accent: #ffc735;
  --tm-ink: #1c2430;
  --tm-muted: #5c6b7f;
  --tm-surface: #ffffff;
  --tm-soft: #f1fbff;
  --tm-line: #e3ebf3;
  --tm-radius: 14px;
  --tm-shadow: 0 10px 30px rgba(28, 36, 48, .08);
  --tm-shadow-hover: 0 18px 44px rgba(28, 36, 48, .14);
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100000;
  padding: 12px 18px;
  background: var(--tm-accent);
  color: var(--tm-ink);
  border-radius: 0 0 8px 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
  top: 0;
}

/* ---------------------------------------------------------------- Blog hero */
.tm-blog-hero {
  background: linear-gradient(135deg, var(--tm-primary) 0%, #17365d 100%);
  color: #fff;
  padding: 64px 0 72px;
}

.tm-blog-hero h1 {
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -.02em;
  margin-bottom: .6rem;
}

.tm-blog-hero p {
  color: rgba(255, 255, 255, .85);
  max-width: 62ch;
  margin: 0 auto;
  font-size: 1.05rem;
}

.tm-blog-tools {
  max-width: 780px;
  margin: 2rem auto 0;
}

.tm-blog-search {
  border: 0;
  border-radius: 999px;
  padding: 15px 26px;
  font-size: 1rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

.tm-blog-search:focus {
  box-shadow: 0 0 0 4px rgba(255, 199, 53, .55);
  outline: none;
}

/* -------------------------------------------------------------- Topic chips */
.tm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin: 1.35rem auto 0;
  padding: 0;
  list-style: none;
}

.tm-chip {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .45);
  color: #fff;
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.tm-chip:hover,
.tm-chip:focus {
  background: var(--tm-accent);
  border-color: var(--tm-accent);
  color: var(--tm-ink);
}

.tm-chip.is-active {
  background: var(--tm-accent);
  border-color: var(--tm-accent);
  color: var(--tm-ink);
}

.tm-chip-count {
  opacity: .7;
  font-size: .78rem;
}

/* --------------------------------------------------------------- Post cards */
.tm-post-grid {
  --bs-gutter-y: 1.75rem;
}

.tm-post-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--tm-surface);
  border: 1px solid var(--tm-line);
  border-radius: var(--tm-radius);
  overflow: hidden;
  box-shadow: var(--tm-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}

.tm-post-card:hover,
.tm-post-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--tm-shadow-hover);
}

.tm-post-card__media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  background: var(--tm-soft);
  overflow: hidden;
}

.tm-post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.tm-post-card:hover .tm-post-card__media img {
  transform: scale(1.05);
}

.tm-post-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(43, 104, 178, .95);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
}

.tm-post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 1.15rem 1.25rem 1.35rem;
}

.tm-post-card__title {
  font-size: 1.09rem;
  font-weight: 650;
  line-height: 1.4;
  margin: 0 0 .55rem;
}

.tm-post-card__title a {
  color: var(--tm-ink);
  text-decoration: none;
}

.tm-post-card__title a:hover {
  color: var(--tm-primary);
}

.tm-post-card__excerpt {
  color: var(--tm-muted);
  font-size: .93rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.tm-post-card__meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--tm-muted);
  font-size: .8rem;
}

.tm-post-card__meta .tm-dot::before {
  content: "\2022";
}

/* --------------------------------------------------------- Enhanced single */
.tm-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--tm-accent);
  z-index: 1040;
  transition: width .1s linear;
}

.tm-article-header {
  background: linear-gradient(135deg, var(--tm-primary) 0%, #17365d 100%);
  color: #fff;
  padding: 56px 0 52px;
}

.tm-article-header h1 {
  font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.7rem);
  line-height: 1.22;
  letter-spacing: -.02em;
  margin: 0 0 1rem;
}

.tm-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .85rem;
  color: rgba(255, 255, 255, .85);
  font-size: .9rem;
}

.tm-article-meta img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.tm-article-body {
  font-size: 1.06rem;
  line-height: 1.78;
  color: #26303d;
}

.tm-article-body > *:first-child {
  margin-top: 0;
}

.tm-article-body h2 {
  margin: 2.4rem 0 .9rem;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--tm-ink);
  scroll-margin-top: 100px;
}

.tm-article-body h3 {
  margin: 1.9rem 0 .75rem;
  font-size: 1.25rem;
  font-weight: 650;
  color: var(--tm-ink);
  scroll-margin-top: 100px;
}

.tm-article-body p {
  margin-bottom: 1.15rem;
}

.tm-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.4rem 0;
}

.tm-article-body ul,
.tm-article-body ol {
  margin-bottom: 1.2rem;
  padding-left: 1.35rem;
}

.tm-article-body li {
  margin-bottom: .5rem;
}

.tm-article-body blockquote {
  border-left: 4px solid var(--tm-accent);
  background: var(--tm-soft);
  padding: 1.1rem 1.4rem;
  border-radius: 0 10px 10px 0;
  margin: 1.6rem 0;
  font-style: italic;
  color: #33404f;
}

.tm-article-body table {
  width: 100%;
  margin-bottom: 1.5rem;
  border-collapse: collapse;
}

.tm-article-body th,
.tm-article-body td {
  border: 1px solid var(--tm-line);
  padding: .65rem .8rem;
  text-align: left;
}

.tm-article-body th {
  background: var(--tm-soft);
}

.tm-article-body a {
  color: var(--tm-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Table of contents */
.tm-toc {
  background: var(--tm-soft);
  border: 1px solid var(--tm-line);
  border-radius: var(--tm-radius);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.75rem;
}

.tm-toc__label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tm-muted);
  margin-bottom: .6rem;
}

.tm-toc ol {
  margin: 0;
  padding-left: 1.2rem;
  font-size: .95rem;
}

.tm-toc li {
  margin-bottom: .35rem;
}

.tm-toc a {
  color: var(--tm-primary);
  text-decoration: none;
}

.tm-toc a:hover {
  text-decoration: underline;
}

/* Sticky sidebar */
.tm-sidebar {
  position: sticky;
  top: 96px;
}

.tm-share {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.25rem 0 0;
}

.tm-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--tm-line);
  background: #fff;
  color: var(--tm-primary);
  font-size: 1rem;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.tm-share__btn:hover {
  background: var(--tm-primary);
  border-color: var(--tm-primary);
  color: #fff;
}

.tm-author-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--tm-soft);
  border: 1px solid var(--tm-line);
  border-radius: var(--tm-radius);
  padding: 1.25rem;
  margin-top: 2.5rem;
}

.tm-author-box img {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0;
}

.tm-author-box h3 {
  margin: 0 0 .35rem !important;
  font-size: 1.05rem !important;
}

.tm-author-box p {
  margin: 0;
  font-size: .92rem;
  color: var(--tm-muted);
}

.tm-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 2rem;
}

.tm-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--tm-soft);
  border: 1px solid var(--tm-line);
  color: var(--tm-primary);
  font-size: .82rem;
  text-decoration: none;
}

.tm-tag:hover {
  background: var(--tm-primary);
  border-color: var(--tm-primary);
  color: #fff;
}

.tm-callout {
  background: var(--tm-primary);
  color: #fff;
  border-radius: var(--tm-radius);
  padding: 1.6rem 1.5rem;
  margin: 2.5rem 0;
  text-align: center;
}

.tm-callout h2,
.tm-callout h3 {
  color: #fff !important;
  margin-top: 0 !important;
}

.tm-callout p {
  color: rgba(255, 255, 255, .88);
}

.tm-btn-accent {
  display: inline-block;
  background: var(--tm-accent);
  color: var(--tm-ink);
  border: 1px solid var(--tm-accent);
  border-radius: 6px;
  padding: .7rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
}

.tm-btn-accent:hover {
  background: #f0b81f;
  border-color: #f0b81f;
  color: var(--tm-ink);
}

/* ------------------------------------------------------------- Blog archive */
.tm-pagination {
  margin-top: 2.5rem;
}

.tm-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  margin: 0 4px;
  border-radius: 10px;
  border: 1px solid var(--tm-line);
  background: #fff;
  color: var(--tm-ink);
  text-decoration: none;
  font-weight: 500;
}

.tm-pagination .page-numbers.current,
.tm-pagination .page-numbers:hover {
  background: var(--tm-primary);
  border-color: var(--tm-primary);
  color: #fff;
}

.tm-empty {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--tm-muted);
}

/* -------------------------------------------------------------- Forms/notices */
.tm-notice {
  border-radius: 10px;
  padding: .9rem 1.15rem;
  margin-bottom: 1.25rem;
  font-size: .95rem;
  border: 1px solid transparent;
}

.tm-notice--success {
  background: #e8f7ee;
  border-color: #b7e2c7;
  color: #1c6b3c;
}

.tm-notice--error {
  background: #fdeceb;
  border-color: #f6c6c2;
  color: #8f2b23;
}

.tm-hidden {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 991.98px) {
  .tm-sidebar {
    position: static;
  }
}
