/*
Theme Name: Cornerstone Community Theme
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: A custom WordPress theme inspired by the provided Cornerstone Community HTML templates.  It features a bold hero section on the home page, clean typography using the Josefin Sans typeface and simple, responsive layouts for posts and pages.
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cornerstone-community
Tags: community, blog, clean, responsive
*/

/* Import the same font used in the provided HTML templates */
@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@400;700&display=swap');

/* Base element styles */
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

body {
  margin: 0;
  font-family: 'Josefin Sans', sans-serif;
  color: #100f0d;
  line-height: 1.6;
  background-color: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  text-decoration: underline;
}

/* Header and hero */
.site-header {
  position: relative;
}

/* Hero container wraps the background image and navigation */
/*
 * Hero wrapper.  A dark overlay sits on top of the background image to
 * improve legibility of the navigation and tagline.  The background
 * image is the stone and cross photograph provided by the user.
 */
.site-header .hero {
  position: relative;
  background-image: url('images/header.jpg');
  background-size: cover;
  background-position: center;
  min-height: 450px;
  color: #ffffff;
}

/* Dark overlay to enhance contrast of text over the hero image */
.site-header .hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* Wrapper around the branding and primary navigation.  This bar is
 * absolutely positioned at the top of the hero so that the navigation
 * stays visible on top of the background image.  It uses a semi‑opaque
 * background for readability.
 */
.nav-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  /* Elevated z-index so it sits above the hero tagline on mobile when the menu opens */
  z-index: 4;
  background: rgba(0, 0, 0, 0.5);
}

/* Site branding: logo and site name */
.site-branding {
  display: flex;
  align-items: center;
}

.site-branding a {
  display: flex;
  align-items: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Logo icon inside site branding */
.site-branding .brand-icon {
  width: 32px;
  height: auto;
  margin-right: 0.5rem;
  display: block;
}

/*
 * Mobile navigation toggle button
 * The button is hidden on larger screens but displayed on small screens via
 * media queries below.  The internal .hamburger span and its pseudo
 * elements create the three lines of the hamburger icon.
 */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  z-index: 3;
}

.menu-toggle .hamburger,
.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
  display: block;
  width: 26px;
  height: 3px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
  content: '';
  position: relative;
  left: 0;
}

.menu-toggle .hamburger::before {
  transform: translateY(-8px);
}

.menu-toggle .hamburger::after {
  transform: translateY(5px);
}

/* When the nav is open, animate the hamburger into an X */
.nav-wrapper.menu-open .menu-toggle .hamburger {
  background-color: transparent;
}

.nav-wrapper.menu-open .menu-toggle .hamburger::before {
  transform: rotate(45deg) translate(5px, -5px);
}

.nav-wrapper.menu-open .menu-toggle .hamburger::after {
  transform: rotate(-45deg) translate(6px, 6px);
}

/* Responsive menu behaviour */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  .nav-wrapper ul.primary-menu {
    /* Hide the menu by default on small screens */
    display: none;
    flex-direction: column;
    /* Position the drop‑down below the navigation bar */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    /* Ensure the menu overlays content like the hero tagline */
    z-index: 3;
    /* Dark background for legibility */
    background: rgba(0, 0, 0, 0.85);
    padding: 1rem 2rem;
    margin: 0;
  }
  .nav-wrapper.menu-open ul.primary-menu {
    display: flex;
  }
  .nav-wrapper ul.primary-menu > li {
    margin: 0.5rem 0;
  }
  .nav-wrapper ul.primary-menu > li > a {
    font-size: 1.1rem;
  }
}

/*
 * Position this override after the base navigation styles.  It ensures the
 * mobile menu is hidden by default even if earlier rules set display:flex.
 */
@media (max-width: 768px) {
  .nav-wrapper ul.primary-menu {
    display: none !important;
  }
  .nav-wrapper.menu-open ul.primary-menu {
    display: flex !important;
  }
}

/* Primary menu inside the nav wrapper */
.nav-wrapper ul.primary-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.nav-wrapper ul.primary-menu > li {
  margin-left: 2rem;
}

.nav-wrapper ul.primary-menu > li:first-child {
  margin-left: 0;
}

.nav-wrapper ul.primary-menu > li > a {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  padding-bottom: 0.25rem;
}

/* Underline effect on hover */
.nav-wrapper ul.primary-menu > li > a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #bb8c4b; /* warm highlight colour reminiscent of the original */
  transition: width 0.2s ease;
}

.nav-wrapper ul.primary-menu > li > a:hover::after,
.nav-wrapper ul.primary-menu > li > a:focus::after,
.nav-wrapper ul.primary-menu > li.current-menu-item > a::after {
  width: 100%;
}

/* Reposition the tagline to centre of the hero */
.main-tagline {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%);
  width: 100%;
  text-align: center;
  font-size: 3rem;
  line-height: 1.1;
  font-weight: 700;
  z-index: 2;
}

/* Remove legacy styles for the old navigation and tagline placement.  The
 * navigation is now handled by .nav-wrapper and the tagline positioning
 * is defined earlier.  Therefore the old definitions are omitted.
 */

/* Main content area */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Section wrapper for the icons and text on the home page */
.home-section {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.home-section .icon {
  flex: 0 0 60px;
  margin-right: 1rem;
}

.home-section .icon svg {
  width: 60px;
  height: 60px;
  fill: #100f0d;
}

.home-section h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
}

.home-section p {
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-size: 1rem;
  flex: 1;
}

/* Single/post and page templates */
.single-content, .page-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.single-content h1,
.page-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.single-content p,
.page-content p {
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* Footer */
footer {
  background-color: #f5f5f5;
  color: #666666;
  font-size: 0.8rem;
  text-align: center;
  padding: 1.5rem 1rem;
}

footer a {
  color: inherit;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .main-tagline {
    font-size: 2.5rem;
    transform: translate(-50%, -35%);
  }
}

@media (max-width: 600px) {
  /* Stack navigation items on small screens */
  .nav-wrapper ul.primary-menu {
    flex-direction: column;
    align-items: center;
  }

  .nav-wrapper ul.primary-menu > li {
    margin: 0.5rem 0;
  }

  .main-tagline {
    font-size: 2rem;
    transform: translate(-50%, -30%);
  }

  .home-section {
    flex-direction: column;
  }

  .home-section .icon {
    margin-bottom: 0.5rem;
  }
}