/*
 * 글 안에 붙여 넣은 "내 사이트의 다른 글 링크"(워드프레스 임베드 카드)의 모양
 *
 * 이 카드는 글 본문 속 iframe 안에 따로 그려지는 화면이라 main.css 가 적용되지 않습니다.
 * 그래서 이 파일(embed.css)만 따로 불러오고, 색·글자·간격은 여기서 바꿉니다.
 * 카드가 글 본문 폭을 얼마나 차지할지는 main.css 의 ".entry-content iframe.wp-embedded-content" 에서 정합니다.
 *
 * 모양: 왼쪽에 정사각 이미지(200px), 오른쪽에 제목 · 두 줄 요약 · 주소. 카드 전체가 하나의 링크입니다.
 * 폭이 좁으면(560px 미만, 휴대폰) 이미지가 위, 글이 아래로 쌓입니다.
 * 글꼴: 카드는 보안상 따로 격리된 화면이라 웹폰트(Noto Sans KR)가 불러와지지 않고, 기기에 설치된 한글 글꼴이 쓰입니다.
 */

body {
	margin: 0;
	font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', 'AppleGothic', sans-serif;
	-webkit-font-smoothing: antialiased;
}

/* 카드 바탕: 사각형, 얇은 테두리, 그림자 없음. 마우스를 올리면 테두리만 진해집니다. */
body .wp-embed {
	position: relative;
	box-sizing: border-box;
	min-height: 200px; /* 워드프레스가 카드 높이를 최소 200px 로 잡습니다 */
	padding: 0;
	border: 1px solid #dcdcdc;
	border-radius: 0;
	box-shadow: none;
	background: #fff;
	color: #333;
	font-size: 13px;
	line-height: 1.4;
	overflow: hidden;
}
body .wp-embed:hover { border-color: #a3a3a3; }
body .wp-embed a { color: inherit; text-decoration: none; }

/* 대표 이미지 (좁은 화면: 위쪽에 가로로 꽉 차게) */
body .wp-embed-featured-image { margin: 0; }
body .wp-embed-featured-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* 제목: 최대 2줄. 이 링크를 카드 전체로 펼쳐서 카드 어디를 눌러도 글로 이동합니다. */
body .wp-embed .wp-embed-heading {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	padding: 22px 20px 0;
	font-size: 17px;
	font-weight: 400;
	line-height: 1.4;
	color: #080808;
}
body .wp-embed .wp-embed-heading a { color: #080808; }
body .wp-embed .wp-embed-heading a::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

/* 요약: 최대 2줄, "계속 읽기" 링크는 숨김 */
body .wp-embed .wp-embed-excerpt { padding: 8px 20px 0; }
body .wp-embed .wp-embed-excerpt p {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	color: #808080;
}
body .wp-embed .wp-embed-excerpt .wp-embed-more { display: none; }

/* 아래줄: 사이트 주소만 보여 줍니다. (주소 글자는 functions.php 의 embed_site_title_html 에서 만듭니다.) */
body .wp-embed-footer { display: block; margin: 0; padding: 12px 20px 20px; }
body .wp-embed-site-title { display: block; font-size: 13px; font-weight: 400; line-height: 1.4; color: #808080; }
body .wp-embed-site-title a { position: static; display: inline; padding: 0; color: inherit; }
body .wp-embed-meta { display: none; } /* 댓글 수·공유 버튼 숨김 */

/* 폭이 넓을 때(글 본문 폭): 이미지는 왼쪽 정사각, 글은 오른쪽 */
@media (min-width: 560px) {
	body .wp-embed .wp-embed-heading { padding: 32px 40px 0; font-size: 20px; }
	body .wp-embed .wp-embed-excerpt { padding: 10px 40px 0; }
	body .wp-embed-footer { padding: 12px 40px 27px; }

	body .wp-embed.has-post-thumbnail {
		display: grid;
		grid-template-columns: 200px minmax(0, 1fr);
		grid-template-rows: auto auto 1fr;
		align-items: start;
	}
	body .wp-embed.has-post-thumbnail .wp-embed-featured-image {
		grid-column: 1;
		grid-row: 1 / 4;
		float: none;
		max-width: none;
	}
	body .wp-embed.has-post-thumbnail .wp-embed-featured-image img {
		width: 200px;
		height: 200px;
		aspect-ratio: auto;
	}
	body .wp-embed.has-post-thumbnail .wp-embed-heading { grid-column: 2; grid-row: 1; }
	body .wp-embed.has-post-thumbnail .wp-embed-excerpt { grid-column: 2; grid-row: 2; }
	body .wp-embed.has-post-thumbnail .wp-embed-footer { grid-column: 2; grid-row: 3; align-self: end; }
}
