/*
 * The Coptic calendar pages: Coptic_Calendar, Feast/{slug}, Holidays/{year}.
 *
 * Mobile first: the rules outside any media query are the phone layout, and
 * wider screens add to them with min-width queries — 600px (large phones,
 * small tablets) and 900px (two columns).
 */

.cc {
  --cc-ink: #1f2433;
  --cc-muted: #5f6472;
  --cc-line: #e7e1d4;
  --cc-soft: #faf7f1;
  --cc-wine: #7a2335;
  --cc-navy: #1a2049;
  --cc-gold: #e0b25a;
  --cc-fast: #f3eefb;
  --cc-fifty: #fff8e1;
  max-width: 1120px;
  margin: 0 auto 40px;
  padding: 0 12px;
  color: var(--cc-ink);
  line-height: 1.7;
  font-size: 16px;
}
.cc *, .cc *::before, .cc *::after { box-sizing: border-box; }
/* An anchor (#convert) stops below the site's fixed header rather than under it. */
.cc [id] { scroll-margin-top: 120px; }
/* :where() keeps this at zero specificity, so button and badge colours below win. */
.cc :where(a) { color: var(--cc-navy); }
.cc h1, .cc h2, .cc h3 { line-height: 1.35; color: var(--cc-navy); }
.cc h1 { font-size: 26px; margin: 20px 0 6px; }
.cc h2 { font-size: 19px; margin: 0 0 10px; }

.cc-crumbs { font-size: 13px; color: var(--cc-muted); margin: 12px 0 0; }
.cc-crumbs a { color: var(--cc-muted); }
/* Read by screen readers and search engines, not shown. */
.cc-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cc-lead { color: var(--cc-muted); margin: 0 0 16px; font-size: 16px; }

.cc-card {
  background: #fff;
  border: 1px solid var(--cc-line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  min-width: 0;
}
.cc-card > h2:first-child { margin-top: 0; }

.cc-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-items: start; }

/* ---- today ---------------------------------------------------------- */
.cc-today {
  background: linear-gradient(135deg, var(--cc-wine), var(--cc-navy));
  border-radius: 18px;
  padding: 12px 14px;
  margin: 12px 0 14px;
  display: grid;
  /* A third for the date, two thirds for the rest, on every screen. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 6px 16px;
  align-items: center;
  text-align: start;
}
/* Everything on the dark card is white; the site stylesheet colours p, small and a itself. */
.cc-today, .cc-today p, .cc-today div, .cc-today small, .cc-today a { color: #fff; }
.cc-today__date { text-align: center; padding-inline-end: 16px; border-inline-end: 1px solid rgba(255,255,255,.25); }
.cc-today__wd { font-size: 14px; opacity: .85; line-height: 1.4; }
.cc-today__day { font-size: 42px; font-weight: 800; line-height: 1.05; }
.cc-today__month { font-size: 19px; font-weight: 700; line-height: 1.4; }
.cc-today__year { font-size: 13px; opacity: .8; line-height: 1.4; }
.cc-today__info p { margin: 0 0 6px; }
.cc-today__info .cc-today__g { font-size: 16px; font-weight: 700; }
.cc-today__evs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cc-today__evs a { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 2px 12px; text-decoration: none; font-size: 15px; }
/* The month navigation at the foot of the card, across both columns, in white. */
.cc-today > .cc-month-head { grid-column: 1 / -1; margin: 6px 0 0; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.25); }
.cc-today .cc-month-head h2, .cc-today .cc-month-head small { color: #fff; }
.cc-today .cc-month-head small { opacity: .8; }
.cc .cc-today .cc-month-head .cc-btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); color: #fff; }
.cc .cc-today .cc-month-head .cc-btn:hover { background: rgba(255,255,255,.22); }
.cc .cc-today .cc-month-today { color: var(--cc-gold); }
/* The card switches the page between the Coptic and the Gregorian calendar. */
.cc .cc-today__switch {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 14px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.12);
  color: #fff; font-size: 14px; font-weight: 700; text-decoration: none;
}
.cc .cc-today__switch:hover { background: rgba(255,255,255,.22); }
.cc-today .cc-today__fast { display: inline-block; background: var(--cc-gold); color: var(--cc-navy); border-radius: 999px; padding: 1px 12px; font-size: 14px; font-weight: 700; }

/* ---- badges --------------------------------------------------------- */
.cc-badge { display: inline-block; font-size: 12.5px; font-weight: 700; border-radius: 8px; padding: 1px 9px; white-space: nowrap; }
.cc .cc-k-major    { background: #fbe9e7; color: #a3241c; }
.cc .cc-k-minor    { background: #fdf1d8; color: #7d5300; }
.cc .cc-k-church   { background: #e8f0fb; color: #1f4f8f; }
.cc .cc-k-saint    { background: #e5f4ea; color: #1d6b40; }
.cc .cc-k-fast     { background: #f1eafb; color: #5e3594; }
.cc .cc-k-national { background: #e0f2f4; color: #0a5f68; }
.cc .cc-k-holiday  { background: #eceef2; color: #454b57; }
.cc .cc-k-note     { background: #f2f2f2; color: #5f6472; }
.cc-flag { font-size: 12px; border-radius: 6px; padding: 0 7px; white-space: nowrap; }
.cc-flag--off { background: #e0f2f4; color: #0a5f68; }
.cc-flag--approx { background: #fff3cd; color: #7a5a00; }

/* ---- occasion lists ------------------------------------------------- */
.cc-list { list-style: none; margin: 0; padding: 0; }
/* Phone: date block, then name with the badge under it. */
.cc-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--cc-line);
}
.cc-row > .cc-badge { grid-column: 2; justify-self: start; }
.cc-row:last-child { border-bottom: 0; }
.cc-row__date { grid-row: span 2; text-align: center; background: var(--cc-soft); border-radius: 12px; padding: 4px 0; line-height: 1.2; }
.cc-row__date b { display: block; font-size: 19px; color: var(--cc-navy); }
.cc-row__date small { font-size: 12px; color: var(--cc-muted); }
.cc-row__body { line-height: 1.5; min-width: 0; }
.cc-row__name { font-weight: 700; text-decoration: none; line-height: 1.5; }
.cc-row__name:hover { text-decoration: underline; }
.cc-row__meta { display: block; color: var(--cc-muted); font-size: 13.5px; line-height: 1.6; margin-top: 2px; }

/* ---- buttons -------------------------------------------------------- */
.cc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 6px 12px; border-radius: 10px;
  border: 1px solid var(--cc-line); background: #fff; color: var(--cc-navy);
  font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.cc-btn:hover { background: var(--cc-soft); }
.cc-btn:focus-visible, .cc a:focus-visible, .cc input:focus-visible, .cc select:focus-visible { outline: 3px solid #7aa7e0; outline-offset: 2px; }
/* .cc in front: the site stylesheet colours a:link and a:visited, which outrank a lone class. */
.cc .cc-btn--on, .cc .cc-btn--primary { background: var(--cc-navy); color: #fff; border-color: var(--cc-navy); }
.cc .cc-btn--on:hover, .cc .cc-btn--primary:hover { background: #2a3270; color: #fff; }

/* ---- month grid ----------------------------------------------------- */
/* Previous and next either side of the month name. */
.cc-month-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cc-month-head > .cc-btn { flex: none; }
.cc-month-title { flex: 1 1 auto; min-width: 0; text-align: center; }
.cc .cc-month-today { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--cc-wine); }
.cc-month-head h2 { margin: 0; font-size: 18px; }

.cc-month-head small { display: block; font-size: 13px; color: var(--cc-muted); font-weight: 400; }
.cc-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cc-list-head h2 { margin: 0; }
.cc .cc-btn--sm { min-height: 36px; padding: 4px 12px; font-size: 14px; flex: none; }

/* Phone: number, the other calendar's day, and the first occasion's short
   name on up to two lines. The month's list under the grid has the rest. */
.cc-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cc-month__wd { text-align: center; font-size: 13px; font-weight: 700; color: var(--cc-muted); padding: 4px 0; }
.cc-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cc-short { display: inline; }
.cc-month__day {
  position: relative;
  min-height: 74px;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  padding: 3px 2px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.cc-month__day.is-empty { border: 0; background: transparent; }
.cc-month__day.is-fast  { background: var(--cc-fast); }
.cc-month__day.is-fifty { background: var(--cc-fifty); }
.cc-month__day.is-today { border: 2px solid var(--cc-gold); box-shadow: 0 0 0 2px rgba(224,178,90,.25); }
.cc-month__num { font-size: 16px; font-weight: 800; line-height: 1.2; color: var(--cc-navy); }
.cc-month__alt { font-size: 10px; color: var(--cc-muted); line-height: 1.25; text-align: center; }
.cc-month__altm { display: none; }
.cc-month__altm.is-shown { display: block; font-weight: 700; }
.cc-month__evs { display: flex; flex-direction: column; gap: 2px; margin-top: 3px; width: 100%; }
.cc-ev {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-size: 9px; font-weight: 700; line-height: 1.3; text-align: center;
  border-radius: 4px; padding: 1px 2px; text-decoration: none; overflow-wrap: normal; word-break: normal;
}
.cc-month__evs .cc-ev ~ .cc-ev { display: none; }
.cc-ev--more { display: none; color: var(--cc-muted); }

.cc-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--cc-muted); margin-top: 10px; }
.cc-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.cc-sw-fast  { background: var(--cc-fast); border: 1px solid #ddd0f2; }
.cc-sw-fifty { background: var(--cc-fifty); border: 1px solid #f0dfa8; }

/* ---- forms ---------------------------------------------------------- */
.cc-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.cc-form label { display: block; font-size: 13px; color: var(--cc-muted); font-weight: 700; margin-bottom: 2px; }
.cc-form input, .cc-form select {
  min-height: 44px; border: 1px solid var(--cc-line); border-radius: 10px; padding: 4px 10px;
  font: inherit; font-size: 16px; background: #fff; color: var(--cc-ink); max-width: 100%;
}
.cc-form input[type=number] { width: 96px; }
.cc-result { background: var(--cc-soft); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.cc-result b { color: var(--cc-navy); }

/* ---- occasion page -------------------------------------------------- */
.cc-when {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: center;
  border-inline-start: 6px solid var(--cc-wine);
}
.cc-when__big { font-size: 22px; font-weight: 800; color: var(--cc-navy); line-height: 1.3; }
.cc-when__sub { color: var(--cc-muted); }
.cc-when__count { justify-self: start; text-align: center; background: var(--cc-soft); border-radius: 14px; padding: 6px 16px; font-weight: 800; color: var(--cc-wine); font-size: 17px; }
.cc-text { font-size: 17px; line-height: 2; margin: 0; }

/* Every calendar table: line height 1.5 so two-line cells don't crowd, cells
   centred vertically, a navy header and soft banding as in the PDF. */
.cc-table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.cc-table th, .cc-table td { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--cc-line); vertical-align: middle; line-height: 1.5; }
.cc-table thead th { background: var(--cc-navy); color: #fff; font-size: 13px; font-weight: 700; }
.cc-table thead th:first-child { border-start-start-radius: 10px; }
.cc-table thead th:last-child { border-start-end-radius: 10px; }
.cc-table tbody tr:nth-child(even) { background: var(--cc-soft); }
.cc-table tbody th { font-weight: 400; }
.cc-table__sub { display: block; font-size: 12.5px; color: var(--cc-muted); line-height: 1.5; }
.cc-table__date { white-space: nowrap; }
.cc-table__date b { font-size: 17px; color: var(--cc-navy); }
.cc-table__kind { display: block; margin-top: 3px; }
.cc-table__nowrap { white-space: nowrap; }
.cc-table--occ td:last-child { white-space: nowrap; color: var(--cc-muted); }
.cc-table-wrap { overflow-x: auto; }

.cc-ideas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.cc-ideas a { display: block; height: 100%; border: 1px solid var(--cc-line); border-radius: 12px; padding: 10px 12px; text-decoration: none; background: #fff; }
.cc-ideas a:hover { border-color: var(--cc-navy); }
.cc-ideas b { display: block; line-height: 1.5; }
.cc-ideas small { color: var(--cc-muted); }

/* ---- year page ------------------------------------------------------ */
.cc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.cc-yearnav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.cc-note { font-size: 14px; color: var(--cc-muted); margin: 10px 0 0; }

/* ==== wider screens ================================================== */
@media (min-width: 600px) {
  .cc { padding: 0 16px; }
  .cc h1 { font-size: 32px; }
  .cc h2 { font-size: 21px; }
  .cc-card { padding: 20px; margin-bottom: 20px; border-radius: 16px; }

  .cc-today { gap: 8px 28px; padding: 22px 24px; }
  .cc-today__date { padding-inline-end: 28px; }
  .cc-today__wd { font-size: 16px; }
  .cc-today__day { font-size: 64px; }
  .cc-today__month { font-size: 22px; }
  .cc-today__year { font-size: 14px; }
  .cc-today__info .cc-today__g { font-size: 18px; }

  .cc-row { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; }
  .cc-row__date { grid-row: auto; }
  .cc-row > .cc-badge { grid-column: auto; }
  /* The sidebar stays narrow on any screen: badge under the name there. */
  .cc aside .cc-row { grid-template-columns: 46px minmax(0, 1fr); gap: 4px 10px; }
  .cc aside .cc-row__date { grid-row: span 2; }
  .cc aside .cc-row > .cc-badge { grid-column: 2; }

  .cc-month-head h2 { font-size: 21px; }
  .cc-month { gap: 4px; }
  .cc-full { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .cc-short { display: none; }
  .cc-month__day { min-height: 92px; padding: 4px 6px; align-items: stretch; border-radius: 10px; }
  .cc-month__num { font-size: 20px; }
  .cc-month__alt { font-size: 11.5px; text-align: start; }
  .cc-month__altm, .cc-month__altm.is-shown { display: inline; font-weight: 400; }
  .cc-month__evs { margin-top: 4px; }
  .cc-ev { display: block; font-size: 11.5px; font-weight: 400; line-height: 1.35; text-align: start; padding: 1px 4px; border-radius: 5px; white-space: nowrap; text-overflow: ellipsis; }
  .cc-month__evs .cc-ev ~ .cc-ev { display: block; }

  .cc-when { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; }
  .cc-when__big { font-size: 28px; }
  .cc-when__count { justify-self: auto; padding: 8px 18px; font-size: 18px; }

  .cc-ideas { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
}

@media (min-width: 900px) {
  .cc-cols { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
}

@media print {
  .cc-btn, .cc-form, .cc-tabs, .cc-tools, .cc-yearnav, .sc-ad { display: none !important; }
  .cc-card { border: 0; padding: 0; }
}
