/*
Theme Name: Diamond & Cardboard
Theme URI: https://example.com
Author: Jerms' Cards
Description: Custom WordPress theme for a baseball & baseball card blog.
Version: 1.2
*/

:root {
  --bg: #0b0b0d;          /* deep black background */
  --text: #e6e6eb;        /* silver-white text */
  --card: #141418;        /* dark graphite cards/header */
  --accent: #ff3b3b;      /* neon red accent */
}


[data-theme="light"] {
  --bg:#f8fafc;
  --text:#020617;
  --card:#ffffff;
}

body {
  margin:0;
  font-family:Inter,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

header {
  background:var(--card);
  padding:1.5rem 2rem;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

header a { color:var(--accent); text-decoration:none; }

.card {
  background:var(--card);
  padding:1.5rem;
  border-radius:14px;
}

.card img {
  width:100%;
  border-radius:10px;
  margin-bottom:1rem;
}

.toggle { cursor:pointer; }

/* Single post header layout */
.single-post .post-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* Thumbnail image */
.single-post .post-thumb img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Title area */
.single-post h1 {
  margin: 0 0 .4rem;
  font-size: 2rem;
  line-height: 1.2;
}

.single-post .meta {
  font-size: .85rem;
  color: #94a3b8;
}

/* Content spacing */
.single-post .post-content {
  line-height: 1.7;
}

/* Homepage post layout */
.home-post-inner {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

/* Homepage thumbnail */
.home-thumb img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Homepage content */
.home-content h3 {
  margin: 0 0 .4rem;
  font-size: 1.2rem;
}

.home-content p {
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
}

/* Mobile stacking */
@media (max-width: 640px) {
  .home-post-inner {
    flex-direction: column;
  }

  .home-thumb img {
    width: 100%;
    height: 160px;
  }
}

/* ===== Homepage Enhancements ===== */

/* Divider between posts */
.home-post {
  border-bottom: 1px solid rgba(148,163,184,.15);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.home-post:last-of-type {
  border-bottom: none;
}

/* Featured (most recent) post */
.home-post-featured {
  padding: 2rem;
}

.home-post-featured h3 {
  font-size: 1.5rem;
}

/* Category badges */
.home-categories {
  margin-bottom: .4rem;
}

.cat-badge {
  display: inline-block;
  background: rgba(244,63,94,.15);
  color: #f43f5e;
  font-size: .7rem;
  padding: .25rem .5rem;
  border-radius: 999px;
  margin-right: .35rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* View All button */
.view-all-wrap {
  text-align: center;
  margin-top: 2.5rem;
}

.view-all-btn {
  display: inline-block;
  padding: .75rem 1.5rem;
  border-radius: 999px;
  border: 1px solid #f43f5e;
  color: #f43f5e;
  text-decoration: none;
  font-weight: 500;
  transition: all .2s ease;
}

.view-all-btn:hover {
  background: #f43f5e;
  color: #fff;
}

.view-all-btn {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 transparent;
}

.view-all-btn:hover {
  background: var(--accent);
  color: #0b0b0d;
  box-shadow: 0 0 18px rgba(255,59,59,0.45);
}

.cat-badge {
  background: rgba(255,59,59,0.15);
  color: var(--accent);
  border: 1px solid rgba(255,59,59,0.35);
}
.card {
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.03),
    rgba(0,0,0,0.15)
  ), var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

/* Force post titles to be silver, not blue */
.home-content h3 a,
.home-content h3 a:visited,
.single-post h1,
.single-post h1 a {
  color: var(--text);
  text-decoration: none;
}

/* Neon red hover effect */
.home-content h3 a:hover {
  color: var(--accent);
}

.home-content h3 a {
  position: relative;
}

.home-content h3 a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width .25s ease;
}

.home-content h3 a:hover::after {
  width: 100%;
}

/* ===== Article content link styling ===== */

/* Default link color inside posts */
.post-content a,
.entry-content a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  transition: color .2s ease, border-color .2s ease;
}

/* Hover state */
.post-content a:hover,
.entry-content a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Visited links */
.post-content a:visited,
.entry-content a:visited {
  color: var(--text);
}
.post-content a {
  background-image: linear-gradient(
    transparent 60%,
    rgba(255,59,59,0.2) 60%
  );
  background-size: 0% 100%;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size .25s ease;
}

.post-content a:hover {
  background-size: 100% 100%;
}

/* ===== Theme toggle (Option B: icon + label) ===== */
#theme-toggle.icon-toggle {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition:
    border-color .2s ease,
    background .2s ease,
    box-shadow .2s ease;
}

#theme-toggle.icon-toggle:hover {
  border-color: rgba(255,59,59,0.55);
  box-shadow: 0 0 18px rgba(255,59,59,0.18);
}

/* Icon dot */
#theme-toggle .icon {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255,59,59,0.45);
}

/* Label */
#theme-toggle .label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
}

/* Hover label color */
#theme-toggle.icon-toggle:hover .label {
  color: var(--accent);
}

/* ===== Gallery image polish ===== */
.wp-block-gallery img,
.blocks-gallery-grid img {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 24px rgba(0,0,0,0.55);
  transition: transform .25s ease, box-shadow .25s ease;
}

.wp-block-gallery img:hover,
.blocks-gallery-grid img:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.7);
}

.wp-block-gallery,
.blocks-gallery-grid {
  margin-top: 1.5rem;
  gap: 14px;
}

/* Lightbox overlay polish */
.wp-lightbox-overlay {
  background: rgba(10,10,12,0.92) !important;
}

.wp-lightbox-overlay img {
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.85);
}

.wp-block-gallery img:hover {
  outline: 2px solid rgba(255,59,59,0.6);
  outline-offset: -2px;
}

@media (max-width: 640px) {
  .wp-block-gallery img,
  .blocks-gallery-grid img {
    height: 140px;
  }
}

.single .wp-block-gallery::before {
  content: "PHOTO GALLERY";
  display: block;
  font-size: .7rem;
  letter-spacing: .18em;
  color: rgba(255,255,255,0.45);
  margin-bottom: .75rem;
}

/* ===== Gallery: larger tiles + captions below (no overlay) ===== */

/* Grid: flexible tiles, not tiny, not stretched */
.wp-block-gallery,
.blocks-gallery-grid {
  display: grid !important;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

/* Make each gallery item behave */
.wp-block-gallery figure,
.blocks-gallery-grid figure {
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* Image tile */
.wp-block-gallery figure img,
.blocks-gallery-grid figure img {
  width: 100%;
  height: 260px;          /* tile height */
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

/* Caption BELOW the image */
.wp-block-gallery figcaption,
.blocks-gallery-grid figcaption {
  margin-top: 8px;
  font-size: 0.85rem;
  line-height: 1.3;
  color: rgba(230,230,235,0.75);
  background: transparent;
  padding: 0;
  text-align: left;
}

/* ===== Header & Navigation Layout ===== */

/* Header layout */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Nav container */
header nav {
  display: flex;
  align-items: center;
}

/* Remove default list styles */
header nav ul {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Menu items */
header nav li {
  margin: 0;
  padding: 0;
}

/* Menu links */
header nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.2s ease;
}

/* Hover effect */
header nav a:hover {
  color: var(--accent);
}

/* Optional underline hover (clean + modern) */
header nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

header nav a:hover::after {
  width: 100%;
}

/* ===== Mobile header/nav (wrapped menu) ===== */
@media (max-width: 768px) {

  header {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
  }

  /* Logo on its own row */
  header h1 {
    width: 100%;
    margin: 0;
  }

  /* Nav takes full width under logo */
  header nav {
    width: 100%;
  }

  /* Wrapped menu */
  header nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.6rem 1.1rem; /* row gap, column gap */
    padding: 0;
    margin: 0;
  }

  /* Menu links slightly smaller on mobile */
  header nav a {
    font-size: 0.78rem;
    padding: 0.25rem 0;
  }

  /* Theme toggle sits on the right under nav */
  #theme-toggle.icon-toggle {
    margin-left: auto;
    margin-top: 0.25rem;
  }
}

/* ===== Mobile: prevent header/nav overflow (iOS safe) ===== */
@media (max-width: 768px) {

  /* Prevent any horizontal scrolling site-wide */
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  header {
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    gap: .75rem;
    padding: 1rem 1.25rem;
    box-sizing: border-box;
  }

  header h1 {
    width: 100%;
    margin: 0;
  }

  header nav {
    width: 100%;
    max-width: 100%;
  }

  /* Force the UL to wrap and stay within screen */
  header nav ul {
    display: flex !important;
    flex-wrap: wrap !important;
    white-space: normal !important;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: .6rem 1rem;
    box-sizing: border-box;
  }

  /* Allow each item to wrap naturally (no long single-line items) */
  header nav li {
    margin: 0;
    padding: 0;
    max-width: 100%;
  }

  /* Prevent long labels from pushing off-screen */
  header nav a {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    font-size: .78rem;
    letter-spacing: .04em; /* reduce width */
    padding: .25rem 0;
  }

  /* Toggle sits on its own row, right-aligned */
  #theme-toggle.icon-toggle {
    margin-left: auto;
    margin-top: .25rem;
  }
}

/* ===== Mobile-only sticky header ===== */
@media (max-width: 768px) {
  header {
    position: sticky;
    top: 0;
    z-index: 9999;
    /* keeps it readable over content */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

@media (max-width: 768px) {
  header {
    background: rgba(20, 20, 24, 0.92); /* matches your --card vibe */
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
}

/* ===== Active menu state ===== */
header nav li.current-menu-item > a,
header nav li.current_page_item > a,
header nav li.current-menu-ancestor > a {
  color: var(--text);
}

/* Persistent underline for active item */
header nav li.current-menu-item > a::after,
header nav li.current_page_item > a::after,
header nav li.current-menu-ancestor > a::after {
  width: 100%;
}

/* ===== Reduce CLS for gallery grids ===== */
.wp-block-gallery figure,
.blocks-gallery-grid figure {
  margin: 0;
}

.wp-block-gallery figure a,
.blocks-gallery-grid figure a {
  display: block;
}

/* Reserve a predictable rectangle before images load */
.wp-block-gallery img,
.blocks-gallery-grid img {
  width: 100%;
  height: auto;              /* prevents stretching */
  aspect-ratio: 1 / 1;       /* reserve square space */
  object-fit: cover;
  display: block;
}

/* ===== Latest Album callout ===== */
.latest-album-wrap {
  margin-top: 2.5rem;
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(230,230,235,0.75);
}

.latest-album {
  border: 1px solid rgba(255,59,59,0.22);
}

.album-links {
  margin-top: 0.9rem;
}

.view-all-btn.small {
  padding: .55rem 1rem;
  font-size: .8rem;
}

/* ===== Style default WP comments (no comments.php file) ===== */

#comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

#comments .comment-list {
  list-style: none;
  padding: 0;
}

#comments .comment {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

#comments .comment-author {
  font-weight: 600;
  color: var(--text);
}

#comments .comment-metadata {
  font-size: .75rem;
  color: rgba(230,230,235,0.55);
}

#comments textarea,
#comments input[type="text"],
#comments input[type="email"] {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text);
}

#comments input[type="submit"] {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: .6rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
}

#comments input[type="submit"]:hover {
  background: var(--accent);
  color: #0b0b0d;
}

/* ===== Site title with icon ===== */
.site-title a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.site-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .site-icon {
    width: 26px;
    height: 26px;
  }
}

/* ===== Header social icons (bubbly, black/white, lower-right) ===== */

header {
  position: relative;
}

/* Container: horizontal row */
header .social-rail.header-social {
  position: absolute;
  right: 16px;
  bottom: 10px;

  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 14px; /* more spacing */
  z-index: 5;
}

/* Bubble buttons */
header .social-rail.header-social a:link,
header .social-rail.header-social a:visited,
header .social-rail.header-social a:active,
header .social-rail.header-social a:focus {
  width: 36px;
  height: 36px;
  border-radius: 999px;

  background: #000 !important;      /* black bubble */
  border: 1px solid #fff !important;/* white ring */
  color: #fff !important;           /* white icon/text */
  -webkit-text-fill-color: #fff !important; /* Safari/iOS */

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 15px;
  line-height: 1;
  text-decoration: none !important;

  box-shadow: none;
  transform: none;

  transition:
    color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease,
    transform .2s ease;
}

/* Hover: on-brand red glow + red icon */
header .social-rail.header-social a:hover {
  color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 16px rgba(255,59,59,0.45);
  transform: translateY(-2px);
}
/* ===== SVG icons inside social bubbles ===== */
header .social-rail.header-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor; /* inherits white / red perfectly */
  display: block;
}


/* Hide on mobile (keeps header clean) */
@media (max-width: 768px) {
  header .social-rail.header-social {
    display: none !important;
  }
}

/* eBay wordmark sizing */
header .social-rail.header-social a svg {
  width: 22px;
  height: auto;
}

/* Optically balance Facebook icon */
header .social-rail.header-social svg.icon-facebook {
  transform: scale(1.15); /* makes it visually match others */
}

/* Optically balance X icon */
header .social-rail.header-social svg.icon-x {
  transform: scale(1.05);
}

/* ===== Desktop layout: edge-to-edge homepage, centered articles ===== */
@media (min-width: 900px) {

  /* 1️⃣ Homepage = nearly full width */
  body.home .container,
  body.front-page .container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 3rem;
    padding-right: 3rem;
  }

  /* 2️⃣ Blog index / archives = wide grid */
  body.blog .container,
  body.archive .container,
  body.category .container,
  body.search .container {
    max-width: 1400px !important; /* wide but not unlimited */
    margin-left: auto;
    margin-right: auto;
  }

/* ===== Wider editorial column (desktop only) ===== */
@media (min-width: 900px) {

  body.single .container,
  body.page:not(.home):not(.front-page) .container {
    max-width: 1080px !important;  /* MUCH wider */
    margin-left: auto;
    margin-right: auto;
    padding-left: 3rem;
    padding-right: 3rem;
  }

  /* Keep readable spacing */
  body.single .entry-content {
    font-size: 1.08rem;
    line-height: 1.75;
  }
}

/* ===== Typography Upgrade – Articles Only ===== */
@media (min-width: 900px) {

  body.single .entry-content,
  body.page:not(.home):not(.front-page) .entry-content {
    font-size: 1.125rem;     /* slightly larger body text */
    line-height: 1.8;        /* smoother reading rhythm */
    letter-spacing: 0.01em;
  }

  /* Paragraph spacing */
  body.single .entry-content p {
    margin-bottom: 1.5rem;
  }

  /* Headings – stronger hierarchy */
  body.single .entry-content h2 {
    font-size: 1.75rem;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
  }

  body.single .entry-content h3 {
    font-size: 1.35rem;
    margin-top: 2.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
  }

  /* Links inside articles */
  body.single .entry-content a {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
  }

  /* Images inside articles */
  body.single .entry-content img {
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
  }

  /* Blockquotes */
  body.single .entry-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.25rem;
    margin: 2rem 0;
    font-style: italic;
    color: rgba(230,230,235,0.85);
  }

}