/**!
 * @file ViewDictionary.css
 * @desc Modern shell for esl_dictionary.php (the dictionary lookup page).
 *       Layout: 2-column at desktop. Main column has a prominent search
 *       hero, then a stack of result cards populated asynchronously by
 *       DictionaryAPI.js (Google, Jisho/Merriam-Webster, Samraworld
 *       vocab match). Right sidebar: latest lessons + lessons-you-may-like.
 *
 *       Scoped under body.view-dictionary so nothing leaks.
 *       Preserves the JS-targeted IDs: GOOGLECONTAINER, GOOGLEDEF,
 *       SUPPLEMENTALCONTAINER1/2, SUPPLEMENTALDEF1/2, SWVOCABCONTAINER,
 *       SWVOCABDEF, NOTICE.
 */
/************************************************************************************************************************************/

body.view-dictionary {
	--vd-brand:      var(--sw-brand-color, #0e6630);
	--vd-brand-dark: #084a22;
	--vd-brand-soft: #e8f3ec;
	--vd-brand-tint: #f4f9f5;
	--vd-ink:        #14211a;
	--vd-ink-soft:   #4a5b51;
	--vd-card:       #ffffff;
	--vd-border:     #e0e8e3;
	--vd-radius:     14px;
	--vd-radius-sm:  10px;
	--vd-max-width:  1180px;
	--vd-shadow:     0 1px 2px rgba(20, 50, 30, 0.04),
	                 0 8px 28px rgba(20, 50, 30, 0.08);
	--vd-shadow-sm:  0 1px 2px rgba(20, 50, 30, 0.04),
	                 0 4px 14px rgba(20, 50, 30, 0.06);

	background-color: var(--vd-brand-tint) !important;
}

/* ------------------------------------------------------------------ */
/* PAGE + GRID                                                         */
/* ------------------------------------------------------------------ */

body.view-dictionary .dict-page {
	max-width: var(--vd-max-width);
	margin: 0 auto;
	padding: 18px 16px 32px 16px;
}

body.view-dictionary .dict-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 24px;
	align-items: start;
}

/* ------------------------------------------------------------------ */
/* MAIN ARTICLE CARD                                                   */
/* ------------------------------------------------------------------ */

body.view-dictionary .dict-article {
	background: var(--vd-card);
	border-radius: var(--vd-radius);
	box-shadow: var(--vd-shadow);
	overflow: hidden;
	min-width: 0;
}

/* --- Hero with search --- */

body.view-dictionary .dict-hero {
	padding: 32px 36px 28px 36px;
	background: linear-gradient(180deg, var(--vd-brand-tint) 0%, var(--vd-card) 100%);
	border-bottom: 1px solid var(--vd-border);
}

body.view-dictionary .dict-hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--vd-brand-dark);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--vd-brand-soft);
	margin-bottom: 14px;
}

body.view-dictionary .dict-hero__title {
	font-size: clamp(1.5rem, 2.2vw, 1.9rem);
	font-weight: 800;
	margin: 0 0 6px 0;
	color: var(--vd-ink);
	line-height: 1.2;
	letter-spacing: -0.01em;
}

body.view-dictionary .dict-hero__subtitle {
	margin: 0 0 18px 0;
	font-size: 0.95rem;
	color: var(--vd-ink-soft);
}

/* --- Search input --- */

body.view-dictionary .dict-search {
	display: flex;
	gap: 0;
	background: var(--vd-card);
	border: 1.5px solid var(--vd-border);
	border-radius: 999px;
	overflow: hidden;
	box-shadow: var(--vd-shadow-sm);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.view-dictionary .dict-search:focus-within {
	border-color: var(--vd-brand);
	box-shadow: 0 0 0 4px var(--vd-brand-soft);
}

body.view-dictionary .dict-search__icon {
	display: inline-flex;
	align-items: center;
	padding: 0 4px 0 22px;
	color: var(--vd-brand);
	font-size: 1.05rem;
}

body.view-dictionary .dict-search__input {
	flex: 1;
	border: none;
	outline: none;
	padding: 14px 18px;
	font-size: 1rem;
	background: transparent;
	color: var(--vd-ink);
	font-family: inherit;
	min-width: 0;
}

body.view-dictionary .dict-search__input::placeholder {
	color: var(--vd-ink-soft);
}

body.view-dictionary .dict-search__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0 26px;
	background: var(--vd-brand);
	color: #fff;
	border: none;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	transition: background 0.15s ease;
	font-family: inherit;
}

body.view-dictionary .dict-search__btn:hover {
	background: var(--vd-brand-dark);
}

/* --- Article body --- */

body.view-dictionary .dict-article__body {
	padding: 26px 36px 36px 36px;
}

/* --- Result section card --- */

body.view-dictionary .dict-section {
	margin-bottom: 18px;
	padding: 18px 20px;
	background: var(--vd-brand-tint);
	border: 1px solid var(--vd-border);
	border-radius: var(--vd-radius-sm);
	transition: opacity 0.2s ease;
}

body.view-dictionary .dict-section[style*="display: none"],
body.view-dictionary .dict-section:not([style*="display"]):empty {
	display: none !important;
}

body.view-dictionary .dict-section__header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--vd-border);
}

body.view-dictionary .dict-section__icon {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: var(--vd-brand-soft);
	color: var(--vd-brand-dark);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.9rem;
	flex-shrink: 0;
}

body.view-dictionary .dict-section__title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--vd-ink);
	margin: 0;
	display: flex;
	align-items: baseline;
	gap: 8px;
}

body.view-dictionary .dict-section__source {
	font-size: 0.78rem;
	color: var(--vd-ink-soft);
	font-weight: 500;
	font-style: italic;
}

body.view-dictionary .dict-section__body {
	font-size: 0.95rem;
	line-height: 1.65;
	color: var(--vd-ink);
	text-align: left;
}

/* Legacy .voc_google has text-align: center — override inside our section. */
body.view-dictionary .dict-section__body .voc_google,
body.view-dictionary .dict-section__body .voc_suppltl {
	text-align: left;
}

body.view-dictionary .dict-section__body cite {
	font-size: 0.78rem;
	color: var(--vd-ink-soft);
	font-style: italic;
	display: block;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px dashed var(--vd-border);
}

/* --- Notice / instruction line --- */

body.view-dictionary .dict-notice {
	text-align: center;
	padding: 36px 22px;
	background: var(--vd-card);
	border: 1px dashed var(--vd-border);
	border-radius: var(--vd-radius-sm);
	color: var(--vd-ink-soft);
	font-size: 0.95rem;
	line-height: 1.6;
}

body.view-dictionary .dict-notice i {
	display: block;
	font-size: 2rem;
	color: var(--vd-brand);
	margin-bottom: 12px;
}

/* ------------------------------------------------------------------ */
/* SIDEBAR — section list + tooltip styles are now in the shared      */
/* LessonListPanel.css (.ll-panel*). This page only owns the outer    */
/* aside wrapper for layout.                                           */
/* ------------------------------------------------------------------ */

body.view-dictionary .dict-sidebar {
	display: block;
}

/* ------------------------------------------------------------------ */
/* RESPONSIVE                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	body.view-dictionary .dict-content {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	body.view-dictionary .dict-hero {
		padding: 24px 22px 20px 22px;
	}
	body.view-dictionary .dict-article__body {
		padding: 22px 22px 30px 22px;
	}
	body.view-dictionary .dict-search__btn span { display: none; }
}
