/*
Theme Name: History of Music
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: A music-history blog theme with a masthead, left/right widget sidebars, and a 3x3 post grid, in a vintage record-label palette of brass gold, velvet crimson, and jazz-club teal on deep navy, with a rotating vinyl-record decoration behind the title.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hom
*/

:root{
  --ink:#10151F;
  --panel:#1B2233;
  --paper:#EFEAE0;
  --brass:#D4A24C;
  --crimson:#A6303B;
  --teal:#1F7A6C;
  --violet:#6C4675;
  --line: rgba(239,234,224,0.14);
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--ink);
  color:var(--paper);
  font-family:'EB Garamond', serif;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none;}
ul{list-style:none;margin:0;padding:0;}
img{max-width:100%;display:block;}

/* ---------- TOP BAR ---------- */
.topbar{
  display:flex;
  justify-content:flex-end;
  gap:24px;
  padding:8px 32px;
  border-bottom:1px solid var(--line);
  font-family:'Space Mono',monospace;
  font-size:11px;
  letter-spacing:0.06em;
  text-transform:uppercase;
  color:rgba(239,234,224,0.45);
}
.topbar a:hover{color:var(--brass);}

/* ---------- MASTHEAD ---------- */
.masthead{
  position:relative;
  text-align:center;
  padding:56px 24px 26px;
  overflow:hidden;
  background:linear-gradient(180deg, var(--panel) 0%, var(--ink) 100%);
}

/* Decorative rotating vinyl record behind the title, purely visual */
.vinyl{
  position:absolute;
  top:50%;
  left:50%;
  width:340px;
  height:340px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background:
    repeating-radial-gradient(circle at center, rgba(239,234,224,0.05) 0 2px, transparent 2px 9px),
    radial-gradient(circle at center, #232c40 0%, #10151F 72%);
  z-index:0;
  animation:vinyl-spin 60s linear infinite;
}
.vinyl::after{
  content:"";
  position:absolute;
  top:50%;left:50%;
  width:64px;height:64px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background:var(--brass);
  box-shadow:0 0 34px rgba(212,162,76,0.35);
}
.vinyl::before{
  content:"";
  position:absolute;
  top:50%;left:50%;
  width:8px;height:8px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background:var(--ink);
  z-index:2;
}
@keyframes vinyl-spin{
  from{transform:translate(-50%,-50%) rotate(0deg);}
  to{transform:translate(-50%,-50%) rotate(360deg);}
}
@media (prefers-reduced-motion: reduce){
  .vinyl{animation:none;}
}

.masthead > *:not(.vinyl){position:relative;z-index:1;}

.masthead h1{
  font-family:'Cinzel', serif;
  font-weight:700;
  font-size:clamp(28px,5.2vw,50px);
  line-height:1.2;
  margin:0;
  letter-spacing:2px;
  text-transform:uppercase;
}
.masthead h1 a{
  color:var(--brass);
  text-shadow:0 2px 0 rgba(0,0,0,0.45);
}
.rule{display:flex;justify-content:center;gap:4px;margin:20px 0 16px;}
.rule span{width:100px;height:3px;}
.rule .c1{background:var(--brass);}
.rule .c2{background:var(--crimson);}
.rule .c3{background:var(--teal);}
.tagline{
  font-family:'Space Mono',monospace;
  font-size:13px;
  letter-spacing:0.16em;
  text-transform:uppercase;
  color:var(--brass);
  margin:0;
}

/* ---------- NAV ---------- */
nav.main{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:34px;
  padding:18px 24px;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  font-family:'Frank Ruhl Libre', serif;
  font-weight:700;
  font-size:15px;
  letter-spacing:0.02em;
  flex-wrap:wrap;
  background:var(--panel);
}
nav.main a{opacity:0.85;transition:opacity .15s, color .15s;}
nav.main a:hover{opacity:1;color:var(--crimson);}

/* ---------- LAYOUT ---------- */
.layout{
  display:grid;
  grid-template-columns:220px minmax(0,1fr) 220px;
  gap:0;
  max-width:1300px;
  margin:0 auto;
}
aside{padding:34px 22px;border-right:1px solid var(--line);}
aside.right{border-right:none;border-left:1px solid var(--line);}
main{padding:34px 32px;min-width:0;}

/* ---------- WIDGETS ---------- */
.widget{margin-bottom:34px;}
.widget h3{
  font-family:'Frank Ruhl Libre', serif;
  font-weight:700;
  font-size:15px;
  letter-spacing:0.02em;
  color:var(--brass);
  margin:0 0 14px;
  padding-bottom:10px;
  border-bottom:2px solid var(--crimson);
}
.widget p{font-size:15px;line-height:1.6;color:rgba(239,234,224,0.7);margin:0;}

.search-box{display:flex;}
.search-box input{
  flex:1;
  background:var(--panel);
  border:1px solid var(--line);
  border-right:none;
  color:var(--paper);
  font-family:'EB Garamond',serif;
  font-size:15px;
  padding:9px 10px;
}
.search-box button{
  background:var(--brass);
  border:none;
  color:var(--ink);
  padding:0 14px;
  font-weight:700;
  cursor:pointer;
}

/* wp_list_categories / generic sidebar link lists */
.widget .linklist li,
.widget ul li{border-bottom:1px solid var(--line);}
.widget .linklist li:last-child,
.widget ul li:last-child{border-bottom:none;}
.widget .linklist a,
.widget ul li a{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 2px;
  font-family:'Space Mono',monospace;
  font-size:12px;
  letter-spacing:0.02em;
}
.widget .linklist a:hover,
.widget ul li a:hover{color:var(--brass);}

.mini-post{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid var(--line);}
.mini-post:last-child{border-bottom:none;}
.mini-thumb{
  width:46px;height:46px;flex:none;border-radius:2px;overflow:hidden;
  display:flex;align-items:center;justify-content:center;font-size:18px;
}
.mini-thumb img{width:100%;height:100%;object-fit:cover;}
.mini-post h4{font-size:13px;line-height:1.35;margin:0 0 4px;font-weight:600;font-family:'EB Garamond',serif;}
.mini-post .meta{font-family:'Space Mono',monospace;font-size:10.5px;color:rgba(239,234,224,0.4);}

.social-row{display:flex;gap:12px;}
.social-row a{
  width:34px;height:34px;border:1px solid var(--line);border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-size:14px;
}
.social-row a:hover{border-color:var(--brass);color:var(--brass);}

.comment-item{padding:11px 0;border-bottom:1px solid var(--line);font-size:13px;line-height:1.5;}
.comment-item:last-child{border-bottom:none;}
.comment-item b{color:var(--teal);font-weight:600;}

/* ---------- MAIN GRID ---------- */
.main-head{
  display:flex;justify-content:space-between;align-items:baseline;
  margin-bottom:22px;padding-bottom:14px;border-bottom:3px solid var(--brass);flex-wrap:wrap;gap:8px;
}
.main-head h2{font-family:'Frank Ruhl Libre',serif;font-weight:700;font-size:23px;margin:0;}
.main-head span{font-family:'Space Mono',monospace;font-size:11px;color:rgba(239,234,224,0.45);text-transform:uppercase;letter-spacing:0.05em;}

.archive-description{
  max-width:720px;font-size:16px;line-height:1.65;color:rgba(239,234,224,0.7);
  margin-bottom:26px;
}
.post-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:26px;}
.post{display:flex;flex-direction:column;}
.thumb{
  height:120px;border-radius:2px;margin-bottom:12px;position:relative;
  display:flex;align-items:center;justify-content:center;font-size:32px;overflow:hidden;
}
.thumb img{width:100%;height:100%;object-fit:cover;}
.thumb::after{content:"";position:absolute;inset:0;background:repeating-radial-gradient(circle, rgba(255,255,255,0.14) 0 1.5px, transparent 1.5px 8px);mix-blend-mode:overlay;pointer-events:none;}
.t1{background:linear-gradient(135deg,#D4A24C,#A6303B);}
.t2{background:linear-gradient(135deg,#1F7A6C,#1B2233);}
.t3{background:linear-gradient(135deg,#A6303B,#6C4675);}
.t4{background:linear-gradient(135deg,#D4A24C,#1F7A6C);}
.t5{background:linear-gradient(135deg,#6C4675,#A6303B);}
.t6{background:linear-gradient(135deg,#1F7A6C,#D4A24C);}
.t7{background:linear-gradient(135deg,#A6303B,#1B2233);}
.t8{background:linear-gradient(135deg,#6C4675,#1F7A6C);}
.t9{background:linear-gradient(135deg,#D4A24C,#6C4675);}

.post h3{font-family:'Frank Ruhl Libre',serif;font-weight:700;font-size:17px;line-height:1.3;margin:0 0 8px;}
.post .meta{
  font-family:'Space Mono',monospace;font-size:10.5px;letter-spacing:0.02em;
  margin-bottom:8px;display:flex;gap:6px;align-items:center;flex-wrap:wrap;
}
.post .meta .cat.brass{color:var(--brass);}
.post .meta .cat.crimson{color:var(--crimson);}
.post .meta .cat.teal{color:var(--teal);}
.post .meta .cat.violet{color:var(--violet);}
.post .meta .cat.default{color:var(--paper);}
.post .meta .dot{opacity:0.3;}
.post p.desc{font-size:14px;line-height:1.6;color:rgba(239,234,224,0.68);margin:0 0 10px;}
.post .read{font-family:'Space Mono',monospace;font-size:11px;font-weight:700;color:var(--brass);text-transform:uppercase;letter-spacing:0.03em;}
.post .read:hover{color:var(--crimson);}

/* pagination */
.screen-reader-text{
  position:absolute!important;
  width:1px;height:1px;
  overflow:hidden;
  clip:rect(1px,1px,1px,1px);
  white-space:nowrap;
}
.pagination, .nav-links{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:12px;
  margin-top:44px;
}
.pagination .page-numbers,
.nav-links .page-numbers{
  font-family:'Space Mono',monospace;
  font-size:14px;
  letter-spacing:0.02em;
  color:var(--paper);
  border:1px solid var(--line);
  border-radius:3px;
  padding:11px 17px;
  min-width:22px;
  text-align:center;
  line-height:1;
  transition:border-color .15s ease, color .15s ease, background .15s ease;
}
.pagination a.page-numbers:hover,
.nav-links a.page-numbers:hover{
  border-color:var(--brass);
  color:var(--brass);
}
.pagination .page-numbers.current,
.nav-links .page-numbers.current{
  background:var(--brass);
  border-color:var(--brass);
  color:var(--ink);
  font-weight:700;
}
.pagination .page-numbers.dots,
.nav-links .page-numbers.dots{
  border-color:transparent;
  color:rgba(239,234,224,0.4);
}
.pagination .page-numbers.prev,
.pagination .page-numbers.next,
.nav-links .page-numbers.prev,
.nav-links .page-numbers.next{
  font-weight:700;
  padding-left:20px;
  padding-right:20px;
}

footer{
  border-top:1px solid var(--line);padding:26px 32px;display:flex;justify-content:space-between;
  flex-wrap:wrap;gap:10px;font-family:'Space Mono',monospace;font-size:11px;
  color:rgba(239,234,224,0.4);max-width:1300px;margin:0 auto;
}

/* ---------- SINGLE POST ---------- */
.single-meta{
  font-family:'Space Mono',monospace;font-size:12px;letter-spacing:0.02em;
  margin-bottom:14px;display:flex;gap:6px;align-items:center;
}
.single-meta .cat.brass{color:var(--brass);}
.single-meta .cat.crimson{color:var(--crimson);}
.single-meta .cat.teal{color:var(--teal);}
.single-meta .cat.violet{color:var(--violet);}
.single-meta .cat.default{color:var(--paper);}
.single-meta .dot{opacity:0.3;}

.single-title{
  font-family:'Frank Ruhl Libre',serif;
  font-weight:700;
  font-size:clamp(26px,4vw,42px);
  line-height:1.25;
  margin:0 0 24px;
}

.single-thumb{
  height:340px;border-radius:3px;margin-bottom:30px;overflow:hidden;position:relative;
}
.single-thumb img{width:100%;height:100%;object-fit:cover;}
.single-thumb::after{content:"";position:absolute;inset:0;background:repeating-radial-gradient(circle, rgba(255,255,255,0.14) 0 1.5px, transparent 1.5px 8px);mix-blend-mode:overlay;pointer-events:none;}

.entry-content{font-size:18px;line-height:1.8;max-width:720px;}
.entry-content::after{content:"";display:table;clear:both;}
.entry-content p{margin:0 0 22px;overflow:hidden;}
.entry-content h2{font-family:'Frank Ruhl Libre',serif;font-weight:700;font-size:25px;margin:36px 0 16px;clear:both;}
.entry-content h3{font-family:'Frank Ruhl Libre',serif;font-weight:700;font-size:20px;margin:30px 0 14px;clear:both;}
.entry-content a{color:var(--brass);text-decoration:underline;}
.entry-content a:hover{color:var(--crimson);}
.entry-content blockquote{
  border-left:3px solid var(--brass);margin:24px 0;padding:4px 0 4px 20px;
  font-style:italic;color:rgba(239,234,224,0.8);clear:both;
}
.entry-content img{border-radius:3px;margin:0 0 20px;}
.entry-content ul,.entry-content ol{margin:0 0 22px;padding-left:22px;clear:both;}
.entry-content li{margin-bottom:8px;}
.page-links{font-family:'Space Mono',monospace;font-size:12px;margin-top:20px;clear:both;}

/* ---------- WordPress image alignment ---------- */
.entry-content img.alignleft{float:left;max-width:240px;height:auto;margin:0 20px 16px 0;}
.entry-content img.alignright{float:right;max-width:240px;height:auto;margin:0 0 16px 20px;}
.entry-content img.aligncenter{display:block;float:none;margin:20px auto;}
.entry-content img.alignnone{float:none;margin:0 0 20px;}

.entry-content .wp-caption{max-width:100%;margin:0 0 16px;}
.entry-content .wp-caption.alignleft{float:left;max-width:240px;margin:0 20px 16px 0;}
.entry-content .wp-caption.alignright{float:right;max-width:240px;margin:0 0 16px 20px;}
.entry-content .wp-caption.aligncenter{float:none;margin:0 auto 20px;}
.entry-content .wp-caption img{display:block;width:100%;margin:0;}
.entry-content .wp-caption-text{
  font-size:12px;line-height:1.4;color:rgba(239,234,224,0.6);
  margin:6px 0 0;padding:0;text-align:center;
}

/* ---------- Fallback: consecutive images with NO alignment set (alignnone) ---------- */
.entry-content p:has(> img.alignnone:only-child):has(+ p > img.alignnone:only-child) img,
.entry-content p:has(> img.alignnone:only-child) + p:has(> img.alignnone:only-child) img{
  float:left;
  width:220px;
  height:220px;
  object-fit:cover;
  margin:0 14px 14px 0;
}

/* ---------- GALLERIES (multiple images grouped in a post) ---------- */
/* Classic "Add Media > Create Gallery" shortcode — flex-based, confirmed reliable */
.entry-content .gallery{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:26px 0;
  list-style:none;
  padding:0;
}
.entry-content .gallery-item{
  width:calc(25% - 10px) !important;
  margin:0 !important;
  float:none !important;
}
.entry-content .gallery-columns-1 .gallery-item{width:100% !important;}
.entry-content .gallery-columns-2 .gallery-item{width:calc(50% - 10px) !important;}
.entry-content .gallery-columns-3 .gallery-item{width:calc(33.333% - 10px) !important;}
.entry-content .gallery-columns-4 .gallery-item{width:calc(25% - 10px) !important;}
.entry-content .gallery-columns-5 .gallery-item{width:calc(20% - 10px) !important;}
.entry-content .gallery-columns-6 .gallery-item{width:calc(16.666% - 10px) !important;}
.entry-content .gallery-columns-7 .gallery-item{width:calc(14.285% - 10px) !important;}
.entry-content .gallery-columns-8 .gallery-item{width:calc(12.5% - 10px) !important;}
.entry-content .gallery-columns-9 .gallery-item{width:calc(11.111% - 10px) !important;}
.entry-content .gallery img{width:100%;height:auto;display:block;margin:0 !important;}
.entry-content .gallery-caption{font-size:12px;line-height:1.4;color:rgba(239,234,224,0.6);margin-top:6px;padding:0;}
.entry-content .gallery-icon{margin:0;}

/* Block editor (Gutenberg) Gallery block, incl. WP 5.9+ nested-images markup */
.entry-content .wp-block-gallery{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  margin:26px 0;
  padding:0;
  list-style:none;
}
.entry-content .wp-block-gallery .wp-block-image,
.entry-content .wp-block-gallery figure.wp-block-image{
  margin:0;
  flex:1 1 calc(33.333% - 14px);
}
.entry-content .wp-block-gallery.columns-2 .wp-block-image{flex-basis:calc(50% - 14px);}
.entry-content .wp-block-gallery.columns-3 .wp-block-image{flex-basis:calc(33.333% - 14px);}
.entry-content .wp-block-gallery.columns-4 .wp-block-image{flex-basis:calc(25% - 14px);}
.entry-content .wp-block-gallery.columns-5 .wp-block-image{flex-basis:calc(20% - 14px);}
.entry-content .wp-block-gallery.columns-6 .wp-block-image{flex-basis:calc(16.666% - 14px);}
.entry-content .wp-block-gallery img{width:100%;height:100%;aspect-ratio:1/1;object-fit:cover;margin:0;display:block;}
.entry-content .wp-block-gallery figcaption{font-size:12px;color:rgba(239,234,224,0.6);margin-top:4px;}

.tags{
  max-width:720px;margin-top:10px;padding-top:20px;border-top:1px solid var(--line);
  font-family:'Space Mono',monospace;font-size:12px;color:rgba(239,234,224,0.58);
}
.tags a{color:var(--teal);}
.tags a:hover{color:var(--brass);}

/* ---------- COMMENTS ---------- */
.comments-wrap{max-width:720px;margin-top:50px;}
.comments-wrap .comments-title,
.comments-wrap .comment-reply-title{
  font-family:'Frank Ruhl Libre',serif;font-weight:700;font-size:21px;margin:0 0 22px;
}
.comment-list{list-style:none;margin:0 0 34px;padding:0;}
.comment-list .children{list-style:none;margin:0;padding-left:30px;}
.comment-list article{
  border-bottom:1px solid var(--line);padding:18px 0;
}
.comment-author .fn{font-weight:600;font-style:normal;font-family:'Space Mono',monospace;font-size:13px;color:var(--teal);}
.comment-metadata{font-family:'Space Mono',monospace;font-size:11px;color:rgba(239,234,224,0.4);margin-bottom:8px;}
.comment-metadata a{color:inherit;}
.comment-content p{font-size:16px;line-height:1.6;margin:0 0 10px;}
.reply a{
  font-family:'Space Mono',monospace;font-size:11px;text-transform:uppercase;letter-spacing:0.04em;color:var(--brass);
}
.reply a:hover{color:var(--crimson);}

.comment-respond{background:var(--panel);border:1px solid var(--line);border-radius:3px;padding:26px;}
.comment-form label{display:block;font-family:'Space Mono',monospace;font-size:12px;letter-spacing:0.02em;margin-bottom:6px;color:rgba(239,234,224,0.7);}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea{
  width:100%;background:var(--ink);border:1px solid var(--line);color:var(--paper);
  font-family:'EB Garamond',serif;font-size:16px;padding:10px 12px;margin-bottom:18px;border-radius:2px;
}
.comment-form textarea{min-height:130px;}
.comment-form input:focus,.comment-form textarea:focus{outline:none;border-color:var(--brass);}
.form-submit input[type="submit"]{
  background:var(--brass);border:none;color:var(--ink);font-family:'Space Mono',monospace;
  font-weight:700;text-transform:uppercase;letter-spacing:0.04em;font-size:12px;padding:12px 26px;
  border-radius:2px;cursor:pointer;
}
.form-submit input[type="submit"]:hover{background:var(--crimson);color:var(--paper);}
.comment-notes,.logged-in-as{font-size:13px;color:rgba(239,234,224,0.55);margin-bottom:18px;}
.comment-notes a,.logged-in-as a{color:var(--teal);}

@media (max-width:960px){
  .layout{grid-template-columns:1fr;}
  .layout main{order:-1;}
  aside,aside.right{border:none;border-top:1px solid var(--line);padding:28px 20px;}
  main{padding:28px 20px;}
  .post-grid{grid-template-columns:repeat(2,1fr);}
}
@media (max-width:560px){
  .post-grid{grid-template-columns:1fr;}
  .topbar{flex-wrap:wrap;justify-content:center;gap:14px;padding:8px 16px;text-align:center;}
  .masthead{padding:38px 16px 20px;}
  .masthead h1{font-size:clamp(22px,8vw,32px);letter-spacing:1px;}
  .vinyl{width:220px;height:220px;}
  .vinyl::after{width:46px;height:46px;}
  .rule span{width:60px;}
  nav.main{gap:16px;padding:14px 16px;}
  aside,main{padding:22px 16px;}
  .entry-content .gallery-columns-3 .gallery-item,
  .entry-content .gallery-columns-4 .gallery-item,
  .entry-content .gallery-columns-5 .gallery-item,
  .entry-content .gallery-columns-6 .gallery-item,
  .entry-content .gallery-columns-7 .gallery-item,
  .entry-content .gallery-columns-8 .gallery-item,
  .entry-content .gallery-columns-9 .gallery-item{width:calc(50% - 10px) !important;}
  .entry-content .wp-block-gallery .wp-block-image{flex-basis:calc(50% - 14px) !important;}
  .entry-content img.alignleft,
  .entry-content img.alignright,
  .entry-content .wp-caption.alignleft,
  .entry-content .wp-caption.alignright{float:none;display:block;margin:0 0 16px;width:100% !important;}
  .entry-content p:has(> img.alignnone:only-child):has(+ p > img.alignnone:only-child) img,
  .entry-content p:has(> img.alignnone:only-child) + p:has(> img.alignnone:only-child) img{
    width:calc((100% - 14px) / 2);
    height:auto;
    aspect-ratio:1/1;
  }
}
