/*════════════════════════════════════════════════════════════════════════════
 * comments.css
 * HackYa theme — comment list and comment form styling.
 * Clean white/neutral palette for readability.
 * Inherits body font stack (Korean/Japanese friendly).
 *
 * Load order: after hackya_style.css
 *   wp_enqueue_style('hackya-comments', $theme_uri . '/css/comments.css',
 *                    ['hackya-style'], $ver, 'all');
 *════════════════════════════════════════════════════════════════════════════*/


/*────────────────────────────────────────────────────────────────────────────
 * COMMENTS AREA
 *────────────────────────────────────────────────────────────────────────────*/

.comments-area {
	max-width: 46em;
	margin: 2.5em auto 3em;
	padding: 0 1em;
	color: #333;
}

.comments-title {
	font-size: 1.25em;
	font-weight: 700;
	color: #1a1a2e;
	border-bottom: 2px solid #e8e8f0;
	padding-bottom: 0.5em;
	margin-bottom: 1.5em;
}

.comments-count {
	color: #1a73e8;
}

.comments-none {
	color: #888;
	font-style: italic;
	margin-bottom: 2em;
}


/*────────────────────────────────────────────────────────────────────────────
 * COMMENT LIST
 *────────────────────────────────────────────────────────────────────────────*/

.comment-list,
.comment-list .children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list li {
	margin-bottom: 0;
}

/* Threading indentation — uses WordPress depth-X classes on each <li> */
.comment-list .depth-2 { padding-left: 2.5em; }
.comment-list .depth-3 { padding-left: 2.5em; }
.comment-list .depth-4 { padding-left: 2.5em; }
.comment-list .depth-5 { padding-left: 2.0em; }

/* Smaller avatars at deeper levels */
.comment-list .children .comment-avatar {
	width: 36px;
	height: 36px;
}


/*────────────────────────────────────────────────────────────────────────────
 * SINGLE COMMENT
 *────────────────────────────────────────────────────────────────────────────*/

.comment-body {
	display: flex;
	gap: 0.875em;
	padding: 1.25em 0;
	border-bottom: 1px solid #f0f0f5;
}

.comment-body:last-child {
	border-bottom: none;
}


/*────────────────────────────────────────────────────────────────────────────
 * AVATAR — generated color circle with initial / gravatar image
 *────────────────────────────────────────────────────────────────────────────*/

.comment-avatar-wrap {
	flex-shrink: 0;
}

.comment-avatar {
	position: relative;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.comment-avatar--sm {
	width: 36px;
	height: 36px;
}

/* Initial letter — shown when no gravatar */
.comment-avatar__initial {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #fff;
	font-weight: 700;
	font-size: 1.1em;
	line-height: 1;
	position: absolute;
	top: 0;
	left: 0;
}

/* Gravatar image — covers the initial when loaded */
.comment-avatar__img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}


/*────────────────────────────────────────────────────────────────────────────
 * COMMENT CONTENT
 *────────────────────────────────────────────────────────────────────────────*/

.comment-content-wrap {
	flex: 1;
	min-width: 0; /* prevent flex overflow */
}

.comment-meta {
	display: flex;
	align-items: baseline;
	gap: 0.75em;
	margin-bottom: 0.4em;
	flex-wrap: wrap;
}

.comment-author-name {
	font-weight: 700;
	color: #1a1a2e;
	font-size: 0.95em;
}

.comment-date {
	font-size: 0.8em;
	color: #999;
}

.comment-text {
	font-size: 1.125em;
	line-height: 1.75em;
	color: #444;
}

.comment-text p {
	margin: 0 0 0.875em;
	white-space: pre-wrap; /* honour line breaks entered by commenter */
}

.comment-text p:last-child {
	margin-bottom: 0;
}

.comment-awaiting-moderation {
	font-size: 0.8em;
	color: #e67e22;
	margin-top: 0.4em;
}


/*────────────────────────────────────────────────────────────────────────────
 * REPLY BUTTON
 *────────────────────────────────────────────────────────────────────────────*/

.comment-actions {
	margin-top: 0.5em;
}

.comment-reply {
	display: inline-block;
}

.comment-reply-link {
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
	font-size: 1em;
	color: #ff0000;
	text-decoration: none;
	transition: color 0.2s ease;
}

.comment-reply-link:hover {
	color: #1a73e8;
}

.comment-reply-link svg {
	flex-shrink: 0;
}


/*────────────────────────────────────────────────────────────────────────────
 * COMMENT FORM AREA
 *────────────────────────────────────────────────────────────────────────────*/

.comment-form-area {
	margin-top: 2.5em;
	padding-top: 2em;
	border-top: 2px solid #e8e8f0;
}

.comment-form-title {
	font-size: 1.1em;
	font-weight: 700;
	color: #1a1a2e;
	margin-bottom: 1.25em;
}


/*────────────────────────────────────────────────────────────────────────────
 * OAUTH LOGIN BUTTONS
 *────────────────────────────────────────────────────────────────────────────*/

.comment-oauth {
	margin-bottom: 1.5em;
}

.comment-oauth__label {
	font-size: 0.85em;
	color: #888;
	margin-bottom: 0.75em;
}

.comment-oauth__buttons {
	display: flex;
	gap: 0.75em;
	flex-wrap: wrap;
}

.oauth-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.6em 1.25em;
	border-radius: 0.375em;
	font-size: 0.9em;
	font-weight: 500;
	text-decoration: none;
	transition: box-shadow 0.2s ease, opacity 0.2s ease;
	white-space: nowrap;
}

.oauth-btn:hover {
	opacity: 0.92;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Google — white button, grey border, dark text (official Google style) */
.oauth-btn--google {
	background: #fff;
	border: 1px solid #dadce0;
	color: #3c4043;
}

.oauth-btn--google:hover {
	color: #3c4043;
	background: #f8f9fa;
}

/* Facebook — official blue */
.oauth-btn--facebook {
	background: #1877f2;
	border: 1px solid #1877f2;
	color: #fff;
}

.oauth-btn--facebook:hover {
	color: #fff;
	background: #166fe5;
}

/* Divider between OAuth and manual form */
.comment-oauth__divider {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin: 1.25em 0 0;
	color: #bbb;
	font-size: 0.8em;
}

.comment-oauth__divider::before,
.comment-oauth__divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #e8e8f0;
}


/*────────────────────────────────────────────────────────────────────────────
 * LOGGED IN USER IDENTITY
 *────────────────────────────────────────────────────────────────────────────*/

.comment-logged-in {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin-bottom: 1.25em;
	padding: 0.75em 1em;
	background: #f8f8fc;
	border-radius: 0.5em;
	font-size: 0.9em;
	color: #555;
}

.comment-logged-in__name strong {
	color: #1a1a2e;
}

.comment-logged-in__logout {
	margin-left: auto;
	font-size: 0.8em;
	color: #999;
	text-decoration: none;
}

.comment-logged-in__logout:hover {
	color: #e53935;
}


/*────────────────────────────────────────────────────────────────────────────
 * COMMENT FORM FIELDS
 *────────────────────────────────────────────────────────────────────────────*/

#commentform {
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* Two-column row for name + email */
#commentform .comment-form-fields,
.comment-form-field--half {
	display: inline-block;
	width: calc(50% - 0.5em);
	vertical-align: top;
}

.comment-form-field--half:nth-child(odd) {
	margin-right: 1em;
}

.comment-form-field {
	margin: 0 0 1em;
	display: block;
}

.comment-form-field label {
	display: block;
	font-size: 0.85em;
	font-weight: 600;
	color: #555;
	margin-bottom: 0.35em;
}

.comment-form-field .required {
	color: #e53935;
	margin-left: 0.2em;
}

.comment-form-field input[type="text"],
.comment-form-field input[type="email"],
.comment-form-field textarea {
	width: 100%;
	padding: 0.6em 0.875em;
	border: 1px solid #ddd;
	border-radius: 0.375em;
	font-size: 0.95em;
	font-family: inherit;
	color: #333;
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.comment-form-field input:focus,
.comment-form-field textarea:focus {
	outline: none;
	border-color: #1a73e8;
	box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.comment-form-field textarea {
	resize: vertical;
	min-height: 7em;
	line-height: 1.6;
}

/* Cookies/remember checkbox */
.comment-form-cookies {
	margin: 0 0 1em;
	font-size: 0.82em;
	color: #888;
}

.comment-form-cookies label {
	display: flex;
	align-items: center;
	gap: 0.5em;
	cursor: pointer;
}


/*────────────────────────────────────────────────────────────────────────────
 * SUBMIT BUTTON
 *────────────────────────────────────────────────────────────────────────────*/

.comment-submit-btn {
	display: inline-block;
	padding: 0.65em 2em;
	background: #1a73e8;
	color: #fff;
	border: none;
	border-radius: 0.375em;
	font-size: 0.95em;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.2s ease, box-shadow 0.2s ease;
}

.comment-submit-btn:hover {
	background: #1557b0;
	box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.comment-submit-btn:active {
	background: #0d47a1;
}


/*────────────────────────────────────────────────────────────────────────────
 * COMMENTS PAGINATION
 *────────────────────────────────────────────────────────────────────────────*/

.comments-pagination {
	margin-top: 1.5em;
	text-align: center;
	font-size: 0.9em;
}


/*────────────────────────────────────────────────────────────────────────────
 * RESPONSIVE — below 600px
 *────────────────────────────────────────────────────────────────────────────*/

@media (max-width: 600px) {

	.comment-form-field--half {
		width: 100%;
		display: block;
		margin-right: 0;
	}

	.comment-oauth__buttons {
		flex-direction: column;
	}

	.oauth-btn {
		justify-content: center;
	}

	.comment-list .depth-2 { padding-left: 1.25em; }
	.comment-list .depth-3 { padding-left: 1.25em; }
	.comment-list .depth-4 { padding-left: 1.0em; }
	.comment-list .depth-5 { padding-left: 0.75em; }

}


/*────────────────────────────────────────────────────────────────────────────
 * MISC
 *────────────────────────────────────────────────────────────────────────────*/

li[id^="comment-"] {
	scroll-margin-top: 80px;
}

/* hide broken img icon */
.comment-avatar__img {
	display: none;
}
