/* Self-hosted fonts (official TTFs from google/fonts, unmodified — no Google Fonts CDN, no WOFF2) */
@font-face {
  font-family: 'Playfair Display';
  src: url('/fonts/PlayfairDisplay%5Bwght%5D.ttf') format('truetype');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('/fonts/PlayfairDisplay-Italic%5Bwght%5D.ttf') format('truetype');
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat%5Bwght%5D.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched system fallbacks so layout doesn't shift once the webfont loads.
   Values computed from each font's OS/2 metrics vs. its system counterpart. */
@font-face {
  font-family: 'Playfair Display Fallback';
  src: local('Georgia');
  size-adjust: 131.61%;
  ascent-override: 82.21%;
  descent-override: 19.07%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Montserrat Fallback';
  src: local('Arial');
  size-adjust: 141.37%;
  ascent-override: 68.47%;
  descent-override: 17.76%;
  line-gap-override: 0%;
}

:root {
  --off-white: #ffffff;
  --dark-text: #1a1a1a;
  --gray-text: #6b7280;
  --gray-border: #e5e7eb;
  --navy-blue: #0a1d37;
  --navy-hover: #133360;
  --font-header: 'Playfair Display', 'Playfair Display Fallback', Georgia, serif;
  --font-body: 'Montserrat', 'Montserrat Fallback', Arial, sans-serif;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--off-white);
  color: var(--dark-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */
.site-header {
  border-bottom: 1px solid var(--gray-border);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 40px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.main-nav a:hover {
  color: var(--navy-blue);
}

.btn-primary {
  background-color: var(--navy-blue);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--navy-hover);
  color: white;
}

/* MAIN CONTAINER */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-header);
  font-weight: 600;
  line-height: 1.2;
}

/* Static Hero Banner */
.hero-banner {
  width: 100%;
  position: relative;
  display: flex;
  overflow: hidden;
}

.hero-banner img {
  width: 100vw;
  max-width: 100vw;
  height: auto;
  object-fit: contain; 
  display: block;
  will-change: transform;
}

.hero-banner-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 29, 55, 0.4); /* slight navy blue tint */
  z-index: 1;
}

/* Featured Header */
.section-title {
  margin-bottom: 2rem;
  font-size: 2.5rem;
  color: var(--navy-blue);
  border-bottom: 2px solid var(--gray-border);
  padding-bottom: 0.5rem;
}

/* Featured Post (Full Width Overlay) */
.featured-post-full {
  position: relative;
  width: 100%;
  aspect-ratio: 21/9;
  min-height: 450px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 4rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  display: flex;
  align-items: flex-end;
}

.featured-post-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}

.featured-post-full:hover .featured-post-bg {
  transform: scale(1.02);
}

.featured-content-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 3rem;
  background: linear-gradient(to top, rgba(10, 29, 55, 0.95) 0%, rgba(10, 29, 55, 0.7) 60%, transparent 100%);
  color: white;
}

.featured-meta {
  color: #e5e7eb;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
  display: flex;
  gap: 1rem;
}

.featured-title {
  font-size: 3.5rem;
  margin-bottom: 0.8rem;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.featured-excerpt {
  font-size: 1.15rem;
  color: #e5e7eb;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  max-width: 800px;
}

.featured-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  background: #f3f4f6;
  color: var(--navy-blue);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 3rem;
  justify-content: center;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--gray-border);
  color: var(--navy-blue);
  padding: 0.6rem 1.5rem;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background: var(--light-gray);
}

.filter-btn.active {
  background: var(--navy-blue);
  color: white;
  border-color: var(--navy-blue);
}

/* Blog Grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 3rem 2rem;
  margin-bottom: 4rem;
}

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

.post-card-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1.2rem;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card-img {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--gray-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.post-card-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.post-card:hover .post-card-title {
  color: var(--navy-blue);
}

.post-card-excerpt {
  color: var(--gray-text);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex-grow: 1;
}

/* Footer / Newsletter */
.site-footer {
  background-color: #f9fafb;
  border-top: 1px solid var(--gray-border);
  padding: 4rem 2rem 2rem 2rem;
  text-align: center;
}

.newsletter {
  max-width: 600px;
  margin: 0 auto 3rem;
}

.newsletter h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.newsletter p {
  color: var(--gray-text);
  margin-bottom: 2rem;
}

.newsletter-form {
  display: flex;
  gap: 1rem;
}

.newsletter-form input {
  flex-grow: 1;
  padding: 1rem;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
}

.footer-bottom {
  border-top: 1px solid var(--gray-border);
  padding-top: 2rem;
  color: var(--gray-text);
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

/* Article View Typography Scale */
.article-content h2 {
  font-family: var(--font-header);
  font-size: 2.25rem;
  color: var(--navy-blue);
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.25;
}

.article-content h3 {
  font-family: var(--font-header);
  font-size: 1.75rem;
  color: var(--navy-blue);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-content p {
  margin-bottom: 1.75rem;
}

.article-content a {
  color: #AC0014;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: all 0.2s ease;
}

.article-content a:hover {
  text-decoration-thickness: 2px;
}

.article-content blockquote {
  border-left: 4px solid #AC0014;
  padding-left: 1.75rem;
  margin: 3rem 0;
  font-style: italic;
  font-family: var(--font-header);
  font-size: 1.55rem;
  color: var(--navy-blue);
  line-height: 1.6;
}

.article-content ul, 
.article-content ol {
  margin-bottom: 2rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.75rem;
}

.article-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 2.5rem 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* TAP Burgundy Components */
#homepage-tag-filter {
  color: #AC0014 !important;
}

#global-search {
  color: var(--dark-text) !important;
}

#global-search,
#homepage-tag-filter {
  border-color: rgba(172, 0, 20, 0.4) !important;
}

#global-search:focus,
#homepage-tag-filter:focus {
  border-color: #AC0014 !important;
  outline: none;
}

#global-search::placeholder {
  color: rgba(172, 0, 20, 0.6) !important;
}

@media (max-width: 768px) {
  .featured-post { grid-template-columns: 1fr; }
  .header-container { flex-direction: column; gap: 1rem; }
  .newsletter-form { flex-direction: column; }
}
