/*
Theme Name: Turkmen Students
Theme URI: https://turkmenstudents.com/
Author: TurkmenStudents.com
Description: A lightweight English news and magazine theme for students and the Turkmen Sahra community, featuring CSS-based Turkmen-inspired motifs and Customizer-managed homepage content.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Text Domain: turkmenstudents
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: news, blog, education, custom-logo, custom-menu, featured-images, translation-ready
*/

:root {
  --ts-bg: #f7f5f0;
  --ts-surface: #ffffff;
  --ts-text: #171615;
  --ts-muted: #6d6962;
  --ts-border: #ded9cf;
  --ts-accent: #8f1f2c;
  --ts-accent-2: #0d6b5a;
  --ts-gold: #c89b3c;
  --ts-radius: 14px;
  --ts-shadow: 0 12px 30px rgba(24,20,15,.07);
  --ts-container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ts-text);
  background: var(--ts-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ts-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid var(--ts-gold); outline-offset: 3px; }

.ts-container { width: min(calc(100% - 32px), var(--ts-container)); margin-inline: auto; }
.ts-skip-link { position: absolute; left: -9999px; top: auto; }
.ts-skip-link:focus { left: 16px; top: 16px; z-index: 9999; background: #fff; padding: 10px 14px; border-radius: 8px; }

/* Lightweight Turkmen-inspired geometric motif: pure CSS, no image request. */
.ts-motif {
  height: 8px;
  background:
    linear-gradient(135deg, transparent 25%, var(--ts-gold) 25% 36%, transparent 36% 64%, var(--ts-gold) 64% 75%, transparent 75%) 0 0/28px 8px,
    var(--ts-accent);
}

.site-header { background: rgba(255,255,255,.97); border-bottom: 1px solid var(--ts-border); position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 32px; }
.ts-header-inner { min-height: 76px; display: flex; align-items: center; gap: 28px; }
.site-branding { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.custom-logo { max-height: 52px; width: auto; }
.site-title { font-size: 1.15rem; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.site-title a { color: var(--ts-text); text-decoration: none; }
.site-description { color: var(--ts-muted); font-size: .78rem; margin: 3px 0 0; }

.ts-nav { margin-left: auto; }
.ts-nav ul { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; align-items: center; }
.ts-nav a { display: block; padding: 10px 11px; color: var(--ts-text); text-decoration: none; font-weight: 650; font-size: .93rem; border-radius: 8px; }
.ts-nav a:hover, .ts-nav .current-menu-item > a { background: #f2eee7; color: var(--ts-accent); }
.menu-toggle { display: none; margin-left: auto; border: 1px solid var(--ts-border); background: #fff; border-radius: 10px; padding: 9px 12px; cursor: pointer; }

.ts-hero { padding: 64px 0 46px; background: linear-gradient(180deg, #fff 0%, var(--ts-bg) 100%); overflow: hidden; position: relative; }
.ts-hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -100px; top: 18px; opacity: .10; transform: rotate(45deg); background: repeating-conic-gradient(from 45deg, var(--ts-accent) 0 12.5%, transparent 0 25%); }
.ts-hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.ts-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--ts-accent-2); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; }
.ts-eyebrow::before { content:""; width: 32px; height: 3px; background: var(--ts-gold); }
.ts-hero h1 { max-width: 800px; margin: 12px 0 16px; font-size: clamp(2.35rem, 5vw, 4.9rem); line-height: .98; letter-spacing: -.055em; }
.ts-hero p { color: var(--ts-muted); font-size: 1.1rem; max-width: 680px; margin: 0 0 24px; }
.ts-button { display: inline-flex; align-items: center; justify-content: center; background: var(--ts-accent); color: #fff; text-decoration: none; min-height: 46px; padding: 0 19px; border-radius: 10px; font-weight: 800; box-shadow: 0 8px 20px rgba(143,31,44,.18); }
.ts-button:hover { color: #fff; transform: translateY(-1px); }
.ts-hero-card { border: 1px solid var(--ts-border); background: var(--ts-surface); border-radius: var(--ts-radius); padding: 14px; box-shadow: var(--ts-shadow); }
.ts-hero-card .post-thumbnail { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 16/10; background: #ece8df; }
.ts-hero-card .post-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.ts-hero-card h2 { font-size: 1.35rem; line-height: 1.2; margin: 13px 4px 8px; }
.ts-hero-card h2 a { color: var(--ts-text); text-decoration: none; }
.ts-meta { color: var(--ts-muted); font-size: .82rem; }

.ts-section { padding: 50px 0; }
.ts-section + .ts-section { border-top: 1px solid var(--ts-border); }
.ts-section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.ts-section-title { margin: 0; font-size: clamp(1.65rem, 3vw, 2.2rem); letter-spacing: -.035em; line-height: 1.1; }
.ts-section-kicker { color: var(--ts-muted); margin: 6px 0 0; font-size: .94rem; }
.ts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.ts-card { background: var(--ts-surface); border: 1px solid var(--ts-border); border-radius: var(--ts-radius); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.ts-card:hover { transform: translateY(-2px); box-shadow: var(--ts-shadow); }
.ts-card-image { aspect-ratio: 16/9; overflow: hidden; background: #ece8df; }
.ts-card-image img { width: 100%; height: 100%; object-fit: cover; }
.ts-card-body { padding: 18px; }
.ts-card-category { color: var(--ts-accent-2); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.ts-card h3 { margin: 7px 0 9px; line-height: 1.25; font-size: 1.14rem; }
.ts-card h3 a { color: var(--ts-text); text-decoration: none; }
.ts-card p { color: var(--ts-muted); margin: 0; font-size: .92rem; }

.ts-content-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 42px; padding: 48px 0; }
.ts-content, .ts-sidebar { min-width: 0; }
.ts-page-header { margin-bottom: 28px; }
.ts-page-header h1 { font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.08; letter-spacing: -.045em; margin: 0 0 10px; }
.entry-title { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.08; letter-spacing: -.045em; margin: 0 0 12px; }
.entry-title a { color: var(--ts-text); text-decoration: none; }
.entry-content { font-size: 1.05rem; }
.entry-content > * { max-width: 760px; }
.entry-content > .alignwide { max-width: 980px; }
.entry-content > .alignfull { max-width: none; }
.entry-content h2, .entry-content h3 { line-height: 1.2; letter-spacing: -.025em; margin-top: 1.8em; }
.entry-content blockquote { border-left: 4px solid var(--ts-gold); margin-left: 0; padding-left: 20px; color: #49443d; }
.ts-featured-single { margin: 26px 0; border-radius: var(--ts-radius); overflow: hidden; }
.ts-post-list { display: grid; gap: 22px; }
.ts-post-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; background: #fff; border: 1px solid var(--ts-border); border-radius: var(--ts-radius); overflow: hidden; }
.ts-post-row .ts-card-image { aspect-ratio: auto; min-height: 160px; }
.ts-post-row .ts-card-body { padding: 18px 18px 18px 0; }

.widget { background: #fff; border: 1px solid var(--ts-border); padding: 20px; border-radius: var(--ts-radius); margin-bottom: 20px; }
.widget-title { margin: 0 0 12px; font-size: 1.05rem; }
.widget ul { padding-left: 18px; }

.navigation.pagination { margin-top: 30px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { min-width: 38px; min-height: 38px; display: inline-grid; place-items: center; border-radius: 8px; background: #fff; border: 1px solid var(--ts-border); text-decoration: none; }
.page-numbers.current { background: var(--ts-accent); color: #fff; border-color: var(--ts-accent); }

.site-footer { margin-top: 54px; background: #151311; color: #eee8df; }
.site-footer .ts-motif { height: 10px; }
.ts-footer-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 40px; padding: 46px 0 30px; }
.site-footer a { color: #fff; }
.ts-footer-title { font-size: 1.35rem; margin: 0 0 10px; }
.ts-footer-copy { color: #bbb3a7; max-width: 640px; }
.ts-footer-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 18px; }
.ts-footer-nav a { text-decoration: none; font-weight: 650; }
.ts-footer-bottom { border-top: 1px solid #302c27; padding: 17px 0 24px; color: #989188; font-size: .85rem; display: flex; justify-content: space-between; gap: 20px; }

.screen-reader-text { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

@media (max-width: 900px) {
  .admin-bar .site-header { top: 46px; }
  .menu-toggle { display: inline-flex; }
  .ts-nav { display: none; position: absolute; left: 16px; right: 16px; top: calc(100% + 8px); background: #fff; border: 1px solid var(--ts-border); border-radius: 12px; padding: 10px; box-shadow: var(--ts-shadow); }
  .ts-nav.is-open { display: block; }
  .ts-nav ul { display: block; }
  .ts-hero-grid, .ts-content-wrap, .ts-footer-grid { grid-template-columns: 1fr; }
  .ts-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ts-footer-nav ul { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .ts-container { width: min(calc(100% - 22px), var(--ts-container)); }
  .site-description { display: none; }
  .ts-header-inner { min-height: 66px; }
  .ts-hero { padding: 42px 0 32px; }
  .ts-hero-grid { gap: 28px; }
  .ts-grid { grid-template-columns: 1fr; }
  .ts-section { padding: 38px 0; }
  .ts-section-head { align-items: start; flex-direction: column; }
  .ts-post-row { grid-template-columns: 1fr; }
  .ts-post-row .ts-card-body { padding: 18px; }
  .ts-footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
