/* Reader Photo of the Day — homepage card, /photo/ form, permalinks, archive.
   Loaded after styles.css; uses its variables. */

/* ---------- Homepage card (main column, under "Your morning") ---------- */
.rp-home { margin-top: 2.2rem; }
.rp-home .rp-home__head { margin-bottom: 1rem; max-width: none; }
.rp-home .section__title { font-size: clamp(1.55rem, 2.3vw, 2rem); margin-bottom: 0; }
.rp-card {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(11, 61, 92, 0.08);
}
.rp-card__media { display: block; position: relative; aspect-ratio: 3 / 2; background: var(--navy-deep); overflow: hidden; }
.rp-card__media picture, .rp-feature__media picture { display: block; width: 100%; height: 100%; }
.rp-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.rp-card__media:hover img, .rp-card__media:focus-visible img { transform: scale(1.02); }
.rp-portrait .rp-card__media img, .rp-portrait .rp-feature__media img { object-fit: contain; }
.rp-card__body { padding: 1rem 1.25rem 1.1rem; }
.rp-card__meta { margin: 0 0 0.35rem; font: 600 0.78rem/1.3 var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-text); }
.rp-card__caption { margin: 0 0 0.45rem; font-family: var(--font-display); font-size: 1.2rem; line-height: 1.35; color: var(--navy); }
.rp-card__credit { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.98rem; }
.rp-card__credit strong { color: var(--ink); font-weight: 700; }
.rp-handle { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.15rem; color: var(--river); font-weight: 600; }
span.rp-handle { min-height: 0; }
.rp-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem; margin: 0; }
.rp-card__actions .btn { min-height: 44px; display: inline-flex; align-items: center; }
.rp-link { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-ui); font-weight: 600; color: var(--navy); }

/* Empty state: a call for photos, kept compact to save space. */
.rp-card--empty { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: stretch; }
.rp-card__art {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 210px; padding: 1.2rem; color: var(--paper);
  background:
    radial-gradient(120% 70% at 50% 115%, rgba(201, 162, 39, 0.55) 0 22%, transparent 23%),
    radial-gradient(150% 80% at 50% 130%, rgba(26, 107, 122, 0.9) 0 40%, transparent 41%),
    linear-gradient(180deg, #0B3D5C 0%, #1A6B7A 100%);
}
.rp-card__art img { width: 72px; height: 72px; background: var(--paper); border-radius: 16px; padding: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.25); }
.rp-card__art span { font: 600 0.75rem/1 var(--font-ui); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-on-navy); border: 1px dashed rgba(224, 196, 90, 0.8); border-radius: 999px; padding: 0.45rem 0.8rem; }
.rp-card--empty .rp-card__body { display: flex; flex-direction: column; justify-content: center; padding: 1.25rem 1.4rem; }
.rp-card--empty .rp-card__caption { font-family: var(--font-body); font-size: 1.02rem; line-height: 1.5; color: var(--ink); margin-bottom: 0.8rem; }

@media (max-width: 640px) {
  .rp-card--empty { grid-template-columns: 1fr; }
  .rp-card__art { min-height: 150px; }
  .rp-card__body { padding: 0.9rem 1rem 1rem; }
}

/* ---------- /photo/ pages ---------- */
.rp-wrap { max-width: var(--content); }
.rp-title { margin-bottom: 1.2rem; }
.rp-lead { color: var(--muted); margin: 0 0 1.4rem; }
.rp-lead a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.rp-empty { margin: 0 0 1.8rem; background: var(--paper); border: 1px dashed var(--light-line); border-radius: var(--radius); padding: 1.1rem 1.25rem; color: var(--muted); }
.rp-empty p { margin: 0; }
.rp-feature { margin: 0 0 2.2rem; background: var(--paper); border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 26px rgba(11, 61, 92, 0.08); }
.rp-feature__media { background: var(--navy-deep); }
.rp-feature__media img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; margin: 0 auto; }
.rp-feature__body { padding: 1.1rem 1.4rem 1.2rem; }
.rp-feature__caption { margin: 0 0 0.45rem; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.35rem, 2.4vw, 1.9rem); line-height: 1.2; color: var(--navy); }
.rp-share { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.rp-share__btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 1rem;
  border: 1px solid var(--card-border); border-radius: 999px; background: #fff; color: var(--navy);
  font: 600 0.9rem var(--font-ui); text-decoration: none; cursor: pointer;
}
.rp-share__btn:hover { border-color: var(--gold); color: var(--navy); }
.rp-share__btn[hidden] { display: none; }
.rp-share__msg { font-size: 0.9rem; color: var(--river); font-weight: 600; }

.rp-form-wrap { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 1.5rem 2.2rem; align-items: start; scroll-margin-top: 5rem; }
.rp-form-intro p { color: var(--ink); line-height: 1.6; }
.rp-tips { margin: 0.8rem 0 0; padding-left: 1.1rem; color: var(--muted); line-height: 1.55; }
.rp-tips li { margin-bottom: 0.3rem; }
.rp-form, .rp-thanks { grid-column: 2; background: var(--paper); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: 0 10px 26px rgba(11, 61, 92, 0.08); }
.rp-form-intro { grid-column: 1; grid-row: 1 / span 2; }
.rp-form[hidden] { display: none; }
.rp-field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.9rem; min-width: 0; }
.rp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.9rem; }
.rp-form label { font: 600 0.92rem/1.3 var(--font-ui); color: var(--navy); }
.rp-form .req { color: #A33; }
.rp-opt { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.rp-form input[type=text], .rp-form input[type=email], .rp-form select, .rp-form textarea {
  width: 100%; min-height: 44px; padding: 0.55rem 0.75rem; border: 1px solid var(--light-line); border-radius: var(--radius-sm);
  background: #fff; font: 1rem/1.4 var(--font-body); color: var(--ink); -webkit-appearance: none; appearance: none;
}
.rp-form select { background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2rem; }
.rp-form textarea { resize: vertical; }
.rp-form input:focus, .rp-form select:focus, .rp-form textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25); }
.rp-field--file input[type=file] { width: 100%; max-width: 100%; min-height: 44px; padding: 0.6rem; border: 2px dashed var(--light-line); border-radius: var(--radius-sm); background: #FBFBF8; font: 0.95rem var(--font-body); cursor: pointer; }
.rp-field--file input[type=file]::file-selector-button { min-height: 36px; margin-right: 0.7rem; border: 0; border-radius: 999px; padding: 0 1rem; background: var(--navy); color: #fff; font: 600 0.9rem var(--font-ui); cursor: pointer; }
.rp-hint { margin: 0; font-size: 0.85rem; color: var(--muted); }
.rp-preview { margin-top: 0.4rem; }
.rp-preview[hidden] { display: none; }
.rp-preview img { display: block; max-width: 100%; max-height: 240px; border-radius: var(--radius-sm); border: 1px solid var(--card-border); }
.rp-check { display: grid !important; grid-template-columns: 24px 1fr; gap: 0.6rem; align-items: start; min-height: 44px; padding: 0.55rem 0; font: 400 0.98rem/1.45 var(--font-body) !important; color: var(--ink) !important; cursor: pointer; }
.rp-check input { width: 22px; height: 22px; margin: 0.05rem 0 0; accent-color: var(--navy); }
.rp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rp-submit { width: 100%; justify-content: center; margin-top: 0.4rem; min-height: 48px; }
.rp-privacy { margin: 0.8rem 0 0; font-size: 0.82rem; line-height: 1.5; color: var(--muted); }
.rp-error { margin: 0 0 0.9rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); background: #FFF4F4; border: 1px solid #F0C2C2; color: #8A1F1F; font-weight: 600; }
.rp-error[hidden] { display: none; }
.rp-thanks { display: none; border: 2px solid var(--gold); }
.rp-thanks:target, .rp-thanks.is-shown { display: block; }
.rp-form-wrap:has(.rp-thanks:target) .rp-form { display: none; }
.rp-thanks__label { margin: 0 0 0.3rem; font: 600 0.78rem var(--font-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-text); }
.rp-thanks p { margin: 0 0 0.8rem; }
.rp-result { font-size: 1.1rem; line-height: 1.55; margin: 1rem 0 1.4rem; }

.rp-recent { margin-top: 2.6rem; }
.rp-recent__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; }
.rp-recent__head h2 { margin: 0; font-family: var(--font-display); color: var(--navy); font-size: 1.4rem; }
.rp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; }
.rp-grid--archive { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rp-thumb { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; box-shadow: 0 6px 18px rgba(11, 61, 92, 0.06); }
.rp-thumb:hover { border-color: var(--gold); color: inherit; }
.rp-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--navy-deep); }
.rp-thumb__body { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.7rem 0.85rem 0.85rem; }
.rp-thumb__date { font: 600 0.72rem var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-text); }
.rp-thumb__cap { font-family: var(--font-display); color: var(--navy); line-height: 1.3; }
.rp-thumb__by { font-size: 0.88rem; color: var(--muted); }
.rp-pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.6rem; align-items: center; margin: -1rem 0 1.6rem; }
.rp-pager a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.rp-pager a:last-child { justify-self: end; }
.rp-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.2rem; padding: 1.1rem 1.3rem; background: var(--paper); border: 1px solid var(--card-border); border-radius: var(--radius); }
.rp-cta p { margin: 0; }
.photo-page .site-footer p a { display: inline-block; padding: 0.7rem 0; min-height: 44px; }

@media (max-width: 900px) {
  .rp-form-wrap { grid-template-columns: 1fr; }
  .rp-form, .rp-thanks, .rp-form-intro { grid-column: 1; grid-row: auto; }
  .rp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-grid--archive { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .rp-row { grid-template-columns: 1fr; }
  .rp-form, .rp-thanks { padding: 1rem; }
  .rp-feature__body { padding: 0.9rem 1rem 1rem; }
  .rp-grid--archive { grid-template-columns: 1fr; }
  .rp-pager { grid-template-columns: 1fr 1fr; }
  .rp-pager a:nth-child(2) { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
}

/* Homepage grid at 1024+: styles.css lines the sidebar up with the top-story row using
   explicit rows (main-col is display: contents there). Add a row for the photo card under
   "Your morning, section by section" and let the sidebar span it, so both columns stay even. */
@media (min-width: 1024px) {
  .page-shell:not(.page-shell--section) { grid-template-rows: auto auto auto auto 1fr; }
  .page-shell:not(.page-shell--section) > .main-col > .rp-home { grid-column: 1; grid-row: 5; min-width: 0; align-self: start; }
  .page-shell:not(.page-shell--section) > .sidebar { grid-row: 2 / 6; }
  /* Keep the morning grid content-sized (WebKit otherwise loops on the cards' min-height: 100%). */
  .page-shell:not(.page-shell--section) .inside-grid { align-self: start; }
  .page-shell:not(.page-shell--section) .inside-grid > .inside-card { min-height: 0; }
}


/* ---------- Picture of the Week + voting ---------- */
.rp-week { margin: 0 0 1.6rem; }
.rp-week__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.rp-week__potw, .rp-week__leader {
  background: var(--paper); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 0.9rem 1rem 1rem; box-shadow: 0 8px 20px rgba(11, 61, 92, 0.06); min-width: 0;
}
.rp-week .section__kicker { margin: 0 0 0.25rem; }
.rp-week__title { margin: 0 0 0.55rem; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.25; color: var(--navy); }
.rp-week__empty { margin: 0; color: var(--muted); font-size: 0.98rem; line-height: 1.5; }
.rp-week__shot { display: grid; grid-template-columns: minmax(0, 7.6rem) minmax(0, 1fr); gap: 0.75rem 0.9rem; align-items: center; text-decoration: none; color: inherit; }
.rp-week__shot:hover { color: inherit; }
.rp-week__media { position: relative; display: block; margin: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--navy-deep); aspect-ratio: 3 / 2; }
.rp-week__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rp-week__cap { margin: 0 0 0.2rem; font-family: var(--font-display); font-weight: 600; color: var(--navy); line-height: 1.3; }
.rp-week__by, .rp-week__meta { margin: 0; font-size: 0.88rem; color: var(--muted); }
.rp-week__howto { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.rp-history { margin: 0.7rem 0 0; border-top: 1px solid var(--light-line); padding-top: 0.45rem; }
.rp-history summary {
  display: flex; align-items: center; min-height: 44px; cursor: pointer; font: 600 0.95rem var(--font-ui); color: var(--navy);
  list-style: none;
}
.rp-history summary::-webkit-details-marker { display: none; }
.rp-history summary::after { content: "▸"; margin-left: 0.45rem; color: var(--gold-text); }
.rp-history[open] summary::after { content: "▾"; }
.rp-history ol { margin: 0 0 0.4rem; padding: 0; list-style: none; }
.rp-history li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.4rem 0.8rem; align-items: baseline; padding: 0.35rem 0; border-top: 1px solid var(--light-line); }
.rp-history li:first-child { border-top: 0; }
.rp-history a { font-weight: 600; color: var(--navy); }
.rp-history .rp-history__week { font: 600 0.75rem/1.3 var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-text); white-space: nowrap; }
.rp-history .rp-history__votes { font-size: 0.88rem; color: var(--muted); white-space: nowrap; }

.rp-crown {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.55rem 0.2rem 0.4rem;
  border-radius: 999px; background: var(--navy); color: var(--gold-on-navy);
  font: 600 0.68rem/1 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.rp-crown svg { display: block; width: 13px; height: 13px; color: var(--gold-on-navy, #E0C45A); }
.rp-feature__media, .rp-thumb__media { position: relative; }
.rp-crown--photo { position: absolute; top: 0.6rem; left: 0.6rem; z-index: 2; box-shadow: 0 4px 14px rgba(0,0,0,0.28); }

.rp-vote-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.7rem; margin-top: 0.65rem; }
.rp-vote { display: inline-flex; align-items: center; margin: 0; position: relative; }
.rp-vote .rp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rp-vote__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 44px; min-width: 44px; padding: 0 0.9rem 0 0.75rem;
  border: 1px solid var(--card-border); border-radius: 999px; background: #fff; color: var(--navy);
  font: 600 0.9rem var(--font-ui); cursor: pointer;
}
.rp-vote__btn:hover, .rp-vote__btn:focus-visible { border-color: var(--gold); }
.rp-vote__btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.28); }
.rp-vote__btn:disabled, .rp-vote__btn[aria-pressed="true"] { cursor: default; }
.rp-vote__btn[aria-pressed="true"] { background: var(--navy); color: #FFFCF7; border-color: var(--navy); }
.rp-vote__btn[aria-pressed="true"] .rp-vote__icon { color: #E0C45A; }
.rp-vote__icon { display: block; flex: 0 0 auto; }
.rp-vote__count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.4rem;
  font-variant-numeric: tabular-nums; color: var(--muted);
}
.rp-vote__btn[aria-pressed="true"] .rp-vote__count { color: #D9E4EA; }
.rp-vote__status { font-size: 0.88rem; color: var(--river); font-weight: 600; }
.rp-thumb { position: relative; } /* now an article, not only an anchor */
a.rp-thumb { /* leftover if any remain */ }
.rp-thumb { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden; color: inherit; box-shadow: 0 6px 18px rgba(11, 61, 92, 0.06); }
.rp-thumb__link { display: flex; flex-direction: column; text-decoration: none; color: inherit; min-width: 0; }
.rp-thumb__link:hover { color: inherit; }
.rp-thumb__link:hover .rp-thumb__cap, .rp-thumb:hover { border-color: var(--gold); }
.rp-thumb__media { display: block; }
.rp-thumb__media img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--navy-deep); }
.rp-thumb .rp-vote-row { margin: 0; padding: 0 0.75rem 0.75rem; }

@media (max-width: 720px) {
  .rp-week__grid { grid-template-columns: 1fr; }
  .rp-week__shot { grid-template-columns: minmax(0, 6.2rem) minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .rp-history li { grid-template-columns: 1fr auto; }
  .rp-history .rp-history__week { grid-column: 1 / -1; }
}

/* .btn carries no padding of its own in styles.css; give ours a comfortable size. */
.rp-card__actions .btn, .rp-cta .btn, .rp-thanks .btn, .rp-result-actions .btn { padding: 0.65rem 1.25rem; min-height: 44px; }
.rp-result-actions { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; align-items: center; }
.rp-result-actions a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
