/*
 Theme Name:   Avada Child
 Theme URI:    https://humandream.org
 Description:  Avada Child Theme for humandream.org
 Author:       humandream.org
 Author URI:   https://humandream.org
 Template:     Avada
 Version:      1.0.0
 Text Domain:  humandream
*/

/*
 * HOW THIS FILE IS STRUCTURED
 * ─────────────────────────────────────────────────────────────────
 * 1.  Custom global / utility overrides (add your own here)
 * 2.  hd_changemaker_projects shortcode — project cards grid
 * 3.  hd_cm_video shortcode — responsive video embed
 * 4.  hd_cm_gallery shortcode — photo grid gallery
 * 5.  hd_cm_social_icons shortcode — social icon row + pill style
 * ─────────────────────────────────────────────────────────────────
 * Add any Avada/Fusion Builder overrides BELOW the existing rules.
 * Keep all custom code in this file — never edit the parent theme.
 */


/* ================================================================
   1. GLOBAL / UTILITY OVERRIDES
   Add any site-wide style overrides here
   ================================================================ */

/* Example: ensure all shortcode content respects Avada box-sizing */
.hd-sc-projects-wrap *,
.hd-sc-video-wrap *,
.hd-sc-gallery-wrap *,
.hd-sc-social-wrap * {
	box-sizing: border-box;
}


/* ================================================================
   2. [hd_changemaker_projects] SHORTCODE — PROJECT CARDS GRID
   ================================================================ */

.hd-sc-projects-grid {
	display: grid;
	gap: 28px;
	margin: 0 0 40px;
}

.hd-sc-cols-1 { grid-template-columns: 1fr; }
.hd-sc-cols-2 { grid-template-columns: repeat(2, 1fr); }
.hd-sc-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 900px) {
	.hd-sc-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
	.hd-sc-cols-2,
	.hd-sc-cols-3 { grid-template-columns: 1fr; }
}

.hd-sc-project-card {
	background: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease;
}

.hd-sc-project-card:hover {
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}

.hd-sc-project-thumb img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
}

.hd-sc-project-body {
	padding: 20px 24px 24px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

/* Status badges */
.hd-sc-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 3px 10px;
	border-radius: 20px;
	margin-bottom: 10px;
}

.hd-sc-status-active    { background: #EAF7EE; color: #1E6B35; }
.hd-sc-status-completed { background: #E8F4FB; color: #1A3A5C; }
.hd-sc-status-upcoming  { background: #FFF8EC; color: #C07000; }
.hd-sc-status-paused    { background: #F3F0FA; color: #5B4A8A; }

.hd-sc-project-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 6px;
	line-height: 1.3;
}

.hd-sc-project-title a {
	color: inherit;
	text-decoration: none;
}

.hd-sc-project-title a:hover {
	color: #2E6DA4;
}

.hd-sc-project-years {
	font-size: 13px;
	color: #888888;
	margin: 0 0 10px;
}

.hd-sc-project-regions {
	margin: 0 0 12px;
}

.hd-sc-tag {
	display: inline-block;
	background: #E8F4FB;
	color: #1A3A5C;
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 4px;
	margin: 0 4px 4px 0;
}

.hd-sc-project-excerpt {
	font-size: 14px;
	color: #555555;
	margin: 0 0 12px;
	flex: 1;
	line-height: 1.6;
}

.hd-sc-project-stat {
	font-size: 15px;
	font-weight: 600;
	color: #1A3A5C;
	margin: 0 0 16px;
}

.hd-sc-project-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: auto;
}

.hd-sc-btn-primary,
.hd-sc-btn-secondary {
	font-size: 13px;
	font-weight: 600;
	padding: 8px 16px;
	border-radius: 4px;
	text-decoration: none;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
	display: inline-block;
}

.hd-sc-btn-primary {
	background: #2E6DA4;
	color: #ffffff;
	border: 1px solid #2E6DA4;
}

.hd-sc-btn-primary:hover {
	background: #1A3A5C;
	border-color: #1A3A5C;
	color: #ffffff;
}

.hd-sc-btn-secondary {
	background: transparent;
	color: #2E6DA4;
	border: 1px solid #2E6DA4;
}

.hd-sc-btn-secondary:hover {
	background: #E8F4FB;
}


/* ================================================================
   3. [hd_cm_video] SHORTCODE — RESPONSIVE VIDEO EMBED
   ================================================================ */

.hd-sc-video-wrap {
	max-width: 800px;
	margin: 0 auto 40px;
}

.hd-sc-video-heading {
	text-align: center;
	margin: 0 0 24px;
}

.hd-sc-video-responsive {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 aspect ratio */
	height: 0;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.hd-sc-video-responsive iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: none;
}


/* ================================================================
   4. [hd_cm_gallery] SHORTCODE — PHOTO GRID GALLERY
   ================================================================ */

.hd-sc-gallery-wrap {
	display: grid;
	gap: 12px;
	margin: 0 0 40px;
}

/* Grid layout adapts to number of photos saved */
.hd-sc-gallery-count-1 {
	grid-template-columns: 1fr;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 40px;
}

.hd-sc-gallery-count-2 {
	grid-template-columns: repeat(2, 1fr);
}

.hd-sc-gallery-count-3 {
	grid-template-columns: repeat(3, 1fr);
}

.hd-sc-gallery-count-4 {
	grid-template-columns: repeat(2, 1fr);
}

.hd-sc-gallery-count-5 {
	grid-template-columns: repeat(3, 1fr);
}

/* 5th photo spans full row to avoid orphan gap */
.hd-sc-gallery-count-5 .hd-sc-gallery-item:last-child {
	grid-column: span 3;
	max-height: 300px;
}

/*
 * TO INCREASE MAXIMUM PHOTOS — add grid rules for new counts:
 *
 * .hd-sc-gallery-count-6  { grid-template-columns: repeat(3, 1fr); }
 * .hd-sc-gallery-count-7,
 * .hd-sc-gallery-count-8,
 * .hd-sc-gallery-count-9,
 * .hd-sc-gallery-count-10 { grid-template-columns: repeat(4, 1fr); }
 *
 * Also update in functions.php:
 *   - hd_cm_meta_box_html()     → for ( $i = 1; $i <= 5; ... )
 *   - hd_cm_save_meta()         → for ( $i = 1; $i <= 5; ... )
 *   - hd_shortcode_cm_gallery() → $max_photos = 5
 */

.hd-sc-gallery-item {
	margin: 0;
	overflow: hidden;
	border-radius: 6px;
	background: #f0f0f0;
}

.hd-sc-gallery-item img {
	width: 100%;
	height: 260px;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.hd-sc-gallery-item:hover img {
	transform: scale(1.03);
}

.hd-sc-gallery-link {
	display: block;
	overflow: hidden;
}

/* Tablet */
@media (max-width: 900px) {
	.hd-sc-gallery-count-3,
	.hd-sc-gallery-count-4,
	.hd-sc-gallery-count-5 {
		grid-template-columns: repeat(2, 1fr);
	}
	.hd-sc-gallery-count-5 .hd-sc-gallery-item:last-child {
		grid-column: span 2;
	}
}

/* Mobile */
@media (max-width: 480px) {
	.hd-sc-gallery-wrap {
		grid-template-columns: 1fr !important;
	}
	.hd-sc-gallery-count-5 .hd-sc-gallery-item:last-child {
		grid-column: span 1;
	}
	.hd-sc-gallery-item img {
		height: 220px;
	}
}


/* ================================================================
   5. [hd_cm_social_icons] SHORTCODE — ICON ROW + PILL STYLE
   ================================================================ */

/* Shared wrapper */
.hd-sc-social-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin: 0 0 24px;
}

/* ── Icon-only mode (default) ─────────────────────────────────── */
.hd-sc-social-icons .hd-sc-social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #f0f0f0;
	color: var(--hd-social-color, #333333);
	text-decoration: none;
	transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.hd-sc-social-icons .hd-sc-social-link:hover {
	background: var(--hd-social-color, #333333);
	color: #ffffff;
	transform: translateY(-2px);
}

/* ── Pill mode (icon + label) ────────────────────────────────── */
.hd-sc-social-pills .hd-sc-social-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border-radius: 24px;
	background: #f0f0f0;
	color: var(--hd-social-color, #333333);
	text-decoration: none;
	font-size: 14px;
	transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.hd-sc-social-pills .hd-sc-social-link:hover {
	background: var(--hd-social-color, #333333);
	color: #ffffff;
	transform: translateY(-2px);
}

.hd-sc-social-label {
	font-size: 14px;
	font-weight: 600;
	font-family: Arial, sans-serif;
}

.hd-sc-social-link i {
	pointer-events: none;
}

/* ── Override for icons placed on a dark Hero background ──────── */
/* Add class "hd-hero-dark" to the Fusion Builder container that
   wraps the social icons shortcode inside the hero section.
   Go to: Container settings → CSS Class → hd-hero-dark          */

.hd-hero-dark .hd-sc-social-link {
	background: rgba(255, 255, 255, 0.15);
	color: #ffffff;
}

.hd-hero-dark .hd-sc-social-link:hover {
	background: rgba(255, 255, 255, 0.30);
	color: #ffffff;
}
