/*
Theme Name: SmilePlease
Theme URI: https://smileplease.in
Author: SmilePlease
Description: A lightweight, mobile-first theme for a feel-good video hub. Custom "Video" post type with YouTube/Vimeo click-to-play embeds, Smile of the Day, emoji reactions, WhatsApp-first sharing and video schema markup.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: smileplease
*/

/* ------------------------------------------------------------------
   Tokens
------------------------------------------------------------------- */
:root {
	--sp-bg: #fffbf2;
	--sp-surface: #ffffff;
	--sp-ink: #1d1b2e;
	--sp-muted: #6b6880;
	--sp-line: #efe7d4;
	--sp-sun: #ffc93c;
	--sp-sun-dark: #e6a800;
	--sp-coral: #ff6b6b;
	--sp-mint: #2ec4a6;
	--sp-radius: 18px;
	--sp-radius-sm: 12px;
	--sp-shadow: 0 6px 24px rgba(29, 27, 46, 0.08);
	--sp-shadow-hover: 0 12px 32px rgba(29, 27, 46, 0.16);
	--sp-font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--sp-wrap: 1320px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--sp-bg: #14131f;
		--sp-surface: #1f1d2e;
		--sp-ink: #f6f3ea;
		--sp-muted: #a7a3bb;
		--sp-line: #2c2a40;
		--sp-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
		--sp-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.55);
	}
}

/* ------------------------------------------------------------------
   Base
------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--sp-bg);
	color: var(--sp-ink);
	font-family: var(--sp-font);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img, svg, video, iframe { max-width: 100%; height: auto; }

a { color: inherit; text-decoration-color: var(--sp-sun-dark); text-underline-offset: 3px; }
a:hover { color: var(--sp-coral); }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	background: var(--sp-sun); color: #000;
	padding: 10px 16px; z-index: 9999; top: 8px; left: 8px;
	border-radius: 8px;
}

:focus-visible { outline: 3px solid var(--sp-coral); outline-offset: 2px; border-radius: 6px; }

.sp-wrap { width: 100%; max-width: var(--sp-wrap); margin: 0 auto; padding: 0 18px; }
.sp-main { padding: 24px 0 56px; min-height: 60vh; }
.sp-section { margin: 40px 0; }
.sp-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sp-section__head h2 { margin: 0; }
.sp-link-more { font-weight: 700; font-size: .95rem; white-space: nowrap; }

/* ------------------------------------------------------------------
   Header
------------------------------------------------------------------- */
.sp-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--sp-bg) 90%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--sp-line);
}
.admin-bar .sp-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .sp-header { top: 46px; } }

.sp-header__inner { display: flex; align-items: center; gap: 14px; min-height: 64px; }

.sp-logo {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: 1.45rem; font-weight: 900; text-decoration: none; letter-spacing: -0.02em;
}
.sp-logo:hover { color: inherit; }
.sp-logo__face {
	display: inline-grid; place-items: center;
	width: 38px; height: 38px; border-radius: 50%;
	background: var(--sp-sun); color: #1d1b2e; font-size: 1.35rem;
	box-shadow: 0 3px 0 var(--sp-sun-dark);
	transition: transform .25s;
}
.sp-logo:hover .sp-logo__face { transform: rotate(-12deg) scale(1.08); }
.sp-logo__text span { color: var(--sp-coral); }

.sp-nav { margin-left: auto; }
.sp-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.sp-nav a {
	display: block; padding: 8px 14px; border-radius: 999px;
	text-decoration: none; font-weight: 700; font-size: .95rem;
}
.sp-nav a:hover,
.sp-nav .current-menu-item > a,
.sp-nav .current-cat > a { background: var(--sp-sun); color: #1d1b2e; }

.sp-search-toggle,
.sp-menu-toggle {
	display: inline-grid; place-items: center;
	width: 42px; height: 42px; border-radius: 50%;
	border: 0; background: var(--sp-surface); color: var(--sp-ink);
	box-shadow: var(--sp-shadow); cursor: pointer; font-size: 1.1rem;
}
.sp-menu-toggle { display: none; }

.sp-search-bar { display: none; padding: 0 0 14px; }
.sp-search-bar.is-open { display: block; }

.sp-search-form { display: flex; gap: 8px; }
.sp-search-form input[type="search"] {
	flex: 1; min-width: 0; padding: 12px 16px; font: inherit;
	border: 2px solid var(--sp-line); border-radius: 999px;
	background: var(--sp-surface); color: var(--sp-ink);
}
.sp-search-form input[type="search"]:focus { border-color: var(--sp-sun-dark); outline: none; }

.sp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 22px; border: 0; border-radius: 999px; cursor: pointer;
	font: inherit; font-weight: 800; text-decoration: none;
	background: var(--sp-sun); color: #1d1b2e;
	box-shadow: 0 3px 0 var(--sp-sun-dark);
	transition: transform .15s, box-shadow .15s;
}
.sp-btn:hover { color: #1d1b2e; transform: translateY(-1px); box-shadow: 0 4px 0 var(--sp-sun-dark); }
.sp-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sp-sun-dark); }

@media (max-width: 860px) {
	.sp-menu-toggle { display: inline-grid; }
	.sp-search-toggle { margin-left: auto; }
	.sp-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		background: var(--sp-bg); border-bottom: 1px solid var(--sp-line);
		padding: 10px 18px 16px; margin: 0;
	}
	.sp-nav.is-open { display: block; }
	.sp-nav ul { flex-direction: column; }
}

/* ------------------------------------------------------------------
   Category chips
------------------------------------------------------------------- */
.sp-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.sp-chips::-webkit-scrollbar { display: none; }
.sp-chip {
	flex: 0 0 auto; padding: 8px 16px; border-radius: 999px;
	background: var(--sp-surface); border: 2px solid var(--sp-line);
	font-weight: 700; font-size: .92rem; text-decoration: none;
}
.sp-chip:hover, .sp-chip.is-active { background: var(--sp-sun); border-color: var(--sp-sun); color: #1d1b2e; }

/* ------------------------------------------------------------------
   Hero: Smile of the Day
------------------------------------------------------------------- */
.sp-hero {
	display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center;
	background: linear-gradient(135deg, #fff1c2 0%, #ffd9d0 100%);
	border-radius: 28px; padding: 28px; box-shadow: var(--sp-shadow);
	color: #1d1b2e;
}
@media (prefers-color-scheme: dark) {
	.sp-hero { background: linear-gradient(135deg, #3a2f12 0%, #3b1f2a 100%); color: #f6f3ea; }
}
.sp-hero__badge {
	display: inline-block; background: #1d1b2e; color: var(--sp-sun);
	font-weight: 900; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
	padding: 6px 14px; border-radius: 999px; margin-bottom: 14px;
}
.sp-hero__title { margin-bottom: 10px; }
.sp-hero__title a { text-decoration: none; }
.sp-hero__excerpt { opacity: .85; margin-bottom: 18px; }
@media (max-width: 860px) {
	.sp-hero { grid-template-columns: 1fr; padding: 16px; border-radius: 22px; }
}

/* ------------------------------------------------------------------
   Video cards & grid
------------------------------------------------------------------- */
.sp-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.sp-card {
	background: var(--sp-surface); border-radius: var(--sp-radius);
	box-shadow: var(--sp-shadow); overflow: hidden;
	display: flex; flex-direction: column;
	transition: transform .2s, box-shadow .2s;
}
.sp-card:hover { transform: translateY(-4px); box-shadow: var(--sp-shadow-hover); }

.sp-card__thumb {
	position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
	background: linear-gradient(135deg, var(--sp-sun), var(--sp-coral));
}
.sp-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.sp-card:hover .sp-card__thumb img { transform: scale(1.05); }
.sp-card__fallback { display: grid; place-items: center; width: 100%; height: 100%; font-size: 3rem; }

.sp-play {
	position: absolute; inset: 0; margin: auto; width: 56px; height: 56px;
	border-radius: 50%; background: rgba(255, 255, 255, .92);
	display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
	transition: transform .2s;
}
.sp-play::before {
	content: ""; margin-left: 4px;
	border-style: solid; border-width: 10px 0 10px 17px;
	border-color: transparent transparent transparent #1d1b2e;
}
.sp-card:hover .sp-play { transform: scale(1.12); }

.sp-tag-short {
	position: absolute; top: 10px; left: 10px;
	background: var(--sp-coral); color: #fff; font-size: .72rem; font-weight: 900;
	padding: 3px 10px; border-radius: 999px; letter-spacing: .05em;
}

.sp-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sp-card__title { font-size: 1.05rem; margin: 0; }
.sp-card__title a { text-decoration: none; }
.sp-card__meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--sp-muted); }
.sp-card__cat {
	font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
	color: var(--sp-coral); text-decoration: none;
}

/* Ranked list ("Most loved this week") */
.sp-rank { counter-reset: rank; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.sp-rank .sp-card { counter-increment: rank; position: relative; }
.sp-rank .sp-card::before {
	content: counter(rank); position: absolute; z-index: 2; top: 10px; right: 10px;
	width: 34px; height: 34px; display: grid; place-items: center;
	background: var(--sp-sun); color: #1d1b2e; border-radius: 50%;
	font-weight: 900; box-shadow: 0 2px 0 var(--sp-sun-dark);
}

/* ------------------------------------------------------------------
   Player (click-to-play)
------------------------------------------------------------------- */
.sp-player {
	position: relative; width: 100%; aspect-ratio: 16 / 9;
	border-radius: var(--sp-radius); overflow: hidden; background: #000;
	box-shadow: var(--sp-shadow);
}
.sp-player.is-vertical { aspect-ratio: 9 / 16; max-width: 400px; margin-left: auto; margin-right: auto; max-height: 78vh; }
.sp-player__btn {
	position: absolute; inset: 0; width: 100%; height: 100%; padding: 0;
	border: 0; background: transparent; cursor: pointer; display: block;
}
.sp-player__btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-player__btn .sp-play { width: 76px; height: 76px; }
.sp-player__btn .sp-play::before { border-width: 14px 0 14px 23px; margin-left: 6px; }
.sp-player__btn:hover .sp-play { transform: scale(1.1); }
.sp-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.sp-hero .sp-player { box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }

/* ------------------------------------------------------------------
   Single video
------------------------------------------------------------------- */
.sp-watch { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.sp-single { min-width: 0; }
.sp-single__content { max-width: 72ch; }

/* Sidebar: compact "More smiles" list */
.sp-side h2 { font-size: 1.15rem; margin-bottom: 14px; }
.sp-mini { display: grid; grid-template-columns: 168px 1fr; gap: 12px; margin-bottom: 14px; align-items: start; }
.sp-mini__thumb {
	position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
	border-radius: 12px; background: linear-gradient(135deg, var(--sp-sun), var(--sp-coral));
}
.sp-mini__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-mini__thumb .sp-play { width: 34px; height: 34px; }
.sp-mini__thumb .sp-play::before { border-width: 6px 0 6px 10px; margin-left: 2px; }
.sp-mini__title { font-size: .95rem; margin: 0 0 4px; line-height: 1.3; }
.sp-mini__title a { text-decoration: none; }
.sp-mini__meta { font-size: .8rem; color: var(--sp-muted); }
@media (max-width: 1000px) {
	.sp-watch { grid-template-columns: 1fr; }
	.sp-mini { grid-template-columns: 140px 1fr; }
}
.sp-single__head { margin-bottom: 18px; }
.sp-single__cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sp-single__meta { color: var(--sp-muted); font-size: .9rem; }
.sp-single__content { margin: 22px 0; font-size: 1.05rem; }
.sp-credit {
	background: var(--sp-surface); border: 2px dashed var(--sp-line);
	border-radius: var(--sp-radius-sm); padding: 10px 16px; font-size: .9rem; color: var(--sp-muted);
}

/* Reactions */
.sp-reactions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 8px; }
.sp-react {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 10px 18px; border-radius: 999px; cursor: pointer;
	background: var(--sp-surface); color: var(--sp-ink);
	border: 2px solid var(--sp-line); font: inherit; font-weight: 800;
	transition: transform .15s, background .15s, border-color .15s;
}
.sp-react__emoji { font-size: 1.3rem; line-height: 1; }
.sp-react:hover { transform: translateY(-2px); border-color: var(--sp-sun); }
.sp-react.is-picked { background: var(--sp-sun); border-color: var(--sp-sun); color: #1d1b2e; transform: scale(1.04); }
.sp-react[disabled] { cursor: default; }

/* Share */
.sp-share { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; align-items: center; }
.sp-share__label { font-weight: 800; margin-right: 4px; }
.sp-share a, .sp-share button {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 9px 16px; border-radius: 999px; border: 0; cursor: pointer;
	font: inherit; font-weight: 800; font-size: .9rem; text-decoration: none; color: #fff;
}
.sp-share .is-wa { background: #25d366; color: #0b3d1f; }
.sp-share .is-fb { background: #1877f2; }
.sp-share .is-x  { background: #111; }
.sp-share .is-copy { background: var(--sp-ink); color: var(--sp-bg); }
.sp-share a:hover { color: #fff; }
.sp-share .is-wa:hover { color: #0b3d1f; }

/* ------------------------------------------------------------------
   Archive / pagination / generic content
------------------------------------------------------------------- */
.sp-archive-head { margin-bottom: 20px; }
.sp-archive-head p { color: var(--sp-muted); max-width: 60ch; }

.pagination, .navigation.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pagination .page-numbers {
	min-width: 42px; height: 42px; padding: 0 14px; display: inline-grid; place-items: center;
	border-radius: 999px; background: var(--sp-surface); border: 2px solid var(--sp-line);
	font-weight: 800; text-decoration: none;
}
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--sp-sun); border-color: var(--sp-sun); color: #1d1b2e; }

.sp-entry { max-width: 780px; margin: 0 auto; }
.sp-entry__content { font-size: 1.05rem; }
.sp-entry__content img { border-radius: var(--sp-radius-sm); }

.sp-empty { text-align: center; padding: 48px 12px; }
.sp-empty__emoji { font-size: 4rem; display: block; margin-bottom: 8px; }

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------- */
.sp-footer { border-top: 1px solid var(--sp-line); background: var(--sp-surface); padding: 32px 0 40px; color: var(--sp-muted); font-size: .92rem; }
.sp-footer__inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.sp-footer__brand { max-width: 420px; }
.sp-footer__brand .sp-logo { color: var(--sp-ink); margin-bottom: 8px; }
.sp-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.sp-footer a { text-decoration: none; font-weight: 700; }
.sp-footer__note { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--sp-line); font-size: .85rem; }

/* WordPress alignment helpers */
.alignleft { float: left; margin: 0 1em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1em; }
.aligncenter { display: block; margin: 0 auto 1em; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--sp-muted); }

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