/*
Theme Name: CCPSL
Theme URI: https://ccpsl.lk
Author: College of Community Physicians of Sri Lanka
Description: Custom theme for the College of Community Physicians of Sri Lanka (CCPSL) — home page with centenary (1927–2027) branding.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: ccpsl
*/

:root {
	--maroon: #7a1426;
	--maroon-dark: #5c0f1c;
	--maroon-deep: #4a0b16;
	--gold: #b8892f;
	--gold-light: #d9b56a;
	--cream: #fbf6ef;
	--cream-2: #f6eee2;
	--line: #eadfce;
	--ink: #2b2420;
	--muted: #6b625b;
	--white: #ffffff;
	--serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
	--sans: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
	--radius: 8px;
	--shadow: 0 2px 10px rgba(74, 11, 22, .06);
	--wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--sans);
	font-size: 15px;
	line-height: 1.6;
	color: var(--ink);
	background: var(--white);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--maroon); text-decoration: none; }
a:hover { color: var(--maroon-dark); }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--maroon); margin: 0 0 .5em; line-height: 1.25; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; gap: .55em;
	padding: .7em 1.2em; border-radius: 4px;
	font-weight: 600; font-size: 14px; line-height: 1;
	border: 1.5px solid var(--maroon); transition: .2s ease;
}
.btn-primary { background: var(--maroon); color: var(--white); }
.btn-primary:hover { background: var(--maroon-dark); border-color: var(--maroon-dark); color: var(--white); }
.btn-outline { background: var(--white); color: var(--maroon); }
.btn-outline:hover { background: var(--maroon); color: var(--white); }
.btn-sm { padding: .55em 1em; font-size: 13px; }
.more { display: inline-flex; align-items: center; gap: .4em; font-size: 13px; font-weight: 600; color: var(--maroon); }
.more .icon { transition: transform .2s; }
.more:hover .icon { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: relative; z-index: 50; }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0 6px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--maroon); }
.brand-emblem { width: 58px; height: 68px; }
.brand-emblem img, .brand .custom-logo { max-height: 68px; width: auto; }
.brand-name { font-family: var(--serif); font-size: 22px; line-height: 1.15; font-weight: 700; color: var(--maroon); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.search-toggle { background: none; border: 0; cursor: pointer; color: var(--ink); font-size: 22px; padding: 6px; }
.btn-join { flex-direction: column; gap: 3px; padding: .5em .8em; font-size: 12px; }
.btn-join .icon { font-size: 16px; }
.header-search { display: none; padding: 0 0 12px; }
.header-search.open { display: block; }
.header-search form { display: flex; gap: 8px; max-width: 480px; margin-left: auto; }
.header-search input[type="search"] { flex: 1; padding: .6em .8em; border: 1px solid var(--line); border-radius: 4px; font: inherit; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; flex-wrap: wrap; }
.main-nav > ul > li { position: relative; }
.main-nav a { display: block; padding: 10px 6px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--maroon); }
.main-nav .menu-item-has-children > a::after {
	content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px;
	border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-3px);
}
.main-nav .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 220px; display: none; flex-direction: column;
	background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--maroon);
	box-shadow: 0 10px 24px rgba(0,0,0,.08); padding: 6px 0;
}
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: flex; }
.main-nav .sub-menu a { padding: 8px 16px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; cursor: pointer; color: var(--maroon); font-size: 20px; }

/* ---------- Hero ---------- */
.hero {
	position: relative; overflow: hidden;
	background: linear-gradient(90deg, var(--cream) 0%, rgba(251,246,239,.92) 40%, rgba(251,246,239,.55) 62%, rgba(251,246,239,.2) 100%), var(--hero-img, none) right center / cover no-repeat, var(--cream);
	padding: 36px 0;
}
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4vw, 46px); margin-bottom: .35em; }
.divider { display: flex; align-items: center; gap: 10px; width: 260px; margin: 6px 0 22px; color: var(--gold); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--gold); }
.divider .icon { font-size: 14px; }
.divider.center { margin-left: auto; margin-right: auto; }
.hero-lead { font-size: 16px; max-width: 560px; color: var(--ink); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }

.quick-panel { background: var(--maroon); border-radius: var(--radius); padding: 8px 18px; box-shadow: 0 10px 30px rgba(74,11,22,.25); }
.quick-panel a { display: flex; align-items: center; gap: 18px; padding: 16px 4px; color: var(--white); border-bottom: 1px solid rgba(255,255,255,.18); }
.quick-panel a:last-child { border-bottom: 0; }
.quick-panel .qp-icon { font-size: 40px; color: var(--gold-light); }
.quick-panel strong { display: block; font-family: var(--serif); font-size: 18px; font-weight: 400; }
.quick-panel span { display: block; font-size: 12.5px; opacity: .85; line-height: 1.4; }
.quick-panel .qp-text { flex: 1; }
.quick-panel .qp-arrow { font-size: 16px; opacity: .8; transition: transform .2s; }
.quick-panel a:hover .qp-arrow { transform: translateX(4px); opacity: 1; }

/* ---------- Centenary strip ---------- */
.centenary-strip { background: linear-gradient(90deg, var(--cream) 0%, #fff 60%, var(--cream-2) 100%); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; }
.centenary-strip .wrap { display: flex; align-items: center; gap: 28px; }
.badge-100 { width: 110px; height: 96px; flex-shrink: 0; }
.cs-text { border-left: 1px solid var(--gold); padding-left: 28px; }
.cs-text h2 { font-size: 22px; margin-bottom: 4px; }
.cs-text p { font-family: var(--serif); font-style: italic; color: var(--maroon); font-size: 17px; margin: 0; line-height: 1.45; }

/* ---------- Pillars ---------- */
.section { padding: 22px 0; }
.pillars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.pillar {
	background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 22px 14px 16px; text-align: center; box-shadow: var(--shadow);
	display: flex; flex-direction: column; align-items: center; transition: .2s;
}
.pillar:hover { transform: translateY(-3px); border-color: var(--gold-light); }
.pillar .p-icon { font-size: 44px; color: var(--maroon); margin-bottom: 12px; }
.pillar h3 { font-size: 15px; color: var(--ink); }
.pillar p { font-size: 12.5px; color: var(--muted); line-height: 1.5; flex: 1; }
.pillar .more { font-size: 18px; }

/* ---------- Cards / panels ---------- */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); height: 100%; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 19px; margin: 0; }
.panel-head .more { font-size: 12px; white-space: nowrap; }

.two-col { display: grid; grid-template-columns: 1fr 1.08fr; gap: 18px; }
.priority { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.priority h3 { font-family: var(--sans); color: var(--ink); font-size: 16px; font-weight: 700; }
.priority p { font-size: 13px; color: var(--muted); }
.priority-img { border-radius: 6px; overflow: hidden; aspect-ratio: 4/3.5; background: var(--cream-2); }
.priority-img img { width: 100%; height: 100%; object-fit: cover; }

.outputs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.output { border: 1px solid var(--line); border-radius: 6px; padding: 16px 10px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.output .o-icon { font-size: 36px; color: var(--maroon); margin-bottom: 10px; }
.output h3 { font-family: var(--sans); font-size: 13.5px; color: var(--ink); margin-bottom: 6px; }
.output .o-sub { font-size: 11.5px; color: var(--ink); margin-bottom: 4px; }
.output p { font-size: 11.5px; color: var(--muted); line-height: 1.45; flex: 1; }
.output .more { font-size: 12px; }

.three-col { display: grid; grid-template-columns: 1fr 1fr 1.55fr; gap: 18px; }
.list-card { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 6px; padding: 16px 14px; margin-bottom: 12px; color: var(--ink); transition: .2s; }
.list-card:last-child { margin-bottom: 0; }
.list-card:hover { border-color: var(--gold-light); background: var(--cream); color: var(--ink); }
.list-card .lc-icon { font-size: 32px; color: var(--maroon); }
.list-card .lc-text { flex: 1; }
.list-card strong { display: block; font-size: 14px; }
.list-card span { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; }
.list-card .lc-go { font-size: 20px; color: var(--maroon); }
.list-card .lc-dl { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 4px; display: grid; place-items: center; color: var(--maroon); font-size: 15px; }
.list-card.compact { padding: 12px 14px; margin-bottom: 10px; }

.stories { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.story { color: var(--ink); }
.story-img { aspect-ratio: 1/0.9; border-radius: 6px; overflow: hidden; margin-bottom: 8px; background: var(--cream-2); }
.story-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.story:hover .story-img img { transform: scale(1.04); }
.story strong { display: block; font-size: 13px; }
.story span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.45; }

.img-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--gold); font-size: 40px; background: linear-gradient(135deg, var(--cream) 0%, var(--cream-2) 100%); }

/* ---------- Centenary banner ---------- */
.centenary-banner {
	position: relative; text-align: center; padding: 26px 20px 22px; margin-top: 16px;
	background: linear-gradient(90deg, rgba(251,246,239,.15) 0%, rgba(251,246,239,.96) 30%, rgba(251,246,239,.96) 70%, rgba(251,246,239,.15) 100%), var(--banner-img, none) center / cover no-repeat, var(--cream-2);
}
.centenary-banner .eyebrow { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 12px; letter-spacing: .25em; color: var(--maroon); font-weight: 600; }
.centenary-banner .eyebrow::before, .centenary-banner .eyebrow::after { content: ""; width: 60px; height: 1px; background: var(--gold); }
.centenary-banner .years { font-family: var(--serif); font-size: clamp(36px, 5vw, 48px); color: var(--maroon); font-weight: 700; line-height: 1.1; margin: 6px 0; }
.centenary-banner .sub { font-family: var(--serif); letter-spacing: .2em; font-size: 13px; color: var(--ink); margin-bottom: 8px; }
.centenary-banner .tag { font-family: var(--serif); font-style: italic; color: var(--maroon); margin: 0; line-height: 1.5; }

/* ---------- Join ---------- */
.join h2 { font-size: 21px; margin-bottom: 14px; }
.join-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.join-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 14px 12px; color: var(--ink); transition: .2s; }
.join-item:hover { background: var(--cream); border-color: var(--gold-light); color: var(--ink); }
.join-item .ji-icon { font-size: 34px; color: var(--maroon); }
.join-item strong { display: block; font-family: var(--serif); font-size: 13px; color: var(--maroon); }
.join-item span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* ---------- Footer ---------- */
.site-footer { background: var(--maroon); color: rgba(255,255,255,.88); margin-top: 26px; font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.1fr 1.3fr .9fr; gap: 26px; padding: 28px 20px 22px; }
.footer-grid > div + div { border-left: 1px solid rgba(255,255,255,.18); padding-left: 24px; }
.site-footer h4 { font-family: var(--serif); color: var(--white); font-size: 14px; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 7px; }
.site-footer a { color: rgba(255,255,255,.88); }
.site-footer a:hover { color: var(--gold-light); }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-brand .brand-emblem { width: 44px; height: 52px; }
.footer-brand .brand-name { color: var(--white); font-size: 16px; }
.footer-contact li { display: flex; gap: 8px; }
.footer-contact .icon { margin-top: 3px; color: var(--gold-light); }
.socials { display: flex; gap: 10px; }
.socials a { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.6); border-radius: 50%; display: grid; place-items: center; font-size: 17px; }
.socials a:hover { background: var(--white); color: var(--maroon); }
.footer-bottom { background: var(--maroon-dark); padding: 10px 0; font-size: 12px; }
.footer-bottom .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.footer-bottom nav { display: flex; gap: 12px; flex: 1; justify-content: center; }
.footer-bottom nav a + a::before { content: "|"; margin-right: 12px; opacity: .5; }

/* ---------- Generic content (index.php / pages) ---------- */
.content-area { padding: 40px 0; }
.content-area article { margin-bottom: 40px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.pillars { grid-template-columns: repeat(3, 1fr); }
	.join-grid { grid-template-columns: repeat(3, 1fr); }
	.two-col { grid-template-columns: 1fr; }
	.three-col { grid-template-columns: 1fr 1fr; }
	.three-col > :last-child { grid-column: 1 / -1; }
	.footer-grid { grid-template-columns: repeat(3, 1fr); }
	.footer-grid > div + div { border-left: 0; padding-left: 0; }
}
@media (max-width: 900px) {
	.nav-toggle { display: inline-block; }
	.main-nav { display: none; }
	.main-nav.open { display: block; }
	.main-nav ul { flex-direction: column; }
	.main-nav .sub-menu { position: static; display: flex; border: 0; box-shadow: none; padding-left: 14px; }
	.header-actions .btn-login-text { display: none; }
	.hero-grid { grid-template-columns: 1fr; }
	.outputs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.brand-name { font-size: 17px; }
	.brand-emblem { width: 44px; height: 52px; }
	.btn-join { display: none; }
	.centenary-strip .wrap { flex-direction: column; text-align: center; gap: 12px; }
	.cs-text { border-left: 0; padding-left: 0; }
	.pillars, .join-grid { grid-template-columns: repeat(2, 1fr); }
	.three-col { grid-template-columns: 1fr; }
	.priority { grid-template-columns: 1fr; }
	.stories { grid-template-columns: 1fr 1fr; }
	.footer-grid { grid-template-columns: 1fr; }
	.footer-bottom .wrap { flex-direction: column; text-align: center; }
}
