/*
Theme Name: Chula AI
Theme URI: https://www.chula.ac.th/
Author: Chula AI
Description: A clean, modern theme for Chulalongkorn University's Chula AI.
Version: 1.2.0
Text Domain: chula-ai
*/

:root {
	--chula-primary: #ce76a5;
	--chula-primary-700: #b25f8e;
	--chula-secondary: #b3b3b3;
	--text-color: #1f1f1f;
	--muted-text: #5a5a5a;
	--bg: #ffffff;
	--bg-alt: #faf7f9;
	--radius: 14px;
	--shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
	--shadow-md: 0 6px 20px rgba(0,0,0,0.10);
}

html, body {
	margin: 0;
	padding: 0;
	font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	color: var(--text-color);
	background: var(--bg);
	line-height: 1.7;
	font-size: 16px;
}

h1, h2, h3, h4, .site-title { font-family: "Kanit", "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; letter-spacing: 0.2px; }

/* Links & buttons */
a { color: var(--chula-primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--chula-primary-700); text-decoration: none; }

.btn { display: inline-block; padding: 10px 16px; border-radius: 999px; font-weight: 600; border: 1px solid transparent; transition: all .2s ease; }
.btn-primary { background: var(--chula-primary); color: #fff; }
.btn-primary:hover { background: var(--chula-primary-700); }
.btn-outline { border-color: var(--chula-primary); color: var(--chula-primary); }
.btn-outline:hover { background: var(--chula-primary); color: #fff; }

/* Layout */
.container {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Header & nav */
.site-header { background: var(--bg); border-bottom: 2px solid var(--chula-secondary); position: sticky; top: 0; z-index: 50; }
.site-header .header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.branding { display: flex; align-items: center; gap: 12px; }
.logo-link img { display: block; height: 48px; width: auto; }

.nav-primary { display: flex; align-items: center; gap: 10px; }
.nav-primary .nav-toggle { display: none; background: none; border: 0; font-size: 16px; padding: 10px; cursor: pointer; }
.nav-primary .menu-wrapper { display: block; }
.nav-primary ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.nav-primary a { padding: 8px 12px; border-radius: 10px; font-weight: 600; color: #333; }
.nav-primary a:hover, .nav-primary .current-menu-item > a { background: var(--chula-primary); color: #fff; }


/* Language switcher (Polylang) */
.lang-switcher { position: relative; }
.lang-switcher .ddl { min-width: 140px; }
.lang-switcher select { 
	appearance: none; 
	-webkit-appearance: none; 
	-moz-appearance: none;
	background: #fff url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7l5 5 5-5' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center; 
	border: 1px solid #ddd; 
	border-radius: 10px; 
	padding: 8px 34px 8px 12px; 
	font-weight: 600; 
	cursor: pointer;
}
.lang-switcher select:focus { outline: none; border-color: var(--chula-primary); box-shadow: 0 0 0 3px rgba(206,118,165,0.2); }
.lang-switcher .lang-item { display: inline; }
.lang-switcher .lang-item a { padding: 8px 12px; }


@media (max-width: 800px) {
	.nav-primary .nav-toggle { display: block; }
	.nav-primary .menu-wrapper { display: none; position: absolute; top: 100%; right: 20px; left: 20px; background: #fff; border: 1px solid #e7e7e7; border-radius: 10px; padding: 8px; box-shadow: var(--shadow-md); }
	.nav-open .nav-primary .menu-wrapper { display: block; }
	.nav-primary ul { flex-direction: column; gap: 6px; }
	.nav-primary a { display: block; }
}

/* Hero */
.hero { position: relative; padding: 72px 0; margin: 0 0 28px;width: 100%; overflow: hidden; border-bottom: 1px solid var(--chula-secondary); }
.hero .bg { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(206,118,165,0.12), rgba(206,118,165,0)); pointer-events: none; }
.hero .container { position: relative; }
.hero h1 { margin: 0 0 10px; font-size: clamp(2rem, 5vw, 3rem); }
.hero p { margin: 0 0 18px; color: var(--muted-text); font-size: 1.05rem; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Sections */
.home-section { margin: 28px 0 12px; }
.home-section h2 { margin: 0 0 12px; font-size: 1.5rem; position: relative; display: inline-block; }
.home-section h2::after { content: ""; display: block; height: 3px; background: var(--chula-primary); width: 60%; border-radius: 3px; margin-top: 6px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card { border: 1px solid #e7e7e7; border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .thumb { aspect-ratio: 16 / 9; background: #f1f1f1; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .content { padding: 12px 14px 16px; }
.card .meta { display: flex; align-items: center; gap: 8px; color: var(--muted-text); font-size: 0.9rem; margin-bottom: 8px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--chula-primary); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .2px; }
.card h3 { margin: 0 0 8px; font-size: 1.15rem; }

/* Footer */
.site-footer { margin-top: 50px; padding: 28px 0; border-top: 2px solid var(--chula-secondary); color: var(--muted-text); background: #fff; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.site-footer a { color: inherit; }

/* Content */
.entry-content p { margin: 0 0 1em; }
.entry-content img { max-width: 100%; height: auto; border-radius: 10px; }

/* Pagination */
.pagination { margin: 16px 0; }
.pagination .page-numbers { display: inline-block; padding: 6px 10px; margin-right: 6px; border: 1px solid #ddd; border-radius: 8px; }
.pagination .current, .pagination .page-numbers:hover { background: var(--chula-primary); color: #fff; border-color: var(--chula-primary); }
