/*
Theme Name: Phalanx Prestige
Theme URI: https://phalanx31.org/
Author: Garett Latham
Description: A modern classic WordPress theme for a historical lodge or civic organization. Built for clean typography, strong hierarchy, posts, pages, and simple management on shared hosting.
Version: 1.0.1
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: phalanx-prestige
Tags: custom-logo, custom-menu, featured-images, blog, one-column, two-columns, right-sidebar, editor-style, wide-blocks
*/

:root {
  --pp-bg: #f7f4ef;
  --pp-surface: #ffffff;
  --pp-surface-alt: #efe7db;
  --pp-text: #17212b;
  --pp-muted: #5a6570;
  --pp-border: #d9cbb1;
  --pp-accent: #b08a45;
  --pp-accent-dark: #8d6c31;
  --pp-navy: #0f1b2d;
  --pp-shadow: 0 14px 40px rgba(15, 27, 45, 0.08);
  --pp-radius: 18px;
  --pp-content: 1160px;
  --pp-narrow: 780px;
  --pp-transition: 180ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--pp-bg);
  color: var(--pp-text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

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

a {
  color: var(--pp-accent-dark);
  text-decoration: none;
  transition: color var(--pp-transition), opacity var(--pp-transition), background var(--pp-transition), border-color var(--pp-transition);
}

a:hover,
a:focus {
  color: var(--pp-accent);
}

h1,
h2,
h3,
h4,
h5,
h6,
.site-title,
.entry-title,
.section-title {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  letter-spacing: 0.01em;
  color: var(--pp-navy);
}

p {
  margin: 0 0 1.15rem;
}

ul,
ol {
  margin: 0 0 1.25rem 1.25rem;
  padding: 0;
}

blockquote {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #fbf8f2;
  border-left: 4px solid var(--pp-accent);
  border-radius: 0 var(--pp-radius) var(--pp-radius) 0;
}

.wp-block-image,
figure {
  margin: 0 0 1.5rem;
}

.container,
.site-main > article,
.page-header__inner,
.site-footer__inner,
.site-header__inner,
.archive-loop,
.front-page__section-inner {
  width: min(calc(100% - 2rem), var(--pp-content));
  margin-inline: auto;
}

.container--narrow {
  width: min(calc(100% - 2rem), var(--pp-narrow));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--pp-navy);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 10000;
  border-radius: 10px;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(14px);
  background: rgba(247, 244, 239, 0.92);
  border-bottom: 1px solid rgba(176, 138, 69, 0.15);
}

.site-header__inner {
  min-height: 86px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  padding: 0.9rem 0;
}

.branding {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.custom-logo-link img {
  width: auto;
  max-height: 64px;
}

.branding__text {
  min-width: 0;
}

.site-title {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  margin-bottom: 0.1rem;
}

.site-title a {
  color: var(--pp-navy);
}

.site-description {
  color: var(--pp-muted);
  font-size: 0.95rem;
  margin: 0;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pp-accent);
  color: #fff;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
}

.header-cta:hover,
.header-cta:focus {
  background: var(--pp-accent-dark);
  color: #fff;
}

.menu-toggle {
  display: none;
  border: 1px solid rgba(15, 27, 45, 0.12);
  background: #fff;
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  color: var(--pp-navy);
  font-weight: 600;
  cursor: pointer;
}

.primary-navigation {
  justify-self: center;
  min-width: 0;
}

.primary-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-navigation > div > ul,
.primary-navigation > ul {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  flex-wrap: wrap;
}

.primary-navigation a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0;
  font-size: 0.96rem;
  color: var(--pp-navy);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.primary-navigation .menu-item-has-children {
  position: relative;
}

.primary-navigation .sub-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 0.4rem);
  min-width: 220px;
  padding: 0.7rem;
  background: #fff;
  border: 1px solid rgba(15, 27, 45, 0.08);
  border-radius: 16px;
  box-shadow: var(--pp-shadow);
  display: none;
}

.primary-navigation .sub-menu li + li {
  margin-top: 0.15rem;
}

.primary-navigation .sub-menu a {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-weight: 500;
}

.primary-navigation .sub-menu a:hover,
.primary-navigation .sub-menu a:focus {
  background: rgba(176, 138, 69, 0.1);
  color: var(--pp-accent-dark);
}

.primary-navigation .menu-item-has-children:hover > .sub-menu,
.primary-navigation .menu-item-has-children:focus-within > .sub-menu {
  display: block;
}

.hero {
  position: relative;
  color: #fff;
  overflow: clip;
  background:
    linear-gradient(135deg, rgba(15, 27, 45, 0.9), rgba(15, 27, 45, 0.68)),
    var(--hero-image, linear-gradient(135deg, #10223e, #2f476a));
}

.hero.hero--has-image {
  background:
    linear-gradient(135deg, rgba(15, 27, 45, 0.84), rgba(15, 27, 45, 0.58)),
    var(--hero-image) center/cover no-repeat;
}

.hero__inner {
  width: min(calc(100% - 2rem), var(--pp-content));
  margin-inline: auto;
  padding: clamp(4rem, 10vw, 7.4rem) 0 clamp(3rem, 8vw, 5.6rem);
  display: grid;
  gap: 2rem;
  align-items: end;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__title {
  max-width: 10ch;
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  color: #fff;
  margin-bottom: 1rem;
}

.hero__text {
  max-width: 40rem;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: rgba(255,255,255,0.85);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.8rem;
}

.button,
.wp-block-button__link,
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--pp-accent);
  color: #fff;
  font-weight: 700;
  padding: 0.8rem 1.1rem;
  cursor: pointer;
  text-align: center;
}

.button:hover,
.wp-block-button__link:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover {
  background: var(--pp-accent-dark);
  color: #fff;
}

.button--secondary {
  background: transparent;
  border-color: rgba(255,255,255,0.34);
  color: #fff;
}

.button--secondary:hover {
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.front-page__section {
  padding: clamp(3.2rem, 6vw, 5rem) 0;
}

.front-page__section--surface {
  background: var(--pp-surface);
}

.front-page__section--tint {
  background: linear-gradient(180deg, #fcfaf7, #f5ede3);
}

.section-heading {
  max-width: 52rem;
  margin: 0 auto 2rem;
  text-align: center;
}

.section-eyebrow {
  color: var(--pp-accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  margin-bottom: 0.9rem;
}

.section-title {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  margin-bottom: 0.9rem;
}

.section-intro {
  color: var(--pp-muted);
  font-size: 1.05rem;
}

.prose {
  width: min(100%, var(--pp-narrow));
  margin-inline: auto;
  color: var(--pp-text);
  font-size: 1.03rem;
}

.feature-grid,
.post-grid,
.footer-widgets {
  display: grid;
  gap: 1.35rem;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.post-card,
.surface-card {
  background: var(--pp-surface);
  border: 1px solid rgba(15, 27, 45, 0.06);
  border-radius: var(--pp-radius);
  box-shadow: var(--pp-shadow);
  padding: 1.6rem;
}

.feature-card h3,
.post-card h3 {
  font-size: 1.55rem;
  margin-bottom: 0.55rem;
}

.feature-card p,
.post-card p,
.post-meta {
  color: var(--pp-muted);
}

.feature-card__link,
.post-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  margin-top: 1rem;
}

.post-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card__image {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1rem;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #d7c7a8, #f4ede3);
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card__content {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
}

.post-card__excerpt {
  margin-bottom: 0;
}

.post-card__footer {
  margin-top: auto;
  padding-top: 0.7rem;
}

.callout {
  border-radius: calc(var(--pp-radius) + 6px);
  padding: clamp(2rem, 5vw, 3rem);
  background: linear-gradient(135deg, rgba(15, 27, 45, 0.96), rgba(40, 56, 81, 0.92));
  color: #fff;
  display: grid;
  gap: 1.25rem;
  align-items: center;
}

.callout h2 {
  color: #fff;
  margin-bottom: 0.65rem;
}

.callout p {
  color: rgba(255,255,255,0.82);
  max-width: 42rem;
  margin-bottom: 0;
}

.page-header {
  padding: clamp(2.4rem, 6vw, 4rem) 0 1.5rem;
}

.page-header--simple {
  background: linear-gradient(180deg, rgba(15, 27, 45, 0.05), transparent);
}

.page-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  margin-bottom: 0.65rem;
}

.page-description,
.archive-description {
  color: var(--pp-muted);
  max-width: 50rem;
}

.site-main {
  padding-bottom: 4rem;
}

.entry-content,
.entry-summary {
  color: var(--pp-text);
}

.entry-content > * {
  max-width: min(100%, var(--pp-narrow));
  margin-inline: auto;
}

.entry-content > .alignwide {
  max-width: min(100%, var(--pp-content));
}

.entry-content > .alignfull {
  max-width: 100%;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 2rem;
}

.entry-content img,
.entry-content .wp-block-image img {
  border-radius: 16px;
}

.content-shell {
  width: min(calc(100% - 2rem), var(--pp-content));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
}

.content-shell--single,
.content-shell--page {
  grid-template-columns: minmax(0, 1fr);
}

.main-column,
.sidebar-column {
  min-width: 0;
}

.sidebar-column .widget {
  background: var(--pp-surface);
  border-radius: 16px;
  padding: 1.35rem;
  box-shadow: var(--pp-shadow);
  border: 1px solid rgba(15, 27, 45, 0.05);
  margin-bottom: 1.1rem;
}

.archive-loop {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  color: var(--pp-muted);
  font-size: 0.94rem;
  margin-bottom: 1.2rem;
}

.entry-featured {
  margin-bottom: 1.5rem;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #d7c7a8, #f4ede3);
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 27, 45, 0.08);
}

.posts-navigation,
.navigation.pagination {
  margin-top: 2rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea,
select {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(15, 27, 45, 0.16);
  background: #fff;
  padding: 0.85rem 1rem;
  color: var(--pp-text);
  font: inherit;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.search-form {
  display: flex;
  gap: 0.75rem;
}

.search-form label {
  flex: 1;
  margin-bottom: 0;
}

.site-footer {
  background: var(--pp-navy);
  color: rgba(255,255,255,0.78);
  margin-top: 3rem;
}

.site-footer__inner {
  padding: 3rem 0 2rem;
}

.footer-widgets {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.footer-widget-title {
  color: #fff;
  font-size: 1.2rem;
}

.site-footer a {
  color: rgba(255,255,255,0.86);
}

.site-footer a:hover {
  color: #fff;
}

.footer-bottom {
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: center;
}

.site-info {
  font-size: 0.94rem;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.aligncenter {
  text-align: center;
}

@media (max-width: 1024px) {
  .feature-grid,
  .post-grid,
  .archive-loop,
  .footer-widgets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar-column {
    order: -1;
  }
}

@media (max-width: 840px) {
  .menu-toggle {
    display: inline-flex;
  }

  .primary-navigation {
    position: absolute;
    inset: calc(100% + 0.3rem) 1rem auto 1rem;
    background: rgba(255,255,255,0.98);
    border-radius: 18px;
    box-shadow: var(--pp-shadow);
    border: 1px solid rgba(15, 27, 45, 0.08);
    padding: 1rem;
    display: none;
  }

  .site-header.menu-open .primary-navigation {
    display: block;
  }

  .primary-navigation > div > ul,
  .primary-navigation > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
  }

  .primary-navigation a {
    padding: 0.75rem;
    border-radius: 12px;
  }

  .primary-navigation a:hover,
  .primary-navigation a:focus {
    background: rgba(176, 138, 69, 0.1);
  }

  .primary-navigation .sub-menu {
    position: static;
    display: block;
    box-shadow: none;
    border: 0;
    padding: 0.15rem 0 0.15rem 0.75rem;
    min-width: 0;
    background: transparent;
  }

  .primary-navigation .sub-menu a {
    padding: 0.5rem 0.75rem;
  }

  .header-cta {
    display: none;
  }
}

@media (max-width: 680px) {
  .feature-grid,
  .post-grid,
  .archive-loop,
  .footer-widgets {
    grid-template-columns: 1fr;
  }

  .hero__title {
    max-width: none;
  }

  .site-header__inner {
    gap: 0.8rem;
  }

  .branding {
    gap: 0.75rem;
  }

  .site-title {
    font-size: 1.22rem;
  }

  .site-description {
    font-size: 0.84rem;
  }
}
