/*
 * RFK 2026 — module presentation layer.
 * All rules are scoped to .rfk-theme and avoid overwriting plugin data models.
 */

/* ProBG Team and Signals theme overrides */
.rfk-theme .rfk-module { width: 100%; min-width: 0; padding: 8px 0 36px; }
.rfk-theme .rfk-module-heading { margin-bottom: 30px; }
.rfk-theme .rfk-module-heading h1,
.rfk-theme .rfk-module-detail h1 {
  margin: 0 0 12px;
  color: var(--rfk-blue);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.2;
  font-weight: 780;
}
.rfk-theme .rfk-module-description { color: var(--rfk-muted); max-width: 75ch; }
.rfk-theme .rfk-module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.rfk-theme .rfk-module-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border: 1px solid var(--rfk-border); background: #fff;
  border-radius: var(--rfk-radius); box-shadow: 0 5px 20px rgb(12 42 58 / 4%);
}
.rfk-theme .rfk-module-card-image { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.rfk-theme .rfk-module-card-image img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .2s;
}
.rfk-theme .rfk-module-card-image:hover img { transform: scale(1.04); }
.rfk-theme .rfk-module-card-symbol {
  display: grid; place-items: center; aspect-ratio: 4 / 3;
  font-weight: 800; font-size: 5rem;
  color: var(--rfk-teal-dark); background: linear-gradient(130deg, #e5f4f1, #d9e9f2);
}
.rfk-theme .rfk-module-card-body { display: flex; flex: 1; flex-direction: column; padding: 24px; }
.rfk-theme .rfk-module-card h2 {
  font-size: 1.16rem; line-height: 1.4; font-weight: 760; margin: 0 0 10px;
}
.rfk-theme .rfk-module-card h2 a { color: var(--rfk-blue); text-decoration: none; }
.rfk-theme .rfk-module-card h2 a:hover { color: var(--rfk-teal-dark); }
.rfk-theme .rfk-module-card-position { color: var(--rfk-teal-dark); font-size: .93rem; font-weight: 650; }
.rfk-theme .rfk-module-card-summary {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  margin: 0 0 12px; color: var(--rfk-muted); font-size: .91rem;
}
.rfk-theme .rfk-module-card time { display: block; margin-top: auto; color: var(--rfk-muted); font-size: .82rem; }
.rfk-theme .rfk-detail-header { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 38px; margin-bottom: 36px; align-items: start; }
.rfk-theme .rfk-detail-header:not(:has(.rfk-detail-photo)) { display: block; }
.rfk-theme .rfk-detail-photo {
  display: block; width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: cover;
  border-radius: 18px; border: 1px solid var(--rfk-border);
}
.rfk-theme .rfk-detail-role { margin: 0 0 18px; color: var(--rfk-teal-dark); font-size: 1.13rem; font-weight: 650; }
.rfk-theme .rfk-detail-meta { color: var(--rfk-muted); font-size: .86rem; }
.rfk-theme .rfk-module-contacts { display: grid; gap: 7px; margin: 18px 0 0; font-size: .91rem; }
.rfk-theme .rfk-module-contact { display: flex; flex-wrap: wrap; gap: 8px; }
.rfk-theme .rfk-module-contact dt { color: var(--rfk-muted); font-weight: 650; }
.rfk-theme .rfk-module-contact dt::after { content: ':'; }
.rfk-theme .rfk-module-contact dd { margin: 0; overflow-wrap: anywhere; }
.rfk-theme .rfk-module-contact dd a { color: var(--rfk-blue); }
.rfk-theme .rfk-module-social { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.rfk-theme .rfk-module-social a { display: inline-flex; padding: 6px 12px; border: 1px solid var(--rfk-border); border-radius: 8px; color: var(--rfk-blue); font-size: .84rem; text-decoration: none; }
.rfk-theme .rfk-module-social a:hover { background: var(--rfk-pale); }
.rfk-theme .rfk-module-intro { font-size: 1.05rem; color: var(--rfk-muted); }
.rfk-theme .rfk-module-body { margin: 24px 0; overflow-wrap: anywhere; }
.rfk-theme .rfk-module-body img, .rfk-theme .rfk-module-intro img { height: auto; }
.rfk-theme .rfk-module-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 18px 0; }
.rfk-theme .rfk-module-gallery img { width: 100%; height: 220px; object-fit: cover; border-radius: 12px; }

/* Photo campaigns: retain plugin-specific controls, CSRF and field names. */
.rfk-theme .photo-campaigns-gallery { --bs-gutter-y: 1.25rem; }
.rfk-theme .photo-campaigns-gallery-item {
  background: #fff; overflow: hidden; border: 1px solid var(--rfk-border);
  border-radius: 16px; box-shadow: 0 5px 20px rgb(12 42 58 / 4%);
}
.rfk-theme .photo-campaigns-gallery-link { display: block; aspect-ratio: 1 / 1; overflow: hidden; }
.rfk-theme .photo-campaigns-gallery-image {
  display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important;
}
.rfk-theme .photo-campaigns-gallery-meta { padding: 13px 18px 18px !important; }
.rfk-theme .photo-campaigns-gallery-name { color: var(--rfk-blue); line-height: 1.4; }
.rfk-theme .photo-campaigns-upload {
  padding: clamp(18px, 4vw, 35px); border: 1px solid var(--rfk-border);
  border-radius: 18px; background: #fff;
}
.rfk-theme .photo-campaigns-upload .form-label { display: block; color: var(--rfk-blue-ink); font-weight: 650; }
.rfk-theme .photo-campaigns-upload .form-control { width: 100%; max-width: 100%; min-height: 44px; border: 1px solid var(--rfk-border); border-radius: 9px; }
.rfk-theme .photo-campaigns-upload .form-control:focus { border-color: var(--rfk-teal); box-shadow: 0 0 0 3px rgb(19 167 157 / 15%); }
.rfk-theme .photo-campaigns-upload .btn-primary { background: var(--rfk-teal); border-color: var(--rfk-teal); color: #fff; }
.rfk-theme .photo-campaigns-upload .btn-primary:hover { background: var(--rfk-teal-dark); border-color: var(--rfk-teal-dark); }

/* Legacy survey: preserve every field, id, name, choice and POST action. */
.rfk-theme .survey-search,
.rfk-theme #view_search form { width: 100%; max-width: 100%; }
.rfk-theme #view_search, .rfk-theme #view_resultsbox { margin-block: 14px; }
.rfk-theme #view_search .form-control { max-width: 100%; min-height: 42px; }
.rfk-theme #view_resultsbox .list-group-item { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; border-color: var(--rfk-border); }
.rfk-theme #view_resultsbox .badge { background: var(--rfk-teal) !important; color: #fff; border-radius: 20px; padding: 4px 9px; }
.rfk-theme .survey .form-control, .rfk-theme #survey .form-control,
.rfk-theme .survey-form .form-control {
  display: block; max-width: 100%; min-height: 42px; border-radius: 9px;
}
.rfk-theme .survey :is(input, textarea, select), .rfk-theme #survey :is(input, textarea, select) { max-width: 100%; }
.rfk-theme .survey :is(input[type="checkbox"], input[type="radio"]),
.rfk-theme #survey :is(input[type="checkbox"], input[type="radio"]) { width: auto; height: auto; }
.rfk-theme .survey .list-group-item, .rfk-theme #survey .list-group-item { border-color: var(--rfk-border); }
.rfk-theme .survey .btn-primary, .rfk-theme #survey .btn-primary { background: var(--rfk-teal); border-color: var(--rfk-teal); }
.rfk-theme .survey .btn-primary:hover, .rfk-theme #survey .btn-primary:hover { background: var(--rfk-teal-dark); }
.rfk-theme #view_resultsbox img { display: inline-block; max-height: 40px; width: auto; }

/* eContact and public forms; keep native validation and hidden anti-spam fields. */
.rfk-theme .econtact-form, .rfk-theme #contact-form, .rfk-theme .contact-form { min-width: 0; }
.rfk-theme .econtact-form :is(input, textarea, select),
.rfk-theme #contact-form :is(input, textarea, select),
.rfk-theme .contact-form :is(input, textarea, select) { max-width: 100%; }
.rfk-theme .econtact-form label, .rfk-theme .contact-form label { font-weight: 600; color: var(--rfk-blue-ink); }
.rfk-theme .econtact-form textarea, .rfk-theme .contact-form textarea { min-height: 145px; }
.rfk-theme .econtact-form .btn-primary, .rfk-theme .contact-form .btn-primary {
  background: var(--rfk-teal); border-color: var(--rfk-teal);
}
.rfk-theme .econtact-form .btn-primary:hover, .rfk-theme .contact-form .btn-primary:hover {
  background: var(--rfk-teal-dark);
}

/* Native e107 defaults and older Bootstrap 3 content inside page bodies. */
.rfk-theme .rfk-page .row > [class*="col-xs-"] { min-width: 0; }
.rfk-theme .rfk-page :is(.alert, .pagination, .list-group, .table-responsive) { max-width: 100%; }
.rfk-theme .rfk-page .pagination { display: flex; flex-wrap: wrap; gap: 4px; padding: 0; }
.rfk-theme .rfk-page .pagination a { color: var(--rfk-blue); }
.rfk-theme .rfk-page .pagination .active a { background: var(--rfk-blue); color: #fff; }
.rfk-theme .rfk-page :is(.btn-primary, .button.btn-primary) { background-color: var(--rfk-teal); border-color: var(--rfk-teal); }
.rfk-theme .rfk-page :is(.btn-primary, .button.btn-primary):hover { background-color: var(--rfk-teal-dark); }
@media (max-width: 991.98px) {
  .rfk-theme .rfk-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rfk-theme .rfk-module-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rfk-theme .rfk-detail-header { gap: 22px; }
}
@media (max-width: 640px) {
  .rfk-theme .rfk-module-grid, .rfk-theme .rfk-module-gallery { grid-template-columns: minmax(0, 1fr); }
  .rfk-theme .rfk-detail-header { grid-template-columns: 1fr; }
  .rfk-theme .rfk-detail-photo { max-width: 320px; }
  .rfk-theme .rfk-module-gallery img { height: auto; aspect-ratio: 4 / 3; }
  .rfk-theme .photo-campaigns-upload { padding: 18px; }
  .rfk-theme #view_search form { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .rfk-theme .rfk-module-card-body { padding: 20px; }
}

/* Category navigation remains available with native team/signals menu filters. */
.rfk-theme .rfk-module-with-navigation {
  display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 28px;
}
.rfk-theme .rfk-module-main { min-width: 0; }
.rfk-theme .rfk-module-with-navigation .rfk-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rfk-theme .rfk-module-navigation {
  min-width: 0; align-self: start; padding: 16px; border: 1px solid var(--rfk-border);
  border-radius: 12px; background: var(--rfk-wash);
}
.rfk-theme .rfk-module-navigation :is(ul, ol) { list-style: none; margin: 0; padding: 0; }
.rfk-theme .rfk-module-navigation a {
  display: block; padding: 10px 8px; border-radius: 7px;
  color: var(--rfk-blue); font-weight: 600; text-decoration: none;
}
.rfk-theme .rfk-module-navigation a:hover,
.rfk-theme .rfk-module-navigation a:focus-visible { background: #e5f4f1; }
@media (max-width: 900px) {
  .rfk-theme .rfk-module-with-navigation { grid-template-columns: minmax(0, 1fr); }
  .rfk-theme .rfk-module-with-navigation .rfk-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .rfk-theme .rfk-module-with-navigation .rfk-module-grid { grid-template-columns: minmax(0, 1fr); }
}

.rfk-theme .rfk-module-empty { padding: 24px; color: var(--rfk-muted); background: var(--rfk-pale); border: 1px solid var(--rfk-border); border-radius: 12px; }

/* Native e107 latest-news menu: full-width image cards. */
.rfk-theme .rfk-news-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; }
.rfk-theme .rfk-news-card { display: flex; flex-direction: column; overflow: hidden; min-width: 0; background: #fff; border: 1px solid var(--rfk-border); border-radius: var(--rfk-radius); box-shadow: 0 6px 20px rgb(12 42 58 / 5%); }
.rfk-theme .rfk-news-media { display: block; background: var(--rfk-wash); aspect-ratio: 16 / 10; overflow: hidden; }
.rfk-theme .rfk-news-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.rfk-theme .rfk-news-media:hover img { transform: scale(1.035); }
.rfk-theme .rfk-news-card-content { display: flex; flex-direction: column; gap: 15px; flex: 1; padding: 23px 24px 25px; }
.rfk-theme .rfk-news-card h3 { margin: 0; font-size: clamp(1.05rem,1.8vw,1.2rem); font-weight: 770; line-height: 1.35; }
.rfk-theme .rfk-news-card h3 a { color: var(--rfk-blue); text-decoration: none; }
.rfk-theme .rfk-news-card h3 a:hover { color: var(--rfk-teal-dark); }
.rfk-theme .rfk-news-summary { color: var(--rfk-muted); font-size: .91rem; line-height: 1.65; overflow: hidden; overflow-wrap: anywhere; max-height: 7.5em; }
.rfk-theme .rfk-news-summary :is(h1,h2,h3,h4,h5,h6) { font-size: 1rem; }
.rfk-theme .rfk-news-summary img { display: none; }
.rfk-theme .rfk-news-summary p:last-child { margin-bottom: 0; }
.rfk-theme .rfk-news-readmore { display: inline-flex; align-items: center; gap: 5px; align-self: start; margin-top: auto; color: var(--rfk-teal-dark) !important; font-weight: 730; text-decoration: none; }
.rfk-theme .rfk-news-readmore:hover { text-decoration: underline; }
@media (max-width: 950px) { .rfk-theme .rfk-news-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 640px) { .rfk-theme .rfk-news-grid { grid-template-columns: minmax(0,1fr); } .rfk-theme .rfk-news-card-content { padding: 20px; } }
