/*
Theme Name: FGT Golf Theme
Theme URI: https://wpgolftheme.fairgotech.com/
Author: Mark Clayton
Author URI: https://www.fairgotech.com/
Description: Custom WordPress theme for small golf clubs featuring course and hole displays, event listings, member integration, sponsor showcases, and responsive modern design optimized for club websites.
Version: 0.8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fgt-golf-theme
Tags: golf, club, green, modern, responsive
*/

/*
  --fgt-primary: #377A00;
  --fgt-primary-dark: #2f6a00;
  --fgt-text: #012104;
  --fgt-bg: #EAF7EB;
  */

/* Base Colors */
:root {
  --fgt-primary-color: #377A00;
  --fgt-secondary-color: #2f6a00;
  --fgt-primary-dark: #2f6a00;
  --fgt-heading-text-color: #151716;
  --fgt-general-text-color: #7A7A7A;
  --fgt-accent-color: #61CE70;
  --fgt-bg-accent-color: #EAF7EB;
  --fgt-white: #fff;
  --fgt-accent: #D0EBCF;
  --fgt-black: #151716;
  --fgt-primary-font: 'Libre Franklin', 'Roboto', Arial, sans-serif;
  --fgt-seconday-font: 'Roboto', Arial, sans-serif;
  --fgt-primary-font-weight: 600;
  --fgt-secondary-font-weight: 400;
  --fgt-accent-weight: 500;
}

/* Apply modern box-sizing reset */
html {
  box-sizing: border-box; /* Base rule: include padding + borders in element width/height */
}

*, *::before, *::after {
  box-sizing: inherit; /* Inherit from html, covers all elements and pseudo-elements */
}

/* Base body styles */
body {
  font-family: var(--fgt-primary-font); /* Font stack */
  background: var(--fgt-white); /* Page background */
  color: var(--fgt-general-text-color); /* Default text color */
  margin: 0; /* Reset browser default margin */
  padding: 0; /* Reset browser default padding */
  line-height: 1.5; /* Improve readability with consistent line spacing */
}

/* Move site down to clear the WP admin bar */
 body.admin-bar #site-header {
  margin-top: 32px; /* pushes whole page down */
 } 
 
@media (max-width: 782px) {
  body.admin-bar #site-header {
    margin-top: 46px; /* pushes more on small screens */
   }
} 

body h1 {
  font-size: 2rem;
  font-weight: var(--fgt-primary-font-weight);
  color: var(--fgt-heading-text-color);
  line-height: 1.12;
  margin: 1em 0 0.67em 0; /* shorthand: top right bottom left */
  text-align: center;
  word-break: break-word;
}

body h2 {
  font-size: 1.75rem;
  font-weight: var(--fgt-primary-font-weight);
  color: var(--fgt-heading-text-color);
  line-height: 1.16;
  margin: 0.83em 0 0.83em 0; /* shorthand: top right bottom left */
  text-align: left;
  word-break: break-word;
  unicode-bidi: isolate; /* Prevents adjacent text from affecting layout */
}

body h3 {
  font-size: 1.5rem;
  font-weight: var(--fgt-primary-font-weight);
  color: var(--fgt-heading-text-color);
  line-height: 1.2;
  letter-spacing: 0; /* reset any letter spacing */
  margin: 0 0 0.1em 0; /* shorthand: top right bottom left */
  text-align: center;
  word-break: break-word;
  unicode-bidi: isolate; /* Prevents adjacent text from affecting layout */
}

/* Ensure .container matches main content width and centering */
.container {
  max-width: 1200px;       /* Restricts the container to 1200px wide at most */
  margin-left: auto;       /* Auto left margin centers block when width < 100% */
  margin-right: auto;      /* Auto right margin does the same */
  width: 100%;             /* Forces container to stretch to fill parent width */
  padding-left: 2em;       /* Adds 2em padding inside on the left */
  padding-right: 2em;      /* Adds 2em padding inside on the right */
  box-sizing: border-box;  /* Includes padding in the total width calculation */
}

/* General Theme Styles */
.button {
  background: var(--fgt-primary-color); /* Primary button background color */
  color: var(--fgt-white); /* Sets the text color */
  border: none; /* Sets the border */
  border-radius: 6px; /* Rounds the corners */
  padding: 0.7em 2.1em; /* Adds padding inside the button */
  font-weight: 600; /* Makes the font weight semi-bold */
  font-size: 1.05rem; /* Sets the font size */
  cursor: pointer; /* Changes cursor to pointer on hover */
  transition: background 0.2s, color 0.2s; /* Smooth transition for background and color */
  text-align: center; /* Centers text inside the button */
  display: inline-block; /* Makes the button inline-block */
  box-shadow: none; /* Removes any default box shadow */
} 
.button:hover, .wp-block-button__link:hover {
  background: var(--fgt-secondary-color) !important; /* Darker background on hover */
  text-decoration-color: white;
}
/* Make sure anchor text inside our .button stays white on hover.
   This is more specific than the generic `a:hover` rule and comes later
   in the file so it wins without using !important. */
.button:hover a,
.button:focus a,
.wp-block-button__link:hover,
.wp-block-button__link:focus {
  color: var(--fgt-white);
  text-decoration: none;
}

/* More specific rules for anchor elements that ARE the button itself
   (e.g. <a class="button">). These beat a generic `a:hover` because
   they're element+class+pseudo-class selectors (higher specificity). */
a.button,
a.button:link,
a.button:visited {
  color: var(--fgt-white);
}

a.button:hover,
a.button:focus,
.wp-block-button__link:hover,
.wp-block-button__link:focus {
  color: var(--fgt-white);
  text-decoration: none;
}

a {
  color: var(--fgt-primary-color); /* Sets the link color */
  text-decoration: none; /* Removes underline from links */
}
a:hover {
    color: var(--fgt-accent);            /* Keep text white */
    text-decoration: none !important; /* Removes underline from links */
}

.small-heading-text {
  font-size: 16px;                   /* Smaller font size */
  font-weight: 600;                    /* Medium font weight */
  margin: 0;                /* Space below the text */
  color: var(--fgt-primary-color);           /* Primary color for emphasis */
  word-break: break-word;           /* Ensure long words break to avoid overflow */
  box-sizing: border-box; /* ensures padding/border included in size */
  display: block; /* Make it a block element so margin works as expected */
  unicode-bidi: isolate; /* Prevents adjacent text from affecting layout */
  text-align: center; /* Center text */
  font-family: var(--fgt-seconday-font); /* Use heading font */
}


/* Adding responsiveness to images and key elements */

@media (max-width: 900px) { /* Tablet and smaller */
  .container { 
    padding-left: 1em; /* Reduce side padding on smaller screens */
    padding-right: 1em; /* Reduce side padding on smaller screens */
  }
  .header-grid-row,
  .features-list,
  .about-row,
  .why-choose-us-row {
    flex-direction: column; /* Stack items vertically */
    gap: 1em; /* Add spacing between stacked items */
  }
  .feature,
  .about-imagecolumn,
  .about-contentcolumn,
  .why-choose-us-feature {
    min-width: unset; /* Remove min-width to allow shrinking */
    max-width: 100%; /* Ensure it doesn't exceed container width */
    width: 100%; /* Make full width of container */
  }
}

/* Desktop: hide hamburger and current page label (must come BEFORE media queries) */
.hamburger {
  display: none; /* hide by default on desktop */
  cursor: pointer;
  background: none;
  border: none;
  font-size: 2em;
  color: var(--fgt-white);
  padding: 0.25em;
  z-index: 101;
}
.mobile-current-page {
  display: none; /* hide by default on desktop */
}

/* Hide menu and show hamburger on mobile */
@media (max-width: 768px) { /* Mobile screens */
  /* Header layout adjustments for mobile */
  .header-grid-row {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .header-section-left {
    flex: 0 0 auto;
    order: 1;
  }
  .header-section-center {
    flex: 0 0 auto;
    order: 2;
  }
  .header-section-right {
    flex: 0 0 auto;
    order: 3;
  }
  
  /* Nav menu container - flex for hamburger + label alignment */
  .nav-menu {
    position: static;
    display: flex;
    align-items: center;
    gap: 0.25em;
  }
  
  /* The dropdown menu - positioned below the header */
  .nav-menu-header {
    display: none; /* hide menu by default */
    flex-direction: column;
    gap: 0;
    background: var(--fgt-white);
    position: absolute; /* relative to .site-header which has position:relative */
    top: 100%; /* place directly below the header */
    left: 0;
    right: 0;
    width: 100vw; /* full viewport width */
    margin: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 9999; /* very high to be above everything */
    padding: 0;
    border-radius: 0;
    max-height: 70vh;
    overflow-y: auto;
  }
  .nav-menu-header.open {
    display: flex; /* show menu when open */
  }
  .nav-menu-header .nav-menu-item {
    width: 100%;
    text-align: center;
    margin: 0;
  }
  .nav-menu-header .nav-menu-item a {
    color: var(--fgt-primary-color) !important; /* dark text on white bg */
    background: var(--fgt-white);
    padding: 1em 1.5em;
    display: block;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    font-size: 1.1rem;
    text-decoration: none;
  }
  .nav-menu-header .nav-menu-item:last-child a {
    border-bottom: none;
  }
  .nav-menu-header .nav-menu-item a:hover,
  .nav-menu-header .nav-menu-item a:focus {
    background: rgba(30, 77, 43, 0.1);
  }
  .nav-menu-header .nav-menu-item.active a {
    color: var(--fgt-accent-color) !important;
    font-weight: 600;
    background: rgba(30, 77, 43, 0.05);
  }
  
  /* Show hamburger button and current page label */
  .hamburger {
    display: block !important;
    color: var(--fgt-white);
    font-size: 1.8em;
    padding: 0.2em 0.4em;
    margin: 0;
    line-height: 1;
  }
  .mobile-current-page {
    display: block !important;
    color: var(--fgt-white);
    font-size: 1rem;
    font-weight: 500;
    margin-left: 0.5em;
    white-space: nowrap;
  }
  
  /* Hide members button text on small screens, or make it smaller */
  .member-button {
    padding: 0.5em 0.8em;
    font-size: 0.85rem;
  }
}

@media (max-width: 600px) { /* Extra small screens */
  .site-title {
    font-size: 1.2rem;
    text-align: center;
  }
  .hero h1 {
    font-size: 1.5rem;
    text-align: center;
  }
  .button {
    padding: 0.5em 1em;
    font-size: 0.95rem;
  }
  .about-contentcolumn,
  .why-choose-us-feature,
  .container,
  .hero,
  .call-to-action {
    text-align: center;
  }
  .features,
  .features-list {
    text-align: center;
  }
}

img, .feature, .about-image, .about-contentcolumn, .why-choose-us-feature {
  max-width: 100%; /* ensures image doesn't exceed container width */
  height: auto; /* maintains aspect ratio */
  box-sizing: border-box; /* ensures padding/border included in size */
}

.event-item {
    display: flex;
    align-items: center; /* vertical centering */
    justify-content: center; /* horizontal alignment of flex items */
    gap: 50px;
    margin-bottom: 60px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap; /* responsive wrapping on smaller screens */
}

.event-meta {
    flex: 0 0 200px;
    text-align: center;
    position: relative;
}

.club-image-wrapper {
    position: relative;
    display: inline-block;
}

.club-image {
    width: 150px;
    height: 150px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.club-date-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Centered text next to the image */
.event-content {
    flex: 1;
    max-width: 600px;
    text-align: center;
}

.event-title {
    margin-bottom: 10px;
    font-size: 1.6rem;
}

.event-title a {
    color: inherit;
    text-decoration: none;
}

.event-excerpt {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.event-link {
    display: inline-block;
    padding: 8px 16px;
    background: #004aad;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s ease-in-out;
}

.event-link:hover {
    background: #00327a;
}

/* Pagination */
.pagination {
    margin-top: 50px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .event-item {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .club-image {
        width: 120px;
        height: 120px;
    }

    .club-date-overlay {
        font-size: 1rem;
    }
}

/* Page Breadcrumb Styling (matches Course Info metabox breadcrumb) */
.page-breadcrumb {
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.page-breadcrumb a {
    color: var(--fgt-primary-color);
    text-decoration: none;
    font-weight: 500;
}

.page-breadcrumb a:hover {
    text-decoration: underline;
}

.page-breadcrumb .fa-home {
    margin-right: 0.25rem;
    color: var(--fgt-primary-color);
}

.page-breadcrumb span:last-child {
    color: var(--fgt-general-text-color);
}

/* Hide main title on specific pages */
.page-id-74 .entry-title {
    display: none;
}
