/*
Theme Name: Theatre and Chardonnay Refresh
Theme URI: https://theatreandchardonnay.co.uk
Description: Child theme of Theatre and Chardonnay. Readability, mobile menu and layout refresh. Keeps the plum and gold identity.
Author: Theatre and Chardonnay
Author URI: https://theatreandchardonnay.co.uk
Template: theatre-and-chardonnay
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: theatre-chardonnay-child
*/

/* =========================================
   1. TOKENS
   Overrides the parent's custom properties.
   ========================================= */

:root {
  --tc-pink: #A3305F;        /* deeper rose: passes contrast on white */
  --tc-pink-deep: #7A2147;
  --tc-pink-hover: #8E2853;
  --tc-wine: #5B1F45;        /* header plum */
  --tc-gold: #D4AF5F;
  --tc-text-light: #6E5A68;
  --tc-warm-grey: #5E4E5A;
  --tc-border: #EEDCE3;

  --tc-font-display: 'Cinzel', serif;
  --tc-font-heading: 'Playfair Display', Georgia, serif;
  --tc-font-body: 'Lora', Georgia, serif;
  --tc-font-accent: 'Cinzel', serif;

  --tc-radius: 8px;
  --tc-radius-lg: 14px;
}

body { background-color: #FBF5F2; }

/* =========================================
   2. BODY TEXT (readability)
   ========================================= */

p { font-size: 1rem; }

.entry-content {
  font-size: 1.1rem;          /* about 20px on desktop */
  line-height: 1.75;
  max-width: 42em;            /* roughly 70 characters a line */
}

.entry-content p { font-size: inherit; }

.entry-content h2 {
  font-size: 1.8rem;
  border-top: 0;
  padding-top: 0;
  margin-top: 2.75rem;
}

.entry-content h3 { font-size: 1.35rem; }

/* Drop cap in Playfair rather than Cinzel Decorative */
.entry-content > p:first-of-type::first-letter {
  font-family: var(--tc-font-heading);
  font-weight: 700;
  font-size: 3.9em;
  line-height: 0.82;
  padding: 0.06em 0.1em 0 0;
}

/* Tables: keep wide ones scrollable on phones */
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content table { font-size: 0.95rem; }

/* =========================================
   3. HEADER
   ========================================= */

.site-header {
  background: var(--tc-wine);
}
.site-header::before { display: none; }
.site-header::after {
  height: 3px;
  background: var(--tc-gold);
}

.site-title {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 2.4rem;
  letter-spacing: 0.06em;
  text-shadow: none;
  line-height: 1.15;
}
.site-title a { color: #fff; }

.site-description {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: #E9CF8E;
  margin-top: 0.4rem;
}

/* =========================================
   4. NAVIGATION
   ========================================= */

.main-navigation { background: #2B1A28; }

.nav-inner { flex-wrap: wrap; }

.main-navigation ul.nav-menu {
  flex-wrap: wrap;
  justify-content: center;
}

.main-navigation a {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: #F6E7EE;
  padding: 1rem 1rem;
  white-space: nowrap;        /* labels never break mid-label */
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-parent > a,
.main-navigation .current-post-parent > a {
  color: #fff;
  background: transparent;
  box-shadow: inset 0 -2px 0 var(--tc-gold);
}

/* Mobile: menu closed until the button is tapped.
   The parent rule loses on specificity, so this one is scoped. */
@media (max-width: 768px) {
  .main-navigation .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 48px;
    margin: 0.6rem 0;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: #fff;
    border-color: var(--tc-gold);
  }
  .main-navigation ul.nav-menu { display: none; width: 100%; }
  .main-navigation ul.nav-menu.toggled {
    display: flex;
    flex-direction: column;
    padding-bottom: 0.5rem;
  }
  .main-navigation a {
    padding: 0.9rem 1rem;
    font-size: 0.8rem;
    white-space: normal;
  }
}

/* =========================================
   5. LAYOUT AND POST CARDS
   Latest post as a wide hero card, the rest in two columns.
   ========================================= */

.site-content { padding-top: 3rem; }

body.blog .content-area,
body.archive .content-area,
body.search .content-area {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem;
  align-content: start;
}

body.blog .content-area > *,
body.archive .content-area > *,
body.search .content-area > * { grid-column: 1 / -1; }

body.blog .content-area > .post-card,
body.archive .content-area > .post-card,
body.search .content-area > .post-card {
  grid-column: auto;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

/* Hero: first card spans both columns, image beside text */
body.blog .content-area > .post-card:first-of-type,
body.archive .content-area > .post-card:first-of-type {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.blog .content-area > .post-card:first-of-type .post-card-thumbnail,
body.archive .content-area > .post-card:first-of-type .post-card-thumbnail {
  aspect-ratio: auto;
  min-height: 320px;
  height: 100%;
}
body.blog .content-area > .post-card:first-of-type .post-card-body,
body.archive .content-area > .post-card:first-of-type .post-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.25rem;
}
body.blog .content-area > .post-card:first-of-type .post-card-title,
body.archive .content-area > .post-card:first-of-type .post-card-title {
  font-size: 1.9rem;
}

.post-card { box-shadow: none; }
.post-card:hover { transform: none; box-shadow: var(--tc-shadow); }

.post-card-thumbnail { aspect-ratio: 16 / 9; display: block; }

.post-card-body {
  padding: 1.4rem 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.post-card-body .post-card-category { align-self: flex-start; }

.post-card-title { font-size: 1.3rem; line-height: 1.28; }

.post-card-excerpt {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--tc-warm-grey);
}
.post-card-excerpt p { font-size: inherit; margin-bottom: 0; }

.post-card-meta {
  font-family: var(--tc-font-body);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
  gap: 0.5rem;
}
.post-card-meta .meta-date { color: var(--tc-text-light); font-weight: 400; }

/* Category pill now sits in the card body (see index.php) */
.post-card-body .post-card-category {
  position: static;
  display: inline-block;
  margin-bottom: 0.8rem;
  font-family: 'Cinzel', serif;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  padding: 0.35rem 0.85rem;
  background: var(--tc-pink);
}
.post-card-body .post-card-category a { color: #fff; }

.read-more-link {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  padding: 0.6rem 0 2px;
  margin-top: auto;
  align-self: flex-start;
}

@media (max-width: 960px) {
  body.blog .content-area > .post-card:first-of-type,
  body.archive .content-area > .post-card:first-of-type {
    grid-template-columns: 1fr;
  }
  body.blog .content-area > .post-card:first-of-type .post-card-thumbnail,
  body.archive .content-area > .post-card:first-of-type .post-card-thumbnail {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
}

/* Phones: one column, compact cards after the hero */
@media (max-width: 600px) {
  body.blog .content-area,
  body.archive .content-area,
  body.search .content-area {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  body.blog .content-area > .post-card:not(:first-of-type),
  body.archive .content-area > .post-card:not(:first-of-type) {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 0.9rem;
    padding: 0.85rem;
    align-items: start;
  }
  body.blog .content-area > .post-card:not(:first-of-type) .post-card-thumbnail,
  body.archive .content-area > .post-card:not(:first-of-type) .post-card-thumbnail {
    aspect-ratio: 1 / 1;
    border-radius: var(--tc-radius);
  }
  body.blog .content-area > .post-card:not(:first-of-type) .post-card-body,
  body.archive .content-area > .post-card:not(:first-of-type) .post-card-body {
    padding: 0;
  }
  body.blog .content-area > .post-card:not(:first-of-type) .post-card-category,
  body.archive .content-area > .post-card:not(:first-of-type) .post-card-category {
    background: none;
    padding: 0;
    margin-bottom: 0.3rem;
  }
  body.blog .content-area > .post-card:not(:first-of-type) .post-card-category a,
  body.archive .content-area > .post-card:not(:first-of-type) .post-card-category a {
    color: var(--tc-pink);
  }
  body.blog .content-area > .post-card:not(:first-of-type) .post-card-title,
  body.archive .content-area > .post-card:not(:first-of-type) .post-card-title {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
  }
  body.blog .content-area > .post-card:not(:first-of-type) .post-card-excerpt,
  body.blog .content-area > .post-card:not(:first-of-type) .read-more-link,
  body.archive .content-area > .post-card:not(:first-of-type) .post-card-excerpt,
  body.archive .content-area > .post-card:not(:first-of-type) .read-more-link {
    display: none;
  }
  .post-card-meta { flex-wrap: wrap; }

  /* Cards without a featured image stay single column */
  body.blog .content-area > .post-card:not(:first-of-type):not(:has(.post-card-thumbnail)),
  body.archive .content-area > .post-card:not(:first-of-type):not(:has(.post-card-thumbnail)) {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   6. SINGLE POST
   ========================================= */

.single-post-header .post-category {
  font-family: 'Cinzel', serif;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
}
.single-post-header h1 {
  font-size: 2.6rem;
  max-width: 760px;
  line-height: 1.15;
}
.single-post-meta {
  font-family: var(--tc-font-body);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
}
.single-post-meta .meta-gold { color: var(--tc-text-light); font-weight: 400; }

.single-featured-image { box-shadow: none; }

/* Image captions, e.g. "Photo: Ali Langton" */
.wp-caption-text,
.wp-element-caption,
.wp-block-image figcaption {
  font-family: var(--tc-font-body);
  font-size: 0.85rem;
  color: var(--tc-text-light);
  letter-spacing: 0;
  text-align: left;
}

.post-navigation a { font-size: 1.1rem; }

/* =========================================
   7. SIDEBAR
   ========================================= */

.widget { box-shadow: none; padding: 1.6rem; }

/* Classic widget titles and block-widget headings look the same */
.widget-title,
.widget-area .widget h2,
.widget-area .widget .wp-block-heading {
  font-family: var(--tc-font-heading);
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--tc-dark);
  margin: 0 0 1.1rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid var(--tc-gold);
}
.widget-title::after { display: none; }

.widget-about-text {
  font-size: 0.95rem;
  color: var(--tc-text);
}
.widget-about-mascot .widget-about-image {
  max-width: 100%;
  border-radius: var(--tc-radius);
}

.widget ul li,
.widget-area .wp-block-latest-posts li,
.widget-area .wp-block-categories li {
  font-size: 0.95rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--tc-border);
  list-style: none;
}
.widget-area .wp-block-latest-posts,
.widget-area .wp-block-categories { padding-left: 0; margin: 0; }
.widget ul li a,
.widget-area .wp-block-latest-posts a { color: var(--tc-text); }
.widget ul li a:hover,
.widget-area .wp-block-latest-posts a:hover { color: var(--tc-pink); }

/* Search: classic form and the Search block */
.search-form .search-field,
.wp-block-search__input {
  font-family: var(--tc-font-body);
  font-size: 1rem;
  min-height: 46px;
  border: 1px solid #D9BFCB;
  border-radius: var(--tc-radius);
  background: #fff;
}
.search-form .search-field { border-right: 1px solid #D9BFCB; border-radius: var(--tc-radius) 0 0 var(--tc-radius); }
.search-form .search-submit,
.wp-block-search__button {
  min-height: 46px;
  background: var(--tc-wine);
  border: 1px solid var(--tc-wine);
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--tc-radius);
  padding: 0 1.1rem;
  cursor: pointer;
}
.search-form .search-submit { border-radius: 0 var(--tc-radius) var(--tc-radius) 0; }
.search-form .search-submit:hover,
.wp-block-search__button:hover { background: var(--tc-pink-deep); border-color: var(--tc-pink-deep); }
.wp-block-search__label {
  font-family: var(--tc-font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--tc-dark);
}

/* =========================================
   8. BUTTONS, PAGINATION, FOOTER
   ========================================= */

.wp-block-button__link,
.comment-form .submit,
.btn-home {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  border-radius: var(--tc-radius);
  min-height: 44px;
}

.pagination .page-numbers { width: 44px; height: 44px; font-family: var(--tc-font-body); }

.site-footer { background: #2B1A28; color: #E9D6DF; }
.site-footer::before { background: var(--tc-gold); }
.footer-widget ul li a { color: #E9D6DF; }
.footer-bottom { color: rgba(233, 214, 223, 0.75); font-family: var(--tc-font-body); text-transform: none; letter-spacing: 0; font-size: 0.8rem; }

/* =========================================
   9. SMALL SCREENS
   ========================================= */

@media (max-width: 768px) {
  .site-title { font-size: 1.55rem; }
  .site-description { font-size: 0.62rem; letter-spacing: 0.22em; }
  .single-post-header h1 { font-size: 1.85rem; }
  .entry-content { font-size: 1.12rem; }   /* html is 16px here, so about 18px */
  .site-content { padding-top: 1.75rem; }
}

@media (max-width: 480px) {
  .site-title { font-size: 1.3rem; }
  .single-post-header h1 { font-size: 1.6rem; }
}

/* Respect reduced-motion settings */
@media (prefers-reduced-motion: reduce) {
  .header-sparkle { animation: none; }
  .post-card, .post-card-thumbnail img { transition: none; }
}
