/*
Theme Name: Twenty Twenty-Four Child
Template: twentytwentyfour
Author: Martin Williams <martin@fourchord.com>
Description: Child theme for displaying custom directory entries.
Version: 1.0
*/

/* Import the parent theme's styles */
@import url("../twentytwentyfour/style.css");

.admin-bar .home-wrapper {
    min-height: calc(100vh - 32px) !important;
}
.home-wrapper > * {
    width: 100%;
}
.home-wrapper > main {
    flex: 1;
}

footer nav .wp-block-loginout a {
    padding: .5em 1em;
    display: block;
    color: inherit;
}

/* Custom styles for directory entry */
.directory-entry-archive img {
    max-width: 150px;
    height: auto;
}

/* Directory Search Form Styles */
.directory-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.directory-search-input {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex: 1; /* Allows inputs to adjust based on the container */
    min-width: 150px; /* Prevents inputs from becoming too small */
}

.button,
.button-primary,
.directory-search-submit {
    padding: 10px 20px;
    background-color: #3258a7;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.button:hover,
.button-primary:hover,
.directory-search-submit:hover {
    background-color: #274685; /* Darken the button on hover */
}

/* Optional: Hide labels visually but keep them for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.wp-block-post-template li.wp-block-post.directory_entry {
    background: #fff;
    padding: 1rem;
    border-radius: var(--wp--preset--spacing--20);
    box-shadow: 0 0 1px rgba(0,0,0,0.1);
}
.wp-block-post-template li.wp-block-post.directory_entry .wp-block-post-featured-image img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}


/* Custom ACF Form Styles */

/* General form styling */
#acf-form.acf-form {
    margin: 20px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

/* Label styling */
#acf-form.acf-form .acf-label label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

/* Input field styling */
#acf-form.acf-form .acf-input input[type="text"],
#acf-form.acf-form .acf-input input[type="email"],
#acf-form.acf-form .acf-input input[type="url"],
#acf-form.acf-form .acf-input textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

/* Button styling */
#acf-form.acf-form .acf-button.button-primary {
    background-color: #3258a7; /* Primary color */
    border: none;
    color: #ffffff;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

#acf-form.acf-form .acf-button.button-primary:hover {
    background-color: #253d7a; /* Darker shade of primary color */
}

/* Icon inside URL fields */
#acf-form.acf-form .acf-input-wrap.acf-url i.acf-icon {
    color: #3258a7;
    margin-right: 8px;
}

/* Textarea specific styling */
#acf-form.acf-form .acf-input textarea {
    resize: vertical;
}

/* Description text styling */
#acf-form.acf-form .acf-label p.description {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
}

/* General Popup Styling */
.popup {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black background with opacity */
    padding: 20px;
}

/* Popup Content */
.popup-content {
    background-color: #fff;
    margin: 5% auto; /* 5% from top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Default width */
    max-width: 600px; /* Max width for larger screens */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border-radius: 8px;
    position: relative;
}

/* Close Button */
.close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover, .close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .popup-content {
        width: 95%; /* Almost full width on smaller screens */
        padding: 15px; /* Slightly less padding */
    }
}

@media screen and (max-width: 480px) {
	.popup {
		padding: 20px 0;
	}
	
    .popup-content {
        width: 90%; /* Full width on very small screens */
        padding: 10px; /* Reduced padding */
        margin: 10% auto; /* More margin from the top */
    }

    .popup-content h2 {
        font-size: 18px; /* Smaller font size for headings */
    }
	
	.popup-content h3 {
		font-size: 16px;
	}

    .popup-content p, .popup-content ul, .popup-content button {
        font-size: 14px; /* Smaller font size for content and buttons */
    }
}

@media screen and (max-height: 400px) {
    .popup-content {
        margin: 2% auto; /* Less margin for very short screens */
        max-height: 90vh; /* Constrain height */
        overflow-y: auto; /* Scroll content if needed */
    }
}


