/* =========================
   1. Fonts & Global Styles
   ========================= */
@import url('https://fonts.googleapis.com/css?family=Trirong');
@import url('https://fonts.googleapis.com/css?family=Sofia');
@import url('https://fonts.googleapis.com/css?family=Montserrat');

body {
	background-color: #696969;
	font-family: "Trirong", serif;
	color: white;
	margin: 0; padding: 0;
}

h1 {                                                                                                                                                      
	color: black;                                                                                                                                     
	font-weight: 900;                                                                                                                                 
	font-size: clamp(2.2rem, 8vw, 4rem);                                                                                                              
	text-align: center;                                                                                                                               
	/* Pulls the header closer to the top navigation */
	margin: -10px 0 0 0;                                                                                                                               
}                                                                                                                                                         
	                                                                                                                                                      
h2 {                                                                                                                                                      
	color: #ffffff;
	text-align: center; 
	/* Tucks the h2 directly under the h1 */
	margin-top: -5px; 
	margin-bottom: 0;                                                                                                                                 
}

.fine-art {
	color: black;
}

/* =========================
   2. Content Containers & Layout
   ========================= */

/* The wrapper that centers a block but keeps text left-aligned */
.content-wrapper {
	margin: 0 auto; 
	width: 90%;
	max-width: 1200px; 
	text-align: left; 
	padding-top: 5px; 
	padding-bottom: 20px; 
}

/* Specific text lines that should be forced to center */
.centered-text {
	text-align: center;
	width: 100%;
	color: black;
}

.index-container {
	width: 100%; 
	margin: 20px 0; 
}

.about-container { max-width: 800px; margin: 0 auto; }
.info-container  { max-width: 480px; margin: 0 auto; }

.index-img {
    width: 100%;
    height: auto;
    display: block;
}

.about-img, .info-img {
	width: 100%;
	height: auto;
	display: block;
	padding-top: 20px;
}

/* Centering logic for the book section */
.books-section {
	display: flex;
	justify-content: center;
	width: 100%;
	margin-top: 30px;
	padding-bottom: 50px;
}

.book-content {
	text-align: left;
	display: inline-block;
}

.book-links {
	margin-top: 10px;
	line-height: 1.8; 
}

/* --- Dedicated Book Link Styles --- */
.book-links a, 
.book-links a:link, 
.book-links a:visited {
    color: #f2f2f2 !important;
    text-decoration: underline !important;
    cursor: pointer;
    padding: 0;
    background-color: transparent !important;
    transition: color 0.2s;
}

/* --- Simple Hover Effect for Books --- */
.book-links a:hover {
    color: #bbb !important;
    text-decoration: none !important;
}

/* =========================
   3. Top / Bottom Navigation
   ========================= */

/* --- Navigation Containers --- */
.topnav, 
.bottomnav {
	display: flex;
	justify-content: flex-start;
	gap: 20px;
	padding: 10px 20px; 
}

.topnav {
	padding-top: 40px;
}

.bottomnav {
	padding-bottom: 40px;
}

/* --- Combined Link Styles --- */
.topnav a, .topnav a:link, .topnav a:visited,
.bottomnav a, .bottomnav a:link, .bottomnav a:visited {
	color: #f2f2f2 !important;
	text-decoration: none !important;
	cursor: pointer;
	padding: 8px 12px;
	border-radius: 4px;
	transition: background-color 0.2s, color 0.2s;
	background-color: transparent;
}

/* --- Visible Gray Hover Box --- */
.topnav a:hover, 
.bottomnav a:hover {
	color: black !important;
	background-color: #bbb !important;
}

/* --- Active Page Styles --- */
.topnav a.active, 
.bottomnav a.active {
	background-color: #808080 !important;
	color: white !important;
}

/* =========================
   4. Gallery Grid & Cards
   ========================= */
.gallery-grid {
	display: grid !important;
	justify-content: center !important;
	grid-template-columns: repeat(auto-fit, minmax(280px, 350px)) !important;
	gap: 40px; 
}

.gallery-item {
	background: #ffffff !important;
	padding: 20px !important;
	border-radius: 8px;
	box-shadow: 0 10px 25px rgba(0,0,0,0.3);
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	overflow: hidden; 
	transition: box-shadow 0.25s ease;
}

.gallery-thumb {
	width: 100% !important;
	height: 230px !important;
	object-fit: contain !important;
	background-color: #f9f9f9;
	border-radius: 4px;
	margin-bottom: 15px;
	transition: transform 0.25s ease; 
}

.gallery-item:hover .gallery-thumb {
	transform: scale(1.04); 
}

.gallery-item:hover {
	box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}

.caption {
	text-align: center;
	color: #333 !important;
	font-weight: bold;
	font-size: 1.1rem;
	text-transform: none !important; /* Ensures PHP casing fixes work */
}

/* =========================
   5. Lightbox
   ========================= */
.lightbox {
	display: none; 
	position: fixed; 
	z-index: 10000;
	left: 0; top: 0; 
	width: 100%; height: 100%;
	background-color: rgba(0, 0, 0, 0.95);
	align-items: center; 
	justify-content: center;
}

.lightbox.active { 
	display: flex; 
}

.lightbox-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	max-width: 80%; 
}

.lightbox-img { 
	max-width: 100%; 
	max-height: 80vh; 
	border: 3px solid white; 
	display: block;
}

.lightbox-caption {
	color: white;
	margin-top: 15px;
	font-size: 1.2rem;
	text-align: center;
	width: 100%;
}

.lightbox .close {
	position: absolute;
	top: 20px;
	right: 30px;
	font-size: 60px;
	color: white;
	cursor: pointer;
	user-select: none;
	font-family: Arial, sans-serif;
	z-index: 10001;
	transition: color 0.2s;
}

.lightbox .prev,
.lightbox .next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	font-size: 50px;
	color: white;
	cursor: pointer;
	user-select: none;
	background: none;
	border: none;
	padding: 20px; 
	line-height: 1;
	z-index: 10001;
}

.lightbox .prev { left: 30px; }
.lightbox .next { right: 30px; }

.lightbox .prev:hover,
.lightbox .next:hover,
.lightbox .close:hover {
	color: #fffccc;
	text-shadow: 0 0 5px black;
}

/* =========================
   6. Contact Form & Cards
   ========================= */
.page-centering-container {
	display: flex;
	justify-content: center;
	align-items: center; 
	min-height: 90vh; 
	padding: 60px 20px;
	margin-top: 20px;
}

.contact-card {
	background: rgba(105, 105, 105, 0.9); /* Matching gray with slight transparency */
	backdrop-filter: blur(10px);
	width: 100%;
	max-width: 600px;
	padding: 40px;
	border-radius: 15px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	animation: slideUpFade 0.7s ease-out forwards;
	opacity: 0;
}

@keyframes slideUpFade {
	from { opacity: 0; transform: translateY(30px); }
	to { opacity: 1; transform: translateY(0); }
}

.contact-form label {
	color: #fff;
	font-weight: 600;
}

.contact-form .form-row {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	margin-bottom: 5px;
}

.contact-form .form-group {
	flex: 1;
	min-width: 200px;
	display: flex;
	flex-direction: column;
	margin-bottom: 20px;
}

.contact-form input, 
.contact-form select, 
.contact-form textarea {
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 1rem;
	font-family: 'Trirong', serif; 
	transition: all 0.3s ease;
	background-color: #fff;
	width: 100%;
	box-sizing: border-box;
	color: #333;
}

.contact-form input:focus, 
.contact-form select:focus, 
.contact-form textarea:focus {
	outline: none;
	border-color: #395c75;
	box-shadow: 0 0 0 4px rgba(57, 92, 117, 0.15);
}

.contact-form button {
	position: relative;
	width: 100%;
	padding: 16px;
	background-color: #395c75;
	color: white;
	border: none;
	border-radius: 8px;
	font-weight: 600;
	font-size: 1.1rem;
	cursor: pointer;
	transition: transform 0.2s, background-color 0.2s;
	margin-top: 10px;
	display: flex;
	justify-content: center;
	align-items: center;
}

.contact-form button:disabled {
	background-color: #5a7b91;
	cursor: not-allowed;
}

.spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 3px solid rgba(255,255,255,.3);
	border-radius: 50%;
	border-top-color: #fff;
	animation: spin 1s ease-in-out infinite;
	margin-left: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }
.is-loading .spinner { display: inline-block; }

.status-msg {
	padding: 15px;
	border-radius: 8px;
	margin-bottom: 25px;
	text-align: center;
	font-weight: 600;
}
.success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }

/* =========================
   7. Mobile Responsiveness
   ========================= */
@media (max-width: 600px) {
	.gallery-grid { 
	    grid-template-columns: 1fr !important; 
	}
	.topnav { 
	    flex-direction: column; 
	    align-items: center; 
	}
	.contact-form .form-row {
	    flex-direction: column; 
	    gap: 0; 
	}
	.contact-card {
	    padding: 25px 20px; 
	}
	.lightbox .close { 
	    top: 10px; 
	    right: 20px; 
	}
}
